Optimal Parking, Part 4 - Sequential Quadratic Programming
RRT* provides a route, but it does not directly provide a smooth control sequence. The next layer solves a trajectory optimization problem over the state sequence and input sequence .
1. The nonlinear optimization problem
The optimizer balances several goals:
- reach the terminal pose,
- stay close to the vehicle dynamics,
- avoid obstacles,
- keep velocity and steering within bounds,
- avoid unnecessarily large inputs.
A representative objective is
The exact weights determine how strongly the solver prioritizes tracking, smoothness, terminal accuracy, and obstacle clearance.
2. Linearizing around the current trajectory
The bicycle dynamics are nonlinear because of , , and . Around the current iterate , the dynamics are approximated by
Here and are local Jacobians, and captures the linearization residual. This approximation converts the local subproblem into a quadratic program.
3. The sequential loop
One optimization iteration follows this pattern:
- Linearize the dynamics and obstacle constraints around the current trajectory.
- Build the quadratic objective and bounds.
- Solve the QP with OSQP.
- Apply the state and input update.
- Recompute the nonlinear trajectory and residuals.
- Repeat until the iteration limit or convergence condition is reached.
This is SQP-like behavior: each QP is easier to solve than the original nonlinear problem, while the repeated relinearization moves the solution toward a feasible trajectory.
4. Why a QP solver is useful
Quadratic programming makes the local problem explicit and computationally manageable. OSQP handles the sparse quadratic objective and linear constraints while exposing iteration and convergence information to the surrounding planner.
The method is local, so the RRT* seed still matters. A good seed gives the sequence of QPs a feasible route topology; the optimizer then focuses on smoothness, bounds, and local geometry.