The timestamp on the message is earlier than all the data in the transform cache
Running Nav2 I get errors I don't see a reason for to appear.
Even though the map builds and localization works, I get many errors in the console. (1 to 2 per second) Does someone have an idea on a possible cause? All nodes run on the same machine for now.
ros2 launch nav2_bringup navigation_launch.py
[controller_server-1] [INFO] [1646771670.720067917] [local_costmap.local_costmap_rclcpp_node]: Message Filter dropping message: frame 'laser' at time 1646771670.173 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
Are you by chance using Hokuyo lidar, on a real robot ? If yes I get similar issue. Digging in he code of the Hokuyo ROS drivers, it appears that it timestamps the messages directly with the system time and not with the ROS time source, and so the timestamps of the laserscan are in the future w.r.t to ROS time on my system... looks related, still investigating.
I am using an rplidar. But I’ll look at the time source in the driver. Same with the rf2o laser odometry driver. Maybe the issue is similar.
Thanks for the hint.
Interesting you use RF2O, so do I. This seems similar to this question: https://answers.ros.org/question/3935... I still got the issue you mention, but I did a correction in my RF2O node to reduce the rate of this error (not fully solved as my answer suggested but it helped...) I wonder if it could be an issue of computation time in RF2O that delays too much the publication of the odom message (takes ~4ms with O3 optimization vs ~70ms)...
I‘ll give your correction a try. Is the correct change a rclcpp::spin_some() in front of the process line? (fairly new to ros, only wrote one microros node so far, so I need to ask 🙈)
For my case, yes: spin_some() to get data; then process(); then spin_some() again to publish odom. But I still sometimes have the message you mention
For me it didn't change anything. (maybe a little, but could be my imagination). Or I did something wrong. You meant a change from
to
right?
Another cheat which mostly solves the problem is changing void CLaserOdometry2DNode::publish()
and
With this the node always publishes with the current time. Not correct, but for a slow robot it might be ok?