Creating a Map
Though ROS can work in unknown environments, it helps to start with a map of the environment that we’re working in.
In this tutorial we’ll drive TurtleBot once around our office using teleoperation to create a map. This will give us a map we can reference in other scripts, giving TurtleBot completely autonomous navigation.
Create a Map Via Teleoperation
On TurtleBot, open a terminal window and run:
On the workstation, open a terminal window and run:
TIP: Instead of using the keyboard, the joystick may be more convenient.
Now using teleoperation, navigate TurtleBot around the entire area you wish to map.
On TurtleBot, open a terminal window and run:
You will now see two files in the /tmp/ directory my_map.pgm
and my_map.yaml
. As you create maps in the future, you can save them with different names (e.g. /tmp/my_office
).
TIP: Ubuntu’s /tmp/
directory is automatically cleaned (deleted) on every boot. You may want to use a different directory if you need want to keep the maps.