Localization, Mapping & SLAM

occupancy grid map

An occupancy grid map is a robot's map of a space drawn as graph paper: the floor is chopped into a fine grid of equal little squares, and each square holds one number answering a single question — is something solid sitting here? Picture laying transparent graph paper over a room's floor plan, then shading each square dark if a wall or table sits on it and leaving it pale if it is open floor you could walk across. That shaded sheet, square by square, is the map. Each square is called a cell, and a typical cell might cover a five-centimeter patch of ground.

The honest twist is that the robot is never fully certain about any square, so each cell does not just say occupied or free — it stores a probability, a number capturing how confident the robot is that the square is blocked. A cell the laser has hit again and again climbs toward near-certain-occupied; a cell the beams pass cleanly through drifts toward near-certain-free; a square the robot has never glimpsed stays at fifty-fifty, an honest shrug meaning unknown. As the robot drives around and sweeps its sensor, every reading nudges the cells it crosses, and the picture sharpens from a vague fog into a crisp floor plan.

This is one of the most popular ways to store a robot's map because it is wonderfully simple to use. A path planner can glance at the grid and route only through pale, free cells while steering clear of dark, blocked ones; a localization method can compare a fresh sensor sweep against the grid to figure out where the robot stands. Its cost is memory and detail: a tiny cell size captures fine structure but eats storage, and because the world is sliced into squares, thin or oddly angled objects can get blurred across cell edges.

After one slow lap of an apartment, a robot vacuum's app shows you a clean floor plan: dark lines trace the walls and furniture legs, pale areas are open carpet it can clean, and a few gray patches under the sofa are spots it never quite saw.

Dark cells are walls, pale cells are open floor, gray cells are still unknown.

Occupancy grids are usually two-dimensional — a flat floor plan — but the same idea extends upward into three-dimensional voxel grids when a robot, such as a drone, needs to map obstacles at different heights.

Also called
occupancy grid栅格地图占用栅格地图