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.
| Stage | Purpose | Typical techniques |
|---|---|---|
| Odometry | Estimate motion between consecutive frames | Wheel encoders, IMU, scan matching, visual odometry |
| Data association | Match observations to known map elements | Feature descriptors, nearest neighbor search |
| Loop closure detection | Recognize revisited places | Bag-of-words image retrieval, scan descriptors |
| Back-end optimization | Compute consistent poses and map | Pose graph optimization, bundle adjustment |
| Map representation | Store the environment for later use | Occupancy grids, point clouds, sparse landmarks |
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.
| Approach | Core idea | Strengths | Limitations |
|---|---|---|---|
| EKF SLAM | Extended Kalman filter over robot pose and landmarks | Simple, well understood | Cost grows quadratically with landmarks |
| Particle filter SLAM | Many pose hypotheses, each with its own map | Handles ambiguity well | Particle count limits map size |
| Graph-based SLAM | Poses as nodes, constraints as edges, solved by optimization | Scales well, accurate | Needs robust outlier rejection |
| Learned or hybrid SLAM | Neural networks for features or depth within classic pipelines | Robust in hard visual conditions | Generalization still uncertain |
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 compared with related perception tasks
SLAM overlaps with several neighboring perception tasks, and the boundaries are often blurred in everyday usage. The comparison clarifies what each task produces.
| Concept | Output | Relation to SLAM |
|---|---|---|
| SLAM | Global map and robot trajectory | Complete solution with loop closure |
| Visual odometry | Relative motion between frames | Front-end component, drifts without loop closure |
| Localization only | Pose in a known map | Uses a map that SLAM produced earlier |
| Sensor fusion | Combined state estimate from several sensors | Technique used inside SLAM |
| Object recognition | Labels for objects in a scene | Adds semantic layers to SLAM maps |
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.
| Situation | Typical choice | Reason |
|---|---|---|
| Indoor warehouse vehicle | 2D LiDAR SLAM with wheel odometry | Reliable, centimeter-level maps of flat floors |
| Drone in GPS-denied space | Visual-inertial SLAM | Light sensors, handles fast 3D motion |
| Outdoor mapping vehicle | 3D LiDAR SLAM fused with GNSS | Large scale, varied lighting |
| Low-cost consumer robot | Monocular camera or low-cost LiDAR | Price constraints dominate |
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.