Repository navigation
fix(3d): take the UTC offset from the first sample with a UTC time - #351
Merged
Merged
Conversation
dakejahl
force-pushed
the
dakejahl/3d-utc-offset
branch
from
October 16, 2026 16:36
fe52f36 to
94514d8
Compare
The offset came from the first sample with a fix. A receiver can report a fix before it knows the time, which left the offset at 0 and started the 3D view's clock at 1970.
dakejahl
force-pushed
the
dakejahl/3d-utc-offset
branch
from
October 16, 2026 18:10
94514d8 to
9587093
Compare
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
The 3D view now gets its UTC time from the first GPS sample that has one, so its clock no longer starts at 1970 for logs where the receiver had a fix before it knew the time.
Problem
The 3D handler computed the UTC offset from the first sample with a 3D fix. Receivers can report a fix a few samples before the UTC time, so
time_utc_usecwas 0 there, the offset fell to 0, and the timeline and flight-mode times started at 1970. Seen on an ARK FMU-V6X log with a Septentrio receiver and on an oldervehicle_gps_positionlog (fix at sample 168, UTC from 208).Solution
Take the offset from the first sample with a non-zero
time_utc_usec, as the info table and the database already do for the logging start time. The takeoff location still comes from the first fixed sample.