From cbac0e8b8c997a225f0efd0b05fb94701c8aac9b Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Wed, 18 May 2022 19:10:40 +0200 Subject: [PATCH] tailsitter: use differential thrust to control pitch and roll in FW Signed-off-by: Silvan Fuhrer --- src/modules/vtol_att_control/tailsitter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/vtol_att_control/tailsitter.cpp b/src/modules/vtol_att_control/tailsitter.cpp index 954737b833..4d677a26b0 100644 --- a/src/modules/vtol_att_control/tailsitter.cpp +++ b/src/modules/vtol_att_control/tailsitter.cpp @@ -146,6 +146,7 @@ void Tailsitter::update_vtol_state() if (transition_to_fw) { _vtol_schedule.flight_mode = vtol_mode::FW_MODE; + printf("transition to FW completed\n"); } // check front transition timeout @@ -341,6 +342,12 @@ void Tailsitter::fill_actuator_outputs() _torque_setpoint_0->xyz[0] = fw_in[actuator_controls_s::INDEX_YAW] * _param_vt_fw_difthr_sc.get() ; } + mc_out[actuator_controls_s::INDEX_PITCH] = fw_in[actuator_controls_s::INDEX_PITCH]; + _torque_setpoint_0->xyz[1] = fw_in[actuator_controls_s::INDEX_PITCH]; + + mc_out[actuator_controls_s::INDEX_YAW] = -fw_in[actuator_controls_s::INDEX_ROLL]; + _torque_setpoint_0->xyz[2] = fw_in[actuator_controls_s::INDEX_ROLL]; + } else { _torque_setpoint_0->xyz[0] = mc_in[actuator_controls_s::INDEX_ROLL]; _torque_setpoint_0->xyz[1] = mc_in[actuator_controls_s::INDEX_PITCH];