37 #ifndef OMPL_BASE_VALID_STATE_SAMPLER_
38 #define OMPL_BASE_VALID_STATE_SAMPLER_
40 #include "ompl/base/State.h"
41 #include "ompl/util/ClassForward.h"
42 #include "ompl/base/GenericParam.h"
43 #include <boost/function.hpp>
44 #include <boost/noncopyable.hpp>
53 OMPL_CLASS_FORWARD(SpaceInformation);
58 OMPL_CLASS_FORWARD(ValidStateSampler);
boost::function< ValidStateSamplerPtr(const SpaceInformation *)> ValidStateSamplerAllocator
Definition of a function that can allocate a valid state sampler.
const ParamSet & params(void) const
Get the parameters for the valid state sampler.
const SpaceInformation * si_
The state space this sampler samples.
Maintain a set of parameters.
void setName(const std::string &name)
Set the name of the sampler.
const std::string & getName(void) const
Get the name of the sampler.
Abstract definition of a state sampler.
unsigned int attempts_
Number of attempts to find a valid sample.
Definition of an abstract state.
unsigned int getNrAttempts(void) const
Get the number of attempts to be performed by the sampling routine.
virtual bool sample(State *state)=0
Sample a state. Return false in case of failure.
virtual bool sampleNear(State *state, const State *near, const double distance)=0
Sample a state near another, within specified distance. Return false, in case of failure.
ParamSet params_
The parameters for this instance of the valid state sampler.
ValidStateSampler(const SpaceInformation *si)
Constructor.
std::string name_
The name of the sampler.
ParamSet & params(void)
Get the parameters for the valid state sampler.
void setNrAttempts(unsigned int attempts)
Finding a valid sample usually requires performing multiple attempts. This call allows setting the nu...