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

Revision history [back]

click to hide/show revision 1
initial version

The documentation everywhere suggest using the use_sim_time parameter to synchronize the output of the slam_toolbox to that of the bagged topics, but on a deeper look, firstly rosbag2 in foxy doesn't yet have the clock topic (available from Galactic onwards), which can be solved by publishing manually to this topic from the timestamps of the sensor/Odom data in the bags. Secondly, and more importantly, even that won't solve our problems as the foxy-devel branch of slam_toolbox (the one that gets downloaded with apt install ros-foxy-slam-toolbox) doesn't make use of the use_sim_time parameter anyway.

So, my workaround was to get the source code of the foxy-devel branch and then cherry-pick the "fixed timestamps input&output not synchronized (#377)" commit from the 'ros-2' branch of slam_toolbox. The fix in this commit is to synchronize the i/p & o/p timestamps, i.e., it uses the timestamps of scan topic to publish the map->odom transform. This fixed my issue and I got some nice maps made out of it! No clock publishing is needed!