10. SLAM


This instruction was tested on Ubuntu 16.04 and ROS Kinetic Kame.


Make sure to run the [Bringup] instruction before performing SLAM.


It is recommended to use a joystick pad instead of the keyboard for easier control.

The Simultaneous Localization and Mapping, or SLAM, is a technique to draw a map by estimating current location in an arbitrary space.

The SLAM is a well-known feature of TurtleBot from its predecessors. The video here shows you how accurately TurtleBot3 can draw a map with its compact and affordable platform.

Robot:TurtleBot3 Burger
Sensor:Laser Distance Sensor
Packages:Gmapping / Cartographer
Place:ROBOTIS Labs & HQ, 15th-floor corridor
Duration:55 minutes
Distance:Total 351 meters

Robot:TurtleBot3 Burger and Waffle
Sensor:Laser Distance Sensor
Place:ROBOTIS HQ Education Room
Duration:About 4 minutes
Distance:Total 15 meters

10.1. Create a Map with Teleoperation


The terminal application can be found with the Ubuntu search icon on the top left corner of the screen. Shortcut key for terminal is Ctrl-Alt-T.

[Remote PC] Open a new terminal and launch the SLAM file. If you have TurtleBot3 Burger,

export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_slam turtlebot3_slam.launch

If you have TurtleBot3 Waffle,

export TURTLEBOT3_MODEL=waffle
roslaunch turtlebot3_slam turtlebot3_slam.launch

[Remote PC] Visualize the model in 3D with RViz.

rosrun rviz rviz -d `rospack find turtlebot3_slam`/rviz/turtlebot3_slam.rviz

[Remote PC] Teleoperation with Keyboard

roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch

10.2. Save the Map

[Remote PC] Open a new terminal and run the map saver node.

rosrun map_server map_saver -f ~/map

map.pgm and map.yaml files will be created in the ~/ directory ($HOME directory, /home/<username>).