PPL API Reference |
|
---|
Public Member Functions | |
Construction | |
MPProblem () | |
Instantiate an empty MPProblem. | |
MPProblem (const std::string &_filename) | |
MPProblem (const MPProblem &_other) | |
Copy. | |
MPProblem (MPProblem &&_other)=delete | |
virtual | ~MPProblem () |
Assignment | |
MPProblem & | operator= (const MPProblem &_other) |
Copy. | |
MPProblem & | operator= (MPProblem &&_other)=delete |
XML File Parsing | |
const std::string & | GetXMLFilename () const |
Get the XML filename from which this object was parsed. | |
void | ReadXMLFile (const std::string &_filename) |
Environment Accessors | |
Environment * | GetEnvironment () |
Get the environment object. | |
void | SetEnvironment (std::unique_ptr< Environment > &&_e) |
Robot Accessors | |
size_t | NumRobots () const noexcept |
Get the number of robots in our problem. | |
Robot * | GetRobot (const size_t _index) const noexcept |
Robot * | GetRobot (const std::string &_label) const noexcept |
const std::vector< std::unique_ptr< Robot > > & | GetRobots () const noexcept |
Get all robots in this problem. | |
const std::vector< Robot * > | GetRobotsOfType (std::string _type) const noexcept |
size_t | NumRobotGroups () const noexcept |
RobotGroup * | GetRobotGroup (const size_t _index) const noexcept |
RobotGroup * | GetRobotGroup (const std::string &_label) const noexcept |
const std::vector< std::unique_ptr< RobotGroup > > & | GetRobotGroups () const noexcept |
Cfg | GetInitialCfg (Robot *_r) |
void | SetInitialCfg (Robot *_r, Cfg _cfg) |
Task Accessors | |
MPTask * | GetTask (std::string _label) |
std::vector< std::shared_ptr< MPTask > > | GetTasks (Robot *const _robot) const noexcept |
std::vector< std::shared_ptr< GroupTask > > | GetTasks (RobotGroup *const _group) const noexcept |
void | AddTask (std::unique_ptr< MPTask > &&_task) |
void | ReassignTask (MPTask *const _task, Robot *const _newOwner) |
void | AddDecomposition (Robot *_coordinator, std::unique_ptr< Decomposition > &&_decomp) |
const std::vector< std::unique_ptr< Decomposition > > & | GetDecompositions (Robot *_coordinator) |
const std::unordered_map< Robot *, std::vector< std::unique_ptr< Decomposition > > > & | GetDecompositions () |
Get map of robots to decompositions. | |
Dynamic Obstacle Accessors | |
const std::vector< DynamicObstacle > & | GetDynamicObstacles () const noexcept |
Get all of the dynamic obstacles in this problem. | |
void | AddDynamicObstacle (DynamicObstacle &&_obstacle) |
void | ClearDynamicObstacles () |
Remove all of the dynamic obstacles in this problem. | |
Debugging | |
virtual void | Print (std::ostream &_os) const |
File Path Accessors | |
const std::string & | GetBaseFilename () const |
Get the base filename for output files. | |
void | SetBaseFilename (const std::string &_s) |
std::string | GetPath (const std::string &_filename="") |
void | SetPath (const std::string &_filename) |
Handoff Template Accessors | |
std::vector< std::unique_ptr< InteractionInformation > > & | GetInteractionInformations () |
Protected Member Functions | |
Construction Helpers | |
void | ParseChild (XMLNode &_node) |
void | MakePointRobot () |
Create a pseudo-point robot. | |
Protected Attributes | |
Core Properties | |
std::unique_ptr< Environment > | m_environment |
The planning environment. | |
std::vector< std::unique_ptr< Robot > > | m_robots |
The robots in our problem. | |
std::vector< std::unique_ptr< RobotGroup > > | m_robotGroups |
Robot groups. | |
std::unique_ptr< Robot > | m_pointRobot |
A pseudo point-robot. | |
std::unordered_map< std::string, std::vector< Robot * > > | m_robotCapabilityMap |
Map of robot type to set of robots. | |
std::unordered_map< Robot *, Cfg > | m_initialCfgs |
Map of robot initial locations. | |
std::vector< DynamicObstacle > | m_dynamicObstacles |
The dynamic obstacles in our problem. | |
std::vector< std::unique_ptr< InteractionInformation > > | m_interactionInformations |
All handoff templates for a problem. | |
std::unordered_map< Robot *, std::list< std::shared_ptr< MPTask > > > | m_taskMap |
Map the tasks assigned to each robot. | |
std::unordered_map< RobotGroup *, std::list< std::shared_ptr< GroupTask > > > | m_groupTaskMap |
Map the group tasks assigned to each robot group. | |
std::unordered_map< std::string, MPTask * > | m_taskLabelMap |
Map task labels to tasks. | |
std::unordered_map< Robot *, std::vector< std::unique_ptr< Decomposition > > > | m_taskDecompositions |
Map robots to task decompositions. | |
Files | |
std::string | m_xmlFilename |
The XML file name. | |
std::string | m_baseFilename |
The base name for output files. | |
std::string | m_filePath |
The relative path for the problem XML. | |
Representation of a motion planning problem, including an environment, tasks, and robots.
|
explicit |
Instantiate an MPProblem from an XML file.
_filename | The name of the XML file. |
void MPProblem::ReadXMLFile | ( | const std::string & | _filename | ) |
Read an XML file.
_filename | The XML file name. |
void MPProblem::SetEnvironment | ( | std::unique_ptr< Environment > && | _e | ) |
Set the environment object.
_e | Environment to set to |
|
noexcept |
Get a specific robot by index.
_index | Index of robot to get |
|
noexcept |
Get a specific robot by label.
_label | Label of robot to get |
|
noexcept |
Get all robots of a specified type.
_type | Type of robots to retrieve |
|
noexcept |
Group versions: Get the number of robot groups in our problem.
|
noexcept |
Get a specific robot group by index.
_index | Index of robot group to retrieve |
|
noexcept |
Get a specific robot group by group's label.
_label | Label of robot group to retrieve |
|
noexcept |
Get all robot groups in this problem.
Get initial configuration of a robot
_r | Robot whose configuration to retrieve |
Get initial configuration of a robot
_r | Robot whose configuration to retrieve |
_cfg | Configuration to set for _r |
MPTask * MPProblem::GetTask | ( | std::string | _label | ) |
Get task by label
_label | Label of task to retrieve |
Get the unfinished tasks currently assigned to a given robot.
_robot | The robot to retrieve tasks for. |
|
noexcept |
Group overload Get the unfinished tasks currently assigned to a group of robots.
_group | The robot group to retrieve tasks for. |
void MPProblem::AddTask | ( | std::unique_ptr< MPTask > && | _task | ) |
Add a task to the problem. The assigned robot will be taken from the task object.
_task | The new task. |
Reassign a task to another robot.
_task | The task to reassign. |
_newOwner | The new robot assigned to _task. |
void MPProblem::AddDecomposition | ( | Robot * | _coordinator, |
std::unique_ptr< Decomposition > && | _decomp | ||
) |
Assign task decomposition to a robot
_coordinator | Robot to assign task to |
_decomp | The decomposition task to assign |
const std::vector< std::unique_ptr< Decomposition > > & MPProblem::GetDecompositions | ( | Robot * | _coordinator | ) |
Get set of decomposition tasks for given robot
_coordinator | Robot to return task decompositions for |
void MPProblem::AddDynamicObstacle | ( | DynamicObstacle && | _obstacle | ) |
Add dynamic obstacle to this problem
Dynamic | obstacle to add |
|
virtual |
Print the environment, robot, and task information.
_os | Stream to print to |
void MPProblem::SetBaseFilename | ( | const std::string & | _s | ) |
Set the base filename for output files.
_s | New base filename |
string MPProblem::GetPath | ( | const std::string & | _filename = "" | ) |
Get the base path for input files to a file name.
_filename | The filename to modify. |
void MPProblem::SetPath | ( | const std::string & | _filename | ) |
Set the base path for input files.
_fileName | File path to set |
std::vector< std::unique_ptr< InteractionInformation > > & MPProblem::GetInteractionInformations | ( | ) |
Return the list of handoff templates defined in the problem
|
protected |
Helper for parsing XML nodes of various types.
_node | The child node to be parsed. |