Ask Your Question

RTAB-Map remote mapping with RealSense T265 + D435

asked 2020-08-27 05:51:57 -0600

eMrazSVK gravatar image


I think title of my question is self-explanatory. Of course I will provide additional info. I want to use depth map generated by D435 camera and odometry generated from T265 camera. My intention is to run realsense_ros on Jetson Nano and then run rtabmap_ros on remote computer connected via wifi.

Launch file run from Jetson Nano :

    <include file="$(find realsense2_camera)/launch/rs_d400_and_t265.launch"/>

    <arg name="rate"  default="5"/>
    <arg name="approx_sync" default="true"/>
    <arg name="rgbd_sync" default="true"/>

    <!-- Use same nodelet used by Freenect/OpenNI -->
    <group ns="camera">
    <node if="$(arg rgbd_sync)" pkg="nodelet" type="nodelet" name="rgbd_sync" args="load rtabmap_ros/rgbd_sync camera_nodelet_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="d400/color/image_raw"/>
      <remap from="depth/image"     to="d400/aligned_depth_to_color/image_raw"/>
      <remap from="rgb/camera_info" to="d400/color/camera_info"/>

      <remap from="rgbd_image"      to="rgbd_image"/>

    <node unless="$(arg rgbd_sync)" pkg="nodelet" type="nodelet" name="data_throttle" args="load rtabmap_ros/data_throttle camera_nodelet_manager" output="screen">
      <param name="rate"         type="double" value="$(arg rate)"/>
      <param name="approx_sync"  type="bool"   value="$(arg approx_sync)"/>

      <remap from="rgb/image_in"       to="d400/color/image_raw"/>
      <remap from="depth/image_in"     to="d400/aligned_depth_to_color/image_raw"/>
      <remap from="rgb/camera_info_in" to="d400/color/camera_info"/>

      <remap from="rgb/image_out"       to="throttled/rgb/image_rect_color"/>
      <remap from="depth/image_out"     to="throttled/depth_registered/image_raw"/>
      <remap from="rgb/camera_info_out" to="throttled/rgb/camera_info"/>


Note that I edited realsense-ros/realsense2_camera/launch/includes/nodelet.launch.xml in a way, that depth and color stream runs at 640x480@6Hz both for saving the bandwidth.

rtabmap.launch run from remote computer (not robot):

  <!-- 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 depth and stereo, set both to false to do only scan -->      
  <arg   name="stereo"                      default="false"/>
  <arg     if="$(arg stereo)" name="depth"  default="false"/>
  <arg unless="$(arg stereo)" name="depth"  default="true"/>

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

  <!-- 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 ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-08-29 11:13:27 -0600

matlabbe gravatar image

With rtabmap.launch, when we set compressed:=true, we use relays to subscribe to compressed topics from remote computer. We use relays because in rtabmap.launch, there are many nodes that would subscribe to image topics. The idea behind a relay is to stream one timethe compressed topics between the computers, then on remote computer all nodes needing those images should subscribe on the local relay. You can look at this tutorial:

Without using relays, if you have many nodes subscribing to compressed image topics (including RVIZ!), the images, even compressed, will be streamed multiple times for each node, multiplying the bandwidth usage.

To debug this, first check if the topics are received on remote computer: rostopic hz /t265/odom/sample \ /d400/color/image_raw_relay \ /d400/aligned_depth_to_color/image_raw_relay \ /d400/color/camera_info

If the relay topics are not published, check the input topics of the relays publishing them. Use rqt_graph to see how all nodes are connected.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2020-08-27 05:51:57 -0600

Seen: 1,115 times

Last updated: Aug 29 '20