Chapter 9. Building Maps of the World

Now that you know how ROS works and have moved your robot around a bit, it’s time to start looking at how to get it to navigate around the world on its own. In order to do this, the robot needs to know where it is, and where you want it to go to. Typically, this means that it needs to have a map of the world and to know where it is in this map. In this chapter, we’re going to see how to build a high-quality map of the world, using data from your robot’s sensors. We’ll then use these maps in the next chapter when we talk about how to make the robot move about in the world.

If your robot had perfect sensors and knew exactly how it was moving, then building a map would be simple: you could take the objects detected by the sensors, transform them into some global coordinate frame (using the robot’s position and some geometry), and then record them in a map (in this global coordinate frame). Unfortunately, in the real world, it’s not quite that easy. The robot doesn’t know exactly how it’s moving, since it’s interacting with an uncertain world. No sensor is perfect, and you’ll have to deal with noisy measurements. How can you combine all this error-laden information together to produce a usable map?

Luckily, ROS has a set of tools that will do this for you. The tools are based on some quite advanced mathematics, but, luckily, you don’t have to understand everything that’s going on under the hood in order to use them. We’ll describe these tools ...

Get Programming Robots with ROS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.