Occupancy grid maps in practice

Occupancy grid maps are one of the most practical map representations in robotics. They divide space into cells and estimate whether each cell is free, occupied, or still unknown. That sounds simple, but the representation is powerful because it turns noisy sensor measurements into a structure that planning, localization, and obstacle reasoning can use directly.

Occupancy grids remain popular because they are conceptually clear, easy to update incrementally, and compatible with a wide range of sensors and algorithms.

The basic idea

Imagine covering the world with a 2D chessboard. Every square stores the current belief about whether that patch of space contains an obstacle. If the robot sees repeated evidence that a cell is blocked, the occupancy probability rises. If the robot repeatedly observes that a cell is clear, the probability falls. Cells that have not been observed remain unknown.

This representation is attractive because it makes uncertainty explicit. The map does not pretend to know the world perfectly. It stores a belief that can change as new measurements arrive.

Why occupancy grids matter

Occupancy grids are useful because they bridge sensing and action. Raw LiDAR or sonar readings are hard for a planner to use directly. A grid map converts those measurements into a spatial memory that answers practical questions such as:

  • Which nearby cells are clearly free?
  • Where are likely obstacles?
  • Which regions remain unknown or poorly observed?
  • Is there a safe corridor from the current pose to the goal?

That makes occupancy grids especially valuable in mobile robotics, autonomous navigation, and obstacle avoidance.

How sensor updates work

The most common formulation updates each cell probabilistically from incoming sensor data. Laser scans, depth sensors, or range observations are traced into the map:

  • cells along the beam are often reinforced as free
  • the end point is reinforced as occupied if an obstacle was detected
  • cells beyond the obstacle remain unknown because the sensor did not see through it

Many systems use a log-odds update because it makes repeated Bayesian updates efficient. Instead of storing raw probabilities directly, the map stores a transformed value that can be incremented or decremented more easily as evidence accumulates.

for each laser beam:
    mark traversed cells as more likely free
    mark impact cell as more likely occupied
    keep unobserved cells unknown

That small pattern is the heart of many practical grid-mapping systems.

Resolution is a real engineering tradeoff

Occupancy grids look straightforward until you choose the cell size. Resolution affects almost everything:

  • finer cells capture more detail
  • coarser cells reduce memory and compute load
  • planning cost often scales badly as resolution becomes too fine
  • small errors and sensor noise can become exaggerated at very high resolution

MRPT’s occupancy-grid notes highlight this tradeoff clearly: many operations scale with the square of the inverse resolution. That means halving the cell size can increase computational cost dramatically.

So the “best” resolution is not the finest possible one. It is the one that matches the robot size, sensor noise, and planning needs.

How grids support planning

Once the map stores free and occupied cells, a planner can search for safe paths. The simplest approach is to inflate obstacles by the robot radius, then run a path-planning algorithm over the remaining free cells. This is why occupancy grids are so practical: they convert navigation into a structured search problem.

MRPT’s planning examples show this nicely. A circular robot can plan over a 2D occupancy grid after obstacle growth, using value iteration or similar methods to find a path toward the goal.

This works well for many indoor or moderately structured environments, even if the final motion planner later refines the path more smoothly.

Where occupancy grids are strong

  • simple and intuitive representation
  • works naturally with range sensors
  • supports incremental updates over time
  • easy to use for planning and collision checking
  • keeps uncertainty visible through free, occupied, and unknown space

Where occupancy grids become limited

Despite their usefulness, occupancy grids also have limitations:

  • large maps consume significant memory
  • fixed resolution may waste detail in some areas and lose detail in others
  • 2D grids do not represent height or overhangs well
  • dynamic environments require frequent updates and clearing
  • the map alone does not explain object identity or semantics

These limitations are why teams sometimes move to hierarchical structures such as octomaps for 3D, or add semantic layers on top of the occupancy representation.

Occupancy grids in modern autonomous systems

Occupancy grids are still relevant in modern autonomy stacks. Autoware’s perception and planning documentation explicitly includes occupancy-map information as an input for planning. That makes sense: even if object detectors and lane models are available, a planner still benefits from a spatial representation of drivable, blocked, and occluded areas.

In other words, occupancy grids are not outdated. They remain one of the cleanest ways to represent navigable space under uncertainty.

A practical checklist

If I were reviewing a grid-mapping system, I would look at:

  • cell resolution and its effect on runtime
  • sensor model assumptions used for free and occupied updates
  • how unknown space is handled by planning
  • whether dynamic obstacles are cleared correctly
  • how obstacle inflation matches robot geometry
  • whether 2D is sufficient or a 3D map is required

These questions usually matter more than the visualization itself.

Conclusion

Occupancy grid maps remain a foundational tool in robotics because they turn uncertain sensor data into a representation that planners and navigation systems can actually use. Their strength lies in simplicity, probabilistic updates, and close compatibility with path planning. Their weaknesses appear when environments become very large, highly dynamic, or deeply three-dimensional. But as a practical engineering tool, occupancy grids still matter a great deal.

References

Leave a Comment