mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-16 17:50:35 +08:00
FlightTasks: Introduce the empty setpoint to reset the setpoint for every loop iteration and return it in case of no task running
This commit is contained in:
@@ -15,6 +15,16 @@ bool FlightTasks::update()
|
||||
return false;
|
||||
}
|
||||
|
||||
const vehicle_local_position_setpoint_s &FlightTasks::getPositionSetpoint()
|
||||
{
|
||||
if (isAnyTaskActive()) {
|
||||
return _current_task->getPositionSetpoint();
|
||||
|
||||
} else {
|
||||
return FlightTask::empty_setpoint;
|
||||
}
|
||||
}
|
||||
|
||||
int FlightTasks::switchTask(int task_number)
|
||||
{
|
||||
/* switch to the running task, nothing to do */
|
||||
|
||||
Reference in New Issue
Block a user