spot_ros
spot_ros copied to clipboard
Time skew updates can cause jumps in the timestamps of odometry output
The time synchronisation with the robot is done with the time skew component, which has an internal mechanism that is updated every 60 seconds by default. The top chart in the image below shows the time offset between consecutive odometry messages from the robot. When the update happens occasionally there are significant offsets. This seems to happen when the clock of the robot and the operating machine have diverged significantly. The update will gradually bring them together, but these updates can cause problems if you are expecting consistent odometry timestamps. The lower part shows the expected yaw values vs the yaw values given by the odometry, and the discontinuity caused by the gap.
This issue can probably be avoided by having the driver turned on for a while before running anything which needs accurate odometry timestamps. Alternatively, we can modify the sync frequency by changing
https://github.com/heuristicus/spot_ros/blob/a09e6add6b0ed192ffd60b19c64055d08505d96d/spot_driver/src/spot_driver/spot_wrapper.py#L255
to set a shorter time sync interval.
That function is here