Plane: allow max auto pitch in hand launch takeoffs

This commit is contained in:
Hwurzburg 2021-03-21 09:44:34 -05:00 committed by Andrew Tridgell
parent 526065a6a4
commit 0eb5369543
1 changed files with 5 additions and 5 deletions

View File

@ -165,13 +165,13 @@ void Plane::takeoff_calc_pitch(void)
nav_pitch_cd = takeoff_pitch_min_cd; nav_pitch_cd = takeoff_pitch_min_cd;
} }
} else { } else {
if (is_positive(g.takeoff_throttle_min_speed) || is_positive(g.takeoff_throttle_min_accel)) { if (g.takeoff_rotate_speed > 0) {
// Doing hand launch so need at least 5 deg pitch to prevent initial height loss
nav_pitch_cd = MAX(auto_state.takeoff_pitch_cd, 500);
} else {
// Rise off ground takeoff so delay rotation until ground speed indicates adequate airspeed // Rise off ground takeoff so delay rotation until ground speed indicates adequate airspeed
nav_pitch_cd = ((gps.ground_speed()*100) / (float)aparm.airspeed_cruise_cm) * auto_state.takeoff_pitch_cd; nav_pitch_cd = ((gps.ground_speed()*100) / (float)aparm.airspeed_cruise_cm) * auto_state.takeoff_pitch_cd;
nav_pitch_cd = constrain_int32(nav_pitch_cd, 500, auto_state.takeoff_pitch_cd); nav_pitch_cd = constrain_int32(nav_pitch_cd, 500, auto_state.takeoff_pitch_cd);
} else {
// Doing hand or catapult launch so need at least 5 deg pitch to prevent initial height loss
nav_pitch_cd = MAX(auto_state.takeoff_pitch_cd, 500);
} }
} }