introlab / rtabmap_ros

RTAB-Map's ROS package.
http://wiki.ros.org/rtabmap_ros
BSD 3-Clause "New" or "Revised" License
1.02k stars 560 forks source link

rtabmap_ros/rgbd_sync using Realsense R200 Did not receive data since 5 seconds! #366

Open CesMak opened 5 years ago

CesMak commented 5 years ago

Hey there,

I want to use rtabmap_ros/rgbd_sync for my Realsense R200 camera in the remote case. Note that I do not have any odom so far.

On my Robot PC I do:

<launch>

  <!-- Realsense: -->
      <include file="$(find realsense_camera)/launch/r200_nodelet_rgbd.launch">
    </include>

  <arg name="compressed" default="true"/>
  <arg name="compressed_rate" default="5"/>

  <group ns="camera">
    <node pkg="nodelet" type="nodelet" name="rgbd_sync" args="load rtabmap_ros/rgbd_sync camera_nodelet_manager" output="screen">
      <remap from="rgb/image"         to="rgb/image_rect_color"/>
      <remap from="/camera/depth_registered/sw_registered/image_rect_raw"       to="depth_registered/image_raw"/>
      <remap from="rgb/camera_info"   to="rgb/camera_info"/>
      <param name="compressed_rate" type="double"  value="$(arg compressed_rate)"/>
      <param name="approx_sync" value="True" />
      <param name="queue_size"  value="100" />
    </node>
  </group>

</launch>

This works without any error. If I check the rate also on the robot pc I get:

rostopic hz /camera/rgbd_image
subscribed to [/camera/rgbd_image]
average rate: 30.271
    min: 0.028s max: 0.037s std dev: 0.00196s window: 29
average rate: 30.076

So this seems fine I guess.

Then I do on my Client PC: roslaunch rtabmap_ros rtabmap.launch subscribe_rgbd:=true rgbd_topic:=/camera/rgbd_image compressed:=true rtabmap_args:="--delete_db_on_start"

And I get this error:

ERROR: cannot launch node of type [rtabmap_ros/rgbd_relay]: can't locate node [rgbd_relay] in package [rtabmap_ros]

[ WARN] [1573076788.159073102]: /rtabmap/rtabmap: Did not receive data since 5 seconds! Make sure the input topics are published ("$ rostopic hz my_topic") and the timestamps in their header are set. If topics are coming from different computers, make sure the clocks of the computers are synchronized ("ntpdate"). If topics are not published at the same rate, you could increase "queue_size" parameter (current=10).
/rtabmap/rtabmap subscribed to (approx sync):
   /rtabmap/odom,
   /camera/rgbd_image_relay,
   /rtabmap/odom_info

Hm I saw that: [ INFO] [1573077960.554460514]: /rtabmap/rtabmapviz: subscribe_odom_info = true

is this the problem? How can I set it to false?

I also published /odom message of my robot (however not compressed or synced with /camera/rgbd_image - as I do not know how to do that)

and then did


 rostopic hz /odom /camera/rgbd_image 
subscribed to [/odom]
subscribed to [/camera/rgbd_image]
topic    rate   min_delta   max_delta   std_dev   window
========================================================
/odom   28.52   0.000345    0.05697     0.01285   27    

      topic           rate   min_delta   max_delta   std_dev   window
=====================================================================
/odom                28.61   9.489e-05   0.08009     0.02181   55    
/camera/rgbd_image   1.696   0.548       0.6314      0.0417    55    
matlabbe commented 5 years ago

On the client you may be using the rtabmap_ros binaries, which unfortunatly don't have rgbd_sync and rgbd_relay. This has been fixed in https://github.com/introlab/rtabmap_ros/commit/e6e7df5beb8108dfb173dbf487d58b4c3bcdafba but until new binaires are released, you would have to build rtabmap_ros from source. To avoid recompiling also rtabmap, you can just recompile rtabmap_ros using the same version than the binaries:

$ sudo apt remove ros-melodic-rtabmap-ros
$ cd ~/catkin_ws/src
$ git clone -b melodic-devel https://github.com/introlab/rtabmap_ros.git
$ cd ~/catkin_ws
$ catkin_make

On remote PC, I would rather do:

$ rostopic hz /odom /camera/rgbd_image/compressed

to get the real frame rate and bandwidth usage you can get over WiFi.

ju-mingyue commented 3 years ago

@matlabbe
Hello, I also encountered the same problem and I don’t know how to solve it. 深度截图_选择区域_20210705123233 I use jetsonnano, ros is melodic .

matlabbe commented 3 years ago

To debug, you should start by checking the framerate of the topics shown and see if some of them are not published or if there is a large difference of rate between them:

rostopic hz /t265/odom/sample /camera/rgb/image_rect_color /camera/depth_registered/image_raw /camera/rgb/camera_info

PS: Please don't join screenshots of text in github issues, it makes difficult for Google to find the same issue afterwards for someone else.

ju-mingyue commented 3 years ago

@matlabbe Thank you very much for your help, and thank you for your suggestions.

hariharan382 commented 2 years ago

I having same issue ,but how can I debug from the frame rates

matlabbe commented 2 years ago

@hariharan382 1) you can know if the topic is published, if one rate is missing, debug why it is not published 2) you can see if the frame rate is different between the topic, if so, how much? queue_size parameter may nee to be increased if the rate is very different.