For an autonomous mobile robot, reaching a destination is only part of the navigation problem. The robot must also detect objects in its path and adjust its motion before a collision occurs. The dynamic window approach (DWA) addresses this local path-planning challenge by evaluating feasible combinations of forward and rotational velocity, then selecting motion that balances progress toward the goal with obstacle clearance and speed.
In a ROS-based system, DWA can use obstacle information represented in a two-dimensional costmap. A laser scanner supplies measurements of the surrounding environment, while localization and mapping components help place the robot within it. Together, these functions provide a practical navigation loop: sense obstacles, assess candidate motion, and update the robot’s direction and velocity as conditions change.
How the dynamic window approach supports obstacle avoidance
Obstacle avoidance is a local planning task. When an obstacle is detected along the robot’s current route, the planner needs to identify a safe alternative motion rather than simply continuing along the existing path. Unlike approaches that select a direction without explicitly evaluating the robot’s current motion limits, DWA searches in velocity space and accounts for what the robot can achieve over a short time interval.
The search considers pairs of translational velocity, which controls forward motion, and rotational velocity, which changes heading. Candidate pairs are narrowed using three constraints:
- Velocity limits: The robot’s maximum and minimum motion capabilities restrict the initial search space.
- Obstacle stopping limits: Candidate velocities must allow the robot to stop before reaching the nearest obstacle along the trajectory.
- Dynamic limits: Because the motors have finite acceleration, the robot can reach only a subset of velocities during the next time step.
The intersection of these regions forms the admissible search space. DWA evaluates candidate velocity pairs within that space using an objective function. In the described system, the function accounts for progress toward the goal, distance from obstacles and forward speed. The selected translational and rotational velocities are passed to motion control, and the process can be repeated as new sensor information becomes available.
Using ROS costmaps and sensor data
The navigation system uses a laser scanner to collect environmental measurements. A ROS 2D Costmap package represents obstacle information in a two-dimensional map, providing boundaries that can constrain DWA’s local trajectory search. Because obstacle data is updated, the planner can respond when the sensed environment changes, including when an obstacle moves.
Mapping and localization provide complementary information. In the experimental setup, Hector SLAM was used for real-time map building, and adaptive Monte Carlo localization (AMCL), also known as particle-filter localization, estimated the robot’s position and orientation. The system schematic connects the global map, laser data, robot pose and costmap obstacle positions with DWA’s velocity output.
The test robot used two driven wheels and two castor wheels. A laptop running the control program sent commands through an STM32F407VET6 microcontroller to the DC motors. Encoders on the driven wheels provided feedback for motor-speed control. This arrangement linked the navigation software to the physical robot’s motion.
What the indoor tests demonstrate
The approach was evaluated in three indoor scenarios, with the robot tasked with travelling from a start point to a goal. Obstacles differed in shape, size, position and motion. The tests therefore examined more than a straight, unobstructed route: the robot needed to adjust its path and instantaneous velocity and heading as it encountered changing conditions.
Fixed obstacles
In the first scenario, all obstacles were stationary. The robot accelerated to its reported maximum speed of 0.6 m/s, then reduced and varied its speed as it changed direction to avoid obstacles. It slowed again as it approached the goal. This illustrates the relationship between local path geometry and velocity: a turn or obstacle-related detour can require a change in motion rather than continuous travel at the highest speed.
A moving obstacle
The second scenario introduced a dynamic obstacle moving in the opposite direction to the robot. The robot travelled near its maximum speed for much of the run, with a reduction as it approached the obstacle. After passing it, the robot adjusted its direction and returned to maximum speed before completing the route.
Combined static and dynamic obstacles
In the third scenario, two stationary obstacles were present along with a moving one. The robot changed direction earlier because of the fixed obstacles. After passing the dynamic obstacle, it did not return to maximum speed, as relatively little distance remained before the goal. The tests show how path conditions and remaining route distance can shape the selected motion.
Practical considerations for automation teams
For system integrators and operations teams, this method illustrates why obstacle avoidance depends on an integrated navigation chain, not only on a motion-planning algorithm. Sensor measurements must inform obstacle boundaries; localization must estimate the robot’s pose; and the planner must select velocities compatible with both obstacle clearance and the robot’s dynamic limits.
The objective-function weights also matter. The reported experiments used different values for the goal-progress, obstacle-distance and speed terms across scenarios. These parameters influence how the planner balances competing objectives. The experimental results establish that the tested configuration navigated the described indoor arrangements, but they do not define universal settings for other robots or facilities. Application-specific validation remains important when the robot, sensing arrangement or operating environment differs.
Conclusion
Combining a ROS 2D costmap with laser-scanner data and the dynamic window approach provides a way for a mobile robot to revise its local motion around static and moving obstacles. The approach evaluates feasible translational and rotational velocities while considering stopping distance, acceleration limits, goal direction, obstacle clearance and speed. In the reported indoor trials, the robot reached its goal through three obstacle arrangements, adjusting its path and velocity along the way. For automation deployments, the practical takeaway is to treat sensing, mapping, localization and motion control as connected parts of the obstacle-avoidance system.
Access Official Technical PDF