mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 02:23:34 +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;
|
bool should_disable_task = true;
|
||||||
int prev_failure_count = _task_failure_count;
|
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) {
|
if (!_vehicle_status.is_rotary_wing) {
|
||||||
_flight_tasks.switchTask(FlightTaskIndex::None);
|
_flight_tasks.switchTask(FlightTaskIndex::None);
|
||||||
return;
|
return;
|
||||||
@@ -858,7 +859,9 @@ MulticopterPositionControl::start_flight_task()
|
|||||||
int error = _flight_tasks.switchTask(FlightTaskIndex::Transition);
|
int error = _flight_tasks.switchTask(FlightTaskIndex::Transition);
|
||||||
|
|
||||||
if (error != 0) {
|
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 = true;
|
||||||
_task_failure_count++;
|
_task_failure_count++;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user