Parasol Planning Library (PPL)
LocalPlannerMethod Class Referenceabstract

#include <LocalPlannerMethod.h>

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

Public Types

Motion Planning Types
typedef MPBaseObject::GroupCfgType GroupCfgType
 
typedef GroupCfgType::Formation Formation
 
- 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
 LocalPlannerMethod (bool _saveIntermediates=false)
 
 LocalPlannerMethod (XMLNode &_node)
 
virtual ~LocalPlannerMethod ()=default
 
MPBaseObject Overrides
virtual void Print (std::ostream &_os) const override
 
Local Planner Interface
virtual bool IsConnected (const Cfg &_start, const Cfg &_end, Cfg &_col, LPOutput *_lpOutput, double _posRes, double _oriRes, bool _checkCollision=true, bool _savePath=false)=0
 
bool IsConnected (const Cfg &_start, const Cfg &_end, LPOutput *_lpOutput, double _posRes, double _oriRes, bool _checkCollision=true, bool _savePath=false)
 
virtual bool IsConnected (const GroupCfgType &_start, const GroupCfgType &_end, GroupCfgType &_col, GroupLPOutput *_lpOutput, double _posRes, double _oriRes, bool _checkCollision=true, bool _savePath=false, const Formation &_formation=Formation())
 
bool IsConnected (const GroupCfgType &_start, const GroupCfgType &_end, GroupLPOutput *_lpOutput, double _posRes, double _oriRes, bool _checkCollision=true, bool _savePath=false, const Formation &_formation=Formation())
 
std::vector< CfgBlindPath (const std::vector< Cfg > &_waypoints, const double _posRes, const double _oriRes)
 
std::vector< CfgBlindPath (const std::vector< Cfg > &_waypoints)
 
std::vector< GroupCfgTypeBlindPath (const std::vector< GroupCfgType > &_waypoints, const double _posRes, const double _oriRes, const Formation &_formation=Formation())
 
std::vector< GroupCfgTypeBlindPath (const std::vector< GroupCfgType > &_waypoints, const Formation &_formation=Formation())
 
- 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...
 
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 Attributes

Internal State
bool m_saveIntermediates {false}
 Save the intermediates in the roadmap? More...
 
- Protected Attributes inherited from MPBaseObject
bool m_debug
 Print debug info? More...
 

Additional Inherited Members

- Protected Member Functions inherited from MPBaseObject
void SetName (const std::string &_s)
 
const std::string & GetBaseFilename () const
 

Detailed Description

Base algorithm abstraction for LocalPlanners.

LocalPlannerMethod has two main functions: IsConnected and BlindPath.

IsConnected takes as input two configurations $c_1$, $c_2$, an LPOutput, validation resolutions, and optional booleans dictating whether to check collision and save the path. The function both returns true or false to validate the simple path between $c_1$ and $c_2$, but also populates the LPOutput structure with useful information.

BlindPath is a helper to plan between waypoints without collision checking. This is useful for working with pre-validated paths.

Todo:

All local planners need to use a distance metric to set their edge weights properly; currently many of them are simply using the number of intermediate steps as a weight.

Local planners and Extenders represent the same concepts and should be merged into a single class with both an Extend and LocalPlan function. This will help simplify several other objects within PMPL as well, such as bi-directional RRT.

Examples
LocalPlanner_UseCase.cpp.

Member Typedef Documentation

◆ Formation

◆ GroupCfgType

Constructor & Destructor Documentation

◆ LocalPlannerMethod() [1/2]

LocalPlannerMethod::LocalPlannerMethod ( bool  _saveIntermediates = false)

◆ LocalPlannerMethod() [2/2]

LocalPlannerMethod::LocalPlannerMethod ( XMLNode _node)

◆ ~LocalPlannerMethod()

virtual LocalPlannerMethod::~LocalPlannerMethod ( )
virtualdefault

Member Function Documentation

◆ BlindPath() [1/4]

std::vector< Cfg > LocalPlannerMethod::BlindPath ( const std::vector< Cfg > &  _waypoints)

◆ BlindPath() [2/4]

std::vector< Cfg > LocalPlannerMethod::BlindPath ( const std::vector< Cfg > &  _waypoints,
const double  _posRes,
const double  _oriRes 
)

Blind-plan between a set of waypoints. Also useful for reconstructing previously validated edges.

Parameters
_waypointsThe waypoint configurations.
_posResPositional DOF resolution.
_oriResRotational DOF resolution.
Returns
Configurations along path through _waypoints up to a resolution (_posRes, _oriRes). Does not include the first or last configuration.

@usage

LocalPlannerPointer lp = this->GetLocalPlanner(m_lpLabel);
Environment* env = this->GetEnvironment();
Cfg c1, c2;
lp->BlindPath({c1, c2}, env->GetPositionRes(), env->GetOrientationRes());
Definition: Cfg.h:38
Definition: Environment.h:137
double GetOrientationRes() const noexcept
Get the orientation resolution.
Definition: Environment.cpp:600
double GetPositionRes() const noexcept
Get the position resolution.
Definition: Environment.cpp:586
Environment * GetEnvironment() const noexcept
Get the current environment.
Definition: MPBaseObject.cpp:94
Examples
LocalPlanner_UseCase.cpp.

◆ BlindPath() [3/4]

std::vector< typename LocalPlannerMethod::GroupCfgType > LocalPlannerMethod::BlindPath ( const std::vector< GroupCfgType > &  _waypoints,
const double  _posRes,
const double  _oriRes,
const Formation _formation = Formation() 
)

◆ BlindPath() [4/4]

std::vector< typename LocalPlannerMethod::GroupCfgType > LocalPlannerMethod::BlindPath ( const std::vector< GroupCfgType > &  _waypoints,
const Formation _formation = Formation() 
)

◆ IsConnected() [1/4]

virtual bool LocalPlannerMethod::IsConnected ( const Cfg _start,
const Cfg _end,
Cfg _col,
LPOutput _lpOutput,
double  _posRes,
double  _oriRes,
bool  _checkCollision = true,
bool  _savePath = false 
)
pure virtual

Validate a simple path between two nodes.

Parameters
_startThe starting configuration.
_endThe ending configuration.
_colThe witness configuration on failure.
_lpOutputWeight and path computed from local plan.
_posResPositional DOF resolution.
_oriResRotational DOF resolution.
_checkCollisionUse validity checking?
_savePathSave all configurations along the path?
Returns
A boolean indicating whether the connection succeeded.

@usage

LocalPlannerPointer lp = this->GetLocalPlanner(m_lpLabel);
Environment* env = this->GetEnvironment();
CfgType c1, c2, col;
LPOutput lpOut;
lp->IsConnected(c1, c2, col, &lpOut, env->GetPositionRes(),
Definition: LPOutput.h:24

Implemented in HierarchicalLP, and StraightLine.

Examples
LocalPlanner_UseCase.cpp.

◆ IsConnected() [2/4]

bool LocalPlannerMethod::IsConnected ( const Cfg _start,
const Cfg _end,
LPOutput _lpOutput,
double  _posRes,
double  _oriRes,
bool  _checkCollision = true,
bool  _savePath = false 
)
inline

This version does not return a collision node. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ IsConnected() [3/4]

bool LocalPlannerMethod::IsConnected ( const GroupCfgType _start,
const GroupCfgType _end,
GroupCfgType _col,
GroupLPOutput _lpOutput,
double  _posRes,
double  _oriRes,
bool  _checkCollision = true,
bool  _savePath = false,
const Formation _formation = Formation() 
)
virtual

This version is for group configurations. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented in StraightLine.

◆ IsConnected() [4/4]

bool LocalPlannerMethod::IsConnected ( const GroupCfgType _start,
const GroupCfgType _end,
GroupLPOutput _lpOutput,
double  _posRes,
double  _oriRes,
bool  _checkCollision = true,
bool  _savePath = false,
const Formation _formation = Formation() 
)
inline

This version for group configurations does not return a collision node. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ Print()

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

Print internal state of this object.

Parameters
_osThe std::ostream to print to.

Reimplemented from MPBaseObject.

Reimplemented in StraightLine, and HierarchicalLP.

Field Documentation

◆ m_saveIntermediates

bool LocalPlannerMethod::m_saveIntermediates {false}
protected

Save the intermediates in the roadmap?


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