Skip to content
Snippets Groups Projects
Commit 50724bce authored by Roman's avatar Roman Committed by Lorenz Meier
Browse files

mc_pos_control: support VTOL transitions again


Signed-off-by: default avatarRoman <bapstroman@gmail.com>
parent fea309b6
No related branches found
No related tags found
No related merge requests found
......@@ -813,6 +813,27 @@ MulticopterPositionControl::start_flight_task()
bool task_failure = false;
int prev_failure_count = _task_failure_count;
if (!_vehicle_status.is_rotary_wing) {
_flight_tasks.switchTask(FlightTaskIndex::None);
return;
}
if (_vehicle_status.in_transition_mode) {
int error = _flight_tasks.switchTask(FlightTaskIndex::Transition);
if (error != 0) {
PX4_WARN("Follow-Me activation failed with error: %s", _flight_tasks.errorToString(error));
task_failure = true;
_task_failure_count++;
} else {
// we want to be in this mode, reset the failure count
_task_failure_count = 0;
}
return;
}
// offboard
if (_vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_OFFBOARD
&& (_control_mode.flag_control_altitude_enabled ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment