PPL API Reference
Overview Core Algorithm Abstractions Utilities Parallel Methods
Modules Class Hierarchy Classes Functions
Todo List Bug List Dead Code
List of all members | Protected Member Functions
Coordinator Class Reference

Public Member Functions

Construction
 Coordinator (Robot *const _r)
 
 Coordinator (Robot *const _r, XMLNode &_node)
 
virtual ~Coordinator ()
 
virtual std::unique_ptr< AgentClone (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
RobotGetRobot () 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< MPTaskGetTask () 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< AgentFactory (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.
 
TMPLibrarym_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< MPTaskm_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< StepFunctionm_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 ()
 
TMPLibraryGetTMPLibrary ()
 
void SetRoadmapGraph (RoadmapGraph< Cfg, DefaultWeight< Cfg > > *_graph)
 
std::vector< std::string > GetMemberLabels ()
 
std::vector< ChildAgent * > GetChildAgents ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Coordinator()

Coordinator::Coordinator ( Robot *const  _r)

Create an agent group with some robot as the coordinator.

Parameters
_rThe coordinator robot.

Member Function Documentation

◆ Clone()

std::unique_ptr< Agent > Coordinator::Clone ( Robot *const  _r) const
virtual

Create a copy of this agent for another robot. This is provided so that we can copy an agent without knowing its type.

Parameters
_rThe robot which this cloned agent will reason for.
Returns
A copy of the agent.

Implements Agent.

◆ Initialize()

void Coordinator::Initialize ( )
overridevirtual

Call PMPL to create a path for the agent to follow.

Implements Agent.

◆ Step()

void Coordinator::Step ( const double  _dt)
overridevirtual

Follow the roadmap.

Implements Agent.

◆ Uninitialize()

void Coordinator::Uninitialize ( )
overridevirtual

Clean up.

Implements Agent.

◆ ArbitrateCollision()

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.

◆ GetCurrentTime()

double Coordinator::GetCurrentTime ( )

Gets the current time of the simulation.

Returns
m_currentTime

◆ Factory()

std::unique_ptr< Agent > Agent::Factory ( Robot *const  _r,
XMLNode _node 
)
staticinherited

Create a dynamically-allocated agent from an XML node.

Parameters
_rThe robot which this agent will reason for.
_nodeThe XML node to parse.
Returns
An agent of the type specified by _node.

◆ SetTask()

void Agent::SetTask ( const std::shared_ptr< MPTask _task)
virtualinherited

Set the task for this agent.

Parameters
_taskThe new task for this agent. Should be owned by the MPProblem.

Reimplemented in PlanningAgent.

◆ ResetStartConstraint()

void Agent::ResetStartConstraint ( )
virtualinherited

Resets the start constraint of the current task to the robot's current position.

◆ MinimumSteps()

size_t Agent::MinimumSteps ( ) const
inherited

Find the smallest time interval which is an integer multiple of the problem time resolution and larger than the hardware time (if any).

◆ ProximityCheck()

std::vector< Agent * > Agent::ProximityCheck ( const double  _distance) const
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.

Parameters
_distanceThe distance threshold.
Returns
The vector of Robots within the threshold.

◆ Halt()

void Agent::Halt ( )
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.

◆ PauseAgent()

void Agent::PauseAgent ( const size_t  _steps)
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.

Parameters
_stepsThe number of steps to stop for.

◆ ContinueLastControls()

bool Agent::ContinueLastControls ( )
protectedinherited

Continue executing the last controls if time remains.

Returns
True if time is left on the last controls, false if the agent is finished and needs new controls.

◆ ExecuteControls()

void Agent::ExecuteControls ( const ControlSet &  _c,
const size_t  _steps 
)
protectedvirtualinherited

Execute a set of controls on the simulated robot, and additionally on the hardware if present.

Parameters
_cThe controls to execute.
_stepsThe number of time steps to execute the control.

◆ ExecuteControlsSimulation()

void Agent::ExecuteControlsSimulation ( const ControlSet &  _c,
const size_t  _steps 
)
protectedvirtualinherited

Execute a set of controls on the simulated robot.

Parameters
_cThe controls to execute.

◆ ExecuteControlsHardware()

void Agent::ExecuteControlsHardware ( const ControlSet &  _c,
const size_t  _steps 
)
protectedvirtualinherited

Execute a set of controls on the hardware if present.

Parameters
_cThe controls to execute.
_stepsThe number of time steps to execute the control.

Member Data Documentation

◆ m_capability

std::string Agent::m_capability
protectedinherited

Specifies the type of agent for heterogenous multiagent teams.

Step function to define agent behaviors.


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