Demo RTAB-Map on Turtlebot

Posted by matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Demo-RTAB-Map-on-Turtlebot-tp439.html

I had many questions about running rtabmap on Turtlebot. I don't own a turtlebot, but the launch files are available online. So I've made a launch from what I can test without the actual robot. The launch file demo_turtlebot_mapping.launch is a one to one replacement of the gmapping_demo.launch of the official SLAM Map Building with TurtleBot tutorial.

Requirements:
$ sudo apt-get install ros-indigo-turtlebot-bringup ros-indigo-turtlebot-navigation

Usage:

 $ roslaunch turtlebot_bringup minimal.launch
 $ roslaunch rtabmap_ros demo_turtlebot_mapping.launch
Visualization (turtlebot_navigation.rviz):
 $ roslaunch rtabmap_ros demo_turtlebot_rviz.launch
or
 $ rosrun rviz rviz -d turtlebot_navigation.rviz

You should see a 2D map and a 3D map. For the navigation stuff, see below. By default, rtabmap re-uses always the same database after each mapping session. To delete the old one and start fresh, delete the database saved here "~/.ros/rtabmap.db" or use argument "args:="--delete_db_on_start" when launching the demo_turtlebot_mapping.launch:

 $ roslaunch rtabmap_ros demo_turtlebot_mapping.launch args:="--delete_db_on_start"

UPDATE : Localization mode and Autonomous Navigation
I've updated the launch file with "localization" argument. After a mapping session as above, a database is saved here "~/.ros/rtabmap.db". Now restart the demo_turtlebot_mapping.launch with argument "localization:=true":

 $ roslaunch rtabmap_ros demo_turtlebot_mapping.launch localization:=true
Move the robot around until it can relocalize in the previous map, then the 2D map would re-appear again when a loop closure is found. You can then follow the same steps from 3.3.2 of the "Autonomous Navigation of a Known Map with TurtleBot" tutorial to navigate in the map.

Normally, you only have to "drop" a navigation goal on the map with RVIZ to see the robot moving autonomously to it. Click on "2D Nav Goal" button in RVIZ to set a goal. You should see a planned path (red line) like this to the goal set (green arrow):

The commands sent by move_base: $ rostopic echo /mobile_base/commands/velocity

UPDATE 2: hydro binaries 0.8.3 (binaries are now 0.8.12)
The binaries for hydro are still at 0.8.3 (checked on June 3 2015). I don't know if there will be new binary releases on Hydro as ROS Jade is officially out. However, I've modified the launch above to handle 0.8.3, so the grid map will be created:

 $ roslaunch rtabmap_ros demo_turtlebot_mapping.launch version083:=true

UPDATE 3: Freenect/OpenNI2 on Indigo
By default, OpenNI2 is used from the included 3dsensor.launch (TURTLEBOT_3D_SENSOR=asus_xtion_pro). If you want to use Freenect driver, set this before launching demo_turtlebot_mapping.launch:

$ export TURTLEBOT_3D_SENSOR=kinect

UPDATE 4: If you don't have the robot
If you don't have the robot and you just want to see what it could look like if you have one, you can still generate an odometry like this (with rgbd_odometry:=true):

$ roslaunch turtlebot_bringup minimal.launch
$ roslaunch rtabmap_ros demo_turtlebot_mapping.launch args:="--delete_db_on_start" rgbd_odometry:=true
$ roslaunch rtabmap_ros demo_turtlebot_rviz.launch

UPDATE 5: Demo moved to ROS wiki
Moved this demonstration on rtabmap_ros tutorials.

UPDATE 6: New demo for Turtlebot3 on Melodic [burger, waffle, waffle_pi]
See rtabmap_ros tutorials.

cheers,
Mathieu