From e6e27e694ed4de19fdf4d8702d1e1587d39b18a2 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Mon, 21 Mar 2022 14:23:26 -0400 Subject: [PATCH] ekf2: delete isYawResetAuthorized() --- src/modules/ekf2/EKF/ekf.h | 1 - src/modules/ekf2/EKF/mag_control.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/ekf2/EKF/ekf.h b/src/modules/ekf2/EKF/ekf.h index 1d631f0120..40eec16fe8 100644 --- a/src/modules/ekf2/EKF/ekf.h +++ b/src/modules/ekf2/EKF/ekf.h @@ -851,7 +851,6 @@ private: float getTerrainVPos() const { return isTerrainEstimateValid() ? _terrain_vpos : _last_on_ground_posD; } void runOnGroundYawReset(); - bool isYawResetAuthorized() const { return !_is_yaw_fusion_inhibited; } bool canResetMagHeading() const; void runInAirYawReset(const Vector3f &mag); diff --git a/src/modules/ekf2/EKF/mag_control.cpp b/src/modules/ekf2/EKF/mag_control.cpp index fcae2a4dc4..2edb1ebc59 100644 --- a/src/modules/ekf2/EKF/mag_control.cpp +++ b/src/modules/ekf2/EKF/mag_control.cpp @@ -155,7 +155,7 @@ void Ekf::checkHaglYawResetReq() void Ekf::runOnGroundYawReset() { - if (_mag_yaw_reset_req && isYawResetAuthorized()) { + if (_mag_yaw_reset_req && !_is_yaw_fusion_inhibited) { const bool has_realigned_yaw = canResetMagHeading() ? resetMagHeading() : false; if (has_realigned_yaw) { @@ -180,7 +180,7 @@ bool Ekf::canResetMagHeading() const void Ekf::runInAirYawReset(const Vector3f &mag_sample) { - if (_mag_yaw_reset_req && isYawResetAuthorized()) { + if (_mag_yaw_reset_req && !_is_yaw_fusion_inhibited) { bool has_realigned_yaw = false; if (_control_status.flags.gps && _control_status.flags.fixed_wing) {