Parasol Planning Library (PPL)
|
#include <SamplerMethod.h>
Public Types | |
Motion Planning Types | |
typedef MPBaseObject::GroupCfgType | GroupCfgType |
Local Types | |
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< Cfg > | WeightType |
typedef GenericStateGraph< Cfg, WeightType > | RoadmapType |
typedef GroupCfg< RoadmapType > | GroupCfgType |
typedef GroupLocalPlan< RoadmapType > | GroupWeightType |
typedef GroupRoadmap< GroupCfgType, GroupWeightType > | GroupRoadmapType |
Public Member Functions | |
Construction | |
SamplerMethod ()=default | |
SamplerMethod (XMLNode &_node) | |
virtual | ~SamplerMethod ()=0 |
Individual Configuration Sampling | |
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) |
Group Configuration Sampling | |
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 | Print (std::ostream &_os) const |
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... | |
MPLibrary * | GetMPLibrary () const noexcept |
Get the owning MPLibrary. More... | |
bool | IsRunning () const noexcept |
Check the library's running flag. More... | |
MPProblem * | GetMPProblem () const noexcept |
Get the library's current MPProblem. More... | |
Environment * | GetEnvironment () const noexcept |
Get the current environment. More... | |
MPTask * | GetTask () const noexcept |
Get the current task. More... | |
GroupTask * | GetGroupTask () const noexcept |
Get the current group task. More... | |
MPSolutionType * | GetMPSolution () const noexcept |
RoadmapType * | GetRoadmap (Robot *const _r=nullptr) const noexcept |
Get the current free-space roadmap. More... | |
GroupRoadmapType * | GetGroupRoadmap (RobotGroup *const _g=nullptr) const noexcept |
Get the current free-space group roadmap. More... | |
RoadmapType * | GetBlockRoadmap (Robot *const _r=nullptr) const noexcept |
Get the current obstacle-space roadmap. More... | |
Path * | GetPath (Robot *const _r=nullptr) const noexcept |
GroupPath * | GetGroupPath (RobotGroup *const _g=nullptr) const noexcept |
Get the current best group path. More... | |
StatClass * | GetStatClass () const noexcept |
Get the current StatClass. More... | |
LocalObstacleMap * | GetLocalObstacleMap () const noexcept |
Get the local obstacle map. More... | |
Protected Member Functions | |
Sampler Rule | |
The default implementations of these throw exceptions so that derived classes can avoid implementing unsupported functions (as opposed to making these pure virtual). | |
virtual bool | Sampler (Cfg &_cfg, const Boundary *const _boundary, std::vector< Cfg > &_valid, std::vector< Cfg > &_invalid) |
virtual bool | Sampler (Cfg &_cfg, const Boundary *const _robotBoundary, const Boundary *const _eeBoundary, std::vector< Cfg > &_valid, std::vector< Cfg > &_invalid) |
virtual bool | Sampler (GroupCfgType &_cfg, const Boundary *const _boundary, std::vector< GroupCfgType > &_valid, std::vector< GroupCfgType > &_invalid) |
virtual bool | Sampler (GroupCfgType &_cfg, const BoundaryMap &_boundaryMap, std::vector< GroupCfgType > &_valid, std::vector< GroupCfgType > &_invalid) |
Protected Member Functions inherited from MPBaseObject | |
void | SetName (const std::string &_s) |
const std::string & | GetBaseFilename () const |
Friends | |
class | MixSampler |
Additional Inherited Members | |
Protected Attributes inherited from MPBaseObject | |
bool | m_debug |
Print debug info? More... | |
Base algorithm abstraction for Samplers.
SamplerMethod has three sets of important functions. The first two are the various public methods in the base class, Sample
and Filter
, and third is the private virtual function which the derived classes overload, Sampler
.
Sample
is called in various ways but they break down into two forms: desired number and input configurations. When specifying a desired number n
of configurations the sampler attempts a
attempts per desired sample. The output is placed on an output iterator.
@usage
Filter
sends a list of input configurations to apply the sampler rule to.
@usage
typedef std::map<Robot*, const Boundary*> SamplerMethod::BoundaryMap |
A map from robots to sampling boundaries.
typedef std::vector<GroupCfgType>::iterator SamplerMethod::GroupInputIterator |
typedef std::back_insert_iterator<std::vector<GroupCfgType> > SamplerMethod::GroupOutputIterator |
typedef std::vector<Cfg>::iterator SamplerMethod::InputIterator |
typedef std::back_insert_iterator<std::vector<Cfg> > SamplerMethod::OutputIterator |
|
default |
SamplerMethod::SamplerMethod | ( | XMLNode & | _node | ) |
|
pure virtualdefault |
void SamplerMethod::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.
|
virtual |
Apply the sampler rule to a set of existing configurations. The output will generally be a filtered or perturbed version of the input set.
_first | An iterator to the beginning of a list of input configurations. |
_last | An iterator to the end of a list of input configurations. |
_maxAttempts | The maximum number of attempts to successfully apply the sampler rule to each input. |
_boundary | The sampling boundary to use. |
_valid | An iterator to storage for the output configurations. |
_invalid | An (optional) iterator to storage for failed attempts. |
void SamplerMethod::Filter | ( | InputIterator | _first, |
InputIterator | _last, | ||
size_t | _maxAttempts, | ||
const Boundary *const | _boundary, | ||
OutputIterator | _valid | ||
) |
This version does not return invalid samples. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
virtual |
Apply the sampler rule to a set of existing configurations. The output will generally be a filtered or perturbed version of the input set.
_first | An iterator to the beginning of a list of input configurations. |
_last | An iterator to the end of a list of input configurations. |
_maxAttempts | The maximum number of attempts to successfully apply the sampler rule to each input. |
_boundary | The sampling boundary to use. |
_valid | An iterator to storage for the output configurations. |
_invalid | An (optional) iterator to storage for failed attempts. |
|
virtual |
This version does not return invalid samples. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
virtual |
Try to sample a set number of new configurations from a single boundary.
_numNodes | The number of samples desired. |
_maxAttempts | The maximum number of attempts for each sample. |
_boundary | The boundary to sample from. |
_valid | An iterator to storage for the new configurations. |
_invalid | An (optional) iterator to storage for failed attempts. |
|
virtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
virtual |
Try to sample a set number of new configurations from a given boundary.
_numNodes | The number of samples desired. |
_maxAttempts | The maximum number of attempts for each sample. |
_boundary | The boundary to sample from. |
_valid | An iterator to storage for the new configurations. |
_invalid | An (optional) iterator to storage for failed attempts. |
|
virtual |
This version does not return invalid samples. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
virtual |
Try to sample a set number of new configurations from a given boundary (for the entire robot), and additionally satisfying a constraint boundary for the end-effector (robot is presumed to have only one EE).
_robotBoundary | The boundary for the entire robot. |
_eeBoundary | The boundary for the end-effector. |
|
virtual |
This version does not return invalid samples. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
virtual |
Try to sample a set number of new configurations from a boundary for each robot.
_numNodes | The number of samples desired. |
_maxAttempts | The maximum number of attempts for each sample. |
_boundaryMap | A map from robot to sampling boundary. Any robots which are not found in the map will use the environment boundary. |
_valid | An iterator to storage for the new configurations. |
_invalid | An (optional) iterator to storage for failed attempts. |
|
protectedvirtual |
Takes a single input configuration and applies the sampler rule to generate one or more output configurations.
_cfg | The input configuration. |
_boundary | The sampling boundary. |
_valid | The resulting output configurations. |
_invalid | The (optional) return for failed attempts. |
Reimplemented in BridgeTestSampler, MixSampler, GaussianSampler, UniformRandomSampler, UniformObstacleBasedSampler, and ObstacleBasedSampler.
|
protectedvirtual |
This version also specifies a boundary for the end-effector. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
protectedvirtual |
Takes a single input configuration and applies the sampler rule to generate one or more output configurations.
_cfg | The input group configuration. |
_boundary | The sampling boundary. |
_valid | The resulting output configurations. |
_invalid | The (optional) return for failed attempts. |
Reimplemented in BridgeTestSampler, UniformRandomSampler, UniformObstacleBasedSampler, and ObstacleBasedSampler.
|
protectedvirtual |
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 in UniformRandomSampler, BridgeTestSampler, and ObstacleBasedSampler.
|
friend |