SLAM stands for Simultaneous Localization And Mapping, a core idea in robotics that lets a robot build a map while also estimating where it is inside that map. This matters because a robot often enters places where no map exists, such as a new home, a warehouse aisle, or a rescue site. The robot must turn sensor measurements into a useful layout of walls, doors, and obstacles.
At the same time, it must keep track of its own changing position so it can move safely and reach goals.
Understanding Robot Mapping and SLAM
A robot does not receive a finished map from a lidar sensor. Lidar sends out light pulses and measures how long they take to return. Each return gives a distance in one direction.
A single scan is like a ring of range readings around the robot. Nearby walls produce many readings that line up. Empty space gives no return until the beam reaches something farther away.
Cameras, wheel encoders, inertial sensors, and sonar can add useful information, but each sensor has limits. A camera may struggle in darkness or glare.
Wheels can slip on dust, carpet, or wet ground. Lidar can miss glass, soft fabric, or very dark surfaces.
The robot first predicts its next pose from its movement. If its wheels turn for one second at a known speed, it can estimate the distance travelled. Its direction tells it how that movement changes its horizontal and vertical location.
This estimate is never exact. A tiny error in wheel rotation becomes a larger error after many movements.
Turning introduces extra uncertainty because a small angle error changes where later motion appears to go. For this reason, a useful SLAM system treats location as an estimate with a region of possible error, not as one perfectly known point.
Sensor correction reduces that uncertainty. The robot compares a new scan with features already placed in its growing map. A long flat group of lidar returns may match a wall.
Corners are especially helpful because they constrain both position and direction. The system shifts and rotates the predicted pose until the new scan fits the earlier evidence as well as possible. Many maps use a grid of small cells.
Each cell stores a belief that the area is occupied, empty, or still unknown. Repeated observations strengthen the belief.
A cell seen as clear from several places is likely free space. A cell repeatedly hit by laser returns is likely part of an obstacle.
One of the hardest parts is loop closure. This happens when a robot returns to a place it visited much earlier, such as the entrance to a room after travelling around a corridor. By then, accumulated motion error may make the old and new locations appear far apart on the map.
Recognising the same place allows the system to correct much of that drift. The correction can adjust the whole path, not only the current position. Students should pay attention to coordinate frames, sensor noise, and the difference between a measurement and a fact.
They should remember that a map of a busy room can become outdated when people, chairs, or doors move. Robots often separate stable structures such as walls from temporary objects so that navigation remains reliable.
Key Facts
- SLAM = Simultaneous Localization And Mapping.
- Pose describes a robot position and direction: pose = (x, y, θ).
- Distance from speed over time: d = vΔt.
- A lidar point can be estimated by x = r cos θ and y = r sin θ.
- Odometry update for straight motion: x_new = x_old + d cos θ, y_new = y_old + d sin θ.
- Good SLAM combines prediction from motion with correction from sensors.
Vocabulary
- SLAM
- SLAM is the process of building a map of an unknown environment while estimating the robot's own location in that map.
- Localization
- Localization is finding the robot's position and direction relative to a map or starting point.
- Mapping
- Mapping is creating a representation of walls, open space, obstacles, and landmarks from sensor data.
- Lidar
- Lidar is a sensor that measures distances by sending out light pulses and timing their reflections.
- Odometry
- Odometry is estimating motion by measuring wheel rotation, motor movement, or other internal motion data.
Common Mistakes to Avoid
- Treating the first map as perfectly correct is wrong because early sensor readings can be noisy or incomplete, especially near corners and glassy surfaces.
- Ignoring robot orientation is wrong because the same x and y position can face different directions, which changes how sensor beams line up with walls.
- Using odometry alone is wrong because small wheel slip errors build up over time and make the estimated path drift away from the true path.
- Assuming every sensor point is an obstacle is wrong because reflections, moving people, and measurement noise can create false points in the map.
Practice Questions
- 1 A robot drives straight at 0.40 m/s for 5.0 s. How far does odometry predict it moved?
- 2 A lidar measures an obstacle at range r = 4.0 m and angle θ = 60 degrees from the robot's forward direction. Using cos 60 degrees = 0.5 and sin 60 degrees = 0.866, find the obstacle coordinates relative to the robot.
- 3 A robot's wheel odometry says it is 1.0 m farther east than the map and lidar readings suggest. Explain why a SLAM system should not simply trust the odometry estimate.