> ## Documentation Index
> Fetch the complete documentation index at: https://aegean.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Mapping While Localizing

> The order to read the mapping and SLAM sections, what each one gives you, and how they lead to the Visual SLAM assignment.

A robot in an unknown room has to build a map and find itself in it at the same time. This chapter gets there in steps. It starts with mapping from known poses, adds the question of which landmark a measurement belongs to, and then estimates the pose and the map together. It then brings in two sensors that measure the robot's own motion, an IMU and a camera, and ends with a camera that maps the room and localizes itself from its images alone. The last step is the Visual SLAM assignment.

## Before you start

The chapter assumes the [extended Kalman filter](https://aegean.ai/aiml-common/lectures/rse/ekf/index.md) and [EKF localization](https://aegean.ai/aiml-common/lectures/rse/ekf-localization/index.md) sections, which supply the motion model, the measurement model and the filter equations every later section reuses. The [D435i for landmark features](https://aegean.ai/aiml-common/lectures/sensor-models/d435i-landmark-features/index.md) section explains how the depth camera turns a pixel and a depth into a range and a bearing.

## Reading order

| Step | Section | What you get from it |
| - | - | - |
| 1 | [Occupancy grid mapping](https://aegean.ai/aiml-common/lectures/rse/occupancy-mapping/index.md) | A map built from lidar scans when the poses are known, and the distortion that odometry drift causes when they are not. |
| 2 | [Correspondence estimation](https://aegean.ai/aiml-common/lectures/rse/correspondence-estimation/index.md) | A way to decide which landmark a measurement came from: the Mahalanobis gate and joint compatibility. |
| 3 | [Scan registration with ICP](https://aegean.ai/aiml-common/lectures/rse/scan-registration/index.md) | The motion between two LIDAR scans from ICP: the closed-form fit, Gauss-Newton, point-to-line errors and robust weights against outliers. |
| 4 | [EKF SLAM](https://aegean.ai/aiml-common/lectures/rse/slam/index.md) | The pose and the landmark map in one filter, with unknown correspondences and new landmarks added as they appear. Lidar and D435i front ends feed the same filter, and loop closure corrects the drift. |
| 5 | [IMU](https://aegean.ai/aiml-common/lectures/sensor-models/imu/index.md) | What a gyroscope and an accelerometer measure, how their noise and bias grow under integration, and why an IMU alone keeps the pose for only seconds. |
| 6 | [Visual-inertial odometry](https://aegean.ai/aiml-common/lectures/rse/vio/index.md) | A filter in which camera images correct the IMU's prediction and estimate the IMU's biases. |
| 7 | [Visual SLAM](https://aegean.ai/aiml-common/lectures/rse/visual-slam/index.md) | Camera motion from two views, the scale a single camera cannot measure, and loop closure with a pose graph, mapped onto the modules of StellaVSLAM. |
| 8 | [Visual SLAM assignment](https://aegean.ai/aiml-common/projects/robotics/visual-slam/visual-slam.md) | Your own monocular pipeline on KITTI, StellaVSLAM in your own room, and StellaVSLAM with Nav2 in the TurtleBot maze. |

Steps 1 to 4 use landmarks and range sensors, and step 4 is the baseline SLAM algorithm. Steps 5 to 7 replace the wheels with inertial and visual motion estimates. Read step 5 before step 6, because the VIO filter's prediction is the IMU integration of step 5. Read step 7 before the assignment: its first task asks you to build the same front end on real images.

> [card] [Occupancy grid mapping](https://aegean.ai/aiml-common/lectures/rse/occupancy-mapping/index.md)
>
> Mapping with known poses, and what odometry drift does to the map.

> [card] [Correspondence estimation](https://aegean.ai/aiml-common/lectures/rse/correspondence-estimation/index.md)
>
> Matching measurements to the map: data association and joint compatibility.

> [card] [Scan registration](https://aegean.ai/aiml-common/lectures/rse/scan-registration/index.md)
>
> Aligning two LIDAR scans with ICP, from the closed-form fit to point-to-line and robust variants.

> [card] [EKF SLAM](https://aegean.ai/aiml-common/lectures/rse/slam/index.md)
>
> Pose and landmark map in one EKF, with landmarks from a lidar or a D435i.

> [card] [IMU](https://aegean.ai/aiml-common/lectures/sensor-models/imu/index.md)
>
> Gyroscope and accelerometer models, bias, and IMU dead reckoning.

> [card] [Visual-inertial odometry](https://aegean.ai/aiml-common/lectures/rse/vio/index.md)
>
> The camera corrects the IMU and estimates its biases.

> [card] [Visual SLAM](https://aegean.ai/aiml-common/lectures/rse/visual-slam/index.md)
>
> Two-view geometry, monocular scale, and loop closure with a pose graph.

***

Found an error on this page? [Report an issue](https://github.com/aegean-ai/eaia-feedback/issues/new?template=page-issue.yml\&page=/book/slam).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.