ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

[SOVED] RTABMAP fails to run in rgbd mode

asked 2019-08-15 17:32:37 -0600

Avner gravatar image

updated 2019-08-16 11:44:19 -0600

Hi,

I am running RTABMAP against a stereo camera that provides left and right and depth images.

When I run RTABMAP in stereo_mode (based on left and right image pairs) RTABMAP is working OK. (e.g. I can see the 3d point cloud being accumulated in Rviz)

Next, I want to test RTABMAP in rgbd mode (based on right and depth image pairs).

In this mode I'm getting error messages from RTABMAP (snippet1) I echo the /rtabmap/odom topic and indeed nothing is advertised.

To debug the problem, I kill the rgbd_odometry process that is triggered from the launch file, and run the same command from the command line. This time rgbd_odometry runs OK, and I can echo the topic (snippet3)

Why rgbd_odometry doesn't publish anything when it runs from the launch file, but publishes data when it runs separately?

The launch files that are related to RTABMAP is in snippet4

Thanks,

Avner


snippet1 - getting error messages from RTABMAP

[ WARN] [1565907237.759114913, 1556048635.546000004]: /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,
   /rtabmap/rgbd_image_relay,
   /rtabmap/odom_info

snippet2 - run rgb_odometry directly from the command line

ps aux | grep odometry
avnerm   22133  6.1  2.1 1805516 172020 ?      Ssl  15:22   0:00 /opt/ros/melodic/lib/rtabmap_ros/rgbd_odometry --delete_db_on_start rgb/image:=/rm_mapping_node/cameras/stern/rectified_right depth/image:=/rm_mapping_node/cameras/stern/3d_z_coords rgb/camera_info:=/rm_mapping_node/cameras/stern/right/camera_info rgbd_image:=rgbd_image_relay odom:=odom __name:=rgbd_odometry __log:=/home/avnerm/.ros/log/8d688094-bfa4-11e9-975a-74d02b912ce1/rtabmap-rgbd_odometry-5.log

snippet3 - echo the topic /odom

rostopic echo /odom
...
---
header: 
  seq: 8
  stamp: 
    secs: 1556049330
    nsecs:  88000059
  frame_id: "odom"
child_frame_id: "base_link"
pose: 
  pose: 
    position: 
      x: -1.05032432079
      y: -1.40366268158
      z: -0.831952929497
    orientation: 
      x: -0.00683327377029
      y: 0.00692438043004
      z: -0.00286356138948
      w: 0.999948578349
  covariance: [660.712180279541, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 660.712180279541, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 660.712180279541, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00214658203125, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00214658203125, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00214658203125]
twist: 
  twist: 
    linear: 
      x: 0.823218107224
      y: -0.786256253719
      z: 0.694412589073
    angular: 
      x: -0.00885304901749
      y: -0.0140505637974
      z: -0.00202373345383
  covariance: [330.3560901397705, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 330.3560901397705, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 330.3560901397705, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001073291015625, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ...
(more)
edit retag flag offensive close merge delete

Comments

Instead of putting your solution in the question, can you please put it as an answer? That'll make it easier for others to find

jayess gravatar image jayess  ( 2019-08-15 20:18:03 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-08-16 11:44:30 -0600

Avner gravatar image

I was able to solve the problem.

The environment setting is such that:

  • the 3 topics: /3d_z_coords, /rectified_right, /camera_info have exactly the same timestamp and
  • a "/clock" topic is published
  • the variable use_sim_time is set to true

I added the following attributes to the RTABMAP launch file:

<arg name="rgbd_sync"               default="true"/>
<arg name="approx_rgbd_sync"        default="false"/>

After adding the variables, rtabmap prints Odom messages that indicate that rgb_odometry is publishing data:

[ INFO] [1565910573.832571034, 1556051971.565000057]: Odom: quality=111, std dev=7.774576m|0.038960rad, update time=0.041168s
[ INFO] [1565910573.968252760, 1556051971.700000048]: Odom: quality=109, std dev=6.788122m|0.027549rad, update time=0.042338s

Occasionally, there are still error messages::

[ WARN] [1565910573.791017902, 1556051971.565000057]: odometry: Could not get transform from camera_link to reference_frame (stamp=1556051971.364000) after 0.200000 seconds ("wait_for_transform_duration"=0.200000)! Error="Lookup would require extrapolation into the future.  Requested time 1556051971.364000082 but the latest data is at time 1556051970.490000010, when looking up transform from frame [reference_frame] to frame [camera_link]. canTransform returned after 0.201 timeout was 0.2."

The quality is not good, but this is a separate issue.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-08-15 17:32:37 -0600

Seen: 644 times

Last updated: Aug 16 '19