## 3 Offline Optimization and Adaptation Under Nonlinear Task Constraints
### Optimization and Adaptation Procedure
#### 3.3.2 Adaptation Procedure
Future efforts should prioritize enhancing the iterative adjustment process in confined environments by incorporating more detailed task constraints and refining the dynamic modulation strategies. These improvements would ensure more reliable performance in such challenging settings. Another notable limitation lies in the iteration time for real-time modulation, particularly for applications demanding ultra-fast responses on commercially available robotic systems. Although our method achieves real-time performance in most cases, further reducing iteration times to meet the requirements of ultra-fast response applications remains an unresolved challenge. Potential avenues for improvement include leveraging deep learning techniques or heuristic approaches to reduce the computational overhead, as well as fine-tuning the interpolation times and refresh rates to enhance speed. Moreover, although our method has been validated on a specific robotic arm, its generalization across different robotic platforms with varying degrees of freedom and kinematic configurations remains to be thoroughly evaluated. Expanding testing to include diverse robotic systems would provide a more comprehensive assessment of its applicability. Additionally, comparing our approach with other state-of-the-art algorithms in human-robot skill transfer, as well as evaluating its performance in environments with increased obstacle density and stricter motion constraints, would offer deeper insights into its versatility and scalability. Finally, exploring the extension of this strategy to more complex tasks, such as the manipulation of deformable objects or operation in environments with higher uncertainty, represents a promising direction for future research. ## 7 Conclusions

This paper presents a strategy for human-robot skill transfer with offline task-constrained optimization and real-time whole-body modulation. The human only needs to provide one demonstration to teach the robot one skill category. Continuous ProMPs distributions can be obtained with discrete via-points from the proposed via-point trajectory generalization method. Facing task constraints under new task scenarios, the objective is to optimize ProMPs by excluding specific regions. The proposed effective probabilistic optimization method can incorporate task constraints in Joint and Cartesian space conveniently to derive optimized ProMPs. We define the threshold enabling the robot to accomplish tasks directly without checking the task constraints for each timestep. Additionally, the human can incrementally demonstrate new skills to the robot when the current skills cannot complete the task. Once the robot selects a specific skill for task execution, in the face of multiple dynamic obstacles, we propose a real-time adaptive control method for robot whole-body obstacle avoidance. The method solves the collision problem in DSM that may occur during the convergence towards a target. We utilize modulations iteratively to obtain the expected end-effector positions in real-time with no need to stop moving, which increases the success rate. Moreover, for non-end-effector obstacle avoidance, we propose the improved null-space velocity control method independent of manually defined retreat velocities by deriving safe joint configurations through iterations, ensuring a high success rate and stable behavior with reduced randomness. The proposed strategy makes robot task execution more flexible. In the offline phase, we can provide the robot with different skills without adhering to specific task constraints. After ProMPs optimization under new task-constrained scenarios, the robot selects randomly from the feasible skills. During task execution, the proposed real-time whole-body adaptation method can modulate in real-time under dynamic environments, which benefits human-robot coexistence in manufacturing. The proposed strategy may fail in very narrow spaces. However, in most cases, the proposed strategy can avoid obstacles in advance with the weighted influence of multiple dynamic obstacles.