| Note: This tutorial assumes that you have completed the previous tutorials: TurtleBot Teleoperation, Performance will be greatly enhanced by accurate calibration. TurtleBot Odometry and Gyro Calibration. |
SLAM Map Building with TurtleBot
Description: How to generate a map using gmappingTutorial Level: BEGINNER
Next Tutorial: Autonomous Navigation of a Known Map with TurtleBot
Contents
This assumes that you have a TurtleBot which has already been brought up in this tutorial. turtlebot_bringup/Tutorials/TurtleBot Bringup.
Launch the gmapping app
On the TurtleBot
- Run the gmapping demo app
roslaunch turtlebot_navigation gmapping_demo.launch
On your Workstation
This assumes you have ROS on your workstation and ROS_MASTER_URI has been set to point to your turtlebot.
- Launch rviz:
rosrun rviz rviz -d `rospack find turtlebot_navigation`/nav_rviz.vcg
On the TurtleBot
Drive the robot around by either:
Using telop (keyboard, joystick, or other) from teleop tutorial
If you are having troubles making a map check out this question.
- Save the map to file:
rosrun map_server map_saver -f /tmp/my_map
Note: Do not close the gmapping launch until after saving the map.
After it says "done" press Ctrl-C #4843
Video of process
In rviz it will look something like this:
To see the map updates on RViz as you drive the robot around, under Map on the left hand side panel, check to see that Topic is set to map, in addition to setting your ROS_MASTER_URI to the Turtlebot.






