Skip to main content

πŸ“ Simultaneous Localization and Mapping (SLAM)

Description​

< What is it? >​

Simultaneous Localization and Mapping (SLAM) is the problem of estimating where a vehicle is while building or updating a map of its surroundings. It combines noisy sensor observations with motion estimates, so the vehicle can maintain a consistent pose even when GPS is weak or unavailable.

In autonomous driving, SLAM is especially useful when creating high-definition maps and when localizing a vehicle against those maps. The output is a vehicle poseβ€”position and orientationβ€”and, when mapping is active, a geometric or landmark map.

  • Example: as a mapping vehicle drives through a city, it uses LiDAR scans, camera images, and IMU motion measurements to estimate its trajectory and align repeated observations of the same buildings, lane markings, and poles into one map.

Key points​

< What is estimated? >​

SLAM estimates a joint probability distribution over the vehicle trajectory x0:tx_{0:t} and map mm, given sensor observations z1:tz_{1:t} and motion inputs u1:tu_{1:t}:

p(x0:t,m∣z1:t,u1:t)p(x_{0:t},m\mid z_{1:t},u_{1:t})

The vehicle must solve two coupled questions: β€œWhere am I?” and β€œWhat does the world around me look like?” A better map improves pose estimates, while better pose estimates let observations be placed correctly in the map.

< Sensors and sensor fusion >​

An autonomous vehicle usually combines several sources because each has different failure modes:

An Inertial Measurement Unit (IMU) contains accelerometers and gyroscopes that measure linear acceleration and angular velocity. By integrating those high-rate measurements, it predicts how the vehicle moved between camera or LiDAR observations. The prediction is useful over short intervals, but noise and sensor bias accumulate into drift without external correction.

Sensor or signalWhat it contributesCommon limitation
LiDARAccurate 3D geometry for scan matching and point-cloud mapsRain, snow, sparse surfaces, and cost
CameraVisual landmarks, lane markings, signs, and semantic contextLighting, weather, motion blur, and texture-poor scenes
IMU and wheel odometryFast short-term motion estimatesSmall errors accumulate as drift
GNSSGlobal position referenceUrban canyons, tunnels, multipath, and outages

Fusion combines their complementary evidence. For example, an IMU can bridge a brief LiDAR or camera failure, while a mapped LiDAR scan can correct accumulated odometry drift.

< Typical SLAM pipeline >​

  1. Synchronize and calibrate sensor data so every measurement is expressed in the correct coordinate frame.
  2. Track motion by matching consecutive scans, images, or features to estimate relative vehicle movement.
  3. Add map constraints by matching observations to landmarks, a point cloud, or keyframes.
  4. Optimize the trajectory and map with a filter or factor graph to make all constraints mutually consistent.
  5. Detect loop closures when the vehicle recognizes a previously visited place; this corrects long-term drift.

Dynamic objects such as cars, cyclists, and pedestrians are usually filtered or down-weighted because they are poor stable landmarks.

< SLAM in a production driving stack >​

Many autonomous-driving systems do not build a new map continuously during normal driving. Instead, they use a prebuilt high-definition map and perform map-based localization:

offline mapping run β†’ high-definition map
↑
online LiDAR, camera, GNSS, IMU β†’ localization and sensor fusion β†’ vehicle pose β†’ planning and control
  • Example: while driving on a mapped road, the vehicle matches its current LiDAR point cloud to the stored point-cloud map and fuses that result with GNSS and IMU data. The planner then uses the resulting pose to identify the current lane and route position.

This is related to SLAM, but it is primarily localization against an existing map. The map must be refreshed when roads, construction zones, or permanent landmarks change.

< Failure modes and safety >​

  • Drift: small relative-motion errors accumulate without a strong global correction.
  • Perceptual degradation: darkness, glare, rain, snow, fog, or repetitive scenery can make visual or LiDAR matching unreliable.
  • Map mismatch: construction, changed lane layouts, or stale landmarks can make a valid old map misleading.
  • Sensor problems: inaccurate calibration, poor time synchronization, occlusion, or a GNSS outage can corrupt the pose estimate.

Driving systems therefore monitor localization confidence, fuse redundant sensors, define an operational design domain, and choose a safe fallback when the pose is unreliable.

Comparison​

< SLAM, odometry, and map-based localization >​

SLAMOdometryMap-based localization
Main goalEstimate pose while building or updating a mapEstimate relative motion over timeEstimate pose in a prebuilt map
Map required at startNoNoYes
Drift correctionLoop closures and map constraintsUsually none beyond sensor fusionMatching to known map features or point clouds
Typical driving useFleet mapping, map updates, unmapped areasShort-term motion inputNormal operation on mapped roads

Video Tutorial​

Reference​