replay: remove GPS relative timestamps #14114
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replaces #14092
Describe problem solved by this pull request
Solves original issue reported here
Describe your solution
Remove relative timestamps of GPS measurements. The benefit of this is that all GPS data that is logged will actually be published during EKF replay even if the ekf2_timestamps topic has dropouts. The downside is that the accuracy of the measurement timestamps is reduced slightly.
Describe possible alternatives
Publish the GPS data anyway if no relative timestamp is found during replay. The upside would be more accurate time stamping and the downside more data to log
Tests

Here are the relative timestamps of two GPS modules (logged in microseconds / 10)
As can be seen the difference from the topic original timestamps is on average ~1 ms. This in comparison to the ~100 ms delay of the GPS measurements themselves should have minimal effect on the replay result.
Here is the dt of the gps topic after replay, PR (top) vs master (bottom). As can be seen the dropouts are significantly reduced

And here is the selected GPS module, as can be seen the GPS timeout is no longer triggered in the replayed logfile

The PR has been tested on code similar to v1.10.1
Thanks @bkueng for the discussion!