Re: Raytracing using stereo camera for better SLAM and obstacle avoidance.

Posted by matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Raytracing-using-stereo-camera-for-better-SLAM-and-obstacle-avoidance-tp5632p5714.html

Hi,

Based on the remote tutorial, you don't need data_throttle nodelet, use only rgbd_sync like this:

<launch>
  <arg name="rate"  default="5"/>
  <arg name="approx_sync" default="false" />

  <group ns="camera">
    <node pkg="nodelet" type="nodelet" name="data_throttle" 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="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"/> <!-- output -->
    </node>
  </group>      
</launch>
You can create a standalone nodelet or use it inside the nodelet manager of the camera (recommended to avoid serialization of image topics between camera driver and rgbd_sync). rqt_graph won't look the same if you start it in its own nodelet manager or in another one, but both approaches should work. "approx_sync" should be false here with realsense cameras, images are already synchronized (same stamps).

For the remote launch file, subscribe to rgbd_image, not the image topics:
<launch>
    <include file="$(find rtabmap_ros)/launch/rtabmap.launch">
        <arg name="compressed" value="true"/>
        <arg name="args" value="--delete_db_on_start"/>
        <arg name="subscribe_rgbd" value="true"/>
        <arg name="rgbd_topic" value="/camera/rgbd_image"/>
        <arg name="rtabmapviz" value="false"/>
        <arg name="rviz" value="true"/>

        <arg name="odom_topic" value="/odometry/filtered"/>
        <arg name="visual_odometry" value="false"/>
    </include>
</launch>

EDIT: You would need the latest rtabmap version to make this example works (rtabmap_ros/rgbd_relay is required).

cheers,
Mathieu