mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 14:13:33 +08:00
FlightTasks: add getter method for constraints
This commit is contained in:
committed by
Lorenz Meier
parent
63871bb4a5
commit
51d4c1f305
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user