Parasol Planning Library (PPL)
UniformRandomSampler Class Reference

#include <UniformRandomSampler.h>

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

Public Types

Motion Planning Types
typedef MPBaseObject::GroupCfgType GroupCfgType
 
Local Types
typedef std::map< Robot *, const Boundary * > BoundaryMap
 A map from robots to sampling boundaries. More...
 
- 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
 UniformRandomSampler ()
 
 UniformRandomSampler (XMLNode &_node)
 
virtual ~UniformRandomSampler ()=default
 
MPBaseObject Overrides
virtual void Print (std::ostream &_os) const override
 
- 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

Sampler Rule
virtual bool Sampler (Cfg &_cfg, const Boundary *const _boundary, std::vector< Cfg > &_valid, std::vector< Cfg > &_invalid) override
 
virtual bool Sampler (GroupCfgType &_cfg, const Boundary *const _boundary, std::vector< GroupCfgType > &_valid, std::vector< GroupCfgType > &_invalid) override
 
virtual bool Sampler (GroupCfgType &_cfg, const BoundaryMap &_boundaryMap, std::vector< GroupCfgType > &_valid, std::vector< GroupCfgType > &_invalid) override
 
- 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
 

Additional Inherited Members

- Protected Attributes inherited from MPBaseObject
bool m_debug
 Print debug info? More...
 

Detailed Description

This sampler only validity-checks the input sample. It is only a 'uniform random' sampler if given a uniform random distribution of input samples.

Member Typedef Documentation

◆ BoundaryMap

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

A map from robots to sampling boundaries.

◆ GroupCfgType

Constructor & Destructor Documentation

◆ UniformRandomSampler() [1/2]

UniformRandomSampler::UniformRandomSampler ( )

◆ UniformRandomSampler() [2/2]

UniformRandomSampler::UniformRandomSampler ( XMLNode _node)

◆ ~UniformRandomSampler()

virtual UniformRandomSampler::~UniformRandomSampler ( )
virtualdefault

Member Function Documentation

◆ Print()

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

Print internal state of this object.

Parameters
_osThe std::ostream to print to.

Reimplemented from MPBaseObject.

◆ Sampler() [1/3]

bool UniformRandomSampler::Sampler ( Cfg _cfg,
const Boundary *const  _boundary,
std::vector< Cfg > &  _valid,
std::vector< Cfg > &  _invalid 
)
overrideprotectedvirtual

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 UniformRandomSampler::Sampler ( GroupCfgType _cfg,
const Boundary *const  _boundary,
std::vector< GroupCfgType > &  _valid,
std::vector< GroupCfgType > &  _invalid 
)
overrideprotectedvirtual

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 UniformRandomSampler::Sampler ( GroupCfgType _cfg,
const BoundaryMap _boundaryMap,
std::vector< GroupCfgType > &  _valid,
std::vector< GroupCfgType > &  _invalid 
)
overrideprotectedvirtual

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.


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