Controls
Presets
Parameters
Model checks
The science
Problem. Choose a control sequence u0..H-1 for a unicycle rover (x' = v cosθ, y' = v sinθ, θ' = ω, with 0 ≤ v ≤ 2 m/s, |ω| ≤ 2.5 rad/s, 0.1 s steps) that minimises a cost S = φ(xH) + ∑t q(xt): distance to the goal plus steep penalties near obstacles and walls. There are no gradients: the cost is not smooth and the obstacles make it non-convex.
MPPI step (Williams et al. 2016/2017). (1) Draw K noise sequences εk,t ~ N(0, Σ) and roll the model out with v = u + ε (clipped to the limits). (2) Score each rollout Sk = φ + ∑ [ q + λ uTΣ-1ε ]. (3) Weight wk = exp(-(Sk - Smin)/λ)/η (a softmax in cost; subtracting Smin only avoids overflow). (4) Update ut ← ut + ∑k wk εk,t, apply u0, shift the sequence one step and repeat.
Why it works. The weights turn the sampling distribution into the Boltzmann distribution exp(-S/λ) of the problem, whose free energy is F = -λ ln E[e-S/λ]; the weighted mean of the noise is the mean control of that distribution. The λ uTΣ-1ε term corrects for sampling around u instead of 0 and makes the fixed point the optimum of S + ½ ∑ vTR v with R = λΣ-1. For linear dynamics and quadratic cost this is exactly the LQR solution as K → ∞, which is how the first two checks test the algorithm. Temperature limits: λ → ∞ gives equal weights (the plan is the plain average of the noise and does not improve), λ → 0 keeps only the best sample (a random-shooting planner). The effective sample size ESS = 1/∑ wk² tells how many rollouts really contribute.
Checks on this page. (1) one MPPI update from a deliberately wrong nominal against the Riccati-recursion optimum of a 1D double integrator, (2) closed-loop MPPI cost against receding-horizon LQR on that problem, (3) the λ → 0 and λ → ∞ limits of the ESS on this scene's real cost batch, (4) Jensen and Chebyshev bounds on the free energy and weighted cost, (5) the rover integrator against the exact circular-arc solution, (6) mean, variance and correlation of the sampler noise.
Simplifications. The planner knows the exact model and the obstacle positions, there is no sensing or process noise, the rollouts use independent noise per step (no smoothing filter), and the number of rollouts drawn on screen is capped at 80 although all K are used for the update. Because MPPI is sampling-based it has no optimality guarantee on the non-convex scenes; with too few samples or a bad temperature the rover can stall or take poor routes, which is intended to be visible. Real-time implementations run the rollouts on a GPU.