Parasol Planning Library (PPL)
BridgeTestSampler Class Reference

This sampler validity checks the input sample and accepts it iff it passes the bridge test - i.e., a random, Gaussian ray places the sample in the center of a ray and it only passes if the sample is valid but the ray's two endpoints are invalid. More...

#include <BridgeTestSampler.h>

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

Public Types

Motion Planning Types
typedef MPBaseObject::GroupCfgType GroupCfgType
 
typedef std::map< Robot *, const Boundary * > BoundaryMap
 
- Public Types inherited from SamplerMethod
typedef MPBaseObject::GroupCfgType GroupCfgType
 
typedef std::vector< Cfg >::iterator InputIterator
 
typedef std::back_insert_iterator< std::vector< Cfg > > OutputIterator
 
typedef std::vector< GroupCfgType >::iterator GroupInputIterator
 
typedef std::back_insert_iterator< std::vector< GroupCfgType > > GroupOutputIterator
 
typedef std::map< Robot *, const Boundary * > BoundaryMap
 A map from robots to sampling boundaries. More...
 
- 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
 BridgeTestSampler (string _vcLabel="", string _dmLabel="", double _d=0.5, bool _useBoundary=false)
 
 BridgeTestSampler (XMLNode &_node)
 
virtual ~BridgeTestSampler ()=default
 
MPBaseObjectOverrides
virtual void Print (ostream &_os) const override
 
Parser
void ParseXML (XMLNode &_node)
 
Sampler Rule
virtual bool Sampler (GroupCfgType &_cfg, const Boundary *const _boundary, vector< GroupCfgType > &_valid, vector< GroupCfgType > &_invalid)
 
virtual bool Sampler (Cfg &_cfg, const Boundary *const _boundary, vector< Cfg > &_valid, vector< Cfg > &_invalid)
 
virtual bool Sampler (GroupCfgType &_cfg, const BoundaryMap &_boundaryMap, std::vector< GroupCfgType > &_valid, std::vector< GroupCfgType > &_invalid)
 
- Public Member Functions inherited from SamplerMethod
 SamplerMethod ()=default
 
 SamplerMethod (XMLNode &_node)
 
virtual ~SamplerMethod ()=0
 
virtual void Sample (size_t _numNodes, size_t _maxAttempts, const Boundary *const _boundary, OutputIterator _valid, OutputIterator _invalid)
 
virtual void Sample (size_t _numNodes, size_t _maxAttempts, const Boundary *const _boundary, OutputIterator _valid)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
virtual void Sample (size_t _numNodes, size_t _maxAttempts, const Boundary *const _robotBoundary, const Boundary *const _eeBoundary, OutputIterator _valid, OutputIterator _invalid)
 
virtual void Sample (size_t _numNodes, size_t _maxAttempts, const Boundary *const _robotBoundary, const Boundary *const _eeBoundary, OutputIterator _valid)
 
virtual void Filter (InputIterator _first, InputIterator _last, size_t _maxAttempts, const Boundary *const _boundary, OutputIterator _valid, OutputIterator _invalid)
 
void Filter (InputIterator _first, InputIterator _last, size_t _maxAttempts, const Boundary *const _boundary, OutputIterator _valid)
 
virtual void Sample (size_t _numNodes, size_t _maxAttempts, const Boundary *const _boundary, GroupOutputIterator _valid, GroupOutputIterator _invalid)
 
virtual void Sample (size_t _numNodes, size_t _maxAttempts, const Boundary *const _boundary, GroupOutputIterator _valid)
 
virtual void Sample (size_t _numNodes, size_t _maxAttempts, const BoundaryMap &_boundary, GroupOutputIterator _valid, GroupOutputIterator _invalid)
 
virtual void Sample (size_t _numNodes, size_t _maxAttempts, const BoundaryMap &_boundary, GroupOutputIterator _valid)
 
virtual void Filter (GroupInputIterator _first, GroupInputIterator _last, size_t _maxAttempts, const Boundary *const _boundary, GroupOutputIterator _valid, GroupOutputIterator _invalid)
 
void Filter (GroupInputIterator _first, GroupInputIterator _last, size_t _maxAttempts, const Boundary *const _boundary, GroupOutputIterator _valid)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. 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...
 
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 GroupInBounds (GroupCfgType &_gcfg, const BoundaryMap &_boundaryMap)
 
- Protected Member Functions inherited from SamplerMethod
virtual bool Sampler (Cfg &_cfg, const Boundary *const _robotBoundary, const Boundary *const _eeBoundary, std::vector< Cfg > &_valid, std::vector< Cfg > &_invalid)
 
- Protected Member Functions inherited from MPBaseObject
void SetName (const std::string &_s)
 
const std::string & GetBaseFilename () const
 

Protected Attributes

Internal State


double m_d
 Gaussian d-value obtained from distribution. More...
 
bool m_useBoundary
 use Bbox as obstacle? More...
 
std::string m_vcLabel
 
std::string m_dmLabel
 The distance metric to use. More...
 
- Protected Attributes inherited from MPBaseObject
bool m_debug
 Print debug info? More...
 

Detailed Description

This sampler validity checks the input sample and accepts it iff it passes the bridge test - i.e., a random, Gaussian ray places the sample in the center of a ray and it only passes if the sample is valid but the ray's two endpoints are invalid.

Member Typedef Documentation

◆ BoundaryMap

typedef std::map<Robot*, const Boundary*> BridgeTestSampler::BoundaryMap

◆ GroupCfgType

Constructor & Destructor Documentation

◆ BridgeTestSampler() [1/2]

BridgeTestSampler::BridgeTestSampler ( std::string  _vcLabel = "",
std::string  _dmLabel = "",
double  _d = 0.5,
bool  _useBoundary = false 
)

◆ BridgeTestSampler() [2/2]

BridgeTestSampler::BridgeTestSampler ( XMLNode _node)

◆ ~BridgeTestSampler()

virtual BridgeTestSampler::~BridgeTestSampler ( )
virtualdefault

Member Function Documentation

◆ GroupInBounds()

bool BridgeTestSampler::GroupInBounds ( GroupCfgType _gcfg,
const BoundaryMap _boundaryMap 
)
protected

Check if all configurations within a group are inside their respective boundaries

◆ ParseXML()

void BridgeTestSampler::ParseXML ( XMLNode _node)

◆ Print()

void BridgeTestSampler::Print ( ostream &  _os) const
overridevirtual

Print internal state of this object.

Parameters
_osThe std::ostream to print to.

Reimplemented from MPBaseObject.

◆ Sampler() [1/3]

bool BridgeTestSampler::Sampler ( Cfg _cfg,
const Boundary *const  _boundary,
vector< Cfg > &  _valid,
vector< Cfg > &  _invalid 
)
virtual

Takes a single input configuration and applies the sampler rule to generate one or more output configurations.

Parameters
_cfgThe input configuration.
_boundaryThe sampling boundary.
_validThe resulting output configurations.
_invalidThe (optional) return for failed attempts.
Returns
True if a valid configuration was generated, false otherwise.

Reimplemented from SamplerMethod.

◆ Sampler() [2/3]

bool BridgeTestSampler::Sampler ( GroupCfgType _cfg,
const Boundary *const  _boundary,
vector< GroupCfgType > &  _valid,
vector< GroupCfgType > &  _invalid 
)
virtual

Takes a single input configuration and applies the sampler rule to generate one or more output configurations.

Parameters
_cfgThe input group configuration.
_boundaryThe sampling boundary.
_validThe resulting output configurations.
_invalidThe (optional) return for failed attempts.
Returns
True if a valid configuration was generated, false otherwise.

Reimplemented from SamplerMethod.

◆ Sampler() [3/3]

bool BridgeTestSampler::Sampler ( GroupCfgType _cfg,
const BoundaryMap _boundaryMap,
std::vector< GroupCfgType > &  _valid,
std::vector< GroupCfgType > &  _invalid 
)
virtual

This version specifies a (possibly different) boundary for each robot. Robots which are not in the boundary map will use the environment boundary. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented from SamplerMethod.

Field Documentation

◆ m_d

double BridgeTestSampler::m_d
protected

Gaussian d-value obtained from distribution.

◆ m_dmLabel

std::string BridgeTestSampler::m_dmLabel
protected

The distance metric to use.

◆ m_useBoundary

bool BridgeTestSampler::m_useBoundary
protected

use Bbox as obstacle?

◆ m_vcLabel

std::string BridgeTestSampler::m_vcLabel
protected

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