Class ValidStateSampler

Inheritance Relationships

Derived Types

Class Documentation

class ValidStateSampler

Abstract definition of a state sampler.

Subclassed by ompl::base::BridgeTestValidStateSampler, ompl::base::ConditionalStateSampler, ompl::base::ConstrainedValidStateSampler, ompl::base::GaussianValidStateSampler, ompl::base::MaximizeClearanceValidStateSampler, ompl::base::MinimumClearanceValidStateSampler, ompl::base::ObstacleBasedValidStateSampler, ompl::base::UniformValidStateSampler

Public Functions

ValidStateSampler(const ValidStateSampler&) = delete
ValidStateSampler &operator=(const ValidStateSampler&) = delete
ValidStateSampler(const SpaceInformation *si)

Constructor.

virtual ~ValidStateSampler()
inline const std::string &getName() const

Get the name of the sampler.

inline void setName(const std::string &name)

Set the name of the sampler.

virtual bool sample(State *state) = 0

Sample a state. Return false in case of failure.

virtual bool sampleNear(State *state, const State *near, double distance) = 0

Sample a state near another, within specified distance. Return false, in case of failure.

Note

The memory for near must be disjoint from the memory for state

inline void setNrAttempts(unsigned int attempts)

Finding a valid sample usually requires performing multiple attempts. This call allows setting the number of such attempts.

inline unsigned int getNrAttempts() const

Get the number of attempts to be performed by the sampling routine.

inline ParamSet &params()

Get the parameters for the valid state sampler.

inline const ParamSet &params() const

Get the parameters for the valid state sampler.

Protected Attributes

const SpaceInformation *si_

The state space this sampler samples.

unsigned int attempts_

Number of attempts to find a valid sample.

std::string name_

The name of the sampler.

ParamSet params_

The parameters for this instance of the valid state sampler.