Atlas Robotics
AMR Software ArchitectureIntermediate

The navigation layer in AMRs: how global and local planners work together

Atlasbot · 22/8/2026 · 11 min read

The navigation layer in AMRs: how global and local planners work together
Global planner calculates the overall route, local planner avoids obstacles instantly

The ROS2 Navigation section has separate articles about Path Planning and Path Following. This article does not repeat the specific A*/DWB algorithm — it stands at the correct position of the Navigation Layer in the 5-layer model: receive a reliable location from the Localization Layer (previous article), return the /cmd_vel command to the ROS2 Layer and send it to the Driver Layer.

Key concepts

Navigation Layer splits into 2 planners running in parallel, different in scope and frequency:

  • Global Planner — see the entire static map, calculate the overall optimal route, only recalculate when there is a new goal or the current route is completely blocked
  • Local Planner — only looks at a small area around the robot, recalculates continuously (5-20Hz) to avoid dynamic obstacles that appear suddenly without the static map knowing in advance

How it works

Both planners read the same data structure called costmap — not a simple map, but a map that assigns a "cost" to each cell: the closer the cell is to an obstacle, the higher the cost, the more the robot should avoid passing through:

Costmap = Static Map (from SLAM/AMCL)
        + Dynamic obstacle layer (continuously updated from /scan LiDAR)
        + Inflation layer (safety buffer zone around each obstacle, cost decreases with distance)

Global costmap uses a static map as the main background, rarely updates dynamic obstacle layers; local costmap is the opposite - prioritize continuously updating the dynamic obstacle layer in a narrow range around the robot, because this is the data that helps avoid people/carts that have just appeared that the static map (built in advance) cannot know in advance.

In short: Global planner answers "what is the optimal overall path", local planner answers "in the next few seconds, what should be avoided immediately". Two different questions, running at different frequencies, but always coordinated — the local planner always tries to follow the path the global planner has outlined, only deviating from it when it is really necessary to avoid obstacles.

Technical details

Formulas

The inflation class in the costmap assigns a cost that decreases with distance to the nearest obstacle — the further away from the obstacle, the lower the cost, up to a threshold of zero:

Cost(distance) = Maximum_cost × e^(−reduction_coefficient × distance)
                        (exponential decay form, commonly used in Nav2 costmap)

Inflation_radius should be greater than or equal to robot radius + desired safety margin,
so that costmap never considers a point too close to an obstacle as "zero cost" which is absolutely safe

Parameters

PlannerFrequency recalculatedVision rangeMain thing
Global PlannerWhen there is a new goal / the road is completely blockedComplete mapFind the overall optimal path (usually A*/Dijkstra algorithm)
Local Planner5-20Hz continuousSmall area around the robot (several meters)path following global, avoiding moving obstacles instantly (usually DWB/TEB)

Practical applications

In actual AMR operations in warehouses, a typical situation clearly demonstrates 2-layer coordination: the global planner calculates the path between 2 rows of shelves based on the existing static map; When a person suddenly steps out from the corner of the shelf, the local planner detects through /scan (learned in the LiDAR lesson in AMR) and makes local adjustments to avoid it, without having to recalculate the entire path from the beginning — the global planner only intervenes again if the path is completely blocked (eg: a long congested corridor), not every time there is a small fleeting obstacle.

Practical example

# View costmap as an image in RViz2 for visual debugging
ros2 run nav2_costmap_2d nav2_costmap_2d_markers

# Check the actual calculated frequency of the local planner (should match the configuration, eg 10Hz)
ros2 topic hz /cmd_vel

# Submit a test goal to activate the global planner
ros2 action send_goal /navigate_to_pose nav2_msgs/action/NavigateToPose \
  "{pose: {header: {frame_id: 'map'}, pose: {position: {x: 2.0, y: 1.0}}}}"

If the robot stops in the middle of the road for unknown reasons, first check to see if the local planner is publishing /cmd_vel continuously (ros2 topic hz) — a frequency of 0 usually means the local planner is "stuck" on the road (the robot is stuck in the costmap), need to review the inflation radius configuration or check if the /scan data is abnormal.

Common mistakes

  • Set the inflation radius too small compared to the actual robot size — as in the Formula section, costmap considers some points too close to obstacles to be safe, the robot may collide even though the local planner works logically.
  • Expect the global planner to react immediately to moving obstacles — this is the responsibility of the local planner; The global planner only recalculates when necessary, not every time a small obstacle appears.
  • Not checking the frequency /cmd_vel when the robot stops abnormally — like the example above, this should be the first debugging step before suspecting a more complex planner algorithm.
  • Configuring the local costmap range is too narrow — the robot cannot detect obstacles early enough to dodge smoothly, leading to quick dodges or sudden stops instead of adjusting the trajectory slowly.

Conclusion

The Navigation Layer is separated into 2 different frequency planners for the same reason seen throughout the AMR architecture: there is no algorithm that can both see far away (full map) and react immediately (several tens of Hz) at the same time effectively. Costmap is the common language that connects the two, with an inflation layer ensuring a safety margin around any obstacles. This is also the penultimate article of the column — the last article goes into the Application Layer, where the original "go to this point" command actually originates from.

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.

The navigation layer in AMRs: how global and local planners work together — Atlas Robotics