From 49023f3d7e5026f891e99c758ccd7da182f0fa63 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Sun, 13 Mar 2016 21:56:28 +1100 Subject: [PATCH] EKF: fix travis build error --- EKF/ekf.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EKF/ekf.cpp b/EKF/ekf.cpp index 12a1ffd177..51f3a64fa9 100644 --- a/EKF/ekf.cpp +++ b/EKF/ekf.cpp @@ -246,7 +246,8 @@ bool Ekf::update() } else { // calculate a filtered offset between the baro origin and local NED origin if we are not using the baro as a height reference - _baro_hgt_offset += 0.02f * math::constrain((_baro_sample_delayed.hgt + _state.pos(2) - _baro_hgt_offset), -5.0f, 5.0f); + float offset_error = _baro_sample_delayed.hgt + _state.pos(2) - _baro_hgt_offset; + _baro_hgt_offset += 0.02f * math::constrain(offset_error, -5.0f, 5.0f); } }