Dynamic window approach

Also known as: DWA

On this page 7

The dynamic window approach (DWA) is a local obstacle avoidance method that searches directly in the robot’s velocity space and selects the translational and rotational velocity pair that best balances progress toward a goal, clearance from obstacles and speed. In robotics navigation, it serves as a classic local planner: a global path planner supplies the route, and DWA turns that route into safe motor commands several times per second.

The method takes its name from the dynamic window, the small set of velocities the robot can actually reach within one short control interval given its acceleration limits. By restricting the search to physically achievable commands, DWA respects the dynamics of the vehicle instead of assuming the robot can change speed or direction instantly.

How the dynamic window approach selects a velocity

DWA works by sampling candidate velocities, simulating the short trajectory each one produces and scoring the results with an objective function. The robot is modeled as moving along circular arcs, because a constant pair of linear velocity v and angular velocity omega traces a circle of radius v divided by omega.

Each control cycle follows the same sequence. The planner first builds the search space, then removes unsafe candidates, then evaluates the remaining ones and sends the best command to the motor controllers. A typical cycle runs at 10 to 20 Hz, and the forward simulation horizon usually spans 1 to 3 seconds.

The search space results from intersecting three velocity sets, shown below. Only velocities that belong to all three sets are considered admissible.

Velocity setWhat it containsConstraint it enforces
Possible velocitiesAll v and omega within the robot’s maximum speedsHardware speed limits
Admissible velocitiesVelocities that allow stopping before the nearest obstacle on the arcCollision safety with braking distance
Dynamic windowVelocities reachable from the current state within one control intervalLinear and angular acceleration limits
The three velocity sets that define the search space

The admissibility test is what makes DWA safe in principle: a velocity is kept only if the robot could brake to a full stop before reaching the closest obstacle along its arc, using its maximum deceleration.

The objective function and its weighting terms

The DWA objective function is a weighted sum of scoring terms, and the chosen velocity is the one with the highest total score. The original formulation uses three terms, often normalized to a common range before weighting so that no single term dominates by scale alone.

TermWhat it rewardsEffect of a high weight
HeadingAlignment of the predicted pose with the goal directionDirect but sometimes risky approach paths
ClearanceDistance to the nearest obstacle along the trajectoryCautious motion and wide margins
VelocityHigher forward speedFast travel with less time to react
Standard scoring terms in the DWA objective function

Modern implementations replace or extend these terms. In the ROS navigation stack and Nav2, the DWB controller uses pluggable trajectory critics that score path alignment, goal alignment, costmap cost, oscillation and rotation behavior. Scoring against a costmap instead of raw obstacle points lets the planner include inflation zones and sensor uncertainty.

Weight tuning is the main practical difficulty. A heavy clearance weight can stop the robot from entering doorways, while a heavy heading weight can push it toward walls. Most deployments iterate on the weights in simulation before field tests.

Key parameters that shape DWA behavior

The behavior of a DWA planner depends on a handful of kinematic and sampling parameters, and each one trades responsiveness against computational load or safety. The values below are typical for indoor differential-drive robots and vary widely with platform size.

ParameterTypical rangeWhat it affects
Maximum linear velocity0.3 to 1.5 m/sTop speed and stopping distance
Linear acceleration limit0.5 to 2.5 m/s²Width of the dynamic window
Simulation time1 to 3 sLook-ahead depth and computation
Velocity samples10 to 30 per axisResolution versus cycle time
Control frequency10 to 20 HzReaction speed to new obstacles
Typical DWA parameters for an indoor differential-drive robot

A longer simulation time helps the robot notice obstacles earlier but makes the circular-arc assumption less accurate, because real robots rarely hold a constant velocity for several seconds. Denser sampling improves trajectory quality at the cost of CPU time, which matters on embedded processors.

How DWA compares with other local planners

DWA belongs to a family of reactive local planners, and its main competitors differ in how they model the robot and how they search for commands. The comparison below shows where each method fits.

MethodSearch approachMain strengthMain weakness
DWASampling in velocity spaceSimple, fast, respects accelerationShort horizon and local minima
Pure pursuitGeometric steering toward a look-ahead pointSmooth path trackingNo native obstacle avoidance
Timed elastic bandOptimization of a time-parameterized trajectoryHandles car-like kinematics wellHigher computational cost
Model predictive controlConstrained optimization over a horizonExplicit constraints and smooth outputRequires careful modeling and solvers
Vector field histogramPolar histogram of obstacle densityVery low computationIgnores robot dynamics
DWA compared with common alternatives

DWA is a natural fit for differential-drive and omnidirectional robots, because their velocity spaces are easy to sample. For car-like vehicles with a minimum turning radius, Hybrid A* for planning combined with an optimization-based controller usually performs better.

Limitations and common failure modes

The most serious weakness of DWA is its short planning horizon, which makes it vulnerable to local minima such as U-shaped obstacles, where every reachable trajectory scores poorly. For this reason, DWA is almost always paired with a global planner and with recovery behaviors.

  • Oscillation in narrow corridors, when two candidate directions score almost equally from cycle to cycle.
  • Failure in doorways when clearance weights or inflation radii make the opening appear impassable.
  • Poor performance with moving obstacles, because the classic formulation treats obstacles as static during the simulation.
  • Sensitivity to localization error, since trajectories are evaluated against a map that may be misaligned with reality.

Many extensions address these issues, including global dynamic window variants that add a navigation function to the score and velocity obstacle methods for dynamic environments. Even so, DWA remains a robust baseline precisely because its assumptions are simple and its behavior is easy to inspect.

Stripped to the essentials

Imagine walking through a crowded hallway. At every moment, you only consider the steps your body can actually take right now: you cannot stop instantly or turn on the spot at full speed. Among those possible steps, you choose the one that keeps you moving toward the exit without bumping into anyone.

The dynamic window approach does the same for a robot. Many times per second, it lists the speeds and turns the robot can realistically reach next, imagines where each choice would lead, and picks the safest useful move. The key idea is simple: plan only what the robot can really do.

Where it is applied

A hospital deploys a fleet of delivery robots that carry medication carts between the pharmacy and the wards. Each robot is a differential-drive platform with a maximum speed of 0.8 m/s and a laser scanner that updates a local costmap ten times per second. A global planner computes the route along the corridors, and a DWA-based local planner turns that route into wheel commands.

In a busy corridor, a nurse steps out of a room two meters ahead. Within one control cycle, the planner discards trajectories that would not allow a stop in time, finds that a gentle arc to the left keeps a safe margin, and slows the robot to about 0.4 m/s while passing. Engineers tuned the clearance weight upward after early trials showed the robots passing too close to doorframes, and the result was smooth, predictable motion that staff quickly learned to trust.