For Nav2, LIDAR timestamp on the message is earlier than all the data in the transform cache
I am trying to bringup Nav2 on a "server" Ubuntu machine hosting ROS2 Rolling, using messages published from a physical robot "client" via Raspberry Pi hosting ROS2 Foxy. The URDF description is at https://github.com/billymccafferty/xerbo .
When I bring up Nav2 via ros2 launch nav2_bringup navigation_launch.py
on the server, I'm seeing the following error:
[controller_server-1] [INFO] [1640913301.944847057] [local_costmap.local_costmap_rclcpp_node]: Message Filter dropping message: frame 'laser_frame' at time 1640913301.637 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
I have chrony running on both the server and client with successful clock sync on the client. E.g., if I run ntpdate from the client to the server, I see the following, showing that they're almost perfectly synced:
server 192.168.x.x, stratum 8, offset -0.000500, delay 0.03116
30 Dec 18:26:02 ntpdate[7778]: adjust time server 192.168.x.x offset -0.000500 sec
Furthermore, if I echo /scan coming from the client and compare that to echo /tf on the server, I see that the header timestamps are identical each other; e.g.,:
/tf
transforms:
- header:
stamp:
sec: 1640913147
nanosec: 522616833
frame_id: odom
/scan
header:
stamp:
sec: 1640913147
nanosec: 60040883
frame_id: laser_frame
I can get everything working fine in the demos and such, but am running into this issue with Nav2 using my physical robot.
Thank you!
Billy McCafferty
Hey, did you solved your issue ? I have s similar one that appeared after migrating from Foxy to Galactic, and even if all my stack runs on the same single physical computer. I use 2 Hokuyos lidars that are merged. My warning message comes from
global_costmap.global_costmap_rclcpp_node
.Not yet. :(
I have other issues that may be related (like this), that bend me toward the
map <-> odom
transform. I use the slam_toolbox in localization mode to provide this TF. If I disable TF publication from slam toolbox and instead publishmap <-> odom
TF from command line withros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 1 odom map
, the error goes away...ok, this issue and my other one are somehow linked. Under Galactic, the slam_toolbox timestamps the TF map-odom with the timestamp of the last laserscan + transform_timeout offset (see here). Under Foxy, it was timestamped with now() + transform_timeout offset (see here).
I replaced in Galactic the laser timestamp by now(), and my two issues got resolved... definitively something to look here.
I'm very happy that I'm not the only one experiencing this! I will try your suggested action for the map <-> odom TF to see if that resolves the issue in the short term, as well as the now() fix you suggested. Thank you very much for your input!
Ok, I'm lost. The slam_toolbox seems involved but not sure how, I have two issues intricated or that give the same error. However I could isolate this: both issues started when I corrected the timestamp of the TF base_link <-> odom provided by rf2o laser odometry, to use the scan's timestamps instead of now(). There probably some timing issue here...