PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.2k stars 13.37k forks source link

Set system time from DDS timestamps #22289

Open dakejahl opened 10 months ago

dakejahl commented 10 months ago

Describe problem solved by the proposed feature

In systems with a companion computer without a GPS, it would be nice to use the timestamps from the DDS bridge to set the PX4 system time.

Describe your preferred solution

Set PX4 system time using DDS timestamps.

Describe possible alternatives

Mavlink TIMESYNC service

Additional context

Initial implementation here, looking for feedback https://github.com/PX4/PX4-Autopilot/pull/22290

PetervdPerk-NXP commented 10 months ago

People considered using ntp as well? it's supported in NuttX and it works besides mavlink or dds. Not sure about the code size and the timing precision, but could be worthwhile to test out. https://github.com/apache/nuttx-apps/blob/647db6393d59dbeab3c12ab5d692585fa608148e/netutils/ntpclient/ntpclient.c#L85