introlab / rtabmap_ros

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

RGBD sync node in ROS2 #488

Open BarzelS opened 4 years ago

BarzelS commented 4 years ago

Hi, I'm trying to do remote mapping on ROS2. Every time I'm trying to subscribe using the rgbd_relay node to the rgbd_sync node the rgbd sync node crashes with this error:

[rgbd_sync-1] terminate called after throwing an instance of 'std::runtime_error' [rgbd_sync-1]
 what(): can't compare times with different time sources 

I think the problem is with that line at rgbdsync.cpp: if ( lastCompressedPublished + rclcpp::Duration(1.0/compressedRate_) > now())

matlabbe commented 4 years ago

A workaround would be to not use compressed_rate parameter, otherwise this should be debugged. Time is handled differently on ROS2 than ROS1, stuff like that can be broken in ROS2. I am opened for pull requests.