06

Robotics · Step 6 of 8 · 6 min

Perception and mapping

You can explain how a robot sees, knows where it is and builds a map.

Richer senses

Bigger robots use cameras, depth cameras and lidar. A camera gives colour and detail but no direct distance. A depth camera adds distance per pixel. Lidar sweeps lasers to measure distances all around, and works in the dark.

These sensors produce a lot of data, so they usually need a real computer, such as a Raspberry Pi or an NVIDIA Jetson, rather than a microcontroller.

Where am I?

Wheel encoders and an IMU let a robot estimate how far it has moved. This is called odometry. Small errors add up, so the estimate drifts the longer it runs.

Robots fix drift by combining sensors. A Kalman filter is the classic way to blend noisy measurements into one better estimate. You do not need the maths yet, only the idea: trust each sensor in proportion to how reliable it is.

SLAM

SLAM stands for simultaneous localisation and mapping. The robot builds a map of a new place while working out where it is on that map. Each problem depends on the other, which is why SLAM was hard for decades.

Today you rarely write SLAM yourself. Mature open-source packages handle it, and your job is to give them good sensor data and tune them.

Try it

Watch a simulated robot sense

  1. 1.Install Webots, a free and open-source robot simulator for Windows, macOS and Linux.
  2. 2.Open one of the bundled sample worlds with a small wheeled robot and its distance sensors.
  3. 3.Run it and look at the sensor readings as the robot nears a wall.
  4. 4.Ask a chatbot why the readings jump around and how a robot might smooth them.
What does SLAM let a robot do?

Check yourself

What does SLAM let a robot do?

Read alongside