PPL API Reference
Overview Core Algorithm Abstractions Utilities Parallel Methods
Modules Class Hierarchy Classes Functions
Todo List Bug List Dead Code
List of all members | Protected Member Functions | Protected Attributes
StraightLine< MPTraits > Class Template Reference

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 CfgType &_c1, const CfgType &_c2, CfgType &_col, LPOutput< MPTraits > *_lpOutput, double _positionRes, double _orientationRes, bool _checkCollision=true, bool _savePath=false) override
 
virtual bool IsConnected (const GroupCfgType &_c1, const GroupCfgType &_c2, GroupCfgType &_col, GroupLPOutput< MPTraits > *_lpOutput, double _positionRes, double _orientationRes, bool _checkCollision=true, bool _savePath=false, const Formation &_robotIndexes=Formation()) override
 
Local Planner Interface
bool IsConnected (const CfgType &_start, const CfgType &_end, LPOutput< MPTraits > *_lpOutput, double _posRes, double _oriRes, bool _checkCollision=true, bool _savePath=false)
 
bool IsConnected (const GroupCfgType &_start, const GroupCfgType &_end, GroupLPOutput< MPTraits > *_lpOutput, double _posRes, double _oriRes, bool _checkCollision=true, bool _savePath=false, const Formation &_formation=Formation())
 
std::vector< CfgType > BlindPath (const std::vector< CfgType > &_waypoints, const double _posRes, const double _oriRes)
 
std::vector< CfgType > BlindPath (const std::vector< CfgType > &_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())
 
Initialization
virtual void Initialize ()
 
Name and Label Accessors
const std::string & GetName () const
 Get the class name for this object.
 
const std::string & GetLabel () const
 Get the unique label for this object.
 
std::string GetNameAndLabel () const
 Get the unique string identifier for this object "m_name::m_label".
 
void SetLabel (const std::string &)
 Set the unique label for this object.
 
MPLibrary Accessors
void SetMPLibrary (MPLibrary *) noexcept
 Set the owning MPLibrary.
 
MPLibraryGetMPLibrary () const noexcept
 Get the owning MPLibrary.
 
bool IsRunning () const noexcept
 Check the library's running flag.
 
DistanceMetricPointer GetDistanceMetric (const std::string &) const noexcept
 Get a distance metric by label from the owning MPLibrary.
 
ValidityCheckerPointer GetValidityChecker (const std::string &) const noexcept
 Get a validity checker by label from the owning MPLibrary.
 
NeighborhoodFinderPointer GetNeighborhoodFinder (const std::string &) const noexcept
 Get a neighborhood finder by label from the owning MPLibrary.
 
SamplerPointer GetSampler (const std::string &) const noexcept
 Get a sampler by label from the owning MPLibrary.
 
LocalPlannerPointer GetLocalPlanner (const std::string &) const noexcept
 Get a local planner by label from the owning MPLibrary.
 
ExtenderPointer GetExtender (const std::string &) const noexcept
 Get an extender by label from the owning MPLibrary.
 
PathModifierPointer GetPathModifier (const std::string &) const noexcept
 Get a path modifier by label from the owning MPLibrary.
 
ConnectorPointer GetConnector (const std::string &) const noexcept
 Get a connector by label from the owning MPLibrary.
 
MetricPointer GetMetric (const std::string &) const noexcept
 Get a metric by label from the owning MPLibrary.
 
MapEvaluatorPointer GetMapEvaluator (const std::string &) const noexcept
 Get a map evaluator by label from the owning MPLibrary.
 
MPStrategyPointer GetMPStrategy (const std::string &) const noexcept
 Get a strategy by label from the owning MPLibrary.
 
MPTraits::MPToolsGetMPTools () const noexcept
 Get the MPTools container from the owning MPLibrary.
 
Problem Accessors
MPProblemGetMPProblem () const noexcept
 Get the library's current MPProblem.
 
EnvironmentGetEnvironment () const noexcept
 Get the current environment.
 
MPTaskGetTask () const noexcept
 Get the current task.
 
GroupTaskGetGroupTask () const noexcept
 Get the current group task.
 
Solution Accessors
MPSolutionGetMPSolution () const noexcept
 
RoadmapTypeGetRoadmap (Robot *const _r=nullptr) const noexcept
 Get the current free-space roadmap.
 
GroupRoadmapTypeGetGroupRoadmap (RobotGroup *const _g=nullptr) const noexcept
 Get the current free-space group roadmap.
 
RoadmapTypeGetBlockRoadmap (Robot *const _r=nullptr) const noexcept
 Get the current obstacle-space roadmap.
 
PathGetPath (Robot *const _r=nullptr) const noexcept
 Get the current best path.
 
GroupPathGetGroupPath (RobotGroup *const _g=nullptr) const noexcept
 Get the current best group path.
 
StatClassGetStatClass () const noexcept
 Get the current StatClass.
 
LocalObstacleMapGetLocalObstacleMap () const noexcept
 Get the local obstacle map.
 
GoalTrackerGetGoalTracker () const noexcept
 Get the goal tracker.
 

Public Types

Motion Planning Types
typedef MPTraits::CfgType CfgType
 
typedef MPTraits::WeightType WeightType
 
typedef MPTraits::GroupCfgType GroupCfgType
 
typedef MPTraits::GroupRoadmapType GroupRoadmapType
 
typedef GroupCfgType::Formation Formation
 
Local Types
typedef MPTraits::RoadmapType RoadmapType
 
typedef MPTraits::LocalObstacleMap LocalObstacleMap
 
typedef MPTraits::Path Path
 
typedef MPTraits::GroupPathType GroupPath
 
typedef MPTraits::MPLibrary MPLibrary
 
typedef MPTraits::MPSolution MPSolution
 
typedef MPTraits::GoalTracker GoalTracker
 
typedef MPLibrary::SamplerPointer SamplerPointer
 
typedef MPLibrary::LocalPlannerPointer LocalPlannerPointer
 
typedef MPLibrary::ExtenderPointer ExtenderPointer
 
typedef MPLibrary::PathModifierPointer PathModifierPointer
 
typedef MPLibrary::ConnectorPointer ConnectorPointer
 
typedef MPLibrary::MetricPointer MetricPointer
 
typedef MPLibrary::MapEvaluatorPointer MapEvaluatorPointer
 
typedef MPLibrary::MPStrategyPointer MPStrategyPointer
 
typedef MPLibrary::DistanceMetricPointer DistanceMetricPointer
 
typedef MPLibrary::ValidityCheckerPointer ValidityCheckerPointer
 
typedef MPLibrary::NeighborhoodFinderPointer NeighborhoodFinderPointer
 

Protected Member Functions

void SetName (const std::string &_s)
 
const std::string & GetBaseFilename () const
 
Helpers
bool IsConnectedFunc (const CfgType &_c1, const CfgType &_c2, CfgType &_col, LPOutput< MPTraits > *_lpOutput, double _positionRes, double _orientationRes, bool _checkCollision=true, bool _savePath=false)
 Default for non closed chains.
 
virtual bool IsConnectedSLSequential (const CfgType &_c1, const CfgType &_c2, CfgType &_col, LPOutput< MPTraits > *_lpOutput, int &_cdCounter, double _positionRes, double _orientationRes, bool _checkCollision=true, bool _savePath=false)
 
virtual bool IsConnectedSLBinary (const CfgType &_c1, const CfgType &_c2, CfgType &_col, LPOutput< MPTraits > *_lpOutput, int &_cdCounter, double _positionRes, double _orientationRes, bool _checkCollision=true, bool _savePath=false)
 

Protected Attributes

bool m_debug
 Print debug info?
 
Internal State
std::string m_dmLabel
 The metric for measuring edge length.
 
std::string m_vcLabel
 The validity checker.
 
bool m_binaryEvaluation {false}
 Use binary search?
 
double m_selfEdgeSteps {1}
 
Internal State
bool m_saveIntermediates {false}
 Save the intermediates in the roadmap?
 

Detailed Description

template<typename MPTraits>
class StraightLine< MPTraits >

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 $\mathcal{C}_{space}$.

Member Function Documentation

◆ Print()

template<typename MPTraits >
void StraightLine< MPTraits >::Print ( std::ostream &  _os) const
overridevirtual

Print internal state of this object.

Parameters
_osThe std::ostream to print to.

Reimplemented from LocalPlannerMethod< MPTraits >.

◆ IsConnected() [1/4]

template<typename MPTraits >
bool StraightLine< MPTraits >::IsConnected ( const CfgType &  _start,
const CfgType &  _end,
CfgType &  _col,
LPOutput< MPTraits > *  _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:\n
LocalPlannerPointer lp = this->GetLocalPlanner(m_lpLabel);
Environment* env = this->GetEnvironment();
CfgType c1, c2, col;
lp->IsConnected(c1, c2, col, &lpOut, env->GetPositionRes(),
Definition: Environment.h:133
double GetOrientationRes() const noexcept
Get the orientation resolution.
Definition: Environment.cpp:585
double GetPositionRes() const noexcept
Get the position resolution.
Definition: Environment.cpp:571
LocalPlannerPointer GetLocalPlanner(const std::string &) const noexcept
Get a local planner by label from the owning MPLibrary.
Definition: MPBaseObject.h:372
Environment * GetEnvironment() const noexcept
Get the current environment.
Definition: MPBaseObject.h:454
Definition: LPOutput.h:22

Implements LocalPlannerMethod< MPTraits >.

◆ IsConnected() [2/4]

template<typename MPTraits >
bool StraightLine< MPTraits >::IsConnected ( const GroupCfgType _start,
const GroupCfgType _end,
GroupCfgType _col,
GroupLPOutput< MPTraits > *  _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.

Reimplemented from LocalPlannerMethod< MPTraits >.

◆ IsConnectedSLSequential()

template<typename MPTraits >
bool StraightLine< MPTraits >::IsConnectedSLSequential ( const CfgType &  _c1,
const CfgType &  _c2,
CfgType &  _col,
LPOutput< MPTraits > *  _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.

◆ IsConnectedSLBinary()

template<typename MPTraits >
bool StraightLine< MPTraits >::IsConnectedSLBinary ( const CfgType &  _c1,
const CfgType &  _c2,
CfgType &  _col,
LPOutput< MPTraits > *  _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.

◆ IsConnected() [3/4]

template<typename MPTraits >
bool LocalPlannerMethod< MPTraits >::IsConnected ( const CfgType &  _start,
const CfgType &  _end,
LPOutput< MPTraits > *  _lpOutput,
double  _posRes,
double  _oriRes,
bool  _checkCollision = true,
bool  _savePath = false 
)
inherited

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() [4/4]

template<typename MPTraits >
bool LocalPlannerMethod< MPTraits >::IsConnected ( const GroupCfgType _start,
const GroupCfgType _end,
GroupLPOutput< MPTraits > *  _lpOutput,
double  _posRes,
double  _oriRes,
bool  _checkCollision = true,
bool  _savePath = false,
const Formation &  _formation = Formation() 
)
inherited

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.

◆ BlindPath() [1/3]

template<typename MPTraits >
std::vector< typename MPTraits::CfgType > LocalPlannerMethod< MPTraits >::BlindPath ( const std::vector< CfgType > &  _waypoints,
const double  _posRes,
const double  _oriRes 
)
inherited

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:\n
LocalPlannerPointer lp = this->GetLocalPlanner(m_lpLabel);
Environment* env = this->GetEnvironment();
CfgType c1, c2;
lp->BlindPath({c1, c2}, env->GetPositionRes(), env->GetOrientationRes());

◆ BlindPath() [2/3]

template<typename MPTraits >
std::vector< typename MPTraits::CfgType > LocalPlannerMethod< MPTraits >::BlindPath ( const std::vector< CfgType > &  _waypoints)
inherited

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

◆ BlindPath() [3/3]

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

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

◆ Initialize()

template<typename MPTraits >
virtual void MPBaseObject< MPTraits >::Initialize ( )
virtualinherited

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 in ConnectorMethod< MPTraits >, CBSQuery< MPTraits >, ComposeEvaluator< MPTraits >, LazyQuery< MPTraits >, QueryMethod< MPTraits >, SIPPMethod< MPTraits >, TimeEvaluator< MPTraits >, TimeMetric< MPTraits >, AdaptiveRRT< MPTraits >, BasicPRM< MPTraits >, BasicRRTStrategy< MPTraits >, TogglePRMStrategy< MPTraits >, ValidationStrategy< MPTraits >, LKHSearch< MPTraits >, ClearanceUtility< MPTraits >, ReachabilityUtil< MPTraits >, SafeIntervalTool< MPTraits >, and TopologicalMap< MPTraits >.

◆ SetName()

template<typename MPTraits >
void MPBaseObject< MPTraits >::SetName ( const std::string &  _s)
protectedinherited
Parameters
_sClass name

◆ GetBaseFilename()

template<typename MPTraits >
const std::string & MPBaseObject< MPTraits >::GetBaseFilename ( ) const
protectedinherited
Returns
base file name from MPProblem

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