tailsitter, tiltrotor:

- use the transition trust when waiting for TECS to kick in
after transition
This commit is contained in:
tumbili
2016-02-18 18:55:56 +01:00
committed by Lorenz Meier
parent 0ccf0ce747
commit 4c61b05ef3
5 changed files with 43 additions and 20 deletions
+10 -2
View File
@@ -292,8 +292,6 @@ void Tiltrotor::update_transition_state()
{
if (!_flag_was_in_trans_mode) {
// save desired heading for transition and last thrust value
_yaw_transition = _v_att->yaw;
_throttle_transition = _actuators_mc_in->control[actuator_controls_s::INDEX_THROTTLE];
_flag_was_in_trans_mode = true;
}
@@ -326,6 +324,8 @@ void Tiltrotor::update_transition_state()
_mc_yaw_weight = 0.0f;
}
_thrust_transition = _mc_virtual_att_sp->thrust;
} else if (_vtol_schedule.flight_mode == TRANSITION_FRONT_P2) {
// the plane is ready to go into fixed wing mode, tilt the rotors forward completely
_tilt_control = _params_tiltrotor.tilt_transition +
@@ -333,6 +333,8 @@ void Tiltrotor::update_transition_state()
&_vtol_schedule.transition_start) / (_params_tiltrotor.front_trans_dur_p2 * 1000000.0f);
_mc_roll_weight = 0.0f;
_thrust_transition = _mc_virtual_att_sp->thrust;
} else if (_vtol_schedule.flight_mode == TRANSITION_BACK) {
if (_rear_motors != IDLE) {
set_rear_motor_state(IDLE);
@@ -364,6 +366,12 @@ void Tiltrotor::update_transition_state()
memcpy(_v_att_sp, _mc_virtual_att_sp, sizeof(vehicle_attitude_setpoint_s));
}
void Tiltrotor::waiting_on_tecs()
{
// keep multicopter thrust until we get data from TECS
_v_att_sp->thrust = _thrust_transition;
}
/**
* Write data to actuator output topic.
*/