Robotics
← Roadmap/Perception

SLAM

Simultaneous Localization And Mapping — the crown jewel.

Progress0/14 questions

Prerequisites

Why it matters in robotics

SLAM — simultaneous localization and mapping — is the canonical hard problem of robot perception: building a map while localizing within it, end to end. Its crux is the repeated cycle of predicting motion and correcting it against new sensor data, the fact that tracking uncertainty across many landmarks gets expensive fast, recognizing when the robot has returned to a previously seen place, and the split between a front-end that tracks features frame to frame and a back-end that reconciles the whole map for consistency. Its real failure modes — drift and mistaking one place for another — trace back to how uncertainty is represented and combined under the hood.

What to study

  • Filtering SLAM: EKF-SLAM and the FastSLAM/particle-filter approach, plus why the covariance grows quadratically with landmarks
  • Graph-based / factor-graph SLAM: pose graphs, bundle adjustment, marginalization, and nonlinear least-squares back-ends (g2o, GTSAM, Ceres)
  • Front-end essentials: feature detection/matching, data association, motion models, and loop-closure detection (place recognition)
  • System view: visual vs LiDAR SLAM, drift and loop-closure correction, and the robust-perception challenges from Cadena et al.

Where to study

Cheatsheet

Symbols used below

xtx_trobot pose at time tt
mmmap — landmark positions (or occupancy cells)
nnnumber of landmarks in the map
ztz_tobservation of a landmark (or scan) at time tt

The joint estimation problem

SLAM estimates the joint posterior over the entire trajectory and the map, p(x1:t,mz1:t,u1:t)p(x_{1:t}, m \mid z_{1:t}, u_{1:t}), from the same predict/update cycle as any Bayes filter — except now correcting the pose also has to correct every landmark correlated with it.

That coupling is exactly what lets a single loop closure retroactively fix an entire trajectory's drift.

EKF-SLAM's cost problem

Stacking the robot pose and all nn landmarks into one state vector makes the covariance matrix (3+2n)×(3+2n)(3+2n) \times (3+2n) (2-D case). Every update touches the full covariance, so each step costs O(n2)O(n^2).

This quadratic growth is why EKF-SLAM alone doesn't scale to large maps — FastSLAM factors the landmarks into per-particle, independent EKFs to avoid it, trading it for particle-count scaling instead.

Front-end vs back-end

Front-end: turns raw sensor data into constraints — detect and match features (or scans) frame to frame, estimate relative motion, and decide data association (is this the same landmark/place as before?).

Back-end: takes those constraints and produces a globally consistent trajectory/map — either recursive filtering (EKF-SLAM) or batch nonlinear optimization (pose-graph / bundle adjustment).

Loop closure fixes drift

Odometry and scan matching alone accumulate error monotonically — the estimated path never closes a real loop. Recognizing a previously visited place (place recognition) adds a new constraint linking the current pose back to that earlier one.

In a pose graph, optimization then redistributes the accumulated error across every pose in the loop, not just the endpoint — a single correct loop closure can snap an entire map back into consistency.

Marginalization keeps optimization bounded

Graph-based SLAM can't keep every past pose in the optimization forever — old poses are marginalized out (folded into a prior/factor over the remaining variables) so the optimization problem stays a bounded size instead of growing with total trajectory length.

loop closureodometry edges (drift) + closure constraint
Loop closure recognizes a previously-visited place and adds a constraint between the current and past pose; pose-graph optimization then redistributes the accumulated drift around the whole loop.
 EKF-SLAMGraph-based SLAM
StateSingle Gaussian over pose + all landmarksGraph of poses/landmarks linked by constraints
Update styleRecursive, one measurement at a timeBatch nonlinear least-squares (e.g. g2o, GTSAM, Ceres)
Revisiting old estimatesCan't easily re-linearize the pastRe-optimizes the whole graph, correcting past poses too
ScalingO(n2)O(n^2) per update in landmark countSparse — exploits that most poses only connect to nearby ones
occupancy gridrobotoccupiedlidar ray
An occupancy grid discretizes space into cells; each lidar ray marks the cells it passes through as free and the cell it strikes as occupied, accumulated probabilistically over many scans.

Application focus

Select an application above.

Practice questions (14)