Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]: GPS clock set time updates #18261

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

dagar
Copy link
Member

@dagar dagar commented Sep 17, 2021

WORK IN PROGRESS - opening early for discussion and testing

  • remove drivers/gps set clock callback
  • drivers/gps try to set sensor_gps timestamp_sample as closely as possible
  • move mavlink timesync to new lib/timesync library
  • sensors/vehicle_gps_position consume all sensor_gps sources and determine time GPS utc time offset using lib/timesync
  • once time offset is stable update system clock if sufficiently different
  • updated hrt ts_to_abstime and abstime_to_ts to work relative to CLOCK_REALTIME
  • increase drivers/gps priority to reduce timing jitter

Requires PX4/PX4-GPSDrivers#90

TODO

  • review mavlink timesync and test (thresholds may need to be configurable for different usage)
  • improve hrt and time update helpers (critical sections, minimize error)
  • review EKF2 GPS delay? ublox timestamp_sample has shifted by more than 10 milliseconds (closer to truth)

@ShiauweiZhao
Copy link
Contributor

maybe we can support gps 1pps signal to Correct time?This allows for more accurate timing

@dagar
Copy link
Member Author

dagar commented Oct 3, 2021

maybe we can support gps 1pps signal to Correct time?This allows for more accurate timing

That's also coming, although it's handled much lower level.

@ShiauweiZhao
Copy link
Contributor

I have the hardware to support 1pps and can do 1pps development, but I'm not quite sure how to combine it with timesync at the moment.

 - remove drivers/gps set clock callback
 - drivers/gps try to set sensor_gps timestamp_sample as closely as possible
 - move mavlink timesync to new lib/timesync library
 - sensors/vehicle_gps_position consume all sensor_gps sources and determine time GPS utc time offset using lib/timesync
 - once time offset is stable update system clock if sufficiently different
@kaklik
Copy link
Contributor

kaklik commented Feb 1, 2022

I have the hardware to support 1pps and can do 1pps development, but I'm not quite sure how to combine it with timesync at the moment.

Hi! I am interested in your hardware solution to handle the 1PPS signal from the GNSS receiver. We currently solved that at a payload level. By allowing the payload to read out the PPS signal from GPS and GPS time data. We are using that to connect, the measurements done by payloads to precise absolute time. An improvement could be done, in the case of uLog file has precise GNSS time data also.

@dagar
Copy link
Member Author

dagar commented Feb 1, 2022

@kaklik as a start did you see #18849?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants