37 #ifndef OMPL_BASE_STATE_SAMPLER_
38 #define OMPL_BASE_STATE_SAMPLER_
40 #include "ompl/base/State.h"
41 #include "ompl/util/RandomNumbers.h"
42 #include "ompl/util/ClassForward.h"
45 #include <boost/function.hpp>
46 #include <boost/noncopyable.hpp>
54 OMPL_CLASS_FORWARD(StateSpace);
59 OMPL_CLASS_FORWARD(StateSampler);
83 virtual void sampleUniformNear(State *state,
const State *near,
const double distance) = 0;
86 virtual void sampleGaussian(State *state,
const State *mean,
const double stdDev) = 0;
141 unsigned int samplerCount_;
boost::function< StateSamplerPtr(const StateSpace *)> StateSamplerAllocator
Definition of a function that can allocate a state sampler.
virtual void sampleGaussian(State *state, const State *mean, const double stdDev)=0
Sample a state using a Gaussian distribution with given mean and standard deviation (stdDev) ...
const StateSpace * space_
The state space this sampler samples.
std::vector< std::string > subspaces_
The names of common subspaces between space_ and subspace_; these are the ones copied after sampling ...
virtual void sampleGaussian(State *state, const State *mean, const double stdDev)
Sample a state using a Gaussian distribution with given mean and standard deviation (stdDev) ...
virtual void sampleUniform(State *state)
Sample a state.
A boost shared pointer wrapper for ompl::base::StateSampler.
RNG rng_
An instance of a random number generator.
virtual void sampleUniform(State *state)=0
Sample a state.
std::vector< StateSamplerPtr > samplers_
The samplers that are composed.
StateSamplerPtr subspaceSampler_
The sampler for the subspace.
SubspaceStateSampler(const StateSpace *space, const StateSpace *subspace, double weight)
Construct a sampler for space but only sample components common to subspace. Use weight as a multipli...
virtual void addSampler(const StateSamplerPtr &sampler, double weightImportance)
Add a sampler as part of the new compound sampler. This sampler is used to sample part of the compoun...
CompoundStateSampler(const StateSpace *space)
Constructor.
Random number generation. An instance of this class cannot be used by multiple threads at once (membe...
virtual void sampleUniformNear(State *state, const State *near, const double distance)
Sample a state near another, within specified distance.
StateSampler(const StateSpace *space)
Constructor.
virtual void sampleGaussian(State *state, const State *mean, const double stdDev)
Call sampleGaussian for each of the subspace states with stdDev scaled by the corresponding subspace ...
const StateSpace * subspace_
The subspace to sample.
Representation of a space in which planning can be performed. Topology specific sampling, interpolation and distance are defined.
Definition of an abstract state.
virtual void sampleUniformNear(State *state, const State *near, const double distance)
Call sampleUniformNear for each of the subspace states with distance scaled by the corresponding subs...
virtual ~CompoundStateSampler(void)
Destructor. This frees the added samplers as well.
double weight_
The weigth factor to multiply distance and stdDev when sampling in the vicinity of a state...
virtual void sampleUniform(State *state)
Sample a state.
virtual void sampleUniformNear(State *state, const State *near, const double distance)=0
Sample a state near another, within specified distance.
Definition of a compound state sampler. This is useful to construct samplers for compound states...
Abstract definition of a state space sampler.
Construct a sampler that samples only within a subspace of the space.
std::vector< double > weightImportance_
The weight of each sampler (used when sampling near a state)