mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 08:53:38 +08:00
mc stabilized mode: move from mc_pos_control to mc_att_control
- better in terms of dependencies: - the position controller code depended on position topics for yaw - mc_pos_control does not have to be run for Stabilized mode - the code path is much simpler, and thus less error prone. This is especially important since Stabilized is often used as a fail-safe flight mode.
This commit is contained in:
@@ -1003,25 +1003,6 @@ MulticopterPositionControl::start_flight_task()
|
||||
}
|
||||
}
|
||||
|
||||
// manual stabilized control
|
||||
if (_vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_MANUAL
|
||||
|| _vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_STAB || task_failure) {
|
||||
should_disable_task = false;
|
||||
int error = _flight_tasks.switchTask(FlightTaskIndex::ManualStabilized);
|
||||
|
||||
if (error != 0) {
|
||||
if (prev_failure_count == 0) {
|
||||
PX4_WARN("Stabilized-Ctrl failed with error: %s", _flight_tasks.errorToString(error));
|
||||
}
|
||||
task_failure = true;
|
||||
_task_failure_count++;
|
||||
|
||||
} else {
|
||||
check_failure(task_failure, vehicle_status_s::NAVIGATION_STATE_STAB);
|
||||
task_failure = false;
|
||||
}
|
||||
}
|
||||
|
||||
// check task failure
|
||||
if (task_failure) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user