bag from D435i cannot run rtabmap_ros

asked 2019-11-18 23:40:11 -0500

lixz123007 gravatar image

updated 2019-11-23 20:44:00 -0500

The SDK of D435i can save bag files (from PC without ROS). And i use(pc with ROS) rosbag play the bag ,i can see the rgb image and depth image in topics (by rviz and rostopic list):

depth_topic:=/device_0/sensor_0/Depth_0/image/data rgb_topic:=/device_0/sensor_1/Color_0/image/data camera_info_topic:=/device_0/sensor_1/Color_0/info/camera_info

So i change default of rtabmap:

roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" depth_topic:=/camera/aligned_depth_to_color/image_raw rgb_topic:=/camera/color/image_raw camera_info_topic:=/camera/color/camera_info approx_sync:=false

to:

roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" depth_topic:=/device_0/sensor_0/Depth_0/image/data rgb_topic:=/device_0/sensor_1/Color_0/image/data camera_info_topic:=/device_0/sensor_1/Color_0/info/camera_info approx_sync:=false

And when i run it , errors come again:

[ WARN] [1574141417.225224637, 0.005708109]: /rtabmap/rtabmapviz: 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"). Parameter "approx_sync" is false, which means that input topics should have all the exact timestamp for the callback to be called.
/rtabmap/rtabmapviz subscribed to (exact sync):
   /rtabmap/odom,
   /device_0/sensor_1/Color_0/image/data,
   /device_0/sensor_0/Depth_0/image/data,
   /device_0/sensor_1/Color_0/info/camera_info,
   /rtabmap/odom_info

I try to add "--clock" to "rosbag play" and " use_sim_time:=true" to "roslaunch.." too and change "approx_sync:=false" to "approx_sync:=true" . And i all failed! Any suggestion is great! Thanks! (My labtop cannot use ROS and rtabmap ,and my desktop can use rtabmap .And our professor buy D435i for us to run outdoors' slam .So i have to save bag from labtop, and run it in my desktop!)

when

rostopic hz /device_0/sensor_1/Color_0/image/data /device_0/sensor_0/Depth_0/image/data /device_0/sensor_1/Color_0/info/camera_info

get:

subscribed to [/device_0/sensor_1/Color_0/image/data]
subscribed to [/device_0/sensor_0/Depth_0/image/data]
subscribed to [/device_0/sensor_1/Color_0/info/camera_info]

                topic                    rate   min_delta   max_delta   std_dev    window
=========================================================================================
/device_0/sensor_1/Color_0/image/data   9.282   0.1017      0.117       0.006138   7     
/device_0/sensor_0/Depth_0/image/data   30.04   0.02849     0.03895     0.002327   7     

                topic                    rate   min_delta   max_delta   std_dev    window
=========================================================================================
/device_0/sensor_1/Color_0/image/data   9.467   0.1004      0.117       0.005116   17    
/device_0/sensor_0/Depth_0/image/data   29.99   0.02769     0.03895     0.002151   17

It may caused by cam_info missing and wrong topics (It needs aligned_depth_to_color, but SDK only provides origin). And i try another way : When i use D435i and RTABmap ,it works .But if i record the topics ,and replay it. it showed:

    [ WARN] [1574562843.229735865]: odometry: Could not get transform from camera_link to camera_color_optical_frame (stamp=1574511134.203767) after 0.200000 seconds ("wait_for_transform_duration"=0.200000)! Error="canTransform: target_frame camera_link does not exist. canTransform: source_frame camera_color_optical_frame does not exist.. canTransform returned after 0.201408 timeout was 0.2."
[ WARN] [1574562843.449741623]: odometry: Could not get transform from camera_link to camera_color_optical_frame (stamp=1574511134.425091) after 0.200000 seconds ("wait_for_transform_duration"=0.200000)! Error="canTransform: target_frame camera_link does ...
(more)
edit retag flag offensive close merge delete

Comments

Could you run a rostopic list when only playing the bag file (not rtabmap) and post it?

bob-ROS gravatar image bob-ROS  ( 2019-11-19 03:01:41 -0500 )edit

Post also output of $ rostopic hz /device_0/sensor_1/Color_0/image/data /device_0/sensor_0/Depth_0/image/data /device_0/sensor_1/Color_0/info/camera_info

matlabbe gravatar image matlabbe  ( 2019-11-19 08:31:52 -0500 )edit

I have post that, the rate is different.Is that i problem?

lixz123007 gravatar image lixz123007  ( 2019-11-20 23:12:16 -0500 )edit

The camera_info is missing.

matlabbe gravatar image matlabbe  ( 2019-11-21 09:20:39 -0500 )edit

But when i try rostopic echo /device_0/sensor_1/Color_0/info/camera_info ,it has messages! Maybe i will try other camera_info

lixz123007 gravatar image lixz123007  ( 2019-11-21 22:29:34 -0500 )edit

For the TF warning, you need to also record /tf and /tf_static in your bag.

matlabbe gravatar image matlabbe  ( 2019-11-24 08:08:44 -0500 )edit