Skip to main content

Optimal Parking Series Summary - From Sampling to Optimized Trajectory

Optimal Parking combines two kinds of reasoning. RRT* searches for a route through free space, while trajectory optimization turns that route into a smooth sequence that respects the car model and numerical constraints.

The complete flow

The planner can be understood as the following pipeline:

scenariokinematic modelRRT* pathstate/input seedlinearized QPsparking trajectory.\text{scenario} \rightarrow \text{kinematic model} \rightarrow \text{RRT* path} \rightarrow \text{state/input seed} \rightarrow \text{linearized QPs} \rightarrow \text{parking trajectory}.

The scenario supplies poses, vehicle dimensions, obstacles, timing, bounds, and weights. The model defines which motions are possible. RRT* supplies a collision-aware route topology. The optimizer then improves that route locally.

The central equations

The vehicle state and input are

x=[px,py,ψ,v,δ]T,u=[a,δ˙]T.x = [p_x, p_y, \psi, v, \delta]^T, \qquad u = [a, \dot{\delta}]^T.

The nonlinear model is discretized as

xk+1=f(xk,uk).x_{k+1} = f(x_k, u_k).

Around the current trajectory, each SQP iteration uses a local approximation:

Δxk+1AkΔxk+BkΔuk+rk.\Delta x_{k+1} \approx A_k\Delta x_k + B_k\Delta u_k + r_k.

The QP balances terminal accuracy, reference tracking, control effort, model consistency, and obstacle avoidance.

What each layer contributes

  • The bicycle model prevents arbitrary sideways motion.
  • RRT* supplies a route when direct interpolation is blocked.
  • SQP and QP solving smooth the route and enforce local constraints.
  • Bounds and penalties express what the vehicle can safely execute.
  • WebAssembly makes the same planner inspectable through an interactive browser interface.

The important design decision is the division of labor. Sampling handles global route discovery; local optimization handles continuous refinement. Neither layer needs to solve the entire problem alone.

Practical reading order

Read Parts 1 and 2 to establish the model and the initial path. Parts 3 and 4 explain the numerical refinement and feasibility conditions. Part 5 follows the implementation into the WebAssembly demo.