Plane: adjust throttle mix for auto landing

use mix-max during landing approach and initial descent, use min in
land final. As discussed with Leonard
This commit is contained in:
Andrew Tridgell 2022-01-29 15:35:26 +11:00
parent 8e64d1cbd7
commit 8b16b5ca94

View File

@ -3608,7 +3608,17 @@ void QuadPlane::update_throttle_mix(void)
// check for requested descent
bool descent_not_demanded = pos_control->get_vel_desired_cms().z >= 0.0f;
if (large_angle_request || large_angle_error || accel_moving || descent_not_demanded) {
bool use_mix_max = large_angle_request || large_angle_error || accel_moving || descent_not_demanded;
/*
special case for auto landing, we want a high degree of
attitude control until LAND_FINAL
*/
if (in_vtol_land_sequence()) {
use_mix_max = !in_vtol_land_final();
}
if (use_mix_max) {
attitude_control->set_throttle_mix_max(1.0);
} else {
attitude_control->set_throttle_mix_min();