Browse Source

ekf2: delete isStrongMagneticDisturbance()

main
Daniel Agar 3 years ago
parent
commit
a7f573e150
  1. 1
      src/modules/ekf2/EKF/ekf.h
  2. 5
      src/modules/ekf2/EKF/mag_control.cpp

1
src/modules/ekf2/EKF/ekf.h

@ -864,7 +864,6 @@ private: @@ -864,7 +864,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);

5
src/modules/ekf2/EKF/mag_control.cpp

@ -175,7 +175,7 @@ void Ekf::runOnGroundYawReset() @@ -175,7 +175,7 @@ void Ekf::runOnGroundYawReset()
bool Ekf::canResetMagHeading() const
{
return !isStrongMagneticDisturbance() && (_params.mag_fusion_type != MagFuseType::NONE);
return !_control_status.flags.mag_field_disturbed && (_params.mag_fusion_type != MagFuseType::NONE);
}
void Ekf::runInAirYawReset(const Vector3f &mag_sample)
@ -299,8 +299,7 @@ bool Ekf::shouldInhibitMag() const @@ -299,8 +299,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)

Loading…
Cancel
Save