ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

Is there RGB-D sync? (Melodic)

asked 2021-02-10 08:55:44 -0600

Giuseppe_ gravatar image

updated 2021-02-10 09:40:18 -0600

Just wanted to ask if someone can explain to me if is there the RGB-D sync in this code got from the file: demo_turtlebot3_navigation.launch from the package rtabmap. Then if someone is interested to what robot I want to apply this I will be very grateful to show it, 'cause even that has got problems.

Sorry for the edit, but I just did a great mistake to what file to attach :)

<launch>
  <!--
    $ sudo apt install ros-melodic-turtlebot3* ros-melodic-dwa-local-planner
    To avoid TF warning about leading '/' in frame name, remove it in:
       - "/opt/ros/melodic/share/turtlebot3_navigation/param/global_costmap_params.yaml"
       - "/opt/ros/melodic/share/turtlebot3_navigation/param/local_costmap_params.yaml"

    Example Gazebo:
    $ export TURTLEBOT3_MODEL=waffle
    $ roslaunch turtlebot3_gazebo turtlebot3_world.launch

    $ export TURTLEBOT3_MODEL=waffle
    $ roslaunch rtabmap_ros demo_turtlebot3_navigation.launch
  -->

  <!-- Arguments -->
  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
  <arg name="open_rviz" default="true"/>
  <arg name="rtabmapviz" default="true"/>
  <arg name="move_forward_only" default="false"/>

  <arg name="with_camera" default="true"/>
  <arg name="localization" default="false"/>
  <arg name="database_path" default="~/.ros/rtabmap.db"/>
  <arg     if="$(arg localization)" name="rtabmap_args" default=""/>
  <arg unless="$(arg localization)" name="rtabmap_args" default="-d"/>

  <!-- Turtlebot3 -->
  <include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch">
    <arg name="model" value="$(arg model)" />
  </include>

  <group ns="rtabmap">
    <node if="$(eval model=='waffle')" pkg="rtabmap_ros" type="rgbd_sync" name="rgbd_sync" output="screen">
      <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"/>
    </node>

    <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="$(arg rtabmap_args)">
      <param name="database_path"       type="string" value="$(arg database_path)"/>
      <param name="frame_id"            type="string" value="base_footprint"/>
      <param name="subscribe_rgb"   type="bool" value="false"/>
      <param name="subscribe_depth" type="bool" value="false"/>
      <param     if="$(eval model=='waffle')" name="subscribe_rgbd" type="bool" value="true"/>
      <param unless="$(eval model=='waffle')" name="subscribe_rgbd" type="bool" value="false"/>
      <param name="subscribe_scan"      type="bool"   value="true"/>
      <param name="approx_sync"         type="bool"   value="true"/>

      <!-- use actionlib to send goals to move_base --> 
      <param name="use_action_for_goal" type="bool" value="true"/>
      <remap from="move_base"            to="/move_base"/>

      <!-- inputs -->
      <remap from="scan"            to="/scan"/>
      <remap from="odom"            to="/odom"/>
      <remap from="rgbd_image"       to="rgbd_image"/>

      <!-- output -->
      <remap from="grid_map" to="/map"/>

      <!-- RTAB-Map's parameters -->
      <param name="Reg/Strategy"                 type="string" value="1"/>
      <param name="Reg/Force3DoF"                type="string" value="true"/>
      <param name="GridGlobal/MinSize"           type="string" value="20"/>

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

    <!-- visualization with rtabmapviz -->
    <node if="$(arg rtabmapviz)" pkg="rtabmap_ros" type="rtabmapviz" name="rtabmapviz" args="-d $(find rtabmap_ros)/launch/config/rgbd_gui.ini" output="screen">
      <param name="subscribe_scan"   type="bool"   value="true"/>
      <param name="subscribe_odom ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-02-12 12:28:05 -0600

matlabbe gravatar image

updated 2021-02-14 15:39:57 -0600

rgbd_sync node is used to combine RGB-D data into a single topic. We would use it if rtabmap is also subscribed to a scan topic.

For example, if you have a camera streaming at 30Hz with exactly syncrhonized images and a lidar publishng at 10 Hz, you don't want to approximately synchronize scan and camera images. To make sure camera images are exactly synchronized together, we use rgbd_sync (with approx_sync:=false), then approximately synchronize scan with rgbd_image topic. See Fig.6 for example: https://introlab.3it.usherbrooke.ca/m...

If depth and RGB are not synchronized, there is still an advantage to synchronize them at 30 Hz before synchronizing with lidar at different rate.

cheers

edit flag offensive delete link more

Comments

@matlabbe if I use a kinect, I would have rgb and depth at the same rate right? salute and thanks for answering

Giuseppe_ gravatar image Giuseppe_  ( 2021-02-13 08:09:41 -0600 )edit

Yes, but I don't think all kinect versions provide synchronized RGB and depth data. The topics are indeed published at the same rate, but not exactly synchronized (rostopic the header of the messages and see the stamps are not exactly the same between RGB and Depth for the same frame). My last comment was about that, it is still better to synchronize them at 30 Hz, then synchronize with lidar afterwards. rtabmap still support RGB+Depth+lidar approx synchronization (without using rgbd_sync), but may be more difficult to debug if RGB+depth are less correctly synchronized because of a lidar topic with different publishing rate.

See Fig.6 of this paper https://introlab.3it.usherbrooke.ca/m...

matlabbe gravatar image matlabbe  ( 2021-02-14 15:38:08 -0600 )edit
1

If your kinect has exact stmaps between RGB and Depth, you should use approx_sync:=false for rgbd_sync.

matlabbe gravatar image matlabbe  ( 2021-02-14 15:39:09 -0600 )edit

Your Answer

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

Add Answer

Question Tools

2 followers

Stats

Asked: 2021-02-10 08:55:44 -0600

Seen: 290 times

Last updated: Feb 14 '21