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

How can I stop Rtabmap from publishing transform data on /tf topic?

asked 2018-05-31 08:09:45 -0600

Jetson_student_group gravatar image

updated 2018-05-31 08:33:38 -0600

Hello, I am trying to implement slam on a mobile robot. I have created my own frames and linked them and I am publishing them on /tf I do not want rtabmap to publish its own transforms on this topic (I am using rtabmap only for visual odometry) I have a launch file as follows:

  <!-- Convenience launch file to launch odometry, rtabmap and rtabmapviz nodes at once -->

  <!-- For stereo:=false
        Your RGB-D sensor should be already started with "depth_registration:=true".
           $ roslaunch freenect_launch freenect.launch depth_registration:=true 
           $ roslaunch openni2_launch openni2.launch depth_registration:=true -->

  <!-- For stereo:=true
        Your camera should be calibrated and publishing rectified left and right 
        images + corresponding camera_info msgs. You can use stereo_image_proc for image rectification.
           $ roslaunch rtabmap_ros bumblebee.launch -->

  <!-- Choose between RGB-D and stereo -->      
  <arg name="stereo"          default="false"/>

  <!-- Choose visualization -->
  <arg name="rtabmapviz"              default="false" /> 
  <arg name="rviz"                    default="false" />

  <!-- Localization-only mode -->
  <arg name="localization"            default="false"/>

  <!-- Corresponding config files -->
  <arg name="cfg"                     default="" /> <!-- To change RTAB-Map's parameters, set the path of config file (*.ini) generated by the standalone app -->
  <arg name="gui_cfg"                 default="~/.ros/rtabmap_gui.ini" />
  <arg name="rviz_cfg"                default="$(find rtabmap_ros)/launch/config/rgbd.rviz" />

  <arg name="frame_id"                default="camera_link"/>     <!-- Fixed frame id, you may set "base_link" or "base_footprint" if they are published -->
  <arg name="namespace"               default="rtabmap"/>
  <arg name="database_path"           default="~/.ros/rtabmap.db"/>
  <arg name="queue_size"              default="10"/>
  <arg name="wait_for_transform"      default="0.2"/>
  <arg name="rtabmap_args"            default=""/>              <!-- delete_db_on_start, udebug -->
  <arg name="launch_prefix"           default=""/>              <!-- for debugging purpose, it fills launch-prefix tag of the nodes -->

  <!-- if timestamps of the input topics are synchronized using approximate or exact time policy-->
  <arg     if="$(arg stereo)" name="approx_sync"  default="false"/>
  <arg unless="$(arg stereo)" name="approx_sync"  default="true"/>         

  <!-- RGB-D related topics -->
  <arg name="rgb_topic"               default="/camera/rgb/image_rect_color" />
  <arg name="depth_topic"             default="/camera/depth_registered/image_raw" />
  <arg name="camera_info_topic"       default="/camera/rgb/camera_info" />

  <!-- stereo related topics -->
  <arg name="stereo_namespace"        default="/stereo_camera"/>
  <arg name="left_image_topic"        default="$(arg stereo_namespace)/left/image_rect_color" />
  <arg name="right_image_topic"       default="$(arg stereo_namespace)/right/image_rect" />      <!-- using grayscale image for efficiency -->
  <arg name="left_camera_info_topic"  default="$(arg stereo_namespace)/left/camera_info" />
  <arg name="right_camera_info_topic" default="$(arg stereo_namespace)/right/camera_info" />

  <arg name="compressed"              default="false"/>         <!-- If you want to subscribe to compressed image topics -->
  <arg name="rgb_image_transport"     default="compressed"/>    <!-- Common types: compressed, theora (see "rosrun image_transport list_transports") -->
  <arg name="depth_image_transport"   default="compressedDepth"/>  <!-- Common types: compressed, theora (see "rosrun image_transport list_transports") -->

  <arg name="subscribe_scan"          default="false"/>
  <arg name="scan_topic"              default="/scan"/>

  <arg name="subscribe_scan_cloud"    default="false"/>
  <arg name="scan_cloud_topic"        default="/scan_cloud"/>

  <arg name="visual_odometry"         default="true"/>          <!-- Launch rtabmap visual odometry node -->
  <arg name="odom_topic"              default="/odom"/>         <!-- Odometry topic used if visual_odometry is false -->
  <arg name="odom_frame_id"           default=""/>              <!-- If set, TF is used to get odometry instead of the topic -->
  <arg name="odom_args"               default="$(arg rtabmap_args)"/>

  <!-- These arguments should not be modified directly, see referred topics without "_relay" suffix above -->
  <arg if="$(arg compressed)"     name="rgb_topic_relay"           default="$(arg rgb_topic)_relay"/>
  <arg unless="$(arg compressed)" name="rgb_topic_relay"           default="$(arg rgb_topic)"/>
  <arg if="$(arg compressed)"     name="depth_topic_relay"         default="$(arg depth_topic ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-05-31 13:41:05 -0600

matlabbe gravatar image


if you are using only visual odometry, I suggest to use the node directly than using rtabmap.launch:

<node pkg="rtabmap_ros" type="rgbd_odometry" name="rgbd_odometry" output="screen">
  <remap from="rgb/image"       to="/camera/rgb/image_rect_color"/>
  <remap from="depth/image"     to="/camera/depth_registered/image_raw"/>
  <remap from="rgb/camera_info" to="/camera/rgb/camera_info"/>
  <param name="frame_id"    type="string" value="camera_link"/>
  <param name="publish_tf"  type="bool"   value="false"/>

With publish_tf set to false, TF will not be published.


edit flag offensive delete link more


Hello Mathieu Thanks a lot, This is just what I needed! Can i ask some questions out of curiosity? Like 1]what does rtabmap use to generate visual odometry? 2]How can i increase the sampling rate of the code. should I create a new question for it?

Jetson_student_group gravatar image Jetson_student_group  ( 2018-06-01 02:56:41 -0600 )edit

1) By default, it uses OpenCV's feature matching and PnP estimation, with local bundle adjustment using g2o to refine motion (when built with g2o support). 2) visual odometry works as fast as it can. If odom frame rate is lower than camera frame rate, you have computation power limitation.

matlabbe gravatar image matlabbe  ( 2018-06-07 16:28:41 -0600 )edit

Question Tools


Asked: 2018-05-31 08:09:45 -0600

Seen: 1,157 times

Last updated: May 31 '18