Skip to content

Mapping

Mapping refers to the ability of a robot to construct a representation or model of its environment. This is crucial for various robotic tasks, including localization, planning, and navigation. In this document, we'll dive deep into Occupancy Grid Mapping (OGM).

Overview of mapping in robotics.

Occupancy Grid Mapping (OGM)

OGM is a mapping method where the environment is represented as a discrete grid. Each cell in this grid represents a patch of space in the real world, and can either be occupied, free, or unknown.

An example occupancy grid. The black boxes indicate occupied regions, the white boxes indicate unoccupied (free) regions, and the gray boxes indicate unexplored regions.

Naive OGM

In a naive OGM, measurements from sensors (e.g., LiDAR or ultrasonic sensors) are used directly to update the grid. If a sensor measurement indicates that there's an obstacle at a specific location, the corresponding cell in the grid is marked as occupied. Conversely, if there's no obstacle, it's marked as free.

The major drawback of this approach is its binary nature. In other words, there's no room for uncertainty, which can lead to inaccuracies in the map, especially in dynamic environments or with noisy sensors.

Our implementation of OGM involves using a 2D lidar. The lidar scans show the distance of different points around the robot.

Probabilistic OGM

To counter the issues with the naive OGM, the Probabilistic OGM was introduced. Instead of binary values, probabilistic OGMs use probabilities to represent the likelihood that a cell is occupied.

If \(P_{occ}\) is the probability that a cell is occupied, then:

\[P_{occ} = \frac{P(z_t | \text{occ}) P_{prev}}{P(z_t)}\]

where:

  • \(P(z_t | \text{occ})\) is the probability of the sensor measurement \(z_t\) given that the cell is occupied.

  • \(P_{prev}\) is the probability that the cell was occupied in the previous time step (prior).

  • \(P(z_t)\) is the probability of the sensor measurement \(z_t\) at time \(t\).

This Bayesian update ensures that uncertainties in sensor measurements and temporary changes in the environment are handled more gracefully.

Demo

To try out the OGM algorithm, run this Google Colab notebook:

Open In Colab