mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-14 16:01:36 +08:00
FlightModeManager: avoid internal flight task running concurrently with external mode
This commit is contained in:
@@ -137,7 +137,9 @@ void FlightModeManager::updateParams()
|
|||||||
void FlightModeManager::start_flight_task()
|
void FlightModeManager::start_flight_task()
|
||||||
{
|
{
|
||||||
// Do not run any flight task for VTOLs in fixed-wing mode
|
// 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);
|
switchTask(FlightTaskIndex::None);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user