## 3 Offline Optimization and Adaptation Under Nonlinear Task Constraints
### Optimization and Adaptation Procedure
#### 3.3.2 Adaptation Procedure
We utilize cylinders to envelop the task objects and robot links; the initial and modulated joints are colored in purple and green, respectively. (**b**) Task execution snapshots when the robot selects the skill of moving above around the obstacle with 0.2 s intervals for each adjacement timestep. and the right column demonstrates that the robot non-end-effector heads away from the big bottle while keeping the expected end-effector positions. The second row shows the robot end-effector modulation with the big bottle and blue painting \(\Gamma_{1}(\xi_{1})=2.5283,\Gamma_{2}(\xi_{2})=2.7075\); the robot non-end-effector will collide at this position with \(\|d_{0}\|=0.01\) mm. We define the enforced velocity \(x_{\mathbf{v}}^{0}\) to obtain the modulated joint configurations iteratively until safe, and the robot tends to move away from the big bottle when approaching the emergency stop to grasp. Figure 9b illustrates robot task execution snapshots; the total running time is 13.8 s with 69 timesteps, and the average modulation time for a single timestep is 0.1757 s. The results demonstrate that our method can simultaneously perform end-effector and non-end-effector modulation in real-time, allowing the robot to adapt joint configurations in confined spaces while keeping its expected end-effector poses. ### Comparative Experiments

In this paper, we propose a combined strategy for robot offline and real-time movement adaptation based on human-robot skill transfer. To validate the performance, we conduct several comparative experiments for proposed methods in the strategy. #### 5.4.1 Offline Movement Adaptation

Concerning offline movement adaptation, KMPs were proposed to address the limitation of explicitly defining the basis functions in ProMPs. The KMPs method was first introduced in [11] by employing GMM/GMR to encode the demonstrated distribution and then deriving the mean and covariance of each timestep under via-points based on dual transformation and KL divergence. The most notable contribution was the derivation of a kernel matrix that depends only on each timestep, eliminating the need to explicitly define the basis functions and reducing the dimensionality of the parameters. Furthermore, they extended KMPs to incorporate linear constraints in [22] (LC-KMPs), allowing for the rapid acquisition of optimal Lagrange multipliers via quadratic programming (QP). However, this method can only be applied to linear constraints in Cartesian space. In [23], they further extended LC-KMPs to incorporate nonlinear constraints (EKMPs) by using Taylor expansion to convert the problem into a QP problem and solve the optimal Lagrange multipliers. This approach can handle various nonlinear constraints in Joint space. To account for all task constraints, especially including collisions between the robot's other links and obstacles, optimization needs to be performed in Joint space. As a result, to further compare the performance, we select EKMPs from [23] and the ProMPs-based method from [21], which is similar to ours. We take the danger scene (see Figure 7a) with the same task constraints to compare. For the three methods, we provide the same initial collision-free trajectory sets of the robot end-effector and obtain the corresponding Joint space distributions with Jacobian IK. Some joint distributions may lead to collisions between the robot links 1 to 6 and obstacles. The goal is to optimize these distributions to generate new joint configurations for task execution. We then execute the task 100 times and evaluate the methods based on several metrics as follows: number of optimization parameters, number of constraints, total iterations, optimization time, distribution loss, and task success rate. The results are shown in Table 2.

In [21], the number of optimization parameters mainly includes the weights and covariance matrices of the 35 basis functions in ProMPs. Due to the use of Cholesky decomposition, a total of \(35+18\times 35=665\) parameters needs optimization.