From 75c49b2082825557fc81cce2b0b086540d41aebf Mon Sep 17 00:00:00 2001 From: bresch Date: Fri, 8 May 2020 15:25:21 +0200 Subject: [PATCH] ekf_helper: fuse double if --- EKF/ekf_helper.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/EKF/ekf_helper.cpp b/EKF/ekf_helper.cpp index 261e160cba..8d92f8ff0b 100644 --- a/EKF/ekf_helper.cpp +++ b/EKF/ekf_helper.cpp @@ -295,15 +295,13 @@ void Ekf::resetHeight() P.uncorrelateCovarianceSetVariance<1>(6, 10.0f); } - // store the reset amount and time to be published if (vert_pos_reset) { + // store the reset amount and time to be published _state_reset_status.posD_change = _state.pos(2) - old_vert_pos; _state_reset_status.posD_counter++; - } - // apply the change in height / height rate to our newest height / height rate estimate - // which have already been taken out from the output buffer - if (vert_pos_reset) { + // apply the change in height / height rate to our newest height / height rate estimate + // which have already been taken out from the output buffer _output_new.pos(2) += _state_reset_status.posD_change; }