FlightTasks: add getter method for constraints

This commit is contained in:
Dennis Mannhart
2018-07-20 09:26:18 +02:00
committed by Lorenz Meier
parent 63871bb4a5
commit 51d4c1f305
2 changed files with 16 additions and 0 deletions
+10
View File
@@ -25,6 +25,16 @@ const vehicle_local_position_setpoint_s FlightTasks::getPositionSetpoint()
}
}
const vehicle_constraints_s FlightTasks::getConstraints()
{
if (isAnyTaskActive()) {
return _current_task->getConstraints();
} else {
return FlightTask::empty_constraints;
}
}
int FlightTasks::switchTask(FlightTaskIndex new_task_index)
{
/* switch to the running task, nothing to do */
+6
View File
@@ -93,6 +93,12 @@ public:
*/
const vehicle_local_position_setpoint_s getPositionSetpoint();
/**
* Get task dependent constraints
* @return setpoint constraints that has to be respected by the position controller
*/
const vehicle_constraints_s getConstraints();
/**
* Switch to the next task in the available list (for testing)
* @return true on success, false on error