From 8643a8b4b3d0f48654e55c1d40f2f2e86a9aae16 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 84cf335db0..f7c27fa578 100644 --- a/src/modules/ekf2/EKF/ekf.h +++ b/src/modules/ekf2/EKF/ekf.h @@ -845,7 +845,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 364f7c379c..ebcaabb7fb 100644 --- a/src/modules/ekf2/EKF/mag_control.cpp +++ b/src/modules/ekf2/EKF/mag_control.cpp @@ -169,7 +169,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) { @@ -194,7 +194,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) {