Parasol Planning Library (PPL)
StraightLine Class Reference

#include <StraightLine.h>

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

Public Types

Motion Planning Types
typedef MPBaseObject::WeightType WeightType
 
typedef MPBaseObject::GroupCfgType GroupCfgType
 
typedef MPBaseObject::GroupRoadmapType GroupRoadmapType
 
typedef GroupCfgType::Formation Formation
 
- Public Types inherited from LocalPlannerMethod
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
 StraightLine (const std::string &_vcLabel="", bool _binary=false, bool _saveIntermediates=false)
 
 StraightLine (XMLNode &_node)
 
virtual ~StraightLine ()=default
 
MPBaseObject Overrides
virtual void Print (std::ostream &_os) const override
 
LocalPlannerMethod Overrides
virtual bool IsConnected (const Cfg &_c1, const Cfg &_c2, Cfg &_col, LPOutput *_lpOutput, double _positionRes, double _orientationRes, bool _checkCollision=true, bool _savePath=false) override
 
virtual bool IsConnected (const GroupCfgType &_c1, const GroupCfgType &_c2, GroupCfgType &_col, GroupLPOutput *_lpOutput, double _positionRes, double _orientationRes, bool _checkCollision=true, bool _savePath=false, const Formation &_robotIndexes=Formation()) override
 
- Public Member Functions inherited from LocalPlannerMethod
 LocalPlannerMethod (bool _saveIntermediates=false)
 
 LocalPlannerMethod (XMLNode &_node)
 
virtual ~LocalPlannerMethod ()=default
 
bool IsConnected (const Cfg &_start, const Cfg &_end, LPOutput *_lpOutput, double _posRes, double _oriRes, bool _checkCollision=true, bool _savePath=false)
 
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 Member Functions

Helpers
bool IsConnectedFunc (const Cfg &_c1, const Cfg &_c2, Cfg &_col, LPOutput *_lpOutput, double _positionRes, double _orientationRes, bool _checkCollision=true, bool _savePath=false)
 Default for non closed chains. More...
 
virtual bool IsConnectedEqualVelocities (const GroupCfgType &_c1, const GroupCfgType &_c2, GroupCfgType &_col, GroupLPOutput *_lpOutput, double _positionRes, double _orientationRes, bool _checkCollision, bool _savePath, const Formation &_robotIndexes)
 
virtual bool IsConnectedSLSequential (const Cfg &_c1, const Cfg &_c2, Cfg &_col, LPOutput *_lpOutput, int &_cdCounter, double _positionRes, double _orientationRes, bool _checkCollision=true, bool _savePath=false)
 
virtual bool IsConnectedSLBinary (const Cfg &_c1, const Cfg &_c2, Cfg &_col, LPOutput *_lpOutput, int &_cdCounter, double _positionRes, double _orientationRes, bool _checkCollision=true, bool _savePath=false)
 
- 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 metric for measuring edge length. More...
 
std::string m_vcLabel
 The validity checker. More...
 
bool m_binaryEvaluation {false}
 Use binary search? More...
 
bool m_equalVelocity {false}
 decides if multi-robots move at same speed More...
 
double m_selfEdgeSteps {1}
 
- Protected Attributes inherited from LocalPlannerMethod
bool m_saveIntermediates {false}
 Save the intermediates in the roadmap? More...
 
- Protected Attributes inherited from MPBaseObject
bool m_debug
 Print debug info? More...
 

Detailed Description

Check a straight-line path in c-space for valididty.

This local planner validates straight line paths which is a direct linear interpolation between two configurations in @cspace.

Member Typedef Documentation

◆ Formation

◆ GroupCfgType

◆ GroupRoadmapType

◆ WeightType

Constructor & Destructor Documentation

◆ StraightLine() [1/2]

StraightLine::StraightLine ( const std::string &  _vcLabel = "",
bool  _binary = false,
bool  _saveIntermediates = false 
)

◆ StraightLine() [2/2]

StraightLine::StraightLine ( XMLNode _node)

◆ ~StraightLine()

virtual StraightLine::~StraightLine ( )
virtualdefault

Member Function Documentation

◆ IsConnected() [1/2]

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

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: 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
Definition: LPOutput.h:24

Implements LocalPlannerMethod.

◆ IsConnected() [2/2]

bool StraightLine::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() 
)
overridevirtual

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.

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.

Reimplemented from LocalPlannerMethod.

◆ IsConnectedEqualVelocities()

bool StraightLine::IsConnectedEqualVelocities ( const GroupCfgType _c1,
const GroupCfgType _c2,
GroupCfgType _col,
GroupLPOutput _lpOutput,
double  _positionRes,
double  _orientationRes,
bool  _checkCollision,
bool  _savePath,
const Formation _robotIndexes 
)
protectedvirtual

Decides if the robots move at equal velocity. This method implements an equal distance intermediate instead of a fixed quanity across all paths. If the cfg has reached its goal, increment will be set to 0 to wait for the other robots.

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.

◆ IsConnectedFunc()

bool StraightLine::IsConnectedFunc ( const Cfg _c1,
const Cfg _c2,
Cfg _col,
LPOutput _lpOutput,
double  _positionRes,
double  _orientationRes,
bool  _checkCollision = true,
bool  _savePath = false 
)
protected

Default for non closed chains.

◆ IsConnectedSLBinary()

bool StraightLine::IsConnectedSLBinary ( const Cfg _c1,
const Cfg _c2,
Cfg _col,
LPOutput _lpOutput,
int &  _cdCounter,
double  _positionRes,
double  _orientationRes,
bool  _checkCollision = true,
bool  _savePath = false 
)
protectedvirtual

Check if two Cfgs could be connected by straight line This method uses binary search to check clearances of Cfgs between _c1 and _c2.

Todo:
Why are we running a local planner on an interaction edge? That shouldn't be necessary since we need neither intermediates nor CD information in that case?

◆ IsConnectedSLSequential()

bool StraightLine::IsConnectedSLSequential ( const Cfg _c1,
const Cfg _c2,
Cfg _col,
LPOutput _lpOutput,
int &  _cdCounter,
double  _positionRes,
double  _orientationRes,
bool  _checkCollision = true,
bool  _savePath = false 
)
protectedvirtual

Check if two Cfgs could be connected by straight line. This method implements straight line connection local planner by checking collision of each Cfg along the line. If the is any Cfg causes Robot collides with any obstacle, false will be returned.

Todo:
Why are we running a local planner on an interaction edge? That shouldn't be necessary since we need neither intermediates nor CD information in that case?

◆ Print()

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

Print internal state of this object.

Parameters
_osThe std::ostream to print to.

Reimplemented from LocalPlannerMethod.

Field Documentation

◆ m_binaryEvaluation

bool StraightLine::m_binaryEvaluation {false}
protected

Use binary search?

◆ m_dmLabel

std::string StraightLine::m_dmLabel
protected

The metric for measuring edge length.

◆ m_equalVelocity

bool StraightLine::m_equalVelocity {false}
protected

decides if multi-robots move at same speed

◆ m_selfEdgeSteps

double StraightLine::m_selfEdgeSteps {1}
protected

◆ m_vcLabel

std::string StraightLine::m_vcLabel
protected

The validity checker.


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