Class CForestStateSampler

Inheritance Relationships

Base Type

Class Documentation

class CForestStateSampler : public ompl::base::StateSampler

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

Public Functions

inline CForestStateSampler(const StateSpace *space, StateSamplerPtr sampler)

Constructor.

inline ~CForestStateSampler() override

Destructor.

virtual 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.

virtual 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.

virtual 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.

inline const StateSpace *getStateSpace() 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().

void clear()

Protected Functions

void getNextSample(State *state)

Extracts the next sample when statesToSample_ is not empty.

Protected Attributes

std::vector<State*> statesToSample_

States to be sampled.

StateSamplerPtr sampler_

Underlying, user-specified state sampler.

std::mutex statesLock_

Lock to control the access to the statesToSample_ vector.