mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-07 17:35:22 +08:00
Tiltrotor: gradually reduce roll control with time or airspeed instead of simply switching it off
This commit is contained in:
committed by
Daniel Agar
parent
f2db8d0106
commit
1de7636fad
@@ -339,14 +339,16 @@ void Tiltrotor::update_transition_state()
|
||||
}
|
||||
|
||||
if (use_airspeed && _airspeed->indicated_airspeed_m_s >= _params_tiltrotor.airspeed_blend_start) {
|
||||
_mc_roll_weight = 0.0f;
|
||||
_mc_roll_weight = 1.0f - (_airspeed->indicated_airspeed_m_s - _params_tiltrotor.airspeed_blend_start) /
|
||||
(_params_tiltrotor.airspeed_trans - _params_tiltrotor.airspeed_blend_start);
|
||||
}
|
||||
|
||||
// without airspeed wait until half of open-loop time has passed
|
||||
// without airspeed do timed weight changes
|
||||
if (!use_airspeed
|
||||
&& (float)hrt_elapsed_time(&_vtol_schedule.transition_start) > (_params->front_trans_time_openloop * 1e6f) / 2) {
|
||||
_mc_roll_weight = 0.0f;
|
||||
_mc_yaw_weight = 0.0f;
|
||||
&& (float)hrt_elapsed_time(&_vtol_schedule.transition_start) > (_params->front_trans_time_min * 1e6f)) {
|
||||
_mc_roll_weight = 1.0f - ((float)hrt_elapsed_time(&_vtol_schedule.transition_start) - _params->front_trans_time_min *
|
||||
1e6f) / (_params->front_trans_time_openloop * 1e6f - _params->front_trans_time_min * 1e6f);
|
||||
_mc_yaw_weight = _mc_roll_weight;
|
||||
}
|
||||
|
||||
_thrust_transition = _mc_virtual_att_sp->thrust;
|
||||
|
||||
Reference in New Issue
Block a user