Just out todayClimate & energy tech: We ran the Ibadan solar forecast ourselves. Every number came back.AI agents & MCP: What a 49.1% attack rate does not tell youCybersecurity: The MCP scanner number that should worry you

Explainer/Robotics

What is SLAM, and how do robots know where they are?

SLAM is how a robot maps a place it has never seen and finds itself on that map at the same time. This guide covers the loop it runs, the sensors it uses, and why blank walls break it.

The short answer

SLAM means Simultaneous Localisation and Mapping. It is the method a robot uses to build a map of a place it has never seen while working out its own position on that same map. The robot senses the space, guesses how far it moved, matches what it sees against what it saw before, and then corrects both the map and its position.

Grade 5 reading level6 min read

The power goes out at night. You are standing at the door of a room you do not know well, and you cannot see a thing. So you put one hand on the wall and shuffle forward. You count the doors. Your knee finds the corner of a table. After a minute you know the shape of the room, and you also know where you are standing in it.

You worked out both things at once, and neither one came first. That is the idea behind SLAM.

SLAM stands for Simultaneous Localisation and Mapping. Localisation means working out where you are, and mapping means drawing the place around you. A robot has to do both jobs, and it has to do them together.

The problem SLAM solves

Think about what a robot needs. To place itself on a map, it needs a map. To draw a map, it needs to know where it stood when it looked. Therefore, each job wants the other job done first.

Why can the robot not simply count its wheel turns? It can, for a short while. However, wheels slip on dust and sand, and motors run a little fast or a little slow. Those small errors pile up. After ten metres the count is a bit off, and after a hundred metres it is worthless.

SLAM breaks the deadlock with a guess. The robot holds a rough guess of where it is and a rough map of the place. Then it checks both of them against what it can see, and each new look nudges both a bit closer to the truth. Guess, look, correct. The robot runs that cycle many times a second.

How SLAM works, step by step

Every SLAM system runs the same loop. The parts change, but the loop does not.

  1. Sense. The robot takes a reading of the space around it.
  2. Predict. It guesses how far it has moved since the last reading.
  3. Match. It hunts for things it has seen before, such as a corner, a pole or a doorway.
  4. Correct. If a known thing is not where it expected, it shifts its own guess.
  5. Extend. Anything new gets added to the map.

Notice the word guess. It is the right word. The robot never knows its position for certain, so it holds a best guess and a sense of how sure it is. A clear reading makes it more sure, and a poor view makes it less sure. Good SLAM is careful bookkeeping of doubt.

What the robot senses with

Robots use a few kinds of eyes, and often more than one at a time.

  • A camera. It is cheap and full of detail, but it struggles in the dark.
  • Lidar. It fires laser pulses and times the echo, so it measures distance directly, but it costs more.
  • Wheel counters. They count turns of the wheel. They drift, but they are almost free.
  • An inertial unit. It feels tilt and turn, like the part that rotates your phone screen.

Mixing them is normal, because where one sensor is weak another one is strong. A camera fails in a dark store, and lidar does not care about light at all. This mixing has a name, and engineers call it sensor fusion.

Why the map drifts, and how the robot fixes it

Walk around a block with your eyes shut and try to stop at your own gate. You will miss it, because every step carried a small error, and the errors added up. That is drift.

SLAM has a neat cure for drift. When the robot returns to a place it has been before, it should recognise it. That moment is called loop closure, and the robot now knows that two points on its map are really one point. So it pulls the whole map to fit, the way you tighten a loose belt. Corridors straighten, and rooms line up.

LOOP CLOSURE IS WHAT KEEPS A LONG MAP HONEST. Without it, a big map slowly bends out of shape.

What SLAM does well, and where it fails

SLAM is strong in places nobody has surveyed, and it needs no beacons and no plan of the building. It works indoors, underground and inside pipes, and it runs on a chip no bigger than the one in your phone.

However, it fails where everything looks the same. A long, blank corridor gives it nothing to match, and rows of identical shelves fool it. So do bare white walls, glass doors and still water. Crowds are hard too, because the robot wants a background that stays put. Fast turns blur a camera, and blur breaks matching.

Therefore, when a robot gets lost, look at the room and not just at the code. Add texture to the walls, stick a mark at the end of the corridor, and slow the robot down.

How SLAM is different from GPS

GPS places a receiver on the whole planet, but it needs a clear view of the sky. A phone reading is usually right to within a few metres. That is fine for a road and no use at all for a doorway.

SLAM works the other way round. It knows nothing about the planet, and it knows the room in fine detail, measured from wherever it started. Indoors, under a roof, or between tall buildings, SLAM keeps working after GPS gives up. Many outdoor robots carry both and let each cover the weak spot of the other.

Where you already meet SLAM

You may already live with SLAM. A robot vacuum that cleans in neat lines is running it. So is a warehouse robot that carries a shelf to a picker. So is a drone that holds still inside a hall with no sky above it. Map apps that paint arrows on the street use the same idea, and so do headsets that keep a virtual chair on your real floor.

SLAM is one of the core skills in robotics. A machine that cannot answer “where am I” cannot do much else. A humanoid robot needs it to cross a room on two legs. A cobot bolted to a bench may not need it at all, because it never moves.

What is coming next, and what to try

Three changes are under way. Robots are starting to label what they map, so the map says “door” and “chair” rather than only “surface”. Robots are starting to share maps, so one machine can start where another left off. And parts of the job are being handed to learned models, sometimes trained with reinforcement learning, instead of being written by hand.

Here is something to try today. Open any phone app that measures a room or drops a virtual object on the floor. Place the object, walk a slow circle, and come back to your start. Watch whether it stayed put, because if it has slid you have just seen drift. Now point the phone at a bare wall for a few seconds and then look back. If the object jumps, you have just seen a match fail.

Just Out Tech explains new research in plain language. This article was drafted with AI assistance and checked by a human against the original source.

What to remember
  • SLAM lets a robot build a map of an unknown place and work out where it is standing on that map at the same time.
  • SLAM drifts as small movement errors add up, and it corrects that drift by recognising a place it has already visited, which engineers call loop closure.
  • SLAM fails in spaces with nothing to match on, such as blank corridors, glass doors and rows of identical shelves.

Questions people ask

What does SLAM stand for?

SLAM stands for Simultaneous Localisation and Mapping. Localisation means working out where the robot is. Mapping means drawing the space around it. The word simultaneous matters, because the robot does both jobs at once rather than one after the other.

Is SLAM the same thing as GPS?

No. GPS uses satellites to place a receiver on the whole planet, and it needs a clear view of the sky. SLAM uses the robot's own sensors to map the room it is in, and it works indoors and underground. Many outdoor robots run both, so that each one covers the weak spot of the other.

Why do robots get lost in long, empty corridors?

SLAM works by matching what the robot sees now against what it saw before. A blank corridor gives it almost nothing to match. Every stretch of wall looks like every other stretch. The robot then leans on its wheel counters alone, and those counters drift.

Can an ordinary phone run SLAM?

Yes. Modern phones run a light form of SLAM every time an app places a virtual object on your floor or paints walking arrows on the street. The phone uses its camera and its motion sensors. The map it builds is small and short lived, but the method is the same.

About the author

Mark Alex

Mark Alex is the founder and Managing Director of Real Biz Digital, a technology company operating out of Nairobi since 2018. He works in agentic AI and the Model Context Protocol, AI governance, enterprise software architecture and cybersecurity. He holds an MSc in Mechatronical Engineering from Obuda University in Budapest and a BSc in IT, Forensic Technology and Cybercrime, from USIU-Africa in Nairobi, and has published IEEE conference research on an AI-powered digital twin for greenhouse systems. He is the author of seven books. Between 2020 and 2024 he mentored more than 200 university students and interns in Nairobi. He writes every Just Out Tech article from the original research paper.