| Algorithm 2. Trajectory optimization method. |
| Input: original path , C-space, obstacles , start point , target point |
| Output: optimized path |
| for to do |
| if l = 1 then |
| continue |
| end if |
| = |
| if then |
| return |
| end if |
| check whether the path between and intersects with any obstacle |
| if intersection then |
| else |
| continue |
| end if |
| end for |