Simultaneous Localization and Mapping (SLAM) Explained
Short answer
Simultaneous localization and mapping is the problem of a robot entering an unknown environment, building a map of it, and estimating its own position inside that map at the same time. The two estimates depend on each other, so the system solves them jointly as a probabilistic estimation task. The result is a map plus a pose estimate that gets corrected whenever the robot revisits a place it has already seen.
Key points
- Localization needs a map, mapping needs positions, and SLAM estimates both at once.
- Odometry drifts, so sensor data and a motion model are needed to keep the estimate consistent.
- Main approaches include extended Kalman filter SLAM, FastSLAM particle filters, and graph-based optimization.
- Variants split by sensor: visual SLAM, lidar SLAM, multi-sensor SLAM, and acoustic SLAM.
- Self-driving cars often replace SLAM with localization against a detailed pre-recorded map.
Simultaneous localization and mapping is the problem a mobile robot faces when it finds itself in a place it has never seen: it has to build a map of that place and work out its own position inside the map at the same time. Neither half can be finished first. Putting a landmark on a map requires knowing where the robot was when it saw the landmark, and knowing where the robot is requires something in the map to compare sensor readings against.
The usual shorthand is SLAM, and the field behind it sits between robotics and computer vision. The output is a map, a trajectory, or both, and the quality of that output decides whether a robot can plan a path, avoid obstacles, or return to a charging dock without help.
Why localization and mapping depend on each other
Take the two tasks apart. Localization means inferring a position given a map. Mapping means inferring a map given positions. Each is straightforward when the other is already known, and both are open questions when neither is.
Odometry alone cannot close the gap. Wheel revolutions, motor commands and inertial readings tell a robot how far it thinks it moved, and small errors in those measurements accumulate. A robot that drives a long loop and returns to its starting point will usually believe it is somewhere else. The gap between the believed start and the real start is the drift that a map has to correct.
Pose is normally expressed with six degrees of freedom in robotics: three for position, three for orientation. Every estimate SLAM produces is a guess about those six numbers, plus the coordinates of every landmark it has recorded.
What simultaneous localization and mapping actually solves
The classic statement of the problem asks whether a mobile robot can begin somewhere it has never seen and still build a coherent map of its surroundings while working out where it is inside that map. Consistent is the demanding word. The map has to stay internally coherent as the robot revisits places, which means earlier estimates are corrected rather than frozen.
That is why SLAM is treated as an estimation problem rather than a geometry problem. The answer is a probability distribution over poses and landmarks, not a single tidy result, and the algorithms that produce it are built to shrink uncertainty as evidence arrives.
Motion model, observation model, and noise
Most SLAM formulations keep two models. The motion model describes how the robot moves, using the commands sent to its motors and the physics of the platform; in probabilistic notation this is the transition term that predicts the next pose from the current one. The observation model describes how a sensor reading relates to a landmark in the map.
Both models carry error. Sensors are noisy, wheels slip, floors are uneven, and the environment contains objects that were never in the map. The motion model is included precisely to keep estimates sane under that noise: it weights what the sensors report against what the robot could physically have done, and produces a cloud of probability around the position and heading rather than a single point. That cloud, drawn over a map, is what a SLAM system really maintains.
Sensors and landmarks
SLAM systems combine several inputs, because each one fails in a different situation.
| Input | What it provides | Where it struggles |
|---|---|---|
| Wheel odometry | Approximate distance and turning | Slip and drift over long runs |
| Laser scan or lidar | Precise ranges to surfaces | Underwater and feature-poor spaces |
| Camera | Rich visual features | Low light, motion blur, texture-poor walls |
| Inertial unit | Fast short-term motion | Bias that grows without correction |
Raw readings have to be turned into landmarks before a filter can use them. Two common extraction methods take different routes. The spike method looks for large changes between adjacent laser beams and treats those jumps as corners or edges, which means it gives up in smooth surroundings where consecutive readings barely differ. RANSAC draws random samples from the readings, fits a line to them by least squares, and repeats until a fit survives with most points treated as inliers and the rest discarded as outliers. It handles cluttered scenes better, at the cost of more computation.
Odometry and scan data arrive at different rates, and matching them in time is one of the fiddly parts of a working implementation. Motor encoders and the actuators that drive them report at one frequency, a lidar at another.
The main families of SLAM algorithms
- Extended Kalman filter SLAM. The EKF is the traditional core of the method. It linearizes the non-linear motion and measurement relationships and keeps a single Gaussian estimate of the robot pose together with the landmarks, updating that estimate whenever a known landmark is seen again.
- FastSLAM and particle filters. Published in 2002 by Montemerlo, Thrun, Koller and Wegbreit, FastSLAM factors the problem: a particle filter carries many hypotheses about the robot path, and each particle keeps its own simple landmark estimates. This scales better than one large filter when landmarks are numerous.
- Graph-based methods. Poses and landmarks become nodes in a graph, and constraints between them become edges. Optimization then spreads the error across the whole graph, which handles large loops more gracefully than incremental filters.
- Visual SLAM. Cameras replace or supplement range sensors. Early work used scale-invariant image features to localize and map with a moving camera, and the vSLAM algorithm later showed the approach working well enough for practical robots.
- Lidar and multi-sensor SLAM. Lidar gives accurate geometry in buildings and on roads; fusing lidar, camera, inertial and odometry data covers the weaknesses of any single source.
- Acoustic SLAM. A moving microphone array can map the positions of surrounding speakers while tracking its own path through the room, using sound instead of light.
Most deployed systems run inside a robotics framework. In the Robot Operating System, a SLAM node typically subscribes to scan and odometry topics and publishes a map plus the coordinate transform that ties the robot to it, which lets other nodes plan and drive without knowing how the map was built.
How SLAM fails
Image and point-cloud mapping can ignore how a robot actually moves, and the result is a position estimate that jumps. A robot travelling at one metre per second may be reported as suddenly ten metres further ahead, because the mapping step matched the wrong geometry. Two fixes are common: a recovery routine that detects the implausible jump and resets the estimate, or a motion model fused with several sensors so the calculation is constrained by what the robot could have done.
Data association causes quieter failures. A landmark is not always seen in every frame, so the system has to decide whether a new observation is a fresh object or a return to one already in the map. Matching it to the wrong landmark bends the map without any obvious alarm, and the error can persist until the robot closes a loop and the constraint pulls the trajectory back into shape.
Where SLAM is used
A robot vacuum is the clearest small example. Without a map it wanders, covers some floor twice, misses other patches, and drains its battery. With SLAM it uses wheel revolutions plus camera or lidar data to track how far it has moved and to sketch the obstacles around it, so it can cover the floor once and find its way back to the dock.
The same machinery moves fleets of warehouse robots that carry shelves, parks a car in an empty space, and guides a delivery drone through a building it has not seen. Augmented reality headsets and phones use visual SLAM to hold virtual objects steady on a surface while the user walks around; that tracking depends on displays such as an AR optical waveguide display presenting the result without lag.
Pre-built maps change the problem
Many self-driving cars do not run full SLAM in traffic. They drive against maps surveyed in advance and annotated in detail, down to the position of individual lane markings and curbs, sometimes with street-level imagery recorded beforehand. With a good prior map, the hard joint problem collapses into localization, and only moving objects such as cars and pedestrians need updating at runtime.
The trade-off is maintenance. A pre-built map is only as good as its last survey, so roadworks, new signs and shifted lanes degrade performance until someone re-maps the area. Systems that keep mapping while they drive avoid that dependency, but they need more computation and more reliable data association to stay consistent.
Questions people also ask
What does SLAM stand for?
Simultaneous localization and mapping. The acronym covers any system that estimates a robot's position and the map around it at the same time.
Is SLAM just localization?
No. Localization assumes a map already exists. SLAM has to produce the map as well, which is why the two estimates are tied together and corrected against each other.
Why is wheel odometry not enough on its own?
Encoder counts accumulate error from slipping and uneven ground, so the position estimate drifts over distance. Map features give the system something fixed to correct against.
Do self-driving cars use SLAM?
Many rely on detailed maps recorded in advance, which turns the task into localization against a known map. Vehicles that map as they drive use the full joint problem.
What happens when a SLAM system matches a landmark to the wrong object?
The map bends around the bad constraint. The error often stays hidden until the robot returns to an area it has already visited and the loop closes, pulling the trajectory back toward consistency.
Related pages
- PID Controllers in Robotics: How Motion Control Works
PID controllers in robotics compare a target motion with measured motion and combine proportional, integral, and derivative corrections to calculate a control command. The robot applies that command to a motor or other actuator, then repeats the measurement and correction as new sensor data arrives.
- Uncanny Valley Robotics: Why Humanlike Robots Feel Creepy
The uncanny valley is a hypothesized drop in human affinity toward an artificial figure that looks almost, but not quite, human. Masahiro Mori proposed the relationship in 1970, and controlled face-rating studies have since confirmed a robust dip in likability, with weaker and more context-dependent effects on trust. Robot designers avoid it by matching realism across features, keeping appearance stylized, and adding baby-like or cartoonish traits.
- Collaborative Robots vs Industrial Robots: Key Differences
Industrial robots are built for speed, heavy payloads and micron-level repeatability inside a fenced cell, while cobots are built to work next to people, move between tasks and be programmed by hand. The choice usually comes down to part weight, how often the job changes, and how quickly the purchase pays back. Most factories that use both keep cobots at assembly and inspection and industrial arms at stamping or palletizing.
- Robotic End Effectors: Types and Applications
Robotic end effectors are the tools attached to the free end of a robotic arm, and they are the part that actually grips, welds, paints, drills or measures. They fall into three broad groups: grippers, process tools, and sensors, with the application deciding which one fits.
- Sensors in Autonomous Robots: Primary Types and Uses
Autonomous mobile robots rely on a small set of primary sensors: wheel encoders and inertial measurement units for motion, LiDAR, ultrasonic and depth cameras for range, cameras for vision, and proximity or safety scanners for contact detection. No single device is trusted alone, so their readings are fused into one pose estimate that drives navigation and obstacle avoidance.
- Robotics Operating System ROS: Architecture and Mechanics
The Robot Operating System (ROS) is an open-source middleware suite that coordinates software and hardware components across robotic platforms. It supplies low-level device control, hardware abstraction, inter-process message exchange, and package management across distributed computer clusters. By decoupling individual software tasks into modular nodes, ROS allows developers to assemble complex robotic behaviors from reusable code.
How this page was prepared
Before writing, the topic was researched in the sources below. The page then passed automatic quality checks.