Parasol Planning Library (PPL)
MPTask Class Referencefinal

#include <MPTask.h>

Public Types

Local Types
typedef std::vector< std::unique_ptr< Constraint > > ConstraintSet
 A set of constraints. More...
 

Public Member Functions

Construction
 MPTask (Robot *const _robot)
 
 MPTask (MPProblem *const _problem, XMLNode &_node, Environment *_env=nullptr)
 
 MPTask (const MPTask &_other)
 Copy. More...
 
 MPTask (MPTask &&_other)
 Move. More...
 
 ~MPTask ()
 
Assignment
MPTaskoperator= (const MPTask &_other)
 Copy. More...
 
MPTaskoperator= (MPTask &&_other)
 Move. More...
 
Property Accessors
RobotGetRobot () const noexcept
 Get the robot associated with this task. More...
 
void SetRobot (Robot *const _r)
 
const std::string & GetLabel () const noexcept
 Get the semantic label for this task. More...
 
void SetLabel (const std::string &_label) noexcept
 
nonstd::status & GetStatus () noexcept
 Get the status object for this task. More...
 
const nonstd::status & GetStatus () const noexcept
 
bool Empty () const noexcept
 
size_t GetNumGoals () const noexcept
 Get the number of goals in this task. More...
 
Constraint Accessors

The task will take ownership of any added constraints and delete them when necessary.

void SetStartConstraint (std::unique_ptr< Constraint > &&_c)
 
void AddPathConstraint (std::unique_ptr< Constraint > &&_c)
 
void AddGoalConstraint (std::unique_ptr< Constraint > &&_c)
 
const ConstraintGetStartConstraint () const noexcept
 Get start constraint. More...
 
const ConstraintSetGetPathConstraints () const noexcept
 Get all path constraints. More...
 
const ConstraintSetGetGoalConstraints () const noexcept
 Get all goal constraints. More...
 
void ClearGoalConstraints ()
 Remove all goal constraints. More...
 
void SetCapability (const std::string &_capability)
 
const std::string & GetCapability () const noexcept
 
Time Accessors

Store and fetch estimated times for beginning and completing this task.

void SetEstimatedStartTime (const double _time) noexcept
 
void SetEstimatedCompletionTime (const double _time) noexcept
 
double GetEstimatedStartTime () const noexcept
 Get the estimated start time for the task. More...
 
double GetEstimatedCompletionTime () const noexcept
 Get the estimated completion time for the task. More...
 
void SetReleaseWindow (const std::pair< double, double > _release) noexcept
 Set release window. More...
 
void SetDeadlineWindow (const std::pair< double, double > _deadline) noexcept
 Set deadline window. More...
 
std::pair< double, double > GetReleaseWindow () const noexcept
 Get the release window. More...
 
std::pair< double, double > GetDeadlineWindow () const noexcept
 Get the deadline window. More...
 
Constraint Evaluation
bool EvaluateCapability (const Robot *const _r) const
 
bool EvaluateStartConstraints (const Cfg &_cfg) const
 
bool EvaluatePathConstraints (const Cfg &_cfg) const
 
bool EvaluateGoalConstraints (const Cfg &_cfg) const
 
bool EvaluateGoalConstraints (const Cfg &_cfg, const size_t _index) const
 

Detailed Description

Describes a motion task for a single robot in terms of start/goal conditions and constraints on allowable trajectories.

Tasks are defined by a robot and three sets of constraints:

Todo:
We should remove the capability here and redefine it as a constraint (since the constraints should fully define the task). The fact that a capability is or is not required should generally be discerned from the problem, while a capability constraint would more likely represent a deliberate restriction that is not strictly required (perhaps to express an operational preference). We will also eventually encounter cases where multiple capabilities are required to satsify a task.
Todo:
Support the use of path constraints in the library code, which currently doesn't care about this.
Examples
MPLibrary_UseCase.cpp.

Member Typedef Documentation

◆ ConstraintSet

typedef std::vector<std::unique_ptr<Constraint> > MPTask::ConstraintSet

A set of constraints.

Constructor & Destructor Documentation

◆ MPTask() [1/4]

MPTask::MPTask ( Robot *const  _robot)
explicit

Create an empty task for a given robot.

Parameters
_robotThe robot assigned to this task.

◆ MPTask() [2/4]

MPTask::MPTask ( MPProblem *const  _problem,
XMLNode _node,
Environment _env = nullptr 
)
explicit

Parse the set of task constraints described in an XML node.

Parameters
_problemThe MPProblem for this task.
_nodeThe XML node to parse.

◆ MPTask() [3/4]

MPTask::MPTask ( const MPTask _other)

Copy.

◆ MPTask() [4/4]

MPTask::MPTask ( MPTask &&  _other)
default

Move.

◆ ~MPTask()

MPTask::~MPTask ( )
default

Member Function Documentation

◆ AddGoalConstraint()

void MPTask::AddGoalConstraint ( std::unique_ptr< Constraint > &&  _c)

Add goal constraint to task

Parameters
_cGoal constraint to add to task

◆ AddPathConstraint()

void MPTask::AddPathConstraint ( std::unique_ptr< Constraint > &&  _c)

Add path constraint to task

Parameters
_cPath constraint to add to task

◆ ClearGoalConstraints()

void MPTask::ClearGoalConstraints ( )

Remove all goal constraints.

◆ Empty()

bool MPTask::Empty ( ) const
noexcept

A task is considered to be 'empty' if it has neither start nor goal constraints.

Returns
True if task is 'empty'

◆ EvaluateCapability()

bool MPTask::EvaluateCapability ( const Robot *const  _r) const

Evaluate whether a robot has the needed capability.

Parameters
_rThe robot to check.
Returns
True if _r meets any capability requirements.

◆ EvaluateGoalConstraints() [1/2]

bool MPTask::EvaluateGoalConstraints ( const Cfg _cfg) const

Check if a configuration satisfies the last goal constraints.

Parameters
_cfgThe configuration to check.
Returns
True if _cfg satisfies the last goal constraints.

◆ EvaluateGoalConstraints() [2/2]

bool MPTask::EvaluateGoalConstraints ( const Cfg _cfg,
const size_t  _index 
) const

Check if a configuration satisfies the constraints for a specific goal.

Parameters
_cfgThe configuration to check.
_indexThe goal index to check.
Returns
True if _cfg satisfies the last goal constraints.

◆ EvaluatePathConstraints()

bool MPTask::EvaluatePathConstraints ( const Cfg _cfg) const

Check if a configuration satisfies the start constraints.

Parameters
_cfgThe configuration to check.
Returns
True if _cfg satisfies all path constraints.

◆ EvaluateStartConstraints()

bool MPTask::EvaluateStartConstraints ( const Cfg _cfg) const

Check if a configuration satisfies the start constraints.

Parameters
_cfgThe configuration to check.
Returns
True if _cfg satisfies all start constraints.

◆ GetCapability()

const std::string & MPTask::GetCapability ( ) const
noexcept

Get the robot capability which is required to satisfy this task, if any.

Returns
The required capability for this task, or empty string if none.

◆ GetDeadlineWindow()

std::pair< double, double > MPTask::GetDeadlineWindow ( ) const
noexcept

Get the deadline window.

◆ GetEstimatedCompletionTime()

double MPTask::GetEstimatedCompletionTime ( ) const
noexcept

Get the estimated completion time for the task.

◆ GetEstimatedStartTime()

double MPTask::GetEstimatedStartTime ( ) const
noexcept

Get the estimated start time for the task.

◆ GetGoalConstraints()

const MPTask::ConstraintSet & MPTask::GetGoalConstraints ( ) const
noexcept

Get all goal constraints.

◆ GetLabel()

const std::string & MPTask::GetLabel ( ) const
noexcept

Get the semantic label for this task.

◆ GetNumGoals()

size_t MPTask::GetNumGoals ( ) const
noexcept

Get the number of goals in this task.

◆ GetPathConstraints()

const MPTask::ConstraintSet & MPTask::GetPathConstraints ( ) const
noexcept

Get all path constraints.

◆ GetReleaseWindow()

std::pair< double, double > MPTask::GetReleaseWindow ( ) const
noexcept

Get the release window.

◆ GetRobot()

Robot * MPTask::GetRobot ( ) const
noexcept

Get the robot associated with this task.

◆ GetStartConstraint()

const Constraint * MPTask::GetStartConstraint ( ) const
noexcept

Get start constraint.

◆ GetStatus() [1/2]

const nonstd::status & MPTask::GetStatus ( ) const
noexcept

◆ GetStatus() [2/2]

nonstd::status & MPTask::GetStatus ( )
noexcept

Get the status object for this task.

◆ operator=() [1/2]

MPTask & MPTask::operator= ( const MPTask _other)

Copy.

◆ operator=() [2/2]

MPTask & MPTask::operator= ( MPTask &&  _other)
default

Move.

◆ SetCapability()

void MPTask::SetCapability ( const std::string &  _capability)

Sets the capability required for this task.

Parameters
_capabilityThe capability required to complete this task.

◆ SetDeadlineWindow()

void MPTask::SetDeadlineWindow ( const std::pair< double, double >  _deadline)
noexcept

Set deadline window.

◆ SetEstimatedCompletionTime()

void MPTask::SetEstimatedCompletionTime ( const double  _time)
noexcept

Set the estimated completion time for the task

Parameters
_timeThe estimated completion time

◆ SetEstimatedStartTime()

void MPTask::SetEstimatedStartTime ( const double  _time)
noexcept

Set the estimated start time for the task

Parameters
_timeThe estimated start time

◆ SetLabel()

void MPTask::SetLabel ( const std::string &  _label)
noexcept

Set the semantic label for this task.

Parameters
_labelLabel to set

◆ SetReleaseWindow()

void MPTask::SetReleaseWindow ( const std::pair< double, double >  _release)
noexcept

Set release window.

◆ SetRobot()

void MPTask::SetRobot ( Robot *const  _r)

Re-assign this task to another robot.

Parameters
_rThe destination robot which will receive this assignment.

◆ SetStartConstraint()

void MPTask::SetStartConstraint ( std::unique_ptr< Constraint > &&  _c)

Set start constraint for task

Parameters
_cConstraint to set as start constraint

The documentation for this class was generated from the following files: