Loading...
Searching...
No Matches
ompl::base::PrecomputedStateSampler Class Reference

State space sampler for discrete states. More...

#include <ompl/base/PrecomputedStateSampler.h>

Inheritance diagram for ompl::base::PrecomputedStateSampler:

Public Member Functions

 PrecomputedStateSampler (const StateSpace *space, const std::vector< const State * > &states)
 Constructor. Takes the state space to be sampled (space) and the set of states to draw samples from (states)
 PrecomputedStateSampler (const StateSpace *space, const std::vector< const State * > &states, std::size_t minStateIndex, std::size_t maxStateIndex)
 Constructor. Takes the state space to be sampled (space), the set of states to draw samples from (states) and a range to sample from: [minIndex, maxIndex].
void sampleUniform (State *state) override
 Sample a state.
void sampleUniformNear (State *state, const State *near, double distance) override
 Sample a state near another, within a neighborhood controlled by a distance parameter.
void sampleGaussian (State *state, const State *mean, double stdDev) override
 Sample a state using a Gaussian distribution with given mean and standard deviation (stdDev).
Public Member Functions inherited from ompl::base::StateSampler
 StateSampler (const StateSampler &)=delete
StateSampleroperator= (const StateSampler &)=delete
 StateSampler (const StateSpace *space)
 Constructor.

Protected Attributes

const std::vector< const State * > & states_
 The states to sample from.
std::size_t minStateIndex_
 The minimum index to start sampling at.
std::size_t maxStateIndex_
 The maximum index to stop sampling at.
Protected Attributes inherited from ompl::base::StateSampler
const StateSpacespace_
 The state space this sampler samples.
RNG rng_
 An instance of a random number generator.

Detailed Description

State space sampler for discrete states.

Definition at line 45 of file PrecomputedStateSampler.h.

Constructor & Destructor Documentation

◆ PrecomputedStateSampler() [1/2]

ompl::base::PrecomputedStateSampler::PrecomputedStateSampler ( const StateSpace * space,
const std::vector< const State * > & states )

Constructor. Takes the state space to be sampled (space) and the set of states to draw samples from (states)

Definition at line 41 of file PrecomputedStateSampler.cpp.

◆ PrecomputedStateSampler() [2/2]

ompl::base::PrecomputedStateSampler::PrecomputedStateSampler ( const StateSpace * space,
const std::vector< const State * > & states,
std::size_t minStateIndex,
std::size_t maxStateIndex )

Constructor. Takes the state space to be sampled (space), the set of states to draw samples from (states) and a range to sample from: [minIndex, maxIndex].

Definition at line 51 of file PrecomputedStateSampler.cpp.

Member Function Documentation

◆ sampleGaussian()

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

Sample a state using a Gaussian distribution with given mean and standard deviation (stdDev).

As with sampleUniform, the implementation of sampleGaussian is specific to the derived class and few assumptions can be made about the distance between state and mean.

Implements ompl::base::StateSampler.

Definition at line 79 of file PrecomputedStateSampler.cpp.

◆ sampleUniform()

void ompl::base::PrecomputedStateSampler::sampleUniform ( State * state)
overridevirtual

Sample a state.

Implements ompl::base::StateSampler.

Definition at line 64 of file PrecomputedStateSampler.cpp.

◆ sampleUniformNear()

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

Sample a state near another, within a neighborhood controlled by a distance parameter.

Typically, StateSampler-derived classes will return in state a state that is uniformly distributed within a ball with radius distance defined by the distance function from the corresponding state space. However, this is not guaranteed. For example, the default state sampler for the RealVectorStateSpace returns samples uniformly distributed using L_inf distance, while the default distance function is L_2 distance.

Implements ompl::base::StateSampler.

Definition at line 69 of file PrecomputedStateSampler.cpp.

Member Data Documentation

◆ maxStateIndex_

std::size_t ompl::base::PrecomputedStateSampler::maxStateIndex_
protected

The maximum index to stop sampling at.

Definition at line 69 of file PrecomputedStateSampler.h.

◆ minStateIndex_

std::size_t ompl::base::PrecomputedStateSampler::minStateIndex_
protected

The minimum index to start sampling at.

Definition at line 66 of file PrecomputedStateSampler.h.

◆ states_

const std::vector<const State *>& ompl::base::PrecomputedStateSampler::states_
protected

The states to sample from.

Definition at line 63 of file PrecomputedStateSampler.h.


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