Navigation and Control

What Is an Occupancy Grid? How Robots Map Free and Blocked Space.

By Rodolfo Garcia Calderoni, CFA ·

On this pageWhat Is an Occupancy Grid?Key TakeawaysHow Does an Occupancy Grid Work?What Is Occupancy Probability?Occupancy Grid vs. CostmapWhy Does Grid Resolution Matter?Frequently Asked QuestionsThe Bottom LineSourcesRelated terms

What Is an Occupancy Grid?

An occupancy grid is a map that divides an environment into small cells and represents whether each cell is occupied, free, or unknown.

Occupancy grids are widely used in mobile robot navigation and mapping.

For example, a warehouse robot may create an occupancy grid showing walls and storage racks as occupied space while marking open aisles as free space.

Navigation software can then use the grid to plan routes.

Key Takeaways

  • Occupancy grids divide an environment into cells representing spatial occupancy.
  • Cells may contain probabilities or other values describing whether space is occupied.
  • Grid resolution affects map detail, memory requirements, and computational cost.

How Does an Occupancy Grid Work?

Imagine a warehouse floor divided into thousands of small squares.

Each square represents a physical region.

A robot equipped with LiDAR measures distances to surrounding surfaces.

The mapping system uses these measurements to update its estimate of which cells contain obstacles.

Cells associated with detected surfaces may be marked as occupied.

Cells along unobstructed sensor paths may be marked as free.

Areas that have not been sufficiently observed remain unknown.

As the robot moves, it collects additional measurements and updates the map.

What Is Occupancy Probability?

Some occupancy grids use probabilities to represent uncertainty.

For example, a cell may have a high probability of being occupied because several sensor measurements indicate a nearby wall.

Another cell may have uncertain occupancy because the robot has only observed it briefly.

Probabilistic updates allow the system to combine imperfect measurements over time.

Different implementations use different numerical representations.

ROS provides an OccupancyGrid message for exchanging two-dimensional grid maps.

Occupancy Grid vs. Costmap

An occupancy grid describes whether space is occupied or free.

A costmap assigns values describing how suitable different areas are for navigation.

For example, an occupancy grid might identify the location of a shelf.

A costmap can assign high travel costs to the shelf and elevated costs to nearby areas, encouraging the robot to maintain clearance.

A navigation system may use an occupancy grid as one source of information for a costmap.

Why Does Grid Resolution Matter?

Consider representing a warehouse using 10-centimeter cells.

Smaller cells could capture finer geometric details.

However, reducing each cell's width and height by half creates approximately four times as many cells over the same area.

This increases memory and processing requirements.

The appropriate resolution depends on robot size, sensor capabilities, and the environmental detail needed.

Frequently Asked Questions

Can an occupancy grid represent moving people?

It can represent observations of moving objects, but systems often handle dynamic obstacles through additional or frequently updated navigation layers.

Does an occupancy grid identify object types?

Not ordinarily. Semantic mapping adds information about what the occupied areas represent.

The Bottom Line

Occupancy grids give robots a structured representation of free, occupied, and unknown space. They are fundamental to mapping and navigation because they turn sensor measurements into information that path planners can use.

Sources

  1. ROS 2 — OccupancyGrid Message

Black Scarab Weekly

Follow the physical AI economy

Get Black Scarab news, deep research, and practical analysis in one clear Thursday briefing.

Weekly reporting and deep dives. Unsubscribe anytime. See our privacy notice.