mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-18 17:49:06 +08:00
Navigator/Commander: make GPS failsafe consitent: switch to Descend also for FW and VTOL
- remove GPS failsafe mode - for VTOL: transition to hover in Descend (unless NAV_FORCE_VT is not set) Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
parent
b77487d69c
commit
f02786d112
@ -215,26 +215,6 @@ void FlightModeManager::start_flight_task()
|
||||
_task_failure_count = 0;
|
||||
}
|
||||
|
||||
} else if (_vehicle_control_mode_sub.get().flag_control_auto_enabled) {
|
||||
// Auto related maneuvers
|
||||
should_disable_task = false;
|
||||
FlightTaskError error = FlightTaskError::NoError;
|
||||
|
||||
error = switchTask(FlightTaskIndex::AutoLineSmoothVel);
|
||||
|
||||
if (error != FlightTaskError::NoError) {
|
||||
if (prev_failure_count == 0) {
|
||||
PX4_WARN("Auto activation failed with error: %s", errorToString(error));
|
||||
}
|
||||
|
||||
task_failure = true;
|
||||
_task_failure_count++;
|
||||
|
||||
} else {
|
||||
// we want to be in this mode, reset the failure count
|
||||
_task_failure_count = 0;
|
||||
}
|
||||
|
||||
} else if (_vehicle_status_sub.get().nav_state == vehicle_status_s::NAVIGATION_STATE_DESCEND) {
|
||||
|
||||
// Emergency descend
|
||||
@ -256,6 +236,26 @@ void FlightModeManager::start_flight_task()
|
||||
_task_failure_count = 0;
|
||||
}
|
||||
|
||||
} else if (_vehicle_control_mode_sub.get().flag_control_auto_enabled) {
|
||||
// Auto related maneuvers
|
||||
should_disable_task = false;
|
||||
FlightTaskError error = FlightTaskError::NoError;
|
||||
|
||||
error = switchTask(FlightTaskIndex::AutoLineSmoothVel);
|
||||
|
||||
if (error != FlightTaskError::NoError) {
|
||||
if (prev_failure_count == 0) {
|
||||
PX4_WARN("Auto activation failed with error: %s", errorToString(error));
|
||||
}
|
||||
|
||||
task_failure = true;
|
||||
_task_failure_count++;
|
||||
|
||||
} else {
|
||||
// we want to be in this mode, reset the failure count
|
||||
_task_failure_count = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// manual position control
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user