ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

RTAB-Map with Turtlebot Navigation for a Known Map [closed]

asked 2016-02-23 15:39:05 -0600

MahsaP gravatar image

updated 2016-02-23 15:40:30 -0600


I am using rtabmap_ros on a Turtlebot in Gazebo. I have successfully created the map with RTAB-Map. Now, I would like to do the navigation with a known map. You can see my launch file here.

My problem is that, my map is just loaded for a second, and after that it disappears. I don't know what changes are necessary for my launch file to fix this problem. To run my files you can run the following commands:

1) Launch the turtlebot in Gazebo:

$ ROBOT_INITIAL_POSE="-x -2 -y -1" roslaunch turtlebot_gazebo turtlebot_world.launch

2) Load the saved map, run rtabmap_ros, run navigation, and visualize the robot on Rviz

$ roslaunch turtlebot_rtabmap_simulation turtlebot_rtabmap_navigation.launch

The distro of my ROS is indigo running on Ubuntu 14.04.

Thank you.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by MahsaP
close date 2016-02-29 13:23:51.823911

1 Answer

Sort by ยป oldest newest most voted

answered 2016-02-29 11:20:56 -0600

matlabbe gravatar image


The map disappears because there are two nodes publishing the same topic /map: map_server and rtabmap. Remap to different topic name or use only the one published by rtabmap. When launching the node with a previous map (localization mode), the map published by rtabmap is empty until a localization is found (look the warnings on the console for possible reasons of localization rejection). The simulated environment doesn't have a lot of visual features, I tuned the parameters to get more visual features (using GFTT/BRIEF instead of ORB) so that it is easier to relocalize, here is a simplified turtlebot_rtabmap_navigation.launch:

<!-- Turtlebot navigation simulation with RTAB-Map -->

  <arg name="database_path"     default="rtabmap.db"/>
  <arg name="localization"      default="true"/>

  <!-- Mapping -->
  <group ns="rtabmap">
    <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen">
      <param name="database_path"       type="string" value="$(arg database_path)"/>
      <param name="frame_id"            type="string" value="base_footprint"/>
      <param name="odom_frame_id"       type="string" value="odom"/>
      <param name="subscribe_laserScan" type="bool"   value="true"/>

      <!-- inputs -->
      <remap from="scan"            to="/scan"/>
      <remap from="rgb/image"       to="/camera/rgb/image_raw"/>
      <remap from="depth/image"     to="/camera/depth/image_raw"/>
      <remap from="rgb/camera_info" to="/camera/rgb/camera_info"/>

      <!-- outputs -->
          <remap from="grid_map" to="/map"/> <!-- input for move_base costmap -->

      <!-- RTAB-Map parameters -->
      <param name="RGBD/LocalLoopDetectionSpace" type="string" value="true"/>
      <param name="RGBD/OptimizeSlam2D"          type="string" value="true"/>      
      <param name="Kp/MaxDepth"                  type="string" value="4.0"/>
      <param name="Kp/DetectorStrategy"          type="string" value="6"/> <!-- GFTT/BRIEF -->
      <param name="GFTT/MinDistance"             type="string" value="5"/>
      <param name="LccIcp/Type"                  type="string" value="2"/> <!-- ICP 2D -->
      <param name="LccIcp2/CorrespondenceRatio"  type="string" value="0.1"/> 

      <!-- localization mode -->
      <param     if="$(arg localization)" name="Mem/IncrementalMemory" type="string" value="false"/>
      <param unless="$(arg localization)" name="Mem/IncrementalMemory" type="string" value="true"/>
      <param name="Mem/InitWMWithAllNodes" type="string" value="$(arg localization)"/> 

  <!-- ******* Navigation - Move Base ******* -->
  <include file="$(find turtlebot_navigation)/launch/includes/move_base.launch.xml"/>

  <!-- ******* Visualization of the Turtlebot on Rviz ******* -->
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find turtlebot_rviz_launchers)/rviz/navigation.rviz"/>


For the second step in your instructions, use either:

a) SLAM mode
$ roslaunch turtlebot_rtabmap_navigation.launch localization:=false

b) Localization-only mode
$ roslaunch turtlebot_rtabmap_navigation.launch localization:=true


edit flag offensive delete link more


@matlabbe Thanks you for your detailed answer.

MahsaP gravatar image MahsaP  ( 2016-02-29 13:21:07 -0600 )edit

Question Tools

1 follower


Asked: 2016-02-23 15:39:05 -0600

Seen: 1,820 times

Last updated: Feb 29 '16