From 21a9f8e3a2751f05dee853493bdfcfb05f9e214f Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Sun, 10 Dec 2023 17:40:29 +0000 Subject: [PATCH] Plane: move landing servo override out of throttle control function --- ArduPlane/Plane.h | 2 +- ArduPlane/servos.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ArduPlane/Plane.h b/ArduPlane/Plane.h index 80e3cb8636..b40ab6a132 100644 --- a/ArduPlane/Plane.h +++ b/ArduPlane/Plane.h @@ -1091,7 +1091,7 @@ private: // servos.cpp void set_servos_idle(void); void set_servos(); - void set_servos_controlled(void); + void set_throttle(void); void set_takeoff_expected(void); void set_servos_old_elevons(void); void set_servos_flaps(void); diff --git a/ArduPlane/servos.cpp b/ArduPlane/servos.cpp index 6048aed804..51a28e1ee3 100644 --- a/ArduPlane/servos.cpp +++ b/ArduPlane/servos.cpp @@ -829,8 +829,13 @@ void Plane::set_servos(void) quadplane.update(); #endif + if (flight_stage == AP_FixedWing::FlightStage::LAND) { + // allow landing to override servos if it would like to + landing.override_servos(); + } + if (control_mode != &mode_manual) { - set_servos_controlled(); + set_throttle(); set_takeoff_expected(); }