Navigation · Theory · M6
M6-T7 — Choosing a Local Planner
There is no best local planner, only the one whose assumptions match your robot, your corridors and your computer.
Every local planner answers the same question: what should the wheels do in the next fraction of a second? They differ in what they optimise, what they assume about the robot, how much computing they use, and what their failures look like. Knowing these differences lets you choose by evidence, before tuning the wrong planner for weeks.
Learning objectives
After this lesson, you should be able to:
- State what DWA, TEB, MPPI and regulated pure pursuit each optimise and how.
- Compare their computational cost with a simple count.
- Match a planner to the robot’s kinematics, environment and available computing.
- Describe the characteristic failure of each and the first thing to check.
The intuition
Picture four drivers on the same road. One looks at a handful of steering-and-pedal combinations for the next second and takes the best (DWA). One draws the whole route for the next few seconds as a stretched elastic band, with times along it, and relaxes the band until the route is short, quick, smooth and clear (TEB). One imagines thousands of slightly random futures, scores them, and steers by the average of the good ones (MPPI). One simply follows the road ahead and slows for corners and for things nearby (regulated pure pursuit, RPP).
All four work. Which one is right depends on the road. A narrow, winding corridor, a robot that cannot turn on the spot, an embedded computer with little to spare, and a hall full of moving people each favour a different driver.
The mathematics
What each one optimises
| Planner | Search | Objective | Kinematics |
|---|---|---|---|
| DWA | Grid of (v, ω) in the dynamic window; constant velocity arcs | Weighted heading, clearance and speed; admissible only | Differential drive (arcs); unicycle |
| TEB | Nonlinear least-squares over a sequence of poses and time intervals | Short time, smooth, clear of obstacles, follows the path; bounds on speed and acceleration as penalties | Differential drive and car-like (minimum turning radius) |
| MPPI | Thousands of sampled control sequences through a model; weighted average | Any cost you can compute along a rollout (path, obstacles, goal) | Any model, including car-like and omnidirectional |
| RPP | None: a look-ahead point on the path and a curvature to reach it | Follow the path; scale speed by curvature and proximity to obstacles | Differential drive and car-like |
How they work, in one sentence each
- DWA (Fox, Burgard and Thrun, 1997): sample velocities reachable now, drop those that cannot stop (lesson M6-T3), score the rest.
- TEB (Rösmann and colleagues): minimise a weighted sum of penalties over a band of timed poses using sparse graph optimisation; the band is re-optimised at each cycle starting from the last solution.
- MPPI (Williams and colleagues): add noise to a nominal control sequence, roll out K samples, and update the sequence by an exponentially weighted average of the noise by the costs.
- RPP (Macenski and colleagues, 2023): pure pursuit’s curvature 2·y/L² towards a look-ahead point, with speed reduced in tight curves and near obstacles.
A cost count
Compare candidates by this product before comparing quality. It also tells you which knob to turn first when the CPU is saturated.
Typical failures
| Planner | Characteristic failure | First check |
|---|---|---|
| DWA | Stops or oscillates in narrow gaps; cannot back out of dead ends | Weights, minimum speed, the global path |
| TEB | Flips between two homotopy classes (left or right of an obstacle); slow solves with many obstacles | Number of obstacles in the band, parameters of the planner |
| MPPI | Jittery commands with too few samples; ignores thin features between samples | Samples, horizon, noise levels, cost scaling |
| RPP | Hits obstacles that were not on the path (it only slows); cuts corners if the look-ahead is long | Look-ahead, collision checking, whether the global path is clear |
A worked example
Counting the work. A DWA configuration of 20 speeds × 40 turn rates, 30 prediction steps, at 20 Hz:
MPPI’s rate is 7 times DWA’s here. The numbers are illustrative: a rollout step of MPPI can be vectorised or run on a GPU, which is what makes it practical, whereas DWA’s step count is small enough for a single core. Run the actual count on your hardware, with your costmap lookups, before deciding.
Choosing for Scout. Scout is a differential-drive robot with an 8-core embedded computer. It drives 60 m corridors, passes through 0.9 m doors, and shares the space with staff.
| Situation | Prefer | Why |
|---|---|---|
| Long corridors, few obstacles, tight CPU | RPP | Smooth path following, almost no computing; slows for bends and walls |
| Crowded halls, moving people | DWA or MPPI | Re-evaluates every cycle against fresh obstacles; MPPI handles richer costs |
| Car-like tug with a turning radius | TEB or MPPI | Needs kinematic constraints that a constant (v, ω) arc ignores |
| Narrow doors and tight manoeuvres | TEB, or a global planner that already respects the footprint | Plans a feasible timed path through the gap |
Scout’s default is RPP on a global path that already respects the footprint and the lanes, with the collision monitor as a safety net. Where people fill the corridor, switch to a sampling planner for that zone. The decision is by zone, not for the whole building.
The first check. When a robot drives badly, the planner is the last place to look. Compare footprints and costmaps (lab M1-L1), confirm the localisation is stable (lab M7), and check the rates and timestamps. Only then retune.
Engineering implications and limitations
Choose by constraint first
Kinematics rule out planners (a car-like robot cannot use unconstrained arcs). Computing rules out others. Quality decides what is left.
Keep the safety net separate
Run an independent collision monitor that stops or slows the robot from raw sensor data, whatever the planner commands. A planner’s model of the world can be wrong; the monitor’s rule is simple (lesson M7-T1).
Tune with scenarios
Fix a set of scenes: a door, a bend, a person crossing, a dead end. Measure the metrics of lesson M1-T6 on each after every change. Never tune on one corridor.
Plan for switching
A navigation stack lets you choose a controller per zone or per task. Define zones in the map (lesson M2-T5) and switch with the behaviour tree, so the corridor controller and the crowd controller can differ.
Mind the plugins
Nav2 ships DWB, RPP and MPPI controllers. TEB comes from ROS 1’s teb_local_planner and is available as a community port for ROS 2. Check that the version you rely on is maintained.
Common misconceptions
“The newest planner is the best.”
Newer planners solve some problems better and cost more. Choose by the constraints you have.
“A local planner can fix a bad global path.”
It can bend around small things. It cannot repair a path through a closed door or a wrong footprint.
“More samples always means better driving.”
Beyond a point, samples add computing, not quality; the cost function decides what “better” means.
“Pure pursuit avoids obstacles.”
It follows a path. In its regulated form it slows near obstacles and can stop, but it does not steer around them.
Engineering takeaways
- DWA samples velocities, TEB optimises a timed band of poses, MPPI averages sampled rollouts, RPP follows a path with regulated speed.
- Compare cost with rate × samples × steps × cost per step.
- Kinematics and computing narrow the choice; the environment decides among the rest.
- Each planner has a typical failure and a first thing to check.
- Keep an independent safety layer, choose per zone, and tune on scenarios rather than one corridor.
References and further reading
The papers behind each planner, and the Navigation 2 documentation.
- D. Fox, W. Burgard and S. Thrun, “The Dynamic Window Approach to Collision Avoidance”, IEEE Robotics & Automation Magazine 4(1), 1997.
- C. Rösmann, W. Feiten, T. Wösch, F. Hoffmann and T. Bertram, “Trajectory Modification Considering Dynamic Constraints of Autonomous Robots”, German Conference on Robotics (ROBOTIK), 2012.
- G. Williams, P. Drews, B. Goldfain, J. M. Rehg and E. A. Theodorou, “Aggressive Driving with Model Predictive Path Integral Control”, IEEE ICRA, 2016.
- S. Macenski, S. Singh, F. Martín and J. Ginés, “Regulated Pure Pursuit for Robot Path Tracking”, Autonomous Robots 47, 2023.
- Nav2 documentation, “Controller Server” and the plugin pages for DWB, MPPI and Regulated Pure Pursuit, docs.nav2.org.
Knowledge check
Three conceptual questions. Write an answer, then reveal the explanation. Your answers stay in your browser.
Question 1
A planner uses 500 rollouts of 40 steps at 25 Hz. How many rollout steps per second?
Explanation
500 × 40 = 20 000 steps per cycle; × 25 = 500 000 steps per second.
Question 2
Scout’s tug has a minimum turning radius of 1.2 m. Why is a plain constant-(v, ω) arc planner a poor fit, and which planners fit better?
Explanation
The arc planner can propose turns the tug cannot make, so its best choice may be infeasible. TEB (with a turning-radius constraint) or MPPI with a car-like model respect the limit.
Question 3
A robot following a clear global path hits a cart that appeared on the path, and the controller is pure pursuit. What is missing?
Explanation
Pure pursuit follows a path and does not avoid new obstacles. It needs obstacle-aware speed regulation and a collision check, a replan from the global planner, or a different local planner for that zone.
What’s next
Next module: staying safe when things go wrong, stopping distances, uncertainty and recovery.
Related content
Nothing below is required to finish this lesson.
- BeforeM6-T6: Social Navigation
Describe personal space, passing side and the freezing-robot problem, and how costs can encode them.
Get notified when the next lesson and new labs are released.
One email per new lesson or lab.