fix(ubx): real UTC time and no fake sample timestamp on NAV-RELPOSNED/DAHEADING - #240
Draft
dakejahl wants to merge 1 commit into
Draft
fix(ubx): real UTC time and no fake sample timestamp on NAV-RELPOSNED/DAHEADING#240dakejahl wants to merge 1 commit into
dakejahl wants to merge 1 commit into
Conversation
…/DAHEADING time_utc_usec carried the raw iTOW, which is GPS time of week rather than a UTC epoch, so a consumer aligning the relative position to a PPS pulse got a time off by weeks. The UTC time is now derived from the last NAV-PVT/TIMEUTC epoch with a valid time by the iTOW difference; GPS and UTC differ by whole seconds, so the sub-week offset is identical in both. timestamp_sample was stamped with the parse time, which reads as a driver-supplied measurement time and defeated the consumer's receiver delay compensation. It is now left unset.
ABI/API Compatibility ReportStatus: DetailsThis comment is automatically updated on each push. |
dakejahl
marked this pull request as draft
September 10, 2026 04:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
NAV-RELPOSNED and NAV-DAHEADING get a real
time_utc_usecand no longer stamptimestamp_samplewith the parse time.Problem
time_utc_useccarried the raw iTOW, GPS time of week rather than a UTC epoch, so a consumer aligning the relative position to a PPS pulse got a time off by weeks.timestamp_samplewas set to the parse time, which reads as a driver-supplied measurement time and defeats the consumer's receiver delay compensation. The PX4 side of this is PX4/PX4-Autopilot#27102.Solution
The UTC time is derived from the last NAV-PVT or NAV-TIMEUTC epoch with a valid time by the iTOW difference, wrapped at the week boundary. GPS and UTC differ by a whole number of seconds, so the sub-week offset is identical in both.
timestamp_sampleis left unset for the consumer to fill.