From 460a0df850c247006d2d9ecb7bc2f5a5787f0664 Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Mon, 20 Dec 2021 14:47:01 +0100 Subject: [PATCH] tiltrotor: fill out thrust_setpoint[0] also in hover, based on tilt and hover thrust In the tiltrotor case, beside an F_z thrust setpoint also a F_x setpoint must be passed to the allocator as the matrix has non-zero thrust-x effectiveness when tilts are applied. Signed-off-by: Silvan Fuhrer --- src/modules/vtol_att_control/tiltrotor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/vtol_att_control/tiltrotor.cpp b/src/modules/vtol_att_control/tiltrotor.cpp index d1278c7454..04dccd533c 100644 --- a/src/modules/vtol_att_control/tiltrotor.cpp +++ b/src/modules/vtol_att_control/tiltrotor.cpp @@ -513,6 +513,7 @@ void Tiltrotor::fill_actuator_outputs() mc_out[actuator_controls_s::INDEX_THROTTLE] = mc_in[actuator_controls_s::INDEX_THROTTLE] * _mc_throttle_weight; _thrust_setpoint_0->xyz[2] = -mc_in[actuator_controls_s::INDEX_THROTTLE] * _mc_throttle_weight; + _thrust_setpoint_0->xyz[0] = -_thrust_setpoint_0->xyz[2] * sinf(_tilt_control * M_PI_2_F); } // Fixed wing output