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:
Matthias Grob
2017-12-15 01:59:55 +01:00
committed by Beat Küng
parent c500221894
commit d9c7e6321f
5 changed files with 20 additions and 4 deletions
+10
View File
@@ -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 */