Tech_Interview_Prep

Perception & SLAM

How a robot builds a map of an unknown environment while simultaneously figuring out its own location within it.

What it is

SLAM (Simultaneous Localization and Mapping) solves the chicken-and-egg problem of a robot building a map of an unknown environment while also determining its own position within that map — needed since it can't fully trust either without the other.

Key points

  • Why it's hard: accurately mapping requires knowing your position, and accurately localizing requires having a map — SLAM algorithms solve both simultaneously, using probabilistic estimation to handle sensor noise and uncertainty in both.
  • Loop closure: recognizing that the robot has returned to a previously-visited location — critical for correcting accumulated drift in the estimated position/map, since small errors otherwise compound over a long path.
  • Sensor fusion: SLAM typically combines multiple sensor types (LiDAR, cameras, IMU) since each has different strengths and failure modes — relying on a single sensor type is fragile.
  • SLAM is foundational to autonomous navigation — a robot that can't answer "where am I, and what does the environment around me look like" can't plan a path through it.