diff --git a/EKF/ekf.h b/EKF/ekf.h index 7556759cc9..7b67ca00ff 100644 --- a/EKF/ekf.h +++ b/EKF/ekf.h @@ -380,7 +380,7 @@ private: bool _mag_decl_cov_reset{false}; ///< true after the fuseDeclination() function has been used to modify the earth field covariances after a magnetic field reset event. bool _synthetic_mag_z_active{false}; ///< true if we are generating synthetic magnetometer Z measurements - bool _yaw_use_inhibit{false}; ///< true when yaw sensor use is being inhibited + bool _is_yaw_fusion_inhibited{false}; ///< true when yaw sensor use is being inhibited SquareMatrix24f P; ///< state covariance matrix diff --git a/EKF/ekf_helper.cpp b/EKF/ekf_helper.cpp index 6ab5373e66..d93588f357 100644 --- a/EKF/ekf_helper.cpp +++ b/EKF/ekf_helper.cpp @@ -518,7 +518,7 @@ bool Ekf::resetMagHeading(const Vector3f &mag_init, bool increase_yaw_var, bool yaw_new_variance = sq(fmaxf(_params.mag_heading_noise, 1.0e-2f)); } - } else if (_params.mag_fusion_type == MAG_FUSE_TYPE_INDOOR && _yaw_use_inhibit) { + } else if (_params.mag_fusion_type == MAG_FUSE_TYPE_INDOOR && _is_yaw_fusion_inhibited) { // we are operating temporarily without knowing the earth frame yaw angle return true; diff --git a/EKF/mag_control.cpp b/EKF/mag_control.cpp index b6230768b3..43027d318e 100644 --- a/EKF/mag_control.cpp +++ b/EKF/mag_control.cpp @@ -52,7 +52,7 @@ void Ekf::controlMagFusion() if (_params.mag_fusion_type == MAG_FUSE_TYPE_NONE) { if (noOtherYawAidingThanMag()) { - _yaw_use_inhibit = true; + _is_yaw_fusion_inhibited = true; fuseHeading(); } return; @@ -156,7 +156,7 @@ void Ekf::runOnGroundYawReset() bool Ekf::isYawResetAuthorized() const { - return !_yaw_use_inhibit; + return !_is_yaw_fusion_inhibited; } bool Ekf::canResetMagHeading() const @@ -268,8 +268,8 @@ void Ekf::checkMagDeclRequired() void Ekf::checkMagInhibition() { - _yaw_use_inhibit = shouldInhibitMag(); - if (!_yaw_use_inhibit) { + _is_yaw_fusion_inhibited = shouldInhibitMag(); + if (!_is_yaw_fusion_inhibited) { _mag_use_not_inhibit_us = _imu_sample_delayed.time_us; } diff --git a/EKF/mag_fusion.cpp b/EKF/mag_fusion.cpp index 32224d7060..9ca549ca49 100644 --- a/EKF/mag_fusion.cpp +++ b/EKF/mag_fusion.cpp @@ -784,7 +784,7 @@ void Ekf::fuseHeading() // handle special case where yaw measurement is unavailable bool fuse_zero_innov = false; - if (_yaw_use_inhibit) { + if (_is_yaw_fusion_inhibited) { // The yaw measurement cannot be trusted but we need to fuse something to prevent a badly // conditioned covariance matrix developing over time. if (!_control_status.flags.vehicle_at_rest) { @@ -851,7 +851,7 @@ void Ekf::fuseHeading() // handle special case where yaw measurement is unavailable bool fuse_zero_innov = false; - if (_yaw_use_inhibit) { + if (_is_yaw_fusion_inhibited) { // The yaw measurement cannot be trusted but we need to fuse something to prevent a badly // conditioned covariance matrix developing over time. if (!_control_status.flags.vehicle_at_rest) {