forked from Archive/PX4-Autopilot
VTOL: reset quad-chute failsafe flag when user triggeres a new transition to FW
This failsafe flag is currently used for not allowing to re-transition to FW, as well as disabling pusher assist in hover. Till now it was only possible to reset it with a commanded transition to MC, which many ground station interfaces didn't allow as the system, after a quad-chute, already was in MC mode. Hereby it is changed to reset when a new transition to FW is triggered (either via RC switch or MAVLink command). It is the users responsibility to assess the situation after a quad-chute happened to try to transition to FW again, manually proceed/land the vehicle in MC, or let it finish the defined behavior after a quad-chute. Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
parent
8a680a3153
commit
2d4be68e00
|
@ -78,11 +78,6 @@ void Standard::update_vtol_state()
|
|||
_pusher_throttle = 0.0f;
|
||||
_reverse_output = 0.0f;
|
||||
|
||||
//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()) {
|
||||
|
||||
// the transition to fw mode switch is off
|
||||
|
|
|
@ -75,11 +75,6 @@ void Tailsitter::update_vtol_state()
|
|||
// Failsafe event, switch to MC mode immediately
|
||||
_vtol_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_mode) { // user switchig to MC mode
|
||||
|
|
|
@ -75,11 +75,6 @@ void Tiltrotor::update_vtol_state()
|
|||
// Failsafe event, switch to MC mode immediately
|
||||
_vtol_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
|
||||
|
|
|
@ -133,6 +133,12 @@ void VtolAttitudeControl::action_request_poll()
|
|||
case action_request_s::ACTION_VTOL_TRANSITION_TO_FIXEDWING:
|
||||
_transition_command = vtol_vehicle_status_s::VEHICLE_VTOL_STATE_FW;
|
||||
_immediate_transition = false;
|
||||
|
||||
// reset vtol_transition_failsafe flag when a new transition to FW is triggered
|
||||
if (_transition_command == vtol_vehicle_status_s::VEHICLE_VTOL_STATE_FW) {
|
||||
_vtol_vehicle_status.vtol_transition_failsafe = false;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -162,6 +168,11 @@ void VtolAttitudeControl::vehicle_cmd_poll()
|
|||
} else {
|
||||
_transition_command = transition_command_param1;
|
||||
_immediate_transition = (PX4_ISFINITE(vehicle_command.param2)) ? int(vehicle_command.param2 + 0.5f) : false;
|
||||
|
||||
// reset vtol_transition_failsafe flag when a new transition to FW is triggered
|
||||
if (_transition_command == vtol_vehicle_status_s::VEHICLE_VTOL_STATE_FW) {
|
||||
_vtol_vehicle_status.vtol_transition_failsafe = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (vehicle_command.from_external) {
|
||||
|
|
Loading…
Reference in New Issue