Costmap
代价地图CommonA grid map of the ground where each cell is labeled with a cost of passing through it, used for navigation planning and obstacle avoidance.
A costmap is the most common environment representation for mobile-robot navigation, built around ROS's costmap_2d and central to Nav2. It divides the ground into a regular 2D grid, with each cell storing a cost value from 0 to 255: in Nav2, 0 means free, 254 means a lethal obstacle, 253 means the robot's center entering that cell would definitely cause a collision (inflated based on the robot's footprint), and 255 means unknown. The map is built by stacking several layers: a static layer comes from a pre-built map, an obstacle layer and a voxel layer are written in real time from sensor data, and an inflation layer adds decaying cost around obstacles so planned paths automatically keep some distance from them. Global planning searches for a path on a costmap covering the whole map, while local control avoids obstacles on a smaller costmap centered on and moving with the robot.
ExampleIn a typical Nav2 example configuration, the local costmap is a 3 m × 3 m rolling window centered on the robot at 0.05 m resolution — a 60×60 grid — continuously refreshed as the robot moves.
- Also called
- Cost Grid Map, costmap_2d
- Related
- Occupancy Grid Map · Global Planning and Local Planning · ROS 2 Navigation Stack (Nav2) · Path Planning · Obstacle Avoidance · Dynamic Window Approach
- Sources
- Nav2 Docs: Environmental Representation
Nav2 Docs: Costmap 2D 配置(含 local_costmap 示例) (Chinese)
navigation2 源码 cost_values.hpp(代价取值定义) (Chinese) - As of
- 2026-09