Ask Your Question
0

[Solved] rtabmap with external odometry (Realsense T265)

asked 2020-02-11 03:38:24 -0500

dschnabel gravatar image

updated 2020-02-15 22:59:50 -0500

OS: Ubuntu 16.04.6 LTS
ROS version: Lunar
RTAB-Map: 0.17.6
Cameras: Realsense D435 and T265

I'm starting both cameras with this launch command: roslaunch realsense2_camera rs_d400_and_t265.launch align_depth:=true (see rs_d400_and_t265.launch)

The map frame looks like this.

When I start rtabmap without external odometry and have visual odometry (uses the image/depth data provided by the D435), it seems to be working fine: roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" depth_topic:=/d400/aligned_depth_to_color/image_raw rgb_topic:=/d400/color/image_raw camera_info_topic:=/d400/color/camera_info approx_sync:=false frame_id:=t265_odom_frame

This starts rtabmap and shows the 3D image as expected.

But when I include external odometry from the T265 then I get an empty rtabmap window where nothing is displayed: roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" depth_topic:=/d400/aligned_depth_to_color/image_raw rgb_topic:=/d400/color/image_raw camera_info_topic:=/d400/color/camera_info approx_sync:=false frame_id:=t265_odom_frame visual_odometry:=false odom_topic:=/t265/odom/sample

There's also a warning message on stdout which only happens if I include external odometry:

[ WARN] [1581412938.063114202]: /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):
   /t265/odom/sample,
   /d400/color/image_raw,
   /d400/aligned_depth_to_color/image_raw,
   /d400/color/camera_info,
   /rtabmap/odom_info
[ WARN] [1581412938.420139502]: /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"). Parameter "approx_sync" is false, which means that input topics should have all the exact timestamp for the callback to be called.
/rtabmap/rtabmap subscribed to (exact sync):
   /t265/odom/sample,
   /d400/color/image_raw,
   /d400/aligned_depth_to_color/image_raw,
   /d400/color/camera_info,
   /rtabmap/odom_info

Odometry data is coming through fine as the command rostopic echo /t265/odom/sample shows:

header: 
  seq: 2186
  stamp: 
    secs: 1581324175
    nsecs: 245380878
  frame_id: "t265_odom_frame"
child_frame_id: "t265_pose_frame"
pose: 
  pose: 
    position: 
      x: -0.000204464944545
      y: -7.67098099459e-05
      z: -0.000421570963226
    orientation: 
      x: -0.00432776007801
      y: 0.0274204164743
      z: 0.000154268200276
      w: 0.999614655972
  covariance: [0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001]
twist: 
  twist: 
    linear: 
      x: 0.00355814174321
      y: -0.00205399848924
      z: 0.000575806943033
    angular: 
      x: 0.00179574472786
      y: 0.00634724180174
      z: 0.00126657017099
  covariance: [0.1, 0.0, 0.0, 0.0, 0.0, 0.0 ...
(more)
edit retag flag offensive close merge delete

Comments

Same issue with realsense D415 and T265 on Melodic! Did you fix it?

bn059 gravatar image bn059  ( 2020-02-15 19:08:38 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-02-15 23:00:22 -0500

dschnabel gravatar image

updated 2020-02-16 04:43:53 -0500

gvdhoorn gravatar image

See https://github.com/IntelRealSense/rea... for solution.

Quote for posterity:

Hi @RealSenseCustomerSupport

thank you for those threads. The occupancy mapping was a great starting point. Once I got that working, I went back to playing around with rs_rtabmap.launch. I then disabled re-localization of the T265:

<rosparam>
        /t265/tracking_module/enable_relocalization: false
</rosparam>

Next I set subscribe_odom_info to false as per this thread in rtabmap.launch at several places: here and here. This change requires restarting the roscore.

When I launch rtabmap via roslaunch realsense2_camera rs_rtabmap.launch I have to wait long enough for both cameras (D435 and T265) to start up. Once both cameras have started, I can finally use rtabmap to build a map. This is working great for me now.

Appreciate your help with this. Closing as solved.

edit flag offensive delete link more

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: 2020-02-11 03:38:24 -0500

Seen: 141 times

Last updated: Feb 16