mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-20 12:59:05 +08:00
make failsafe handling consistent over all VTOL types
This commit is contained in:
parent
38e46ff341
commit
df41c99b61
@ -80,7 +80,16 @@ void Tailsitter::update_vtol_state()
|
||||
|
||||
float pitch = Eulerf(Quatf(_v_att->q)).theta();
|
||||
|
||||
if (!_attc->is_fixed_wing_requested()) {
|
||||
if (_vtol_vehicle_status->vtol_transition_failsafe) {
|
||||
// Failsafe event, switch to MC mode immediately
|
||||
_vtol_schedule.flight_mode = vtol_mode::MC_MODE;
|
||||
|
||||
//reset failsafe when FW is no longer requested
|
||||
if (!_attc->is_fixed_wing_requested()) {
|
||||
_vtol_vehicle_status->vtol_transition_failsafe = false;
|
||||
}
|
||||
|
||||
} else if (!_attc->is_fixed_wing_requested()) {
|
||||
|
||||
switch (_vtol_schedule.flight_mode) { // user switchig to MC mode
|
||||
case vtol_mode::MC_MODE:
|
||||
|
||||
@ -100,7 +100,16 @@ void Tiltrotor::update_vtol_state()
|
||||
* forward completely. For the backtransition the motors simply rotate back.
|
||||
*/
|
||||
|
||||
if (!_attc->is_fixed_wing_requested()) {
|
||||
if (_vtol_vehicle_status->vtol_transition_failsafe) {
|
||||
// Failsafe event, switch to MC mode immediately
|
||||
_vtol_schedule.flight_mode = vtol_mode::MC_MODE;
|
||||
|
||||
//reset failsafe when FW is no longer requested
|
||||
if (!_attc->is_fixed_wing_requested()) {
|
||||
_vtol_vehicle_status->vtol_transition_failsafe = false;
|
||||
}
|
||||
|
||||
} else if (!_attc->is_fixed_wing_requested()) {
|
||||
|
||||
// plane is in multicopter mode
|
||||
switch (_vtol_schedule.flight_mode) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user