Intermodalics / tango_ros

ROS related software for Tango
Apache License 2.0
67 stars 22 forks source link

Fix/ros vs tango timestamp #312

Closed PerrineAguiar closed 7 years ago

PerrineAguiar commented 7 years ago

This fixes #299.

PerrineAguiar commented 7 years ago

FYI @adamantivm @jubeira

mcopejans commented 7 years ago

@PerrineAguiar Code changes are LGTM. Do you intend to merge this or should we keep it in a feature branch to avoid having forwards-backwards changes in master?

Some questions that could help tracking down the actual timestamp issue: Do you have an idea why the timestamp is wrong? How big is the offset? Is the time offset due to accuracy or due to an error in the calculation? Is the offset always constant?

PerrineAguiar commented 7 years ago

@mcopejans Thanks for the review. I would merge this PR (but keep the issue opened) as this is blocking Ekumen at the moment.

The reason of the issue is explained in #299. The problem comes from the calculation of the offset and the fact that we do not have a way to convert Tango time to system time. The error of the offset seems to be between 0.09 to 0.18 s (values taken from tf exceptions when trying to use the Tango ROS Streamer with the navigation stack). It varies between runs and also during the same run.

PerrineAguiar commented 7 years ago

@jubeira @adamantivm @mcopejans I am now using CLOCK_BOOTTIME as suggested by Ian. This allows us to calculate accurately the time offset between Tango and ROS. I tested it with the turtlebot and the navigation stack and it seems to resolve the tf issue.