mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-09 15:08:52 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user