Costmap
- In French:
- Carte de coût
Definition
A two-dimensional grid that divides a mobile robot’s environment into cells, each marked as unknown, free, occupied or close to an obstacle. It is fed by sensors, lidar, depth cameras or sonar, and is used to compute a path and then movement commands. In Nav2, several layers are stacked on top of each other to bring in different sources of information.
Checked on against the references below. · Written with AI · checked against the sources Source: Nav2 documentation, “Environmental Representation”.
Concrete examples
The ROS 2 navigation guide for TurtleBot 3 has a section on costmap parameters. For inflation_radius, which defines an area around detected obstacles that generated paths must not cross, ROBOTIS says it is safe to set this value slightly larger than the robot’s radius.
What it changes for you
In Nav2, the inflation layer applies a cost that decays exponentially around obstacles, tuned with cost_scaling_factor. According to the TurtleBot 3 guide, a smaller value pushes the path farther from obstacles. The voxel layer detects obstacles in 3D.
Not to be confused with
A costmap is not the same thing as a static occupancy grid map. Nav2’s map server loads and serves the latter, while the costmap can take it as a base layer (static layer) and then add obstacles marked from sensor data (obstacle layer) and the inflation margin (inflation layer). The planner and controller servers use it to check for collisions.
Additional material checked on .