costmap
A costmap is a map of the robot's surroundings carved into a grid of little squares, where each square holds a number saying how 'expensive' or risky it is to drive through that spot. A wide open floor square is cheap, so its cost is low; a square sitting right on a wall is forbidden, so its cost is maxed out; and a square just next to a wall is mildly costly, a warning to keep some breathing room. When a planner looks for a route, it adds up these square-by-square costs along each candidate path and prefers the route with the smallest total — much like choosing the cheapest set of stepping stones across a stream.
A key trick that makes costmaps safe is obstacle inflation: around every real obstacle, the costmap paints a halo of raised cost that fades out with distance, as if the obstacle were puffed up larger than it really is. This exists because the robot is not a single point — it has width — so if a path is allowed to skim the exact edge of a wall, the robot's body would actually clip it. By inflating obstacles, the planner can keep treating the robot as a dot while still leaving a real cushion of clearance. The size of the halo is usually set to the robot's own radius plus a little extra for comfort.
Costmaps are usually built fresh and constantly updated from live sensor data — laser scans, depth cameras, bumpers — so they capture both the fixed walls from a stored map and new things that appear, like a person stepping into the hallway. Navigation systems often keep two layers at once: a big, slow-changing global costmap of the whole area for plotting the overall route, and a small, fast-updating local costmap around the robot for dodging surprises in real time.
A warehouse robot's costmap shows a thick red halo bulging around every shelf leg; the planner threads the aisle down the cheap green center, automatically keeping the robot's shoulders clear of the racks.
Inflated obstacles let a point-sized planner steer a wide robot safely.
Squares are usually called cells. Cells the robot must never enter are 'lethal'; the faded halo of caution around them is the 'inflation layer'.