ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

First off, your image isn't included. But I think your question boils down to this sentence

why does the local plan diverge from the global plan?

for which I do not need an image to answer. You could implement a local planner (controller) to follow a path directly. These are generally referred to as pure pursuit controllers and I'm sure you can find a couple online. Even DWB (the later version of DWA) can be tuned that way, given time.

There are several reasons why you may want a controller to deviate from a path, I'll mention a few intuitive ones.

  • The global planner in ROS is A* or Dijkstra that do straight graph search. They do not take into account the kinematics of the vehicle so paths do not meet the kinematic constraints of the robot itself. Deviating lets the robot actually follow it in some cases.

  • There may be situations where you would like to not replan often unless absolutely required. In that case, you would like your robot to be able to deviate from the route that it planned (lets say over 100 meters, around corners, where the robot can't possibly know the current state of the environment) so it can continue on its way.

  • Sometimes, stuff just happens. The local costmap generally updates faster and could be higher resolution than the planning space. In the case that something unexpected happens, its useful for the robot to be able to smoothly react to it (if possible) rather than stop dead in its tracks while it tries to replan.