Skip to content

fix(3d): take the UTC offset from the first sample with a UTC time - #351

Merged
bkueng merged 1 commit into
mainfrom
dakejahl/3d-utc-offset
Oct 20, 2026
Merged

bkueng merged 1 commit into
mainfrom
dakejahl/3d-utc-offset

Conversation

@dakejahl

@dakejahl dakejahl commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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_usec was 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 older vehicle_gps_position log (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.

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
dakejahl force-pushed the dakejahl/3d-utc-offset branch from 94514d8 to 9587093 Compare October 16, 2026 18:10

@bkueng bkueng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find, thanks

@bkueng
bkueng merged commit 9dec4bb into main Oct 20, 2026
5 checks passed
@bkueng
bkueng deleted the dakejahl/3d-utc-offset branch October 20, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants