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
This commit is contained in:
Balduin
2026-01-14 13:59:45 +01:00
parent 80c8e42de3
commit df6e432f71
@@ -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);