Navigation · Theory · M6
M6-T3 — The Dynamic Window Approach
Instead of planning a path, choose a velocity: the best one among those the motors can reach now and the brakes can stop.
A mobile robot is commanded by two numbers, speed and turn rate, and it can only change them so fast. The dynamic window approach takes that seriously: it samples the velocities reachable within one control period, throws away any that cannot be stopped before an obstacle, scores the rest, and sends the best. It is the engine behind many local planners, including the default one of Nav2’s predecessors.
Learning objectives
After this lesson, you should be able to:
- Compute the dynamic window from acceleration limits and the robot’s absolute limits.
- Predict the arc of a velocity pair and measure the free distance along it.
- Apply the admissibility rule and explain what each term of the score does.
- Recognise the usual failures: local minima, oscillation in narrow gaps, and coarse sampling.
The intuition
A driver does not choose a path in a car park, they choose how hard to press the pedal and how far to turn the wheel for the next moment. Each choice leads along a curve. The driver only considers choices that are possible now: the car cannot go from 1 m/s to 3 m/s in a blink. Of those, the ones that lead to a place the driver could still stop short of an obstacle are acceptable. Among the acceptable ones, the driver picks the curve that goes towards the goal, keeps clear of things, and is not painfully slow.
That is the whole method. The set of reachable velocities is the dynamic window. The curves are circular arcs, because a constant speed and turn rate give one. The rule that a curve must leave room to stop is called admissibility. The choice among acceptable curves is a weighted score.
The mathematics
The window
With current velocity (v, ω), accelerations av and aω, control period Δt, and the robot’s limits:
The search space is Vd ∩ Vs: both intervals clipped to the limits (lab M6-L2, stage 1).
Predicting an arc
For a constant (v, ω) the pose after time t is the unicycle arc of lesson M1-T3. The free distance d(v, ω) is the arc length at which the robot first touches an obstacle, or a cap D if none is met within D (lab M6-L2, stage 2).
Admissibility
A velocity is allowed only if the robot, braking at abrake, could stop before the first contact on its arc. The same idea for turning gives a rule for ω. The braking deceleration is a design number, not the motor’s peak.
The score
| Term | What it rewards | If its weight is too high |
|---|---|---|
| heading | Arcs that end up facing the goal | Cuts close to obstacles, and cannot turn away from a minimum |
| clearance | Arcs that stay away from obstacles | Hesitates in narrow gaps, drifts to the middle of free space |
| speed | Faster arcs | Ignores the goal direction and rushes past it |
Fox, Burgard and Thrun normalise the terms and smooth the sum, and their clearance term is the distance to the nearest obstacle. The principle is the same.
A worked example
One decision. Scout is at the origin facing +x with v = 0.6 m/s and ω = 0.3 rad/s. Limits: vmax = 1.0 m/s, ωmax = 1.5 rad/s, av = 0.8 m/s², aω = 2.0 rad/s², Δt = 0.25 s, braking 0.5 m/s², robot radius 0.3 m. A post (radius 0.2 m) stands at (1.0, 0.1) and the goal is at (4, 1.0).
Three speeds and three turn rates give nine candidates. “Free” is the distance to the post along the arc (3.00 means clear to the cap), “stop” is v²/(2 · 0.5), and the score uses the weights 0.6, 0.2, 0.2 with the heading measured after 1 s:
| v | ω | free (m) | stop (m) | admissible | score |
|---|---|---|---|---|---|
| 0.4 | −0.2 | 0.54 | 0.16 | yes | 0.624 |
| 0.4 | 0.3 | 0.52 | 0.16 | yes | 0.706 |
| 0.4 | 0.8 | 3.00 | 0.16 | yes | 0.771 |
| 0.6 | −0.2 | 0.53 | 0.36 | yes | 0.659 |
| 0.6 | 0.3 | 0.51 | 0.36 | yes | 0.747 |
| 0.6 | 0.8 | 0.57 | 0.36 | yes | 0.647 |
| 0.8 | −0.2 | 0.52 | 0.64 | no | 0.694 |
| 0.8 | 0.3 | 0.51 | 0.64 | no | 0.788 |
| 0.8 | 0.8 | 0.53 | 0.64 | no | 0.682 |
Without admissibility the winner is (0.8, 0.3) with score 0.788: fast, pointed at the goal, and heading at a post 0.51 m away, with a stopping distance of 0.64 m. With admissibility the three fast arcs are removed and the winner is (0.4, 0.8) with 0.771: it turns away from the post, whose clearance term is a full 1.0, and keeps moving. The difference between the two is 0.017 in score and the difference between a collision and a clean pass in practice. This is lab M6-L2, stage 3.
Engineering implications and limitations
Cost and resolution
The work is samples × prediction steps × obstacle checks per cycle. With 20 speeds, 40 turn rates and 30 steps there are 24 000 pose evaluations each cycle, 480 000 per second at 20 Hz, before any obstacle lookup. A costmap lookup per pose is cheap; a per-obstacle loop is not. Use grid lookups with the footprint, and keep the samples as few as the manoeuvres need.
Weights are behaviour
Tune one weight at a time on a fixed set of scenes and watch the arcs, not only the trajectory. Nav2’s DWB controller exposes the same idea as a list of “critics”, each a cost with a scale, for example path alignment, goal alignment and obstacle proximity.
Known failure modes
- Local minima: the score is local, so a dead end looks as good as a corridor until the robot is in it (lab M6-L1).
- Oscillation: alternate cycles prefer left and right when two arcs score alike; add a penalty for changing the turn rate, or a forward preference.
- Narrow gaps: the best arcs may be a curve that needs a larger turn than the window gives; the robot slows and stops. Allow rotation in place as a candidate.
- Coarse arcs: a prediction step larger than a post can skip it (lab M6-L2, stage 2).
- Circular arcs are an assumption: a car-like robot with limited steering rate needs its own kinematics.
Common misconceptions
“The dynamic window approach plans a path.”
It chooses one velocity per cycle. Any path is the result of repeating that choice.
“Collision-free for the next second is safe.”
Safe means that a stop is still possible. That is the admissibility rule, and it often removes the fastest arcs.
“More samples always improve the result.”
They improve the best score, but the weights decide what “best” means, and more samples cost cycle time.
“The window is the same as the speed limit.”
The speed limit is part of it, but the window also moves with the current velocity, which is why it is called dynamic.
Engineering takeaways
- The dynamic window is the set of velocities reachable in one control period, clipped to the robot’s limits.
- Each candidate is a circular arc; its free distance is the arc length to the first contact.
- Admissible means v² ≤ 2·abrake·free distance, so a stop is always possible.
- The score combines heading, clearance and speed; the weights define the behaviour.
- It is local: it needs a global path and recovery for minima and narrow gaps.
References and further reading
The original paper and its global extension.
- D. Fox, W. Burgard and S. Thrun, “The Dynamic Window Approach to Collision Avoidance”, IEEE Robotics & Automation Magazine 4(1), 1997.
- O. Brock and O. Khatib, “High-Speed Navigation Using the Global Dynamic Window Approach”, IEEE ICRA, 1999.
- Nav2 documentation, “DWB Controller”, docs.nav2.org.
Knowledge check
Three conceptual questions. Write an answer, then reveal the explanation. Your answers stay in your browser.
Question 1
A robot at v = 0.9 m/s with av = 1.0 m/s², Δt = 0.2 s and vmax = 1.0 m/s. What is the speed window?
Explanation
[0.9 − 0.2, 0.9 + 0.2] = [0.7, 1.1], clipped to [0.7, 1.0].
Question 2
An arc has a free distance of 0.7 m. The robot brakes at 0.5 m/s². What is the highest admissible speed?
Explanation
v ≤ √(2 × 0.5 × 0.7) = √0.7 = 0.837 m/s.
Question 3
An obstacle is 0.8 m along an arc. Is the arc admissible at 1.0 m/s with braking 0.5 m/s²?
Explanation
No. Stopping from 1.0 m/s takes 1.0² / (2 × 0.5) = 1.0 m, more than the 0.8 m available. The arc is collision-free for now, but the robot could no longer avoid contact.
What’s next
Next: obstacles that move, and how to predict whether and when they will cross your path.
Related content
Nothing below is required to finish this lesson.
- BeforeM6-T2: Potential Fields and Local Minima
Build an attractive-plus-repulsive field and show with an example why a robot can get stuck.
- LabM6-L2: Implement the Dynamic Window
Pick the best safe velocity every tick to reach the goal without touching the shelving.
- LabM10-L1: The Shift Simulator
Run a full compressed shift with your own planner, controller and recovery logic, scored on hidden shifts.
Get notified when the next lesson and new labs are released.
One email per new lesson or lab.