Skip to the lesson
FixTheRobot Explore Robotics / Navigation / M6 Local Planning and Obstacle Avoidance / M6-T7

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.

  • Lesson 7 of 7
  • Module 6: Local Planning and Obstacle Avoidance
  • Theory
  • About 7 minutes to read

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.

Four local planners in one picture eachFour panels. Dynamic window: a fan of arcs with one chosen. Timed elastic band: a path deformed around an obstacle. MPPI: a bundle of noisy rollouts with a weighted mean. Regulated pure pursuit: a circle of look-ahead radius meeting the path.DWATEBMPPIRPP samples (v, ω); scores arcsoptimises poses + timingsamples control sequencesfollows path, regulates speed
The four planners, in one panel each. DWA picks one arc; TEB deforms a path; MPPI averages sampled rollouts; RPP follows a path with a look-ahead point.

The mathematics

What each one optimises

Local planners compared
PlannerSearchObjectiveKinematics
DWAGrid of (v, ω) in the dynamic window; constant velocity arcsWeighted heading, clearance and speed; admissible onlyDifferential drive (arcs); unicycle
TEBNonlinear least-squares over a sequence of poses and time intervalsShort time, smooth, clear of obstacles, follows the path; bounds on speed and acceleration as penaltiesDifferential drive and car-like (minimum turning radius)
MPPIThousands of sampled control sequences through a model; weighted averageAny cost you can compute along a rollout (path, obstacles, goal)Any model, including car-like and omnidirectional
RPPNone: a look-ahead point on the path and a curvature to reach itFollow the path; scale speed by curvature and proximity to obstaclesDifferential 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

Computing cost
work per second≈rate×samples×steps×cost per step\text{work per second}\approx \text{rate}\times \text{samples}\times \text{steps}\times \text{cost per step}

Compare candidates by this product before comparing quality. It also tells you which knob to turn first when the CPU is saturated.

Typical failures

Where each one fails
PlannerCharacteristic failureFirst check
DWAStops or oscillates in narrow gaps; cannot back out of dead endsWeights, minimum speed, the global path
TEBFlips between two homotopy classes (left or right of an obstacle); slow solves with many obstaclesNumber of obstacles in the band, parameters of the planner
MPPIJittery commands with too few samples; ignores thin features between samplesSamples, horizon, noise levels, cost scaling
RPPHits obstacles that were not on the path (it only slows); cuts corners if the look-ahead is longLook-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:

DWA
20×40=800 rollouts×30 steps=24 000 steps per cycle×20 Hz=480 000 stepss20\times 40=800\,\text{rollouts}\times 30\,\text{steps}=24\,000\,\text{steps per cycle}\times 20\,\mathrm{Hz}=\frac{480\,000\,\text{steps}}{s}
MPPI
2000 rollouts×56 steps=112 000 steps per cycle×30 Hz=3 360 000 stepss2000\,\text{rollouts}\times 56\,\text{steps}=112\,000\,\text{steps per cycle}\times 30\,\mathrm{Hz}=\frac{3\,360\,000\,\text{steps}}{s}

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.

A first choice
SituationPreferWhy
Long corridors, few obstacles, tight CPURPPSmooth path following, almost no computing; slows for bends and walls
Crowded halls, moving peopleDWA or MPPIRe-evaluates every cycle against fresh obstacles; MPPI handles richer costs
Car-like tug with a turning radiusTEB or MPPINeeds kinematic constraints that a constant (v, ω) arc ignores
Narrow doors and tight manoeuvresTEB, or a global planner that already respects the footprintPlans 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

  1. DWA samples velocities, TEB optimises a timed band of poses, MPPI averages sampled rollouts, RPP follows a path with regulated speed.
  2. Compare cost with rate × samples × steps × cost per step.
  3. Kinematics and computing narrow the choice; the environment decides among the rest.
  4. Each planner has a typical failure and a first thing to check.
  5. 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.

Next lesson

M7-T1 — Stopping Distance and Speed Limits

Compute stopping distance from speed, deceleration and latency, and set a speed limit from the sensing range.

Nothing below is required to finish this lesson.

  • Before
    M6-T6: Social Navigation

    Describe personal space, passing side and the freezing-robot problem, and how costs can encode them.