mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-23 14:47:44 +08:00
mc_pos_control: fix task activation failure for Transition
This commit is contained in:
@@ -848,6 +848,7 @@ MulticopterPositionControl::start_flight_task()
|
||||
bool should_disable_task = true;
|
||||
int prev_failure_count = _task_failure_count;
|
||||
|
||||
// Do not run any flight task for VTOLs in fixed-wing mode
|
||||
if (!_vehicle_status.is_rotary_wing) {
|
||||
_flight_tasks.switchTask(FlightTaskIndex::None);
|
||||
return;
|
||||
@@ -858,7 +859,9 @@ MulticopterPositionControl::start_flight_task()
|
||||
int error = _flight_tasks.switchTask(FlightTaskIndex::Transition);
|
||||
|
||||
if (error != 0) {
|
||||
PX4_WARN("Follow-Me activation failed with error: %s", _flight_tasks.errorToString(error));
|
||||
if (prev_failure_count == 0) {
|
||||
PX4_WARN("Transition activation failed with error: %s", _flight_tasks.errorToString(error));
|
||||
}
|
||||
task_failure = true;
|
||||
_task_failure_count++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user