Plane: apply the takeoff throttle slew limit to quadplanes

this applies the limit when we are in a fwd transition, both in AUTO
modes and stabilized modes
This commit is contained in:
Andrew Tridgell 2021-10-09 20:28:16 +11:00
parent e5efc52324
commit faba02a3f5
1 changed files with 11 additions and 0 deletions

View File

@ -43,6 +43,17 @@ void Plane::throttle_slew_limit(SRV_Channel::Aux_servo_function_t func)
slewrate = landing.get_throttle_slewrate(); slewrate = landing.get_throttle_slewrate();
} }
} }
if (g.takeoff_throttle_slewrate != 0 &&
(flight_stage == AP_Vehicle::FixedWing::FLIGHT_TAKEOFF ||
flight_stage == AP_Vehicle::FixedWing::FLIGHT_VTOL)) {
// for VTOL we use takeoff slewrate, which helps with transition
slewrate = g.takeoff_throttle_slewrate;
}
#if HAL_QUADPLANE_ENABLED
if (g.takeoff_throttle_slewrate != 0 && quadplane.in_transition()) {
slewrate = g.takeoff_throttle_slewrate;
}
#endif
// if slew limit rate is set to zero then do not slew limit // if slew limit rate is set to zero then do not slew limit
if (slewrate) { if (slewrate) {
SRV_Channels::limit_slew_rate(func, slewrate, G_Dt); SRV_Channels::limit_slew_rate(func, slewrate, G_Dt);