[ntp:questions] Sync system time with pixhawk autopilot

Jason Beach jason.m.beach at gmail.com
Fri Nov 4 01:33:58 UTC 2016

I am working on a multicopter that is flown by a pixhawk autopilot and also
a Jetson TK1 running Ubuntu (both onboard the vehicle). I am trying to
figure out how best to synchronize the time between the two boards. The
pixhawk has a GPS that it uses for navigation and also to set the autopilot
system time (the pixhawk runs an RTOS called nuttx).  Communication between
the pixhawk and Jetson is via a serial port using a protocol called
mavlink.  It's fairly straightforward to determine the time offset between
the two boards using a ptp-ish type algorithm--i.e. the Jetson timestamps a
mavlink timesync packet, sends it to the autopilot which timestamps it and
sends it back.  The Jetson records the time the timesync packet is received
and using the three timestamps, calculates the offset (this all occurs on a
custom interface written in C++).

The problem is how do I feed that offset to ntp so that it can correct the
Jetson time or use it to adjust the Jetson system time outright? I know
enough about ntp to get it to sync to computers together using fudge and
that's about it.  Any advice is appreciated.


More information about the questions mailing list