## 3 Offline Optimization and Adaptation Under Nonlinear Task Constraints
### Optimization and Adaptation Procedure
#### 3.3.2 Adaptation Procedure
Considering basic-level MPs learning, we develop the via-point trajectory generalization method adapting to the task start, end, and via-points from only one human demonstration. Our approach ensures robust extrapolation beyond the demonstration range. By discretizing the via-points, we can efficiently generate a large set of trajectory sets without additional demonstrations. These skills are encoded using ProMPs, preserving the probabilistic properties. In other words, the proposed via-point generalization enhances the extrapolation capability of ProMPs [10], while retaining key probabilistic characteristics, like the mean and covariance. Considering core-level MPs adaptation, we develop an effective task-constrained optimization method by combining multiple task constraints into a unified probabilistic framework. To account for all task constraints in Joint and Cartesian space simultaneously, we encode ProMPs in Joint space. We introduce a double-loop optimization method with ProMPs, where each timestep is first decoupled as the Gaussian distribution, and only those timesteps violating task constraints are optimized. After optimizing the Gaussians at each timestep, a second optimization is performed to obtain the optimized ProMPs. To mitigate the loss of distributions due to the probabilistic nature, we introduce a threshold to directly utilize the ProMPs for task execution with analytical movement adaptation. To evaluate MPs adaptation performance under different task constraints, three performance indices are considered as follows: (i) Computational Efficiency denotes the number of parameters, iterations, and runtime required to derive the optimized MPs; (ii) Constraint Diversity Satisfaction refers to whether MPs can simultaneously handle multiple types of task constraints in both Joint and Cartesian space; and (iii) Generalization Capability evaluates whether the optimized MPs can retain the distribution of original MPs while successfully executing tasks across different task scenarios. Our method ensures the Constraint Diversity Satisfaction to handle multiple task constraints in Joint and Cartesian space. Compared to [21], our method avoids symmetric positive-definite issues during iterations by decoupling the Gaussians for each timestep and optimizing the ProMPs independently. Furthermore, unlike EKMPs [23], our method does not involve large matrix computationsor numerical stability issues, resulting in improved Computational Efficiency. Additionally, we estimate nonlinear task constraints with different probability distributions, rather than first-order Taylor expansions, thus exhibiting robust generalization capabilities compared to EKMPs [23]. By incorporating a threshold that accounts for the probabilistic nature, our method exhibits robust generalization compared to [21]. Considering real-time movement adaptation, we propose an improved real-time robot whole-body control method integrating offline task-constrained optimization. For the robot end-effector, we incorporate the offline-optimized trajectory with via-point generalization for dynamic modulation, and develop DSM by performing multiple modulation iterations until safe if initial positions will collide, while satisfying real-time needs. For the robot non-end-effector, we integrate the offline-optimized Joint ProMPs to the real-time null space velocity control method and ensure collision-free joint configurations through iterations. ### Limitations and Future Work

Although the proposed strategy has made some progress, it still faces certain limitations that require further investigation. The method demonstrates strong performance in environments with a moderate number of obstacles; however, its effectiveness in extremely confined spaces remains an area needing refinement. In such scenarios, joint configurations become highly constrained, and the iterative modulation process may lead to slower convergence or even failure to identify feasible solutions.