Warning

# Map Building

Motivations and Goals
Learn the principle of the occupancy grid map construction
Task t1d-map - Implement function for updating the occupancy grid map using sensory data

## Occupancy Grid Maps

Occupancy grid maps represent an example of environment representation in probabilistic robotics, which addresses the problem of generating maps from noisy and uncertain sensor measurement data, assuming that the robot pose is known. 1) The goal of the occupancy mapping is to estimate the posterior probability over maps given the data: $p( m \vert z_{1:t}, x_{1:t} )$ where $m$ is the map, $z_{1:t}$ is the set of measurements from time $1$ to $t$, and $x_{1:t}$ is the set of robot poses from time $1$ to $t$. Typically, the problem decomposes to the estimation of $p( m_i \vert z_{1:t}, x_{1:t} )$, where $m_i$ is a single cell of the occupancy grid map.

In general, the grid maps divide the action space of the robot into discrete cells, which carry the information about the occupancy of the designated area (occupied, free, unknown). The cell dimensions are user-defined to balance the environment size, which influences the overall memory consumption, and geometrical precision, which should be proportional to the robot dimensions. The data from the sensors are fused to the occupancy grid using either a Bayesian or Non-bayesian way.

The Bayesian occupancy grid update is defined as: $$P(m_i = occupied \vert z) = \dfrac{p(z \vert m_i = occupied)P(m_i = occupied)}{p(z \vert m_i = occupied)P(m_i = occupied) + p(z \vert m_i = free)P(m_i = free)},$$ where $P(m_i = occupied \vert z)$ is the probability of cell $m_i$ being occupied after the fusion of the sensory data; $P(m_i = occupied)$ is the previous probability of the cell being occupied and $p(z \vert m_i = occupied)$ is the model of the sensor which is usually modeled as: $$p(z \vert m_i = occupied) = \dfrac{1 + S^z_{occupied} - S^z_{free}}{2},$$ $$p(z \vert m_i = free) = \dfrac{1 - S^z_{occupied} + S^z_{free}}{2} = 1 - p(z \vert m_i = occupied),$$ where $S^z_{occupied}$ and $S^z_{free}$ are the sensory models for the occupied and free space, respectively.

An example of the occupancy grid mapping: https://www.youtube.com/watch?v=zjl7NmutMIc