SLAM

On this page 7

SLAM, short for simultaneous localization and mapping, is the process by which a robot builds a map of an unknown environment while estimating its own pose within that map, using only its onboard sensors. In robotics perception, it solves a circular problem: an accurate map requires knowing where the robot is, and knowing where the robot is requires an accurate map.

SLAM is what allows a vacuum robot, a warehouse vehicle or a drone to operate without GPS or a pre-built map. It combines motion estimates, such as wheel odometry or visual odometry, with observations of landmarks or surfaces, and it corrects accumulated error whenever the robot recognizes a place it has visited before.

How SLAM works

A SLAM system is usually divided into a front end and a back end. The front end processes raw sensor data: it extracts features or aligns scans, associates observations with existing map elements and proposes constraints between poses. The back end turns all those constraints into the most probable trajectory and map through estimation or optimization.

The key event is loop closure. As the robot moves, small errors in each motion estimate accumulate as drift, so a long corridor may appear bent and a loop may fail to close. When the front end recognizes a previously seen place, it adds a constraint linking the current pose to the old one, and the back end redistributes the error across the whole trajectory.

The table below summarizes the main stages of a typical SLAM pipeline.

StagePurposeTypical techniques
OdometryEstimate motion between consecutive framesWheel encoders, IMU, scan matching, visual odometry
Data associationMatch observations to known map elementsFeature descriptors, nearest neighbor search
Loop closure detectionRecognize revisited placesBag-of-words image retrieval, scan descriptors
Back-end optimizationCompute consistent poses and mapPose graph optimization, bundle adjustment
Map representationStore the environment for later useOccupancy grids, point clouds, sparse landmarks
Stages of a SLAM pipeline

Families of SLAM methods

SLAM algorithms differ in how they represent uncertainty and in which sensors they rely on. Early systems used filters that track a single probability distribution, while most modern systems use graph-based optimization over many past poses.

ApproachCore ideaStrengthsLimitations
EKF SLAMExtended Kalman filter over robot pose and landmarksSimple, well understoodCost grows quadratically with landmarks
Particle filter SLAMMany pose hypotheses, each with its own mapHandles ambiguity wellParticle count limits map size
Graph-based SLAMPoses as nodes, constraints as edges, solved by optimizationScales well, accurateNeeds robust outlier rejection
Learned or hybrid SLAMNeural networks for features or depth within classic pipelinesRobust in hard visual conditionsGeneralization still uncertain
Main estimation approaches in SLAM

By sensor, systems are usually grouped into LiDAR SLAM, which aligns laser scans or point clouds, and visual SLAM, which tracks image features with monocular, stereo or RGB-D cameras. Visual-inertial SLAM adds an IMU and has become standard for drones and mobile devices, because the IMU fills gaps during fast motion and fixes the metric scale that a single camera cannot observe.

SLAM overlaps with several neighboring perception tasks, and the boundaries are often blurred in everyday usage. The comparison clarifies what each task produces.

ConceptOutputRelation to SLAM
SLAMGlobal map and robot trajectoryComplete solution with loop closure
Visual odometryRelative motion between framesFront-end component, drifts without loop closure
Localization onlyPose in a known mapUses a map that SLAM produced earlier
Sensor fusionCombined state estimate from several sensorsTechnique used inside SLAM
Object recognitionLabels for objects in a sceneAdds semantic layers to SLAM maps
SLAM versus neighboring perception concepts

In deployed products, robots often run SLAM once to build a map and then switch to localization against that map, which is cheaper and more predictable. The map is updated only when the environment changes significantly.

Choosing a SLAM setup in practice

The right SLAM configuration depends on environment, required accuracy, compute budget and sensor cost. The decision table below reflects common engineering choices.

SituationTypical choiceReason
Indoor warehouse vehicle2D LiDAR SLAM with wheel odometryReliable, centimeter-level maps of flat floors
Drone in GPS-denied spaceVisual-inertial SLAMLight sensors, handles fast 3D motion
Outdoor mapping vehicle3D LiDAR SLAM fused with GNSSLarge scale, varied lighting
Low-cost consumer robotMonocular camera or low-cost LiDARPrice constraints dominate
Matching SLAM configurations to situations

Accuracy figures depend heavily on conditions. Well-tuned LiDAR systems commonly reach centimeter-level consistency indoors, while visual systems vary more with texture and lighting, and drift is usually quoted as a percentage of distance traveled.

Failure modes and limitations of SLAM

SLAM fails mostly when sensors stop providing distinctive, consistent information. Experienced engineers plan for these conditions instead of assuming the map will always converge.

  • Feature-poor scenes such as white walls, long identical corridors or open fields.
  • Dynamic environments where people, vehicles or pallets move and corrupt the map.
  • Perceptual aliasing, in which two different places look alike and a false loop closure warps the map.
  • Lighting changes and motion blur that degrade visual SLAM.
  • Reflective or transparent surfaces that confuse LiDAR and depth sensors.

A single false loop closure can be more damaging than no loop closure at all, which is why modern back ends use robust cost functions and consistency checks to reject suspicious constraints.

The simple explanation

SLAM is how a robot draws a map of a new place while also keeping track of where it is on that map. Imagine walking through an unfamiliar building in the dark with a flashlight, sketching the rooms as you go and marking your own position on the sketch.

Your sketch gets a little wrong over time. But when you return to a doorway you have already seen, you realize where you really are and correct the whole drawing. A robot does the same, many times per second, using cameras or laser scanners instead of eyes.

How it is used in practice

A logistics company introduces autonomous mobile robots in a 20,000 square meter warehouse. Before operation, a technician drives one robot through every aisle while it runs 2D LiDAR SLAM with wheel odometry, closing several loops around the racking. The result is an occupancy grid map with a resolution of 5 cm.

In daily operation, the robots localize against that map rather than rebuilding it, and they treat moving forklifts and people as temporary obstacles. When racks are rearranged, the team runs a short remapping session. The robots navigate to pick stations without floor markers or reflectors, and the layout can change in a day instead of weeks.