Parasol Planning Library (PPL)
Data Structures
MPLibrary Class Reference

#include <MPLibrary.h>

Collaboration diagram for MPLibrary:
Collaboration graph
[legend]

Data Structures

struct  Solver
 

Public Types

Motion Planning Types
typedef MPSolutionType MPSolution
 
typedef GenericStateGraph< Cfg, DefaultWeight< Cfg > > RoadmapType
 
typedef GroupRoadmap< GroupCfg< RoadmapType >, GroupLocalPlan< RoadmapType > > GroupRoadmapType
 
typedef size_t VID
 
typedef MPToolsType MPTools
 
typedef GoalTrackerType GoalTracker
 
Method Set Types
typedef MethodSet< DistanceMetricMethodDistanceMetricSet
 
typedef MethodSet< ValidityCheckerMethodValidityCheckerSet
 
typedef MethodSet< NeighborhoodFinderMethodNeighborhoodFinderSet
 
typedef MethodSet< SamplerMethodSamplerSet
 
typedef MethodSet< LocalPlannerMethodLocalPlannerSet
 
typedef MethodSet< ExtenderMethodExtenderSet
 
typedef MethodSet< PathModifierMethodPathModifierSet
 
typedef MethodSet< EdgeValidityCheckerMethodEdgeValidityCheckerSet
 
typedef MethodSet< ConnectorMethodConnectorSet
 
typedef MethodSet< MetricMethodMetricSet
 
typedef MethodSet< MapEvaluatorMethodMapEvaluatorSet
 
typedef MethodSet< MPStrategyMethodMPStrategySet
 
Method Pointer Types
typedef ValidityCheckerSet::MethodPointer ValidityCheckerPointer
 
typedef DistanceMetricSet::MethodPointer DistanceMetricPointer
 
typedef NeighborhoodFinderSet::MethodPointer NeighborhoodFinderPointer
 
typedef SamplerSet::MethodPointer SamplerPointer
 
typedef LocalPlannerSet::MethodPointer LocalPlannerPointer
 
typedef ExtenderSet::MethodPointer ExtenderPointer
 
typedef PathModifierSet::MethodPointer PathModifierPointer
 
typedef EdgeValidityCheckerSet::MethodPointer EdgeValidityCheckerPointer
 
typedef ConnectorSet::MethodPointer ConnectorPointer
 
typedef MetricSet::MethodPointer MetricPointer
 
typedef MapEvaluatorSet::MethodPointer MapEvaluatorPointer
 
typedef MPStrategySet::MethodPointer MPStrategyPointer
 

Public Member Functions

Construction
 MPLibrary ()
 
 MPLibrary (const std::string &_filename)
 
 MPLibrary (XMLNode &planningLibraryNode)
 
virtual ~MPLibrary ()
 
Configuration
void ReadXMLFile (const std::string &_filename)
 
void ProcessXML (XMLNode &node)
 
Distance Metric Accessors
DistanceMetricPointer GetDistanceMetric (const std::string &_l)
 
void AddDistanceMetric (DistanceMetricPointer _dm, const std::string &_l)
 
Validity Checker Accessors
ValidityCheckerPointer GetValidityChecker (const std::string &_l)
 
void AddValidityChecker (ValidityCheckerPointer _vc, const std::string &_l)
 
void ToggleValidity ()
 
Neighborhood Finder Accessors
NeighborhoodFinderPointer GetNeighborhoodFinder (const std::string &_l)
 
void AddNeighborhoodFinder (NeighborhoodFinderPointer _nf, const std::string &_l)
 
Sampler Accessors
const SamplerSet *const GetSamplers () const
 
SamplerPointer GetSampler (const std::string &_l)
 
void AddSampler (SamplerPointer _s, const std::string &_l)
 
Local Planner Accessors
LocalPlannerPointer GetLocalPlanner (const std::string &_l)
 
void AddLocalPlanner (LocalPlannerPointer _lp, const std::string &_l)
 
Extender Accessors
ExtenderPointer GetExtender (const std::string &_l)
 
void AddExtender (ExtenderPointer _mps, const std::string &_l)
 
Path Modifier Accessors
PathModifierPointer GetPathModifier (const std::string &_l)
 
void AddPathModifier (PathModifierPointer _ps, const std::string &_l)
 
Edge Validity Checker Accessors
EdgeValidityCheckerPointer GetEdgeValidityChecker (const std::string &_l)
 
void AddEdgeValidityChecker (EdgeValidityCheckerPointer _ps, const std::string &_l)
 
Connector Accessors
ConnectorPointer GetConnector (const std::string &_l)
 
void AddConnector (ConnectorPointer _c, const std::string &_l)
 
Metric Accessors
MetricPointer GetMetric (const std::string &_l)
 
void AddMetric (MetricPointer _m, const std::string &_l)
 
Map Evaluator Accessors
MapEvaluatorPointer GetMapEvaluator (const std::string &_l)
 
void AddMapEvaluator (MapEvaluatorPointer _me, const std::string &_l)
 
MPStrategy Accessors
const MPStrategySet *const GetMPStrategies () const
 
MPStrategyPointer GetMPStrategy (const std::string &_l)
 
void AddMPStrategy (MPStrategyPointer _mps, const std::string &_l)
 
MPTools Accessors
MPToolsGetMPTools ()
 
Input Accessors
MPProblemGetMPProblem () const noexcept
 
void SetMPProblem (MPProblem *const _problem) noexcept
 
MPTaskGetTask () const noexcept
 
void SetTask (MPTask *const _task) noexcept
 
GroupTaskGetGroupTask () const noexcept
 
void SetGroupTask (GroupTask *const _task) noexcept
 
const std::string & GetBaseFilename () const noexcept
 
void SetBaseFilename (const std::string &_s) noexcept
 
Solution Accessors
MPSolutionGetMPSolution () const noexcept
 
void SetMPSolution (MPSolution *_sol) noexcept
 
RoadmapTypeGetRoadmap (Robot *const _r=nullptr) const noexcept
 
GroupRoadmapTypeGetGroupRoadmap (RobotGroup *const _g=nullptr) const noexcept
 
RoadmapTypeGetBlockRoadmap (Robot *const _r=nullptr) const noexcept
 
PathGetPath (Robot *const _r=nullptr) const noexcept
 
GroupPathGetGroupPath (RobotGroup *const _g=nullptr) const noexcept
 
LocalObstacleMapGetLocalObstacleMap (Robot *const _r=nullptr) const noexcept
 
GoalTrackerGetGoalTracker () const noexcept
 
StatClassGetStatClass () const noexcept
 
Edge Reconstruction
std::vector< typename RoadmapType::VPReconstructEdge (RoadmapType *const _roadmap, const VID _source, const VID _target, const double _posRes, const double _oriRes)
 
std::vector< typename GroupRoadmapType::VPReconstructEdge (GroupRoadmapType *const _roadmap, const VID _source, const VID _target, const double _posRes, const double _oriRes)
 
template<typename AbstractRoadmapType >
std::vector< typename AbstractRoadmapType::VP > ReconstructEdge (AbstractRoadmapType *const _roadmap, const VID _source, const VID _target)
 
Execution Interface
void Halt ()
 
bool IsRunning () const noexcept
 Check to see if the strategy should continue. More...
 
void SetSeed () const noexcept
 Set the current seed to match the first solver node. More...
 
void SetSeed (const long _seed) const noexcept
 
void AddSolver (const std::string &_label, long _seed, const std::string &_baseFileName, bool _vizmoDebug=false)
 
std::vector< std::string > GetSolverLabels ()
 
void Solve (MPProblem *_problem, MPTask *_task, MPSolution *_solution)
 
void Solve (MPProblem *_problem, MPTask *_task)
 
void Solve (MPProblem *_problem, GroupTask *_task)
 Group overload: More...
 
void Solve (MPProblem *_problem, GroupTask *_task, MPSolution *_solution)
 
void Solve (MPProblem *_problem, MPTask *_task, MPSolution *_solution, const std::string &_label, const long _seed, const std::string &_baseFilename)
 
Debugging
void Print (std::ostream &_os) const
 Print each method set. More...
 

Protected Attributes

Method Sets

Method sets hold and offer access to the motion planning objects of the corresponding type.

DistanceMetricSetm_distanceMetrics {nullptr}
 
ValidityCheckerSetm_validityCheckers {nullptr}
 
NeighborhoodFinderSetm_neighborhoodFinders {nullptr}
 
SamplerSetm_samplers {nullptr}
 
LocalPlannerSetm_localPlanners {nullptr}
 
ExtenderSetm_extenders {nullptr}
 
PathModifierSetm_pathModifiers {nullptr}
 
EdgeValidityCheckerSetm_edgeValidityCheckers {nullptr}
 
ConnectorSetm_connectors {nullptr}
 
MetricSetm_metrics {nullptr}
 
MapEvaluatorSetm_mapEvaluators {nullptr}
 
MPStrategySetm_mpStrategies {nullptr}
 

Detailed Description

A collection of planning algorithms that can operate on a specific MPProblem and MPTask.

Member Typedef Documentation

◆ ConnectorPointer

◆ ConnectorSet

◆ DistanceMetricPointer

◆ DistanceMetricSet

◆ EdgeValidityCheckerPointer

◆ EdgeValidityCheckerSet

◆ ExtenderPointer

◆ ExtenderSet

◆ GoalTracker

◆ GroupRoadmapType

◆ LocalPlannerPointer

◆ LocalPlannerSet

◆ MapEvaluatorPointer

◆ MapEvaluatorSet

◆ MetricPointer

◆ MetricSet

◆ MPSolution

◆ MPStrategyPointer

◆ MPStrategySet

◆ MPTools

◆ NeighborhoodFinderPointer

◆ NeighborhoodFinderSet

◆ PathModifierPointer

◆ PathModifierSet

◆ RoadmapType

◆ SamplerPointer

◆ SamplerSet

◆ ValidityCheckerPointer

◆ ValidityCheckerSet

◆ VID

typedef size_t MPLibrary::VID

Constructor & Destructor Documentation

◆ MPLibrary() [1/3]

MPLibrary::MPLibrary ( )

◆ MPLibrary() [2/3]

MPLibrary::MPLibrary ( const std::string &  _filename)

◆ MPLibrary() [3/3]

MPLibrary::MPLibrary ( XMLNode planningLibraryNode)

◆ ~MPLibrary()

MPLibrary::~MPLibrary ( )
virtual

Member Function Documentation

◆ AddConnector()

void MPLibrary::AddConnector ( ConnectorPointer  _c,
const std::string &  _l 
)
inline

◆ AddDistanceMetric()

void MPLibrary::AddDistanceMetric ( DistanceMetricPointer  _dm,
const std::string &  _l 
)
inline

◆ AddEdgeValidityChecker()

void MPLibrary::AddEdgeValidityChecker ( EdgeValidityCheckerPointer  _ps,
const std::string &  _l 
)
inline

◆ AddExtender()

void MPLibrary::AddExtender ( ExtenderPointer  _mps,
const std::string &  _l 
)
inline

◆ AddLocalPlanner()

void MPLibrary::AddLocalPlanner ( LocalPlannerPointer  _lp,
const std::string &  _l 
)
inline

◆ AddMapEvaluator()

void MPLibrary::AddMapEvaluator ( MapEvaluatorPointer  _me,
const std::string &  _l 
)
inline

◆ AddMetric()

void MPLibrary::AddMetric ( MetricPointer  _m,
const std::string &  _l 
)
inline

◆ AddMPStrategy()

void MPLibrary::AddMPStrategy ( MPStrategyPointer  _mps,
const std::string &  _l 
)
inline

◆ AddNeighborhoodFinder()

void MPLibrary::AddNeighborhoodFinder ( NeighborhoodFinderPointer  _nf,
const std::string &  _l 
)
inline

◆ AddPathModifier()

void MPLibrary::AddPathModifier ( PathModifierPointer  _ps,
const std::string &  _l 
)
inline

◆ AddSampler()

void MPLibrary::AddSampler ( SamplerPointer  _s,
const std::string &  _l 
)
inline

◆ AddSolver()

void MPLibrary::AddSolver ( const std::string &  _label,
long  _seed,
const std::string &  _baseFileName,
bool  _vizmoDebug = false 
)
inline

Add an input set to this MPLibrary.

Parameters
_labelThe MPStrategy label to use.
_seedThe random seed to use.
_baseFileNameThe base name of the XML file to use.
_vizmoDebugEnable/disable vizmo debug.

◆ AddValidityChecker()

void MPLibrary::AddValidityChecker ( ValidityCheckerPointer  _vc,
const std::string &  _l 
)
inline

◆ GetBaseFilename()

const std::string & MPLibrary::GetBaseFilename ( ) const
noexcept

◆ GetBlockRoadmap()

MPLibrary::RoadmapType * MPLibrary::GetBlockRoadmap ( Robot *const  _r = nullptr) const
noexcept

◆ GetConnector()

ConnectorPointer MPLibrary::GetConnector ( const std::string &  _l)
inline

◆ GetDistanceMetric()

DistanceMetricPointer MPLibrary::GetDistanceMetric ( const std::string &  _l)
inline

◆ GetEdgeValidityChecker()

EdgeValidityCheckerPointer MPLibrary::GetEdgeValidityChecker ( const std::string &  _l)
inline

◆ GetExtender()

ExtenderPointer MPLibrary::GetExtender ( const std::string &  _l)
inline

◆ GetGoalTracker()

MPLibrary::GoalTracker * MPLibrary::GetGoalTracker ( ) const
noexcept

◆ GetGroupPath()

GroupPath * MPLibrary::GetGroupPath ( RobotGroup *const  _g = nullptr) const
noexcept

◆ GetGroupRoadmap()

MPLibrary::GroupRoadmapType * MPLibrary::GetGroupRoadmap ( RobotGroup *const  _g = nullptr) const
noexcept

◆ GetGroupTask()

GroupTask * MPLibrary::GetGroupTask ( ) const
noexcept

◆ GetLocalObstacleMap()

LocalObstacleMap * MPLibrary::GetLocalObstacleMap ( Robot *const  _r = nullptr) const
noexcept

◆ GetLocalPlanner()

LocalPlannerPointer MPLibrary::GetLocalPlanner ( const std::string &  _l)
inline

◆ GetMapEvaluator()

MapEvaluatorPointer MPLibrary::GetMapEvaluator ( const std::string &  _l)
inline

◆ GetMetric()

MetricPointer MPLibrary::GetMetric ( const std::string &  _l)
inline

◆ GetMPProblem()

MPProblem * MPLibrary::GetMPProblem ( ) const
noexcept

◆ GetMPSolution()

MPLibrary::MPSolution * MPLibrary::GetMPSolution ( ) const
noexcept

◆ GetMPStrategies()

const MPStrategySet* const MPLibrary::GetMPStrategies ( ) const
inline

◆ GetMPStrategy()

MPStrategyPointer MPLibrary::GetMPStrategy ( const std::string &  _l)
inline

◆ GetMPTools()

MPTools* MPLibrary::GetMPTools ( )
inline

◆ GetNeighborhoodFinder()

NeighborhoodFinderPointer MPLibrary::GetNeighborhoodFinder ( const std::string &  _l)
inline

◆ GetPath()

Path * MPLibrary::GetPath ( Robot *const  _r = nullptr) const
noexcept

◆ GetPathModifier()

PathModifierPointer MPLibrary::GetPathModifier ( const std::string &  _l)
inline

◆ GetRoadmap()

MPLibrary::RoadmapType * MPLibrary::GetRoadmap ( Robot *const  _r = nullptr) const
noexcept

◆ GetSampler()

SamplerPointer MPLibrary::GetSampler ( const std::string &  _l)
inline

◆ GetSamplers()

const SamplerSet* const MPLibrary::GetSamplers ( ) const
inline

◆ GetSolverLabels()

std::vector<std::string> MPLibrary::GetSolverLabels ( )
inline

◆ GetStatClass()

StatClass * MPLibrary::GetStatClass ( ) const
noexcept

◆ GetTask()

MPTask * MPLibrary::GetTask ( ) const
noexcept

◆ GetValidityChecker()

ValidityCheckerPointer MPLibrary::GetValidityChecker ( const std::string &  _l)
inline

◆ Halt()

void MPLibrary::Halt ( )

Halt the current strategy and move on to finalization. Useful for controlling the library from an external client object.

◆ IsRunning()

bool MPLibrary::IsRunning ( ) const
noexcept

Check to see if the strategy should continue.

◆ Print()

void MPLibrary::Print ( std::ostream &  _os) const

Print each method set.

◆ ProcessXML()

void MPLibrary::ProcessXML ( XMLNode node)

◆ ReadXMLFile()

void MPLibrary::ReadXMLFile ( const std::string &  _filename)

Read an XML file to set the algorithms and parameters in this instance.

Parameters
_filenameThe XML file name.

◆ ReconstructEdge() [1/3]

template<typename AbstractRoadmapType >
std::vector< typename AbstractRoadmapType::VP > MPLibrary::ReconstructEdge ( AbstractRoadmapType *const  _roadmap,
const VID  _source,
const VID  _target 
)

◆ ReconstructEdge() [2/3]

std::vector< typename MPLibrary::GroupRoadmapType::VP > MPLibrary::ReconstructEdge ( GroupRoadmapType *const  _roadmap,
const VID  _source,
const VID  _target,
const double  _posRes,
const double  _oriRes 
)

◆ ReconstructEdge() [3/3]

std::vector< typename MPLibrary::RoadmapType::VP > MPLibrary::ReconstructEdge ( RoadmapType *const  _roadmap,
const VID  _source,
const VID  _target,
const double  _posRes,
const double  _oriRes 
)

Recompute a roadmap edge path at full resolution (source and target cfgs are not included).

Parameters
_roadmapThe roadmap pointer.
_sourceThe source VID.
_targetThe target VID.
_posResThe position resolution to use.
_oriResThe orientation resolution to use.
Returns
A vector of cfgs along the edge, spaced at resolution intervals.

◆ SetBaseFilename()

void MPLibrary::SetBaseFilename ( const std::string &  _s)
noexcept

◆ SetGroupTask()

void MPLibrary::SetGroupTask ( GroupTask *const  _task)
noexcept

◆ SetMPProblem()

void MPLibrary::SetMPProblem ( MPProblem *const  _problem)
noexcept

◆ SetMPSolution()

void MPLibrary::SetMPSolution ( MPSolution _sol)
noexcept

◆ SetSeed() [1/2]

void MPLibrary::SetSeed ( ) const
noexcept

Set the current seed to match the first solver node.

◆ SetSeed() [2/2]

void MPLibrary::SetSeed ( const long  _seed) const
noexcept

Set the current seed.

Parameters
_seedThe seed value.

◆ SetTask()

void MPLibrary::SetTask ( MPTask *const  _task)
noexcept

◆ Solve() [1/5]

void MPLibrary::Solve ( MPProblem _problem,
GroupTask _task 
)

Group overload:

◆ Solve() [2/5]

void MPLibrary::Solve ( MPProblem _problem,
GroupTask _task,
MPSolution _solution 
)

◆ Solve() [3/5]

void MPLibrary::Solve ( MPProblem _problem,
MPTask _task 
)

Run each input (solver) in sequence.

Parameters
_problemThe problem representation.
_taskThe task representation.

◆ Solve() [4/5]

void MPLibrary::Solve ( MPProblem _problem,
MPTask _task,
MPSolution _solution 
)

Run a single input (solver) and get back its solution.

Parameters
_problemThe problem representation.
_taskThe task representation.
_solutionThe solution container, which may or may not already be populated. Existing solutions should be extended, not overwritten.

◆ Solve() [5/5]

void MPLibrary::Solve ( MPProblem _problem,
MPTask _task,
MPSolution _solution,
const std::string &  _label,
const long  _seed,
const std::string &  _baseFilename 
)

Run a specific MPStrategy from the XML file with a designated seed and base output file name. This is intended for use with the simulator where agents may need to call various strategies within a single execution.

Parameters
_problemThe problem representation.
_taskThe task representation.
_solutionThe solution container, which may or may not already be populated. Existing solutions should be extended, not overwritten.
_labelThe label of the MPStrategy to call.
_seedThe seed to use.
_baseFilenameThe base name for output files.

◆ ToggleValidity()

void MPLibrary::ToggleValidity ( )
inline

Field Documentation

◆ m_connectors

ConnectorSet* MPLibrary::m_connectors {nullptr}
protected

◆ m_distanceMetrics

DistanceMetricSet* MPLibrary::m_distanceMetrics {nullptr}
protected

◆ m_edgeValidityCheckers

EdgeValidityCheckerSet* MPLibrary::m_edgeValidityCheckers {nullptr}
protected

◆ m_extenders

ExtenderSet* MPLibrary::m_extenders {nullptr}
protected

◆ m_localPlanners

LocalPlannerSet* MPLibrary::m_localPlanners {nullptr}
protected

◆ m_mapEvaluators

MapEvaluatorSet* MPLibrary::m_mapEvaluators {nullptr}
protected

◆ m_metrics

MetricSet* MPLibrary::m_metrics {nullptr}
protected

◆ m_mpStrategies

MPStrategySet* MPLibrary::m_mpStrategies {nullptr}
protected

◆ m_neighborhoodFinders

NeighborhoodFinderSet* MPLibrary::m_neighborhoodFinders {nullptr}
protected

◆ m_pathModifiers

PathModifierSet* MPLibrary::m_pathModifiers {nullptr}
protected

◆ m_samplers

SamplerSet* MPLibrary::m_samplers {nullptr}
protected

◆ m_validityCheckers

ValidityCheckerSet* MPLibrary::m_validityCheckers {nullptr}
protected

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