mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-04 14:28:52 +08:00
Add Altitude Cruise mode
-add new NAVIGATION_STATE_ALTITUDE_VOYAGER -this mode does require manual control to enter -but you can disable the manual control loss failsafe to continue flying in case of manual control loss -for MC: in throttle and yaw are controlled like in Altitude mode, the tilt is controlled via integrated rate input (similar to Acro, but with tilt limit) Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -249,6 +249,17 @@ void FlightModeManager::start_flight_task()
|
||||
matching_task_running = matching_task_running && !task_failure;
|
||||
}
|
||||
|
||||
// Altitude cruise
|
||||
if (_vehicle_status_sub.get().nav_state == vehicle_status_s::NAVIGATION_STATE_ALTITUDE_CRUISE) {
|
||||
found_some_task = true;
|
||||
FlightTaskError error = FlightTaskError::NoError;
|
||||
|
||||
error = switchTask(FlightTaskIndex::AltitudeCruise);
|
||||
|
||||
task_failure = (error != FlightTaskError::NoError);
|
||||
matching_task_running = matching_task_running && !task_failure;
|
||||
}
|
||||
|
||||
// Emergency descend
|
||||
if (nav_state_descend || task_failure) {
|
||||
found_some_task = true;
|
||||
|
||||
Reference in New Issue
Block a user