ompl::base::CForestStateSampler Class Reference

Extended state sampler to use with the CForest planning algorithm. It wraps the user-specified state sampler. More...

#include <ompl/geometric/planners/cforest/CForestStateSampler.h>

Inheritance diagram for ompl::base::CForestStateSampler:

Public Member Functions

 CForestStateSampler (const StateSpace *space, StateSamplerPtr sampler)
 Constructor. More...
 
 ~CForestStateSampler () override
 Destructor. More...
 
void sampleUniform (State *state) override
 It will sample the next state of the vector StatesToSample_. If this is empty, it will call the sampleUniform() method of the specified sampler. More...
 
void sampleUniformNear (State *state, const State *near, double distance) override
 It will sample the next state of the vector StatesToSample_. If this is empty, it will call the sampleUniformNear() method of the specified sampler. More...
 
void sampleGaussian (State *state, const State *mean, double stdDev) override
 It will sample the next state of the vector StatesToSample_. If this is empty, it will call the sampleGaussian() method of the specified sampler. More...
 
const StateSpacegetStateSpace () const
 
void setStatesToSample (const std::vector< const State * > &states)
 Fills the vector StatesToSample_ of states to be sampled in the next calls to sampleUniform(), sampleUniformNear() or sampleGaussian(). More...
 
void clear ()
 
- Public Member Functions inherited from ompl::base::StateSampler
 StateSampler (const StateSampler &)=delete
 
StateSampleroperator= (const StateSampler &)=delete
 
 StateSampler (const StateSpace *space)
 Constructor. More...
 
virtual void sampleUniform (State *state)=0
 Sample a state. More...
 
virtual void sampleUniformNear (State *state, const State *near, double distance)=0
 Sample a state near another, within a neighborhood controlled by a distance parameter. More...
 
virtual void sampleGaussian (State *state, const State *mean, double stdDev)=0
 Sample a state using a Gaussian distribution with given mean and standard deviation (stdDev). More...
 

Protected Member Functions

void getNextSample (State *state)
 Extracts the next sample when statesToSample_ is not empty. More...
 

Protected Attributes

std::vector< State * > statesToSample_
 States to be sampled. More...
 
StateSamplerPtr sampler_
 Underlying, user-specified state sampler. More...
 
std::mutex statesLock_
 Lock to control the access to the statesToSample_ vector. More...
 
- Protected Attributes inherited from ompl::base::StateSampler
const StateSpacespace_
 The state space this sampler samples. More...
 
RNG rng_
 An instance of a random number generator. More...
 

Detailed Description

Extended state sampler to use with the CForest planning algorithm. It wraps the user-specified state sampler.

Definition at line 51 of file CForestStateSampler.h.

Constructor & Destructor Documentation

◆ CForestStateSampler()

ompl::base::CForestStateSampler::CForestStateSampler ( const StateSpace space,
StateSamplerPtr  sampler 
)
inline

Constructor.

Definition at line 55 of file CForestStateSampler.h.

◆ ~CForestStateSampler()

ompl::base::CForestStateSampler::~CForestStateSampler ( )
inlineoverride

Destructor.

Definition at line 61 of file CForestStateSampler.h.

Member Function Documentation

◆ clear()

void ompl::base::CForestStateSampler::clear ( )

Definition at line 88 of file CForestStateSampler.cpp.

◆ getNextSample()

void ompl::base::CForestStateSampler::getNextSample ( State state)
protected

Extracts the next sample when statesToSample_ is not empty.

Definition at line 80 of file CForestStateSampler.cpp.

◆ getStateSpace()

const StateSpace * ompl::base::CForestStateSampler::getStateSpace ( ) const
inline

Definition at line 78 of file CForestStateSampler.h.

◆ sampleGaussian()

void ompl::base::CForestStateSampler::sampleGaussian ( State state,
const State mean,
double  stdDev 
)
overridevirtual

It will sample the next state of the vector StatesToSample_. If this is empty, it will call the sampleGaussian() method of the specified sampler.

Implements ompl::base::StateSampler.

Definition at line 55 of file CForestStateSampler.cpp.

◆ sampleUniform()

void ompl::base::CForestStateSampler::sampleUniform ( State state)
overridevirtual

It will sample the next state of the vector StatesToSample_. If this is empty, it will call the sampleUniform() method of the specified sampler.

Implements ompl::base::StateSampler.

Definition at line 39 of file CForestStateSampler.cpp.

◆ sampleUniformNear()

void ompl::base::CForestStateSampler::sampleUniformNear ( State state,
const State near,
double  distance 
)
overridevirtual

It will sample the next state of the vector StatesToSample_. If this is empty, it will call the sampleUniformNear() method of the specified sampler.

Implements ompl::base::StateSampler.

Definition at line 47 of file CForestStateSampler.cpp.

◆ setStatesToSample()

void ompl::base::CForestStateSampler::setStatesToSample ( const std::vector< const State * > &  states)

Fills the vector StatesToSample_ of states to be sampled in the next calls to sampleUniform(), sampleUniformNear() or sampleGaussian().

Definition at line 63 of file CForestStateSampler.cpp.

Member Data Documentation

◆ sampler_

StateSamplerPtr ompl::base::CForestStateSampler::sampler_
protected

Underlying, user-specified state sampler.

Definition at line 97 of file CForestStateSampler.h.

◆ statesLock_

std::mutex ompl::base::CForestStateSampler::statesLock_
protected

Lock to control the access to the statesToSample_ vector.

Definition at line 100 of file CForestStateSampler.h.

◆ statesToSample_

std::vector<State *> ompl::base::CForestStateSampler::statesToSample_
protected

States to be sampled.

Definition at line 94 of file CForestStateSampler.h.


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