| Algorithm 2. Strategy for obstacle presence determination and task recovery based on force feedback | ||
|
Input: Real-time force feedback ; Collision threshold ; Original parameters ; Output: Restored system parameters and trajectory; | ||
| 1 | if sustained contact force then | |
| 2 | Maintain state: Output current avoidance parameters , and maintain avoidance pose; | |
| 3 | else (Obstacle removal determined: and stable) | |
| 4 | Smooth recovery: Guide variable parameters back to initial values (Equations (6) and (7)); | |
| 5 | Trajectory reset: Output displacement deviation $e$ approaching 0 to return to desired trajectory ; | |
| 6 | end if | |