diff options
author | M.H.Kabir <mhkabir98@gmail.com> | 2014-12-17 12:12:09 +0530 |
---|---|---|
committer | M.H.Kabir <mhkabir98@gmail.com> | 2014-12-17 12:12:09 +0530 |
commit | 4a42f6ca6a95c9b05ed2c1e66cc251ea0e001c59 (patch) | |
tree | 55feea6346d692ff3bac7cf886a7ed225d99cfb1 /src/modules/mavlink/mavlink_receiver.h | |
parent | 0e41624f7902b13bbf830742481174e08e0f97c4 (diff) | |
download | px4-firmware-4a42f6ca6a95c9b05ed2c1e66cc251ea0e001c59.tar.gz px4-firmware-4a42f6ca6a95c9b05ed2c1e66cc251ea0e001c59.tar.bz2 px4-firmware-4a42f6ca6a95c9b05ed2c1e66cc251ea0e001c59.zip |
Restore EMA. Works better for low rates
Diffstat (limited to 'src/modules/mavlink/mavlink_receiver.h')
-rw-r--r-- | src/modules/mavlink/mavlink_receiver.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/modules/mavlink/mavlink_receiver.h b/src/modules/mavlink/mavlink_receiver.h index 7c79f661b..a677e75cd 100644 --- a/src/modules/mavlink/mavlink_receiver.h +++ b/src/modules/mavlink/mavlink_receiver.h @@ -136,7 +136,11 @@ private: * Convert remote nsec timestamp to local hrt time (usec) */ uint64_t to_hrt(uint64_t nsec); - + /** + * Exponential moving average filter to smooth time offset + */ + void smooth_time_offset(uint64_t offset_ns); + mavlink_status_t status; struct vehicle_local_position_s hil_local_pos; struct vehicle_control_mode_s _control_mode; @@ -171,6 +175,7 @@ private: bool _hil_local_proj_inited; float _hil_local_alt0; struct map_projection_reference_s _hil_local_proj_ref; + double _time_offset_avg_alpha; uint64_t _time_offset; /* do not allow copying this class */ |