mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Tailsitter: add add transition timeout (abort transition after VT_TRANS_TMEOUT, Quadchute)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
parent
1a1bb2629d
commit
bdc57178d4
@ -130,6 +130,8 @@ void Tailsitter::update_vtol_state()
|
||||
|
||||
case vtol_mode::TRANSITION_FRONT_P1: {
|
||||
|
||||
const float time_since_trans_start = (float)(hrt_absolute_time() - _vtol_schedule.transition_start) * 1e-6f;
|
||||
|
||||
|
||||
const bool airspeed_triggers_transition = PX4_ISFINITE(_airspeed_validated->calibrated_airspeed_m_s)
|
||||
&& !_params->airspeed_disabled;
|
||||
@ -151,6 +153,14 @@ void Tailsitter::update_vtol_state()
|
||||
_vtol_schedule.flight_mode = vtol_mode::FW_MODE;
|
||||
}
|
||||
|
||||
// check front transition timeout
|
||||
if (_params->front_trans_timeout > FLT_EPSILON) {
|
||||
if (time_since_trans_start > _params->front_trans_timeout) {
|
||||
// transition timeout occured, abort transition
|
||||
_attc->quadchute(VtolAttitudeControl::QuadchuteReason::TransitionTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user