PPL API Reference |
|
---|
Public Member Functions | |
Construction | |
Coordinator (Robot *const _r) | |
Coordinator (Robot *const _r, XMLNode &_node) | |
virtual | ~Coordinator () |
virtual std::unique_ptr< Agent > | Clone (Robot *const _r) const |
Agent Interface | |
virtual void | Initialize () override |
Call PMPL to create a path for the agent to follow. More... | |
void | InitializePlanningComponents () |
virtual void | Step (const double _dt) override |
Follow the roadmap. More... | |
virtual void | Uninitialize () override |
Clean up. More... | |
Coordinator Interface | |
void | ArbitrateCollision () |
void | CheckFinished () |
Agent Properties | |
Robot * | GetRobot () const noexcept |
Get the robot object to which this agent belongs. | |
virtual bool | IsChild () const noexcept |
Is this agent a child of some group/aggregate? | |
Task Management | |
virtual void | SetTask (const std::shared_ptr< MPTask > _task) |
std::shared_ptr< MPTask > | GetTask () const noexcept |
Get the task that the agent is currently working on. | |
virtual void | ResetStartConstraint () |
Simulation Interface | |
size_t | MinimumSteps () const |
std::vector< Agent * > | ProximityCheck (const double _distance) const |
Agent Control | |
void | Halt () |
void | PauseAgent (const size_t _steps) |
Accessors | |
const std::string & | GetCapability () const noexcept |
Get the type of agent. | |
Static Public Member Functions | |
Construction | |
static std::unique_ptr< Agent > | Factory (Robot *const _r, XMLNode &_node) |
Public Types | |
Motion Planning Types | |
typedef RoadmapGraph< CfgType, WeightType > | RoadmapType |
typedef RoadmapType::vertex_descriptor | VID |
typedef std::vector< VID >::const_iterator | VIDIterator |
Protected Member Functions | |
void | Localize () |
Instruct the agent to enqueue a command for gathering sensor readings. | |
bool | IsLocalizing () const noexcept |
Is the agent waiting on sensor data? | |
Cfg | EstimateState () |
Estimate the state of the robot from the last localization data. | |
bool | ContinueLastControls () |
virtual void | ExecuteControls (const ControlSet &_c, const size_t _steps) |
virtual void | ExecuteControlsSimulation (const ControlSet &_c, const size_t _steps) |
virtual void | ExecuteControlsHardware (const ControlSet &_c, const size_t _steps) |
Protected Attributes | |
Internal State | |
MPLibrary * | m_library {nullptr} |
The shared-roadmap planning library. | |
TMPLibrary * | m_tmpLibrary {nullptr} |
The task and motion planning library. | |
MPSolution * | m_solution {nullptr} |
The shared-roadmap solution. | |
std::vector< std::string > | m_memberLabels |
Labels for the group members. | |
std::vector< ChildAgent * > | m_childAgents |
All robots in the group. | |
std::string | m_dmLabel |
The regular distance metric for finding nearest agents/chargers. | |
double | m_currentTime {0.0} |
Current time in the simulator. | |
std::vector< size_t > | m_simulatorGraphIDs |
List of simulator visualization graph ids. | |
std::shared_ptr< Plan > | m_plan {nullptr} |
size_t | m_numRandTasks |
bool | m_runSimulator {true} |
bool | m_runDummies |
Internal State | |
Robot *const | m_robot |
The robot that this agent controls. | |
bool | m_initialized {false} |
Is the agent initialized? | |
std::shared_ptr< MPTask > | m_task |
The task this agent is working on. | |
ControlSet | m_currentControls |
The current control set. | |
size_t | m_stepsRemaining {0} |
Steps remaining on current controls. | |
bool | m_debug {true} |
Toggle debug messages. | |
std::string | m_capability |
Specifies the type of agent for heterogenous multiagent teams. More... | |
std::unique_ptr< StepFunction > | m_stepFunction |
Accessors | |
std::unordered_map< std::shared_ptr< MPTask >, std::vector< Cfg > > | m_interactionPathsDelivering |
std::unordered_map< std::shared_ptr< MPTask >, std::vector< Cfg > > | m_interactionPathsReceiving |
double | GetCurrentTime () |
TMPLibrary * | GetTMPLibrary () |
void | SetRoadmapGraph (RoadmapGraph< Cfg, DefaultWeight< Cfg > > *_graph) |
std::vector< std::string > | GetMemberLabels () |
std::vector< ChildAgent * > | GetChildAgents () |
This agent represents the task hand-off behavior presented in the thesis Titled:
A Task Hand-Off Framework for Multi-Robot Systems by Saurabh Mishra
A portion of this work was also presented in: Mishra, Saurabh, Samuel Rodriguez, Marco Morales, and Nancy M. Amato. "Battery-constrained coverage." In Automation Science and Engineering (CASE), 2016 IEEE International Conference on, pp. 695-700. IEEE, 2016.
This agent represents a coordinator and does not correspond to a physical robot. Its job is to coordinate the children and hold shared data structures for their use. It has a robot pointer purely for the purpose of building the shared roadmap.
@WARNING This object currently only supports homogeneous robot teams, and assumes a shared roadmap model.
None of the above information is accurate. Will and James wrote a bunch of new stuff that may or (more likely) may not work.
Coordinator::Coordinator | ( | Robot *const | _r | ) |
Create an agent group with some robot as the coordinator.
_r | The coordinator robot. |
Create a copy of this agent for another robot. This is provided so that we can copy an agent without knowing its type.
_r | The robot which this cloned agent will reason for. |
Implements Agent.
|
overridevirtual |
Call PMPL to create a path for the agent to follow.
Implements Agent.
|
overridevirtual |
Follow the roadmap.
Implements Agent.
|
overridevirtual |
Clean up.
Implements Agent.
void Coordinator::ArbitrateCollision | ( | ) |
Decide what to do when some group of agents are facing a potential collision. Send a command to each agent in this group to resolve the potential collision.
double Coordinator::GetCurrentTime | ( | ) |
Gets the current time of the simulation.
Create a dynamically-allocated agent from an XML node.
_r | The robot which this agent will reason for. |
_node | The XML node to parse. |
|
virtualinherited |
Set the task for this agent.
_task | The new task for this agent. Should be owned by the MPProblem. |
Reimplemented in PlanningAgent.
|
virtualinherited |
Resets the start constraint of the current task to the robot's current position.
|
inherited |
Find the smallest time interval which is an integer multiple of the problem time resolution and larger than the hardware time (if any).
|
inherited |
Check for proximity to other robots and return those that lie within some threshold. @WARNING This checks the distance between the robots' reference points; it does not indicate the minimum distance between their hulls.
_distance | The distance threshold. |
|
inherited |
Stop the robot in simulation (places 0s in all 6 velocity dofs). @WARNING Arbitrarily setting the velocity does not respect the robot's dynamics. It is suitable for debugging and freezing a scenario upon completion, but it is not physically realistic.
|
inherited |
Orders the agent to stop itself at its current position. It will ask the controller to choose actions which stay as close as possible to the current position.
_steps | The number of steps to stop for. |
|
protectedinherited |
Continue executing the last controls if time remains.
|
protectedvirtualinherited |
Execute a set of controls on the simulated robot, and additionally on the hardware if present.
_c | The controls to execute. |
_steps | The number of time steps to execute the control. |
|
protectedvirtualinherited |
Execute a set of controls on the simulated robot.
_c | The controls to execute. |
|
protectedvirtualinherited |
Execute a set of controls on the hardware if present.
_c | The controls to execute. |
_steps | The number of time steps to execute the control. |
|
protectedinherited |
Specifies the type of agent for heterogenous multiagent teams.
Step function to define agent behaviors.