Time Synchronization

2020-05-084.0.0

NOTE This article is Machine-Translated. If you have any questions about this article, please send an E-mail to DJI, we will correct it in time. DJI appreciates your support and attention.

Overview

OSDK provides the time synchronization for developers to synchronize the time in the sensors, onboard computer and the drone. It also supports the synchronization of time between drones and GPS systems.

NOTE

  • Only the drone with RTK support Time Synchronization.
  • Before using the time synchronization function, please keep the communication status between the drone and the RTK satellite in the good condition from DJI Pilot or a Mobile APP developed based on MSDK APP, as shown in Figure 1.

Figure 1 Communication Status

Time Synchronization

Time synchronization is the function that uses PPS signals to synchronize with GPS satellites; the application developed with the "time synchronization" could improve the accuracy of the camera's exposure time and achieve precise positioning ,etc. this function support Developers obtain the RTK data in 1 Hz and GPS data in 5 Hz.

The process of the Time Synchronization is as follows:

  1. The drone sends the PPS and UTC time stamp through the hardware, which is used to synchronize the time with the onboard computer and the sensor;
  2. When the communication status between the drone and the RTK or GPS satellite is good, the drone will send the RTK data packet at a frequency in 1 Hz and the GPS data packet in 5 Hz, which contain the NMEA data.

NOTE The UTC time stamps generated from the drone on the pulses rising edge (from 0V to 3.3V).

Develop With Time Synchronization

Subscribe NMEA's Information

  • Asynchronous
void subscribeNMEAMsgs(VehicleCallBack cb, void *userData);
void unsubscribeNMEAMsgs();
  • Synchronize
bool getNMEAMsg(NMEAType type, NMEAData &nmea);

Subscribe the time stamp of the UTC

  • Asynchronous
void subscribeUTCTime(VehicleCallBack cb, void *userData);
void unsubscribeUTCTime();
  • Synchronize
bool getUTCTime(NMEAData &utc);

Subscribe the time of the drone

  • Asynchronous
void subscribeFCTimeInUTCRef(VehicleCallBack cb, void *userData);
void unsubscribeFCTimeInUTCRef();
  • Synchronize
bool getFCTimeInUTCRef(DJI::OSDK::ACK::FCTimeInUTC &fcTimeInUTC);

Subscribe the PPS of the drone

  • Asynchronous
void subscribePPSSource(VehicleCallBack cb, void *userData);
void unsubscribePPSSource();
  • Synchronize
bool getPPSSource(PPSSource &source);

After synchronize the time of the drone, sensor and onboard computer, the PPS hardware pulse output by the deone is as shown in Figure 2.

Figure 2.Time Synchronization Signal