diff --git a/src/modules/vtol_att_control/tailsitter.cpp b/src/modules/vtol_att_control/tailsitter.cpp index 692a256690..97b7f6066c 100644 --- a/src/modules/vtol_att_control/tailsitter.cpp +++ b/src/modules/vtol_att_control/tailsitter.cpp @@ -42,7 +42,7 @@ #include "tailsitter.h" #include "vtol_att_control_main.h" -#define ARSP_YAW_CTRL_DISABLE 7.0f // airspeed at which we stop controlling yaw during a front transition +#define ARSP_YAW_CTRL_DISABLE 4.0f // airspeed at which we stop controlling yaw during a front transition #define THROTTLE_TRANSITION_MAX 0.25f // maximum added thrust above last value in transition #define PITCH_TRANSITION_FRONT_P1 -1.1f // pitch angle to switch to TRANSITION_P2 #define PITCH_TRANSITION_FRONT_P2 -1.2f // pitch angle to switch to FW @@ -236,7 +236,9 @@ void Tailsitter::update_transition_state() if (!_flag_was_in_trans_mode) { // save desired heading for transition and last thrust value _yaw_transition = _v_att_sp->yaw_body; - _pitch_transition_start = _v_att_sp->pitch_body; + //transition should start from current attitude instead of current setpoint + matrix::Eulerf euler = matrix::Quatf(_v_att->q); + _pitch_transition_start = euler.theta(); _thrust_transition_start = _v_att_sp->thrust; _flag_was_in_trans_mode = true; } @@ -495,7 +497,7 @@ void Tailsitter::fill_actuator_outputs() // NOTE: There is no mistake in the line below, multicopter yaw axis is controlled by elevon roll actuation! _actuators_out_1->control[actuator_controls_s::INDEX_ROLL] = -_actuators_fw_in->control[actuator_controls_s::INDEX_ROLL] - * (1 - _mc_roll_weight); + * (1 - _mc_yaw_weight); _actuators_out_1->control[actuator_controls_s::INDEX_PITCH] = _actuators_mc_in->control[actuator_controls_s::INDEX_PITCH] * _mc_pitch_weight; // **LATER** + (_actuators_fw_in->control[actuator_controls_s::INDEX_PITCH] + _params->fw_pitch_trim) *(1 - _mc_pitch_weight);