AI Glossary / Reinforcement learning and robotics / Intermediate

Local costmap

Definition

A local costmap is a spatial representation of the area near a robot that assigns navigation costs to locations. It is updated as observations and the robot's position change, helping a local planner or controller evaluate nearby motion. It commonly uses a grid and may move with the robot as a rolling window.

What it means

A long-range route tells a robot where it is trying to go, but nearby conditions determine whether its next movement is feasible. A chair moved into the aisle or an object detected moments ago may not be represented in the original route.
The local costmap brings relevant nearby information into the form used by navigation software. It describes space, not the command to execute. A controller uses it alongside the route, robot geometry, motion constraints, and other objectives to choose what happens next.

How it works

Sensor observations are transformed into a consistent coordinate frame and incorporated into map layers. Depending on the platform, layers may mark obstacles, clear previously occupied space when observations support doing so, incorporate a static map, or express other spatial information.
Costs near obstacles can be increased to discourage close passage. The robot's footprint must be considered when evaluating a candidate position or trajectory. Cost values are implementation-specific navigation quantities, not automatically calibrated collision probabilities.
A rolling local costmap maintains a bounded view around the robot. As the robot moves, the represented region changes. Its width, height, resolution, update rate, and unknown-space policy affect the information available to the controller.
The map update rate and its publication rate need not be identical. A display receiving updates slowly may not show every internal update. Conversely, a fast map update cannot create observations that an occluded or slow sensor never supplied.

Three practical examples

  • Indoor delivery: a local controller responds to a newly detected object along a previously planned corridor route.
  • Mobile manipulation: the navigation system updates its footprint representation when the robot's load changes its occupied shape.
  • Inspection: a robot maintains nearby obstacle information while traversing a larger facility, using a separate broader representation for route planning.

Think of it this way

Think of the difference between a building's floor plan and the immediate view around your feet while carrying a trolley. The plan helps you choose a corridor; the nearby view helps you avoid a bag left in that corridor. A local costmap organizes the nearby evidence for a robot, but its usefulness still depends on what the sensors can observe and how quickly the robot can respond.

Worked example

Consider an original grid-sizing example. A square rolling local costmap covers 6 by 6 meters at a resolution of 0.1 meters per cell. It contains 60 by 60 cells, or 3,600 cells.
With the robot at map coordinates (10, 20) and the window centered on it, the represented ranges are approximately x = 7 to 13 and y = 17 to 23 meters. An obstacle at (11.2, 20.4) lies 4.2 meters from the window's left edge and 3.4 meters from its lower edge. Using zero-based floor indexing and ignoring floating-point rounding, its cell index is (42, 34).
If the robot advances one meter in x, a recentered window spans x = 8 to 14. The stationary obstacle is then at index (32, 34). Its world location did not change; its position within the moving window did.
Halving the cell size to 0.05 meters gives 120 by 120 cells, or 14,400. That is four times as many cells, although actual processing cost depends on the layers and update method rather than cell count alone.
At an illustrative update rate of 5 hertz, updates are scheduled 0.2 seconds apart. A robot traveling at 0.8 meters per second covers 0.16 meters in that interval, before considering sensor, communication, and controller delays. This is a timing illustration, not an adequate stopping-distance calculation or a recommended configuration.
The example shows three distinct design choices: spatial coverage, spatial detail, and temporal freshness. Improving one does not automatically solve limitations in the others.

Illustrative case study

Fictional case: Rowan Facilities investigates why an indoor service robot sometimes hesitates near temporary carts. Engineers compare recorded sensor observations, coordinate transforms, costmap updates, and controller decisions.
They find that one obstacle layer retains some detections after the cart moves because clearing observations are not reaching the relevant area. They adjust the observation setup and test both stationary and moving obstacles, rather than merely reducing obstacle costs until the robot proceeds.
The team measures whether the revised setup removes stale detections without hiding real obstacles. This fictional case illustrates diagnosis of the complete sensing-to-control chain, not a claim of demonstrated reliability or a finished commercial deployment.

Common misconceptions and mistakes

A local costmap is not necessarily a permanent map or a complete world model. A low cost does not guarantee that an unobserved location is empty. Updating sensor-derived obstacles is not the same as predicting their future motion.
Finer cells do not automatically improve navigation if sensor accuracy, timing, or computing capacity is inadequate. Clearing the whole costmap can remove useful evidence and does not fix its underlying cause. Finally, a valid nearby maneuver may still lead into a dead end that requires broader replanning.

Business use

Local costmaps help robots adapt planned tasks to immediate conditions. For a business deployment, useful measures include unnecessary stops, obstacle response, navigation completion, and processing load under representative conditions. Teams should examine how sensor coverage and map freshness interact with operating speed, while maintaining explicit policies for unknown space and stale data. Configuration changes deserve testing across the relevant layouts and robot loads.

People also ask

Is a local costmap always centered on the robot?

A rolling window commonly is, but the exact configuration varies.

Does it have to use only live sensor data?

No. It may combine several layers, including static information.

Can it replace localization?

No. It needs suitable pose estimates and coordinate transforms to place observations consistently.

Check your understanding

Why does the example's stationary obstacle move from grid column 42 to column 32?

Answer: The rolling window moved one meter, equal to ten cells at 0.1 meters per cell. The obstacle stayed at the same world position while the window's origin changed.

Related terms

  • Global costmap
  • Occupancy grid
  • Localization
  • Keepout
  • Obstacle layer
  • Robot footprint
  • Rolling window
  • Local planner

Learn next

Study coordinate frames and grid indexing, then follow a sensor observation through marking, clearing, and costmap combination. Compare the resulting map with the controller's chosen trajectory to understand how spatial evidence influences motion.

More in Reinforcement learning and robotics

  • Inverse reinforcement learning - Inverse reinforcement learning is the task of inferring a reward or cost function from observed behavior in a sequential decision-making setting.
  • Lambda return - A lambda return is a weighted combination of multi-step returns used as a learning target in reinforcement learning.
  • Least-squares temporal-difference learning - Least-squares temporal-difference learning, usually abbreviated LSTD, estimates a value function by solving a system of equations built from observed...
  • Markov localization - Markov localization is a probabilistic method for estimating a robot's pose by maintaining and updating a belief distribution over possible poses.
  • Maximum a posteriori policy optimization - Maximum a posteriori policy optimization, usually called MPO, is a reinforcement-learning method that improves a policy through alternating action...
  • Maximum entropy inverse reinforcement learning - Maximum entropy inverse reinforcement learning is a method for learning a reward model from demonstrated sequential behavior.

Sources

PAL Robotics, PAL OS glossary, Local costmap entry: https://docs.pal-robotics.com/edge/glossary Nav2, Costmap 2D, rolling-window, resolution, footprint, and update parameters: https://docs.nav2.org/rolling/configuration_and_development/configuration_guide/core_servers/costmap_2d/

Independent review checked PAL scope and Nav2 costmap parameters.

Previous: Local consistency Next: Local-first software

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer