From 36596694095e3e4417192fbab10ad8d869525ddd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 3 Mar 2022 14:25:32 +1100 Subject: [PATCH] Plane: cope with high angle error in airbrake state if we are flying too far off the target vector then exit airbrake state. This prevents flying for a long distance away from the landing point in airbrake mode --- ArduPlane/quadplane.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ArduPlane/quadplane.cpp b/ArduPlane/quadplane.cpp index bbf09c362c..dc52d1d842 100644 --- a/ArduPlane/quadplane.cpp +++ b/ArduPlane/quadplane.cpp @@ -2337,6 +2337,7 @@ void QuadPlane::vtol_position_controller(void) if (poscontrol.get_state() == QPOS_AIRBRAKE && poscontrol.time_since_state_start_ms() > min_airbrake_ms && (aspeed < aspeed_threshold || + fabsf(degrees(closing_vel.angle(desired_closing_vel))) > 60 || closing_speed > MAX(desired_closing_speed*1.2, desired_closing_speed+2) || labs(plane.ahrs.roll_sensor - plane.nav_roll_cd) > attitude_error_threshold_cd || labs(plane.ahrs.pitch_sensor - plane.nav_pitch_cd) > attitude_error_threshold_cd)) {