MulticopterPositionControl: don't switch out of Orbit task

when it got started via vehicle_command
This commit is contained in:
Matthias Grob
2020-11-30 14:05:21 +01:00
committed by Daniel Agar
parent 8f40558f41
commit de66616341

View File

@@ -478,7 +478,9 @@ void MulticopterPositionControl::start_flight_task()
}
// Switch to clean new task when mode switches e.g. to reset state when switching between auto modes
if (_last_vehicle_nav_state != _vehicle_status.nav_state) {
// exclude Orbit mode since the task is initiated in FlightTasks through the vehicle_command and we should not switch out
if (_last_vehicle_nav_state != _vehicle_status.nav_state
&& _vehicle_status.nav_state != vehicle_status_s::NAVIGATION_STATE_ORBIT) {
_flight_tasks.switchTask(FlightTaskIndex::None);
}