diff --git a/ArduPlane/ArduPlane.pde b/ArduPlane/ArduPlane.pde index ad9bc1627f..4e66fa0cd9 100644 --- a/ArduPlane/ArduPlane.pde +++ b/ArduPlane/ArduPlane.pde @@ -1091,12 +1091,15 @@ static void update_current_flight_mode(void) nav_pitch_cd = constrain(nav_pitch_cd, 500, takeoff_pitch_cd); } - // don't use a pitch/roll integrators during takeoff if we are - // below minimum speed #if APM_CONTROL == DISABLED - if (airspeed.use() && airspeed.get_airspeed() < g.flybywire_airspeed_min) { - g.pidServoPitch.reset_I(); - g.pidServoRoll.reset_I(); + float aspeed; + if (ahrs.airspeed_estimate(&aspeed)) { + // don't use a pitch/roll integrators during takeoff if we are + // below minimum speed + if (aspeed < g.flybywire_airspeed_min) { + g.pidServoPitch.reset_I(); + g.pidServoRoll.reset_I(); + } } #endif diff --git a/ArduPlane/Attitude.pde b/ArduPlane/Attitude.pde index 5c290d973f..e2c13b00f2 100644 --- a/ArduPlane/Attitude.pde +++ b/ArduPlane/Attitude.pde @@ -220,9 +220,7 @@ static void calc_nav_roll() // Use airspeed_cruise as an analogue for airspeed if we don't have airspeed. float speed; - if(airspeed.use()) { - speed = airspeed.get_airspeed(); - } else { + if (!ahrs.airspeed_estimate(&speed)) { speed = g.airspeed_cruise_cm*0.01; // Floor the speed so that the user can't enter a bad value