Atlas Robotics
Nav2Intermediate

Controllers in Nav2: how DWB and MPPI follow paths differently

Atlasbot · 17/8/2026 · 12 min read

Controllers in Nav2: how DWB and MPPI follow paths differently
DWB sampling velocity, MPPI sampling future trajectory

What is the article Path Following? introduces Pure Pursuit — which is simple but does not naturally handle dynamic obstacle handling. controller_server in Nav2 uses more sophisticated algorithms: DWB and MPPI— both of which were mentioned in the project content Atlas A2 in the showcase, this is a more detailed explanation.

Key concepts

Both belong to the "sampling - based" family, the core difference being the sampling unit:

  • DWB (Dynamic Window Approach) — sampled instantaneous velocity, computationally light
  • MPPI (Model Predictive Path Integral)— sampled both future trajectories, much more computationally heavy

How it works

DWB performs 4 steps per cycle:

1. Sample feasible velocities (v, ω) within the dynamic window
   (bounded by acceleration limits — see Acceleration limits)
2. For each sample, simulate the short-term trajectory (a few seconds) if that velocity is applied
3. Score each simulated trajectory with multiple critics (criteria):
   distance to obstacles, deviation from the path, forward speed...
4. Choose (v, ω) with the highest total score, apply it immediately, and repeat next cycle

Computationally lightweight, runs well on a pure (Raspberry Pi 4) — CPU which is why showcase projects using Raspberry Pi 4 (Robot Mecanum, Diff Robot) default use DWB.

The MPPI performs the more complex process:

1. Sample HUNDREDS of possible future trajectories (not just instantaneous velocities)
   based on the robot's kinematic model
2. Score each trajectory with a cost function
3. Combine good trajectories using a weighted average into an optimal trajectory
4. Repeat this optimization several times within one control cycle

The computational cost is much higher than DWB (large - volume sampling, multiple - loop optimization) — which requires a GPU or multi-core CPU to run real - time smooth, which is why the Atlas A2 project (using the Jetson Orin Nano) is able to run smooth MPPI, while the Mecanum/Diff Robot (Raspberry Pi 4) is more affordable with DWB.

In brief: Orbital sampling allows MPPI to "see beyond" the obstacle (predicting seconds ahead rather than just instantaneous response), which in turn requires much larger computational resources.

Technical details

Formulas

The number of simulations to perform each control cycle differs significantly between the two algorithms:

DWB: Simulation_count ≈ v_sample_count × ω_sample_count (typically tens to hundreds of combinations)

MPPI: Simulation_count ≈ Sampled_trajectory_count × Time_steps_per_trajectory × Optimization_iterations
      (typically hundreds of trajectories × tens of steps × a few iterations
       = tens of thousands of simulations per cycle)

This scale discrepancy (hundreds versus tens of thousands of simulations per cycle) directly explains why MPPI needs many orders of magnitude more powerful hardware than DWB to reach the same real-time control frequency.

Parameters

DWBMPPI
Unit of samplingvelocity (v, ω)future trajectory
Calculation costsLowHigh
Hardware fitPlain CPU (Raspberry Pi 4)GPU/multiplet (Jetson) Expected
Dynamic obstacle avoidance qualityGood, immediate reaction.Smoother, more "foresee."

Practical applications

The Critic is a separately configurable scoring component in DWB:

FollowPath:
  plugin: "dwb_core::DWBLocalPlanner"
  critics: ["ObstacleFootprint", "PathAlign", "GoalAlign", "PathDist", "Oscillation"]
  ObstacleFootprint.scale: 0.02
  PathAlign.scale: 32.0

Each critic scores a different aspect of the candidate trajectory (impedance distance, path grip, goal orientation...) — weights (scale) each critic decides which aspect the controller "prioritizes". This is the most refined of real-world parameters, as discussed in Tuning Controller .

Practical example

Scenario: the robot is following a path when a person suddenly steps into its way

With DWB (Raspberry Pi 4):
1. In the next control cycle (typically ~10-20Hz), sample new (v,ω) values
2. Short-term simulation detects a collision trajectory if the direction is unchanged
3. The ObstacleFootprint critic assigns that trajectory a low score
4. Choose another (v,ω) and move aside — responding within 1 control cycle

With MPPI (Jetson Orin Nano):
1. Simulate hundreds of future trajectories over the next few seconds at once
2. Detect EARLIER that the person is moving across the expected path
3. Adjust the trajectory more smoothly, avoiding sudden last-minute maneuvers
   by anticipating motion trends rather than only reacting immediately

Common mistakes

  • MPPI retrievals on pure CPU-only (Rolar Raspberry Pi 4) hardware— as calculated in the Formulary section, the number of required simulations outstrips the pure CPU capability, causing unacceptable control latency.
  • Using DWBs for complex dynamic obstacle avoidance environments, multiple intersecting movement directions— DWBs only respond instantaneously, do not "foresee" motion trends such as MPPIs, and can avoid more folding than necessary.
  • Failing to fine-tune the criticism weight for the operating environment— uses the default weight as an integral for the particular environment (e.g., very narrow corridors requiring higher PathAlign preference), causing path-tagging behavior to be suboptimal.
  • Choosing controllers by "newer technology" (MPPI) without considering the possibility of existing real-world hardware — follows the principle learned in Computer Choosing for AMR, choosing redundancies "for sure" costs as much and sometimes real-world performance poorer if the hardware is not sufficiently powerful to run smoothly.

Conclusion

DWB and MPPI both belong to the sampling-based family but differ corely in whether instantaneous velocity sampling or both future trajectories — directly trade off between computational costs and the ability to "see far" when dodging dynamic obstacles. Choosing the correct real-world hardware capability (considered in the Choosing Computer for AMR article) is more important than choosing the "most powerful" algorithm. The next article in the column goes into the Costmap — cost map that both the Planner and the Controller rely on for calculation.

Get new articles and lessons by email

When a new technical article or course module is published, Atlas Robotics sends you a short email. No spam.

Unsubscribe any time with the link in each email. See our Privacy policy.

Controllers in Nav2: how DWB and MPPI follow paths differently — Atlas Robotics