From ab1c880aadcee048dc3a29d9792bfdc9fcf77a9a Mon Sep 17 00:00:00 2001 From: Balduin Date: Wed, 5 Nov 2025 09:55:49 +0100 Subject: [PATCH] pusher_assist: keep pitch setpoint VT_PITCH_MIN (#25871) * pusher_assist: keep pitch setpoint VT_PITCH_MIN resetting the pitch setpoint to zero made little sense, because we lose the forward thrust component of the hover motors, while the pusher throttle was calculated to be applied in addition to the hover forward component * pusher assist: change default min pitches to 0 To make for a smoother transition for users who don't care much about pitch when pusher-assisting and were fine with it (mostly) being at zero --- src/modules/vtol_att_control/vtol_att_control_params.c | 4 ++-- src/modules/vtol_att_control/vtol_type.cpp | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/modules/vtol_att_control/vtol_att_control_params.c b/src/modules/vtol_att_control/vtol_att_control_params.c index 4b9452d3b6..af664bd632 100644 --- a/src/modules/vtol_att_control/vtol_att_control_params.c +++ b/src/modules/vtol_att_control/vtol_att_control_params.c @@ -365,7 +365,7 @@ PARAM_DEFINE_FLOAT(VT_B_DEC_I, 0.1f); * @decimal 1 * @group VTOL Attitude Control */ -PARAM_DEFINE_FLOAT(VT_PITCH_MIN, -5.0f); +PARAM_DEFINE_FLOAT(VT_PITCH_MIN, 0.0f); /** * Minimum pitch angle during hover landing. @@ -380,7 +380,7 @@ PARAM_DEFINE_FLOAT(VT_PITCH_MIN, -5.0f); * @decimal 1 * @group VTOL Attitude Control */ -PARAM_DEFINE_FLOAT(VT_LND_PITCH_MIN, -5.0f); +PARAM_DEFINE_FLOAT(VT_LND_PITCH_MIN, 0.0f); /** * Spoiler setting while landing (hover) diff --git a/src/modules/vtol_att_control/vtol_type.cpp b/src/modules/vtol_att_control/vtol_type.cpp index def70ece07..8195df5f8b 100644 --- a/src/modules/vtol_att_control/vtol_type.cpp +++ b/src/modules/vtol_att_control/vtol_type.cpp @@ -515,12 +515,8 @@ float VtolType::pusher_assist() // limit forward actuation to [0, 0.9] forward_thrust = math::constrain(forward_thrust, 0.0f, 0.9f); - // Set the pitch to 0 if the pitch limit is negative (pitch down), but allow a positive (pitch up) pitch. - // This can be used for tiltrotor to make them hover with a positive angle of attack - const float pitch_new = pitch_setpoint_min > 0.f ? pitch_setpoint_min : 0.f; - // create corrected desired body z axis in heading frame - const Dcmf R_tmp = Eulerf(roll_new, pitch_new, 0.0f); + const Dcmf R_tmp = Eulerf(roll_new, pitch_setpoint_min, 0.0f); Vector3f tilt_new(R_tmp(0, 2), R_tmp(1, 2), R_tmp(2, 2)); // rotate the vector into a new frame which is rotated in z by the desired heading