From 50369673437e1facc9166a4115e546bf71b600e6 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 27 Apr 2017 17:25:09 +0200 Subject: [PATCH] barometer does not special height sensor offset because a barometer offset from the local origin is calculated if the primary source for height is not baro Signed-off-by: Roman --- EKF/control.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/EKF/control.cpp b/EKF/control.cpp index 47b3f186d0..ec6461e6fe 100644 --- a/EKF/control.cpp +++ b/EKF/control.cpp @@ -724,10 +724,10 @@ void Ekf::controlHeightFusion() setControlBaroHeight(); _fuse_height = true; - // we have just switched to using baro height, calculate height sensor offset such that current - // measurment matches our current height estimate + // we have just switched to using baro height, we don't need to set a height sensor offset + // since we track a separate _baro_hgt_offset if (_control_status_prev.flags.baro_hgt != _control_status.flags.baro_hgt) { - _hgt_sensor_offset = _baro_sample_delayed.hgt - _baro_hgt_offset + _state.pos(2); + _hgt_sensor_offset = 0.0f; } } }