SteveMacenski / slam_toolbox

Slam Toolbox for lifelong mapping and localization in potentially massive maps with ROS
GNU Lesser General Public License v2.1
1.68k stars 525 forks source link

Old map to odom transformation published on node relaunch #478

Closed Jannkar closed 2 years ago

Jannkar commented 2 years ago

Required Info:

Steps to reproduce issue

Relaunch slam-toolbox, for example using online_async_launch.py

Expected behavior

The published map to odom transformation is not timestamped to the past

Actual behavior

On relaunch, the slam_toolbox publishes for a while the map to odom transformations with the timestamp of 0.0 + transform timeout. This causes lots of errors to be printed by multiple different nodes that rely on this transformation.

Additional information

This seems to happen due to time being taken from the scan message, which is initialized with 0.0 timestamp. Old transform is published until the first laserscan message is received.

I made a simple fix for this in my own fork by publishing the tf only if the scan time is larger than 0.0. I can create a pull request from it, if you agree that this is a good way to handle the problem.

SteveMacenski commented 2 years ago

Sure, that sounds reasonable