Browse Source

AP_AHRS: ensure AHRS never uses an unhealthy gyro

mission-4.1.18
Andrew Tridgell 6 years ago
parent
commit
5e1f9068a1
  1. 4
      libraries/AP_AHRS/AP_AHRS_NavEKF.cpp

4
libraries/AP_AHRS/AP_AHRS_NavEKF.cpp

@ -188,7 +188,7 @@ void AP_AHRS_NavEKF::update_EKF2(void) @@ -188,7 +188,7 @@ void AP_AHRS_NavEKF::update_EKF2(void)
// calculate corrected gyro estimate for get_gyro()
_gyro_estimate.zero();
if (primary_imu == -1) {
if (primary_imu == -1 || !_ins.get_gyro_health(primary_imu)) {
// the primary IMU is undefined so use an uncorrected default value from the INS library
_gyro_estimate = _ins.get_gyro();
} else {
@ -261,7 +261,7 @@ void AP_AHRS_NavEKF::update_EKF3(void) @@ -261,7 +261,7 @@ void AP_AHRS_NavEKF::update_EKF3(void)
// calculate corrected gyro estimate for get_gyro()
_gyro_estimate.zero();
if (primary_imu == -1) {
if (primary_imu == -1 || !_ins.get_gyro_health(primary_imu)) {
// the primary IMU is undefined so use an uncorrected default value from the INS library
_gyro_estimate = _ins.get_gyro();
} else {

Loading…
Cancel
Save