mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-06 16:49:51 +08:00
vtol tailsitter attitude control (#7841)
* revise pitch transition start and actuator_out_1 in transition * update with new matrix math library
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user