diff options
author | M.H.Kabir <mhkabir98@gmail.com> | 2015-01-11 12:59:30 +0530 |
---|---|---|
committer | Mohammed Kabir <mhkabir98@gmail.com> | 2015-04-14 13:14:15 +0530 |
commit | 66e6938c6d979b1a955af7dbb3abb4d420d7c241 (patch) | |
tree | 0c39edb99b92e9146625fdd40628b717532641ba /src/modules/mavlink/mavlink_receiver.h | |
parent | 3c36a615692d746996e4d32a97e8e24285330913 (diff) | |
download | px4-firmware-66e6938c6d979b1a955af7dbb3abb4d420d7c241.tar.gz px4-firmware-66e6938c6d979b1a955af7dbb3abb4d420d7c241.tar.bz2 px4-firmware-66e6938c6d979b1a955af7dbb3abb4d420d7c241.zip |
timesync: Add uORB topic, general fixes
Diffstat (limited to 'src/modules/mavlink/mavlink_receiver.h')
-rw-r--r-- | src/modules/mavlink/mavlink_receiver.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/mavlink/mavlink_receiver.h b/src/modules/mavlink/mavlink_receiver.h index ffacb59a6..2b6174f8f 100644 --- a/src/modules/mavlink/mavlink_receiver.h +++ b/src/modules/mavlink/mavlink_receiver.h @@ -73,6 +73,7 @@ #include <uORB/topics/airspeed.h> #include <uORB/topics/battery_status.h> #include <uORB/topics/vehicle_force_setpoint.h> +#include <uORB/topics/time_offset.h> #include "mavlink_ftp.h" @@ -138,9 +139,10 @@ private: void *receive_thread(void *arg); /** - * Convert remote nsec timestamp to local hrt time (usec) + * Convert remote timestamp to local hrt time (usec) + * Use timesync if available, monotonic boot time otherwise */ - uint64_t to_hrt(uint64_t nsec); + uint64_t sync_stamp(uint64_t usec); /** * Exponential moving average filter to smooth time offset */ @@ -177,6 +179,7 @@ private: orb_advert_t _rc_pub; orb_advert_t _manual_pub; orb_advert_t _land_detector_pub; + orb_advert_t _time_offset_pub; int _control_mode_sub; int _hil_frames; uint64_t _old_timestamp; |