To plan a path, a robot needs a map. The simplest robot map is a grid of squares on graph paper.
Key idea
An occupancy grid cuts the floor into square cells of size $s$. A point at $x$ falls in column $\lfloor x / s \rfloor$ (round down, counting from 0). Each cell is marked free, occupied or unknown, often as a probability.
Why it works
A grid turns the world into something a computer can search. Smaller cells give a more exact map but more cells: halving the size makes four times as many, which takes more memory and more search time.
Worked example: Which cell?
Cells 0.25 m wide. A point at $x = 1.6$ m.
- $1.6 / 0.25 = 6.4$.
- Round down: column 6.
Answer: Column 6.
Worked example: How big?
A 5 m Γ 4 m room, 0.1 m cells.
- $50 \times 40 = 2000$ cells.
Answer: 2,000 cells.
Common mistake
Rounding to the nearest cell instead of down, or counting cells from 1.