Browse Source

Plane: fix bug causing wrong thr max and slew to be used during takeoff

Fix bug introduced in 3d34e061fe which causes flight_stage to be
FLIGHT_NORMAL instead of FLIGHT_TAKEOFF during takeoff stage causing
itself at least the use of THR_MAX and THR_SLEWRATE instead of
respectively TKOFF_THR_MAX and TKOFF_THR_SLEW and perhaps has other
consequences.

Could be really bad if TKOFF_THR_MAX needs to be much higher
than THR_MAX or if TKOFF_THR_SLEW needs to be much lower than
THR_SLEWRATE and cause a crash on takeoff due to low airspeed or torque
roll
gps-1.3.1
Michel Pastor 3 years ago committed by Andrew Tridgell
parent
commit
685d34d615
  1. 1
      ArduPlane/ArduPlane.cpp

1
ArduPlane/ArduPlane.cpp

@ -572,6 +572,7 @@ void Plane::update_flight_stage(void) @@ -572,6 +572,7 @@ void Plane::update_flight_stage(void)
#endif
if (auto_state.takeoff_complete == false) {
set_flight_stage(AP_Vehicle::FixedWing::FLIGHT_TAKEOFF);
return;
} else if (mission.get_current_nav_cmd().id == MAV_CMD_NAV_LAND) {
if (landing.is_commanded_go_around() || flight_stage == AP_Vehicle::FixedWing::FLIGHT_ABORT_LAND) {
// abort mode is sticky, it must complete while executing NAV_LAND

Loading…
Cancel
Save