Problem about TF2 delay
Hello, I'm trying use ROS2 ans S2 rplidar to establish map by Cartographer. However, when I moved my lidar in real world, the laser tf in Rviz would not move but the laserScan data would update correctly.
After I check tf2_monitor, it show that laser frame is delay 2~50s. Like below:
ros2 run tf2_ros tf2_monitor
Gathering data on all frames for 10 seconds...
RESULTS: for all Frames
Frames: Frame: base_link, published by <no authority available>, Average Delay: 0.000209381, Max Delay: 0.00391769
Frame: laser_frame, published by <no authority available>, Average Delay: 7.57297, Max Delay: 7.57297 Frame: odom, published by <no authority available>, Average Delay: 0.000203073, Max Delay: 0.00390005
All Broadcasters: Node: <no authority available> 187.103 Hz, Average Delay: 0.000206227 Max Delay: 0.00390887
Then I check my base_link -> laser_frame carefully:
ros2 run tf2_ros tf2_monitor base_link laser_frame
Gathering data on base_link -> laser_frame for 10 seconds...
RESULTS: for base_link to laser_frame
Chain is: laser_frame -> base_link
Net delay avg = 3.16691e+08: max = 1.66441e+09
Frames:
Frame: base_link, published by <no authority available>, Average Delay: 0.00019925, Max Delay: 0.000592947
Frame: laser_frame, published by <no authority available>, Average Delay: 10.8441, Max Delay: 10.8441
All Broadcasters:
Node: <no authority available> 183.478 Hz, Average Delay: 0.000195868 Max Delay: 0.000586987
And I put my rqt and tf_tree picture on my github. Please help me to deal with this delay problem. I just learn it for few days. And I google it but still not solve it. If you need more information, please tell me. Thank you!
This kind of excessive-delay symptom can occur if the time-of-day clocks on all your ros machines are not synchronized.