ekf2: delete isStrongMagneticDisturbance()

This commit is contained in:
Daniel Agar
2022-03-21 14:24:24 -04:00
parent 8643a8b4b3
commit 9ee4bf9bf5
2 changed files with 2 additions and 4 deletions
-1
View File
@@ -858,7 +858,6 @@ private:
void checkMagInhibition();
bool shouldInhibitMag() const;
void checkMagFieldStrength(const Vector3f &mag);
bool isStrongMagneticDisturbance() const { return _control_status.flags.mag_field_disturbed; }
static bool isMeasuredMatchingExpected(float measured, float expected, float gate);
void runMagAndMagDeclFusions(const Vector3f &mag);
void run3DMagAndDeclFusions(const Vector3f &mag);
+2 -3
View File
@@ -189,7 +189,7 @@ void Ekf::runOnGroundYawReset()
bool Ekf::canResetMagHeading() const
{
return !isStrongMagneticDisturbance() && (_params.mag_fusion_type != MAG_FUSE_TYPE_NONE);
return !_control_status.flags.mag_field_disturbed && (_params.mag_fusion_type != MAG_FUSE_TYPE_NONE);
}
void Ekf::runInAirYawReset(const Vector3f &mag_sample)
@@ -313,8 +313,7 @@ bool Ekf::shouldInhibitMag() const
&& !_control_status.flags.ev_pos
&& !_control_status.flags.ev_vel;
return (user_selected && heading_not_required_for_navigation)
|| isStrongMagneticDisturbance();
return (user_selected && heading_not_required_for_navigation) || _control_status.flags.mag_field_disturbed;
}
void Ekf::checkMagFieldStrength(const Vector3f &mag_sample)