From df6e432f714d6c90993cbf9bd381e9a573cd9d89 Mon Sep 17 00:00:00 2001 From: Balduin Date: Tue, 9 Dec 2025 10:29:12 +0100 Subject: [PATCH] FixedWingModeManager: give idle throttle if landed - except in takeoff where that is nonsensical - the other control_auto* and the two control_manual* functions already have such logic --- .../fw_mode_manager/FixedWingModeManager.cpp | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/modules/fw_mode_manager/FixedWingModeManager.cpp b/src/modules/fw_mode_manager/FixedWingModeManager.cpp index 02cedcba97..d33f72c4e4 100644 --- a/src/modules/fw_mode_manager/FixedWingModeManager.cpp +++ b/src/modules/fw_mode_manager/FixedWingModeManager.cpp @@ -784,7 +784,10 @@ FixedWingModeManager::control_auto_position(const float control_interval, const float throttle_min = NAN; float throttle_max = NAN; - if (pos_sp_curr.gliding_enabled) { + if (_landed) { + throttle_max = _param_fw_thr_idle.get(); + + } else if (pos_sp_curr.gliding_enabled) { /* enable gliding with this waypoint */ throttle_min = 0.0; throttle_max = 0.0; @@ -844,7 +847,10 @@ FixedWingModeManager::control_auto_velocity(const float control_interval, const _longitudinal_ctrl_sp_pub.publish(fw_longitudinal_control_sp); - if (pos_sp_curr.gliding_enabled) { + if (_landed) { + _ctrl_configuration_handler.setThrottleMax(_param_fw_thr_idle.get()); + + } else if (pos_sp_curr.gliding_enabled) { _ctrl_configuration_handler.setThrottleMin(0.0f); _ctrl_configuration_handler.setThrottleMax(0.0f); _ctrl_configuration_handler.setSpeedWeight(2.0f); @@ -938,7 +944,10 @@ FixedWingModeManager::control_auto_loiter(const float control_interval, const Ve _longitudinal_ctrl_sp_pub.publish(fw_longitudinal_control_sp); - if (pos_sp_curr.gliding_enabled) { + if (_landed) { + _ctrl_configuration_handler.setThrottleMax(_param_fw_thr_idle.get()); + + } else if (pos_sp_curr.gliding_enabled) { _ctrl_configuration_handler.setThrottleMin(0.0f); _ctrl_configuration_handler.setThrottleMax(0.0f); _ctrl_configuration_handler.setSpeedWeight(2.0f); @@ -986,7 +995,10 @@ FixedWingModeManager::controlAutoFigureEight(const float control_interval, const _longitudinal_ctrl_sp_pub.publish(fw_longitudinal_control_sp); - if (pos_sp_curr.gliding_enabled) { + if (_landed) { + _ctrl_configuration_handler.setThrottleMax(_param_fw_thr_idle.get()); + + } else if (pos_sp_curr.gliding_enabled) { _ctrl_configuration_handler.setThrottleMin(0.0f); _ctrl_configuration_handler.setThrottleMax(0.0f); _ctrl_configuration_handler.setSpeedWeight(2.0f);