Firmware
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MavlinkTimesync Class Reference

Public Member Functions

 MavlinkTimesync (Mavlink *mavlink)
 
void handle_message (const mavlink_message_t *msg)
 
uint64_t sync_stamp (uint64_t usec)
 Convert remote timestamp to local hrt time (usec) Use synchronised time if available, monotonic boot time otherwise.
 

Protected Member Functions

void add_sample (int64_t offset_us)
 Online exponential filter to smooth time offset.
 
bool sync_converged ()
 Return true if the timesync algorithm converged to a good estimate, return false otherwise.
 
void reset_filter ()
 Reset the exponential filter and its states.
 

Protected Attributes

orb_advert_t _timesync_status_pub {nullptr}
 
uint32_t _sequence {0}
 
double _time_offset {0}
 
double _time_skew {0}
 
double _filter_alpha {ALPHA_GAIN_INITIAL}
 
double _filter_beta {BETA_GAIN_INITIAL}
 
uint32_t _high_deviation_count {0}
 
uint32_t _high_rtt_count {0}
 
Mavlink *const _mavlink
 

The documentation for this class was generated from the following files: