Confused with the launch file RTABmap

asked 2019-03-27 05:17:49 -0500

EdwardNur gravatar image

I want to use my remote robot to send depth images to my host PC. In order to do that, I have followed this tutorial: http://wiki.ros.org/rtabmap_ros/Tutor...

My camera publishes these topics:

/camera/color/camera_info
/camera/color/image_raw
/camera/depth/camera_info
/camera/depth/image_rect_raw

And I have used this launch file to start the rtabmap_ros/rgbd_sync:

  <launch>

      <arg name="rate"  default="30"/>
      <arg name="approx_sync" default="true" /> <!-- true for freenect driver -->

      <!-- Use same nodelet used by Freenect/OpenNI -->
      <group ns="camera">
        <node pkg="nodelet" type="nodelet" name="data_throttle" args="load rtabmap_ros/rgbd_sync realsense2_camera_manager" output="screen">
          <param name="compressed_rate"  type="double" value="$(arg rate)"/>
          <param name="approx_sync"      type="bool"   value="$(arg approx_sync)"/>

          <remap from="rgb/image"       to="color/image_raw"/>
          <remap from="depth/image"     to="depth/image_rect_raw"/>
          <remap from="rgb/camera_info" to="color/camera_info"/>

          <remap from="rgbd_image"      to="rgbd_image"/>
        </node>
      </group>      
    </launch>

I have turned off the visual odometry but I get this warning on my host pc when I launch rtabmap:

/rtabmap/rtabmap subscribed to (approx sync):
   /rtabmap/odom,
   /camera/color/image_raw_relay,
   /camera/depth/image_rect_raw_relay,
   /camera/color/camera_info

Why it tries to subscribe to /rtabmap/odom? I do not want to erase the group name "rtabmap" as it will mess other topics but from the logic from the launch file, shouldn't turning off the visual odometry make the subscribtion to /odom? And if I am using rgbd_sync why rtabmap does not subscribe to /rgbd_image?

Here is the rtabmap launch file I am using:

<launch>
  <!-- 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".
        Examples:
           $ 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.
        Example:
           $ roslaunch rtabmap_ros bumblebee.launch -->

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

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

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

  <!-- sim time for convenience, if playing a rosbag -->
  <arg name="use_sim_time"            default="false"/>
  <param if="$(arg use_sim_time)" name="use_sim_time" value="true"/>

  <!-- 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="duo3d_camera"/>     <!-- Fixed frame id, you may set "base_link" or "base_footprint" if they are published -->
  <arg name="map_frame_id"            default="map"/>
  <arg name="ground_truth_frame_id"   default=""/>     <!-- e.g., "world" -->
  <arg name="ground_truth_base_frame_id" default=""/>  <!-- e.g., "tracker", a fake frame matching the frame "frame_id" (but on different TF tree) -->
  <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="args"                    default="-- delete_db_on_start"/>              <!-- delete_db_on_start, udebug -->
  <arg name="rtabmap_args"            default="$(arg args)"/>   <!-- deprecated, use "args" argument -->
  <arg name="launch_prefix"           default ...
(more)
edit retag flag offensive close merge delete

Comments

1

Why it tries to subscribe to /rtabmap/odom?

As the wiki page you linked to in the end suggests:

1. If you have already odometry on the robot, you can set arguments visual_odometry:=false and odom_topic:="/odom".

relevant line in your rtabmap launch:

<arg name="odom_topic"               default="odom"/>

The problem here is the missing / in your rtabmap launch file. Without the slash the topic will use the namespace of the node, adding it will make it absolute. The whole concept is explained here: http://wiki.ros.org/ROS/Concepts#Names.Names

So either change it to be

<arg name="odom_topic"               default="/odom"/>

or launch your file with roslaunch rtabmap rtabmap.launch odom_topic:="/odom"

Reamees gravatar image Reamees  ( 2019-03-27 09:33:25 -0500 )edit