Parasol Planning Library (PPL)
Friends
MPStrategyMethod Class Reference

#include <MPStrategyMethod.h>

Inheritance diagram for MPStrategyMethod:
Inheritance graph
[legend]
Collaboration diagram for MPStrategyMethod:
Collaboration graph
[legend]

Public Types

Motion Planning Types
typedef size_t VID
 
- Public Types inherited from MPBaseObject
typedef DefaultWeight< CfgWeightType
 
typedef GenericStateGraph< Cfg, WeightTypeRoadmapType
 
typedef GroupCfg< RoadmapTypeGroupCfgType
 
typedef GroupLocalPlan< RoadmapTypeGroupWeightType
 
typedef GroupRoadmap< GroupCfgType, GroupWeightTypeGroupRoadmapType
 

Public Member Functions

Construction
 MPStrategyMethod ()=default
 
 MPStrategyMethod (XMLNode &_node)
 
virtual ~MPStrategyMethod ()
 
MPBaseObject Overrides
virtual void Print (std::ostream &_os) const override
 
Interface
void operator() ()
 Execute the strategy by calling Initialize, Run, and Finalize. More...
 
void EnableOutputFiles (const bool _enable=true)
 
virtual void Initialize ()
 
- Public Member Functions inherited from MPBaseObject
 MPBaseObject (const std::string &_label="", const std::string &_name="", bool _debug=false)
 
 MPBaseObject (XMLNode &_node)
 
virtual ~MPBaseObject ()
 
const std::string & GetName () const
 Get the class name for this object. More...
 
const std::string & GetLabel () const
 Get the unique label for this object. More...
 
std::string GetNameAndLabel () const
 Get the unique string identifier for this object "m_name::m_label". More...
 
void SetLabel (const std::string &)
 Set the unique label for this object. More...
 
void SetMPLibrary (MPLibrary *) noexcept
 Set the owning MPLibrary. More...
 
MPLibraryGetMPLibrary () const noexcept
 Get the owning MPLibrary. More...
 
bool IsRunning () const noexcept
 Check the library's running flag. More...
 
MPProblemGetMPProblem () const noexcept
 Get the library's current MPProblem. More...
 
EnvironmentGetEnvironment () const noexcept
 Get the current environment. More...
 
MPTaskGetTask () const noexcept
 Get the current task. More...
 
GroupTaskGetGroupTask () const noexcept
 Get the current group task. More...
 
MPSolutionTypeGetMPSolution () const noexcept
 
RoadmapTypeGetRoadmap (Robot *const _r=nullptr) const noexcept
 Get the current free-space roadmap. More...
 
GroupRoadmapTypeGetGroupRoadmap (RobotGroup *const _g=nullptr) const noexcept
 Get the current free-space group roadmap. More...
 
RoadmapTypeGetBlockRoadmap (Robot *const _r=nullptr) const noexcept
 Get the current obstacle-space roadmap. More...
 
PathGetPath (Robot *const _r=nullptr) const noexcept
 
GroupPathGetGroupPath (RobotGroup *const _g=nullptr) const noexcept
 Get the current best group path. More...
 
StatClassGetStatClass () const noexcept
 Get the current StatClass. More...
 
LocalObstacleMapGetLocalObstacleMap () const noexcept
 Get the local obstacle map. More...
 

Protected Member Functions

Helpers
virtual void Run ()
 Call Iterate until EvaluateMap is true. More...
 
virtual bool EvaluateMap ()
 Check if we satisfied all map evaluators. More...
 
virtual void Iterate ()
 Execute one iteration of the strategy. More...
 
virtual void Finalize ()
 Clean-up and output results. More...
 
virtual void ClearRoadmap ()
 Pre-clear the roadmap(s) if requested. More...
 
Start/Goal Generation
virtual size_t GenerateStart (const std::string &_samplerLabel="")
 
virtual std::vector< size_t > GenerateGoals (const std::string &_samplerLabel="")
 
- Protected Member Functions inherited from MPBaseObject
void SetName (const std::string &_s)
 
const std::string & GetBaseFilename () const
 

Protected Attributes

Internal State
std::string m_querySampler
 Sampler for generating start/goal. More...
 
std::vector< std::string > m_meLabels
 The list of map evaluators to use. More...
 
size_t m_iterations {0}
 The number of executed iterations. More...
 
bool m_writeOutput {true}
 Write output at the end? More...
 
bool m_clearMap {false}
 Clear the roadmap(s) before run? More...
 
- Protected Attributes inherited from MPBaseObject
bool m_debug
 Print debug info? More...
 

Friends

template<typename >
class AOAnalyzer
 Needs access to Iterate for other methods. More...
 

Detailed Description

Base algorithm abstraction for MotionPlanningStrategies.

MPStrategyMethod has one main function, operator(), which performs preprocessing, processing, and postprocessing functionalities of the motion planning algorithm.

@usage

MPStrategyPointer mps = this->GetMPStrategy(m_mpsLabel);
(*mps)(); //call as a function object
mps->operator()(); //call with pointer notation
Todo:
Incorporate path constraints when generating the start and goal.
Examples
MPStrategies_UseCase.cpp.

Member Typedef Documentation

◆ VID

typedef size_t MPStrategyMethod::VID

Constructor & Destructor Documentation

◆ MPStrategyMethod() [1/2]

MPStrategyMethod::MPStrategyMethod ( )
default

◆ MPStrategyMethod() [2/2]

MPStrategyMethod::MPStrategyMethod ( XMLNode _node)

◆ ~MPStrategyMethod()

MPStrategyMethod::~MPStrategyMethod ( )
virtual

Member Function Documentation

◆ ClearRoadmap()

void MPStrategyMethod::ClearRoadmap ( )
protectedvirtual

Pre-clear the roadmap(s) if requested.

Todo:
This uses the STAPL graph 'clear' function, which doesn't activate any roadmap hooks. Methods which use hooks may have stale data after clearing the map. To fix we'll need to replace with our own function in RoadmapGraph.

◆ EnableOutputFiles()

void MPStrategyMethod::EnableOutputFiles ( const bool  _enable = true)

Set output file writing to on or off (on by default). This is used to suppress generation of roadmap, path, and stat files.

Parameters
_enableTrue to enable, false to disable.

◆ EvaluateMap()

bool MPStrategyMethod::EvaluateMap ( )
protectedvirtual

Check if we satisfied all map evaluators.

◆ Finalize()

void MPStrategyMethod::Finalize ( )
protectedvirtual

◆ GenerateGoals()

std::vector< size_t > MPStrategyMethod::GenerateGoals ( const std::string &  _samplerLabel = "")
protectedvirtual

Generate 'goal' node(s) for the task and add it(them) to the roadmap.

Parameters
_samplerLabelThe label for the sampler to use if no query sampler was provided, or empty to require a query sampler.
Returns
The VIDs of the generated configurations.
Note
This returns size_t so that it will work for both individual and group strategies (all VID types are typedefs for size_t).

Reimplemented in GroupStrategyMethod.

◆ GenerateStart()

size_t MPStrategyMethod::GenerateStart ( const std::string &  _samplerLabel = "")
protectedvirtual

Generate a 'start' node for the task and add it to the roadmap.

Parameters
_samplerLabelThe label for the sampler to use if no query sampler was provided, or empty to require a query sampler.
Returns
The VID of the generated configuration.
Note
This returns size_t so that it will work for both individual and group strategies (all VID types are typedefs for size_t).

Reimplemented in GroupStrategyMethod.

◆ Initialize()

virtual void MPBaseObject::Initialize
inlinevirtual

Initialize this object for the current MPProblem. This should reset any internal state of the algorithms so that they are ready for execution. It is also the place to initialize any state that depends on the current problem.

Warning
This member will be called for every compiled algorithm in the planning library - even those that will not be used. If an algorithm needs to do expenisve setup, then this method should only set a flag that tells it to do so on first use. The only exceptions are the MPStrategies, which will only have their initialize called on first use.

Reimplemented from MPBaseObject.

◆ Iterate()

virtual void MPStrategyMethod::Iterate ( )
inlineprotectedvirtual

◆ operator()()

void MPStrategyMethod::operator() ( )

Execute the strategy by calling Initialize, Run, and Finalize.

◆ Print()

void MPStrategyMethod::Print ( std::ostream &  _os) const
overridevirtual

Print internal state of this object.

Parameters
_osThe std::ostream to print to.

Reimplemented from MPBaseObject.

Reimplemented in TogglePRMStrategy, GroupPRM, GroupDecoupledStrategy, DynamicRegionsPRM, DynamicRegionRRT, DynamicDomainRRT, BasicPRM, ModifyPath, BasicRRTStrategy, AdaptiveRRT, and PathStrategy.

◆ Run()

void MPStrategyMethod::Run ( )
protectedvirtual

Call Iterate until EvaluateMap is true.

Reimplemented in ValidationStrategy< MPTraits >, and PathStrategy.

Friends And Related Function Documentation

◆ AOAnalyzer

template<typename >
friend class AOAnalyzer
friend

Needs access to Iterate for other methods.

Field Documentation

◆ m_clearMap

bool MPStrategyMethod::m_clearMap {false}
protected

Clear the roadmap(s) before run?

◆ m_iterations

size_t MPStrategyMethod::m_iterations {0}
protected

The number of executed iterations.

◆ m_meLabels

std::vector<std::string> MPStrategyMethod::m_meLabels
protected

The list of map evaluators to use.

◆ m_querySampler

std::string MPStrategyMethod::m_querySampler
protected

Sampler for generating start/goal.

◆ m_writeOutput

bool MPStrategyMethod::m_writeOutput {true}
protected

Write output at the end?


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