FlightModeManager: avoid internal flight task running concurrently with external mode

This commit is contained in:
Matthias Grob 2023-07-13 19:20:44 +02:00 committed by Beat Küng
parent a72f2517ea
commit 0dcecf0666
1 changed files with 3 additions and 1 deletions

View File

@ -137,7 +137,9 @@ void FlightModeManager::updateParams()
void FlightModeManager::start_flight_task()
{
// Do not run any flight task for VTOLs in fixed-wing mode
if (_vehicle_status_sub.get().vehicle_type == vehicle_status_s::VEHICLE_TYPE_FIXED_WING) {
if ((_vehicle_status_sub.get().vehicle_type == vehicle_status_s::VEHICLE_TYPE_FIXED_WING)
|| ((_vehicle_status_sub.get().nav_state >= vehicle_status_s::NAVIGATION_STATE_EXTERNAL1)
&& (_vehicle_status_sub.get().nav_state <= vehicle_status_s::NAVIGATION_STATE_EXTERNAL8))) {
switchTask(FlightTaskIndex::None);
return;
}