Parasol Planning Library (PPL)
BasicExtender Class Reference

#include <BasicExtender.h>

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

Public Types

Motion Planning Types
typedef MPBaseObject::GroupCfgType GroupCfgType
 
typedef MPBaseObject::GroupWeightType GroupWeightType
 
typedef GroupCfgType::Formation Formation
 
- Public Types inherited from ExtenderMethod
typedef MPBaseObject::RoadmapType RoadmapType
 
typedef MPBaseObject::GroupCfgType GroupCfgType
 
typedef GroupLocalPlan< RoadmapType > GroupWeightType
 
- Public Types inherited from MPBaseObject
typedef DefaultWeight< Cfg > WeightType
 
typedef GenericStateGraph< Cfg, WeightType > RoadmapType
 
typedef GroupCfg< RoadmapType > GroupCfgType
 
typedef GroupLocalPlan< RoadmapType > GroupWeightType
 
typedef GroupRoadmap< GroupCfgType, GroupWeightType > GroupRoadmapType
 

Public Member Functions

Construction
 BasicExtender ()
 
 BasicExtender (XMLNode &_node)
 
virtual ~BasicExtender ()=default
 
MPBaseObject Overrides
virtual void Print (std::ostream &_os) const override
 
ExtenderMethod Overrides
virtual bool Extend (const Cfg &_start, const Cfg &_end, Cfg &_new, LPOutput &_lp) override
 
virtual bool Extend (const Cfg &_start, const Cfg &_end, Cfg &_new, LPOutput &_lp, CDInfo &_cdInfo) override
 An optional version if CDInfo is desired. Not required to implement. More...
 
virtual bool Extend (const GroupCfgType &_start, const GroupCfgType &_end, GroupCfgType &_new, GroupLPOutput &_lp, const Formation &_robotIndexes=Formation()) override
 
virtual bool Extend (const GroupCfgType &_start, const GroupCfgType &_end, GroupCfgType &_new, GroupLPOutput &_lp, CDInfo &_cdInfo, const Formation &_robotIndexes=Formation()) override
 
- Public Member Functions inherited from ExtenderMethod
 ExtenderMethod ()=default
 
 ExtenderMethod (XMLNode &_node)
 
virtual ~ExtenderMethod ()=default
 
virtual double GetMinDistance () const
 Get the minimum extension distance. More...
 
virtual double GetMaxDistance () const
 Get the maximum extension distance. More...
 
- Public Member Functions inherited from MPBaseObject
 MPBaseObject (const std::string &_label="", const std::string &_name="", bool _debug=false)
 
 MPBaseObject (XMLNode &_node)
 
virtual ~MPBaseObject ()
 
virtual void Initialize ()
 
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...
 
MPLibrary * GetMPLibrary () const noexcept
 Get the owning MPLibrary. More...
 
bool IsRunning () const noexcept
 Check the library's running flag. More...
 
MPProblem * GetMPProblem () const noexcept
 Get the library's current MPProblem. More...
 
Environment * GetEnvironment () const noexcept
 Get the current environment. More...
 
MPTask * GetTask () const noexcept
 Get the current task. More...
 
GroupTask * GetGroupTask () const noexcept
 Get the current group task. More...
 
MPSolutionType * GetMPSolution () const noexcept
 
RoadmapType * GetRoadmap (Robot *const _r=nullptr) const noexcept
 Get the current free-space roadmap. More...
 
GroupRoadmapType * GetGroupRoadmap (RobotGroup *const _g=nullptr) const noexcept
 Get the current free-space group roadmap. More...
 
RoadmapType * GetBlockRoadmap (Robot *const _r=nullptr) const noexcept
 Get the current obstacle-space roadmap. More...
 
Path * GetPath (Robot *const _r=nullptr) const noexcept
 
GroupPath * GetGroupPath (RobotGroup *const _g=nullptr) const noexcept
 Get the current best group path. More...
 
StatClass * GetStatClass () const noexcept
 Get the current StatClass. More...
 
LocalObstacleMap * GetLocalObstacleMap () const noexcept
 Get the local obstacle map. More...
 

Protected Member Functions

Helpers
bool Expand (const Cfg &_start, const Cfg &_end, Cfg &_newCfg, double _delta, LPOutput &_lp, double _posRes, double _oriRes)
 
bool Expand (const Cfg &_start, const Cfg &_end, Cfg &_newCfg, double _delta, LPOutput &_lp, CDInfo &_cdInfo, double _posRes, double _oriRes)
 
bool Expand (const GroupCfgType &_start, const GroupCfgType &_end, GroupCfgType &_newCfg, double _delta, GroupLPOutput &_lp, double _posRes, double _oriRes, const Formation &_robotIndexes=Formation())
 GroupCfg Overrides. More...
 
bool Expand (const GroupCfgType &_start, const GroupCfgType &_end, GroupCfgType &_newCfg, double _delta, GroupLPOutput &_lp, CDInfo &_cdInfo, double _posRes, double _oriRes, const Formation &_robotIndexes=Formation())
 
- Protected Member Functions inherited from MPBaseObject
void SetName (const std::string &_s)
 
const std::string & GetBaseFilename () const
 

Protected Attributes

Internal State
std::string m_dmLabel
 The distance metric to use. More...
 
std::string m_vcLabel
 The validity checker to use. More...
 
bool m_randomOrientation {true}
 Setting this to false fixes orientation. More...
 
- Protected Attributes inherited from ExtenderMethod
double m_minDist {.1}
 The minimum valid extension distance. More...
 
double m_maxDist {1.}
 The maximum valid extension distance. More...
 
- Protected Attributes inherited from MPBaseObject
bool m_debug
 Print debug info? More...
 

Detailed Description

Basic straight-line extension.

Extends in straight-line through @cspace until either the target is reached, @cobst is encountered, or the max distance is exceeded.

Member Typedef Documentation

◆ Formation

◆ GroupCfgType

◆ GroupWeightType

Constructor & Destructor Documentation

◆ BasicExtender() [1/2]

BasicExtender::BasicExtender ( )

◆ BasicExtender() [2/2]

BasicExtender::BasicExtender ( XMLNode &  _node)

◆ ~BasicExtender()

virtual BasicExtender::~BasicExtender ( )
virtualdefault

Member Function Documentation

◆ Expand() [1/4]

bool BasicExtender::Expand ( const Cfg &  _start,
const Cfg &  _end,
Cfg &  _newCfg,
double  _delta,
LPOutput &  _lp,
CDInfo &  _cdInfo,
double  _posRes,
double  _oriRes 
)
protected
Todo:
No, we don't have to set _newCfg to _end, and it would be better if we didn't use this assumption. We are doing this so that we can use extenders as local planners in multi-tree RRT methods. To fix and remove the assumption, we need to homogenize our extenders and local planners into a single class with methods for both uses (i.e. 'Extend' and 'LocalPlan').

◆ Expand() [2/4]

bool BasicExtender::Expand ( const Cfg &  _start,
const Cfg &  _end,
Cfg &  _newCfg,
double  _delta,
LPOutput &  _lp,
double  _posRes,
double  _oriRes 
)
protected

Basic utility for "extend" a RRT tree. Assumed to be given a start node and a goal node to grow towards. Resulting node extended towards the goal is passed by reference and modified.

Parameters
_startCfg to grow from.
_endCfg to grow toward.
_newCfgReturn for newly created cfg.
_deltaMaximum distance to grow
Returns
True if the extension produced a valid configuration that is at least the minimum distance away from the starting point.

◆ Expand() [3/4]

bool BasicExtender::Expand ( const GroupCfgType &  _start,
const GroupCfgType &  _end,
GroupCfgType &  _newCfg,
double  _delta,
GroupLPOutput &  _lp,
CDInfo &  _cdInfo,
double  _posRes,
double  _oriRes,
const Formation &  _robotIndexes = Formation() 
)
protected

Set these to true to have single parts treated (less efficiently) as multiple parts, which should now be identical.

TODO: this can likely be optimized. For one, only one Configure call should be necessary here. Also a lot of the group Cfgs here could be made individual if using the leader, then using Configure on that.

◆ Expand() [4/4]

bool BasicExtender::Expand ( const GroupCfgType &  _start,
const GroupCfgType &  _end,
GroupCfgType &  _newCfg,
double  _delta,
GroupLPOutput &  _lp,
double  _posRes,
double  _oriRes,
const Formation &  _robotIndexes = Formation() 
)
protected

GroupCfg Overrides.

◆ Extend() [1/4]

bool BasicExtender::Extend ( const Cfg &  _start,
const Cfg &  _end,
Cfg &  _new,
LPOutput &  _lp 
)
overridevirtual

Extends a local plan from a starting configuration towards a target configuration.

Parameters
_startInitial configuration to grow from.
_endTarget configuration to grow towards.
_newPlaceholder for resulting configuration.
_lpPlaceholder for polygonal chain configurations for non-straight-line extention operations and associated weight.
Returns
True if the extension produced a valid configuration that was at least the minimum distance away from the starting point.

Implements ExtenderMethod.

Reimplemented in RotationThenTranslation.

◆ Extend() [2/4]

bool BasicExtender::Extend ( const Cfg &  _start,
const Cfg &  _end,
Cfg &  _new,
LPOutput &  _lp,
CDInfo &  _cdInfo 
)
overridevirtual

An optional version if CDInfo is desired. Not required to implement.

Reimplemented from ExtenderMethod.

◆ Extend() [3/4]

bool BasicExtender::Extend ( const GroupCfgType &  _start,
const GroupCfgType &  _end,
GroupCfgType &  _new,
GroupLPOutput &  _lp,
CDInfo &  _cdInfo,
const Formation &  _robotIndexes = Formation() 
)
overridevirtual

For groups, with CD info. @override

Parameters
_robotIndexesThe indexes of the robots which should move (empty for all).

Reimplemented from ExtenderMethod.

◆ Extend() [4/4]

bool BasicExtender::Extend ( const GroupCfgType &  _start,
const GroupCfgType &  _end,
GroupCfgType &  _new,
GroupLPOutput &  _lp,
const Formation &  _robotIndexes = Formation() 
)
overridevirtual

For groups. @override

Parameters
_robotIndexesThe indexes of the robots which should move (empty for all).

Reimplemented from ExtenderMethod.

◆ Print()

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

Print internal state of this object.

Parameters
_osThe std::ostream to print to.

Reimplemented from ExtenderMethod.

Field Documentation

◆ m_dmLabel

std::string BasicExtender::m_dmLabel
protected

The distance metric to use.

◆ m_randomOrientation

bool BasicExtender::m_randomOrientation {true}
protected

Setting this to false fixes orientation.

◆ m_vcLabel

std::string BasicExtender::m_vcLabel
protected

The validity checker to use.


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