Browse Source

AP_Airspeed: Health: use reading from correct airspeed sensor

gps-1.3.1
Iampete1 3 years ago committed by Andrew Tridgell
parent
commit
ff2fdb65ef
  1. 5
      libraries/AP_Airspeed/AP_Airspeed_Health.cpp

5
libraries/AP_Airspeed/AP_Airspeed_Health.cpp

@ -28,8 +28,7 @@ void AP_Airspeed::check_sensor_ahrs_wind_max_failures(uint8_t i) @@ -28,8 +28,7 @@ void AP_Airspeed::check_sensor_ahrs_wind_max_failures(uint8_t i)
return;
}
const float aspeed = get_airspeed();
if (aspeed <= 0) {
if (state[i].airspeed <= 0) {
// invalid estimate
return;
}
@ -44,7 +43,7 @@ void AP_Airspeed::check_sensor_ahrs_wind_max_failures(uint8_t i) @@ -44,7 +43,7 @@ void AP_Airspeed::check_sensor_ahrs_wind_max_failures(uint8_t i)
}
return;
}
const float speed_diff = fabsf(aspeed-gps.ground_speed());
const float speed_diff = fabsf(state[i].airspeed-gps.ground_speed());
// update health_probability with LowPassFilter
if (speed_diff > _wind_max) {

Loading…
Cancel
Save