ompl::control::CompoundControlSampler Class Reference

Definition of a compound control sampler. This is useful to construct samplers for compound controls. More...

#include <ompl/control/ControlSampler.h>

Inheritance diagram for ompl::control::CompoundControlSampler:

Public Member Functions

 CompoundControlSampler (const ControlSpace *space)
 Constructor. More...
 
 ~CompoundControlSampler () override=default
 Destructor. This frees the added samplers as well.
 
virtual void addSampler (const ControlSamplerPtr &sampler)
 Add a sampler as part of the new compound sampler. This sampler is used to sample part of the compound control.
More...
 
void sample (Control *control) override
 Sample a control. All other control sampling functions default to this one, unless a user-specified implementation is given. More...
 
void sample (Control *control, const base::State *state) override
 Sample a control, given it is applied to a specific state (state). The default implementation calls the previous definition of sample(). Providing a different implementation of this function is useful if, for example, the sampling of controls depends on the state of the system. When attempting to sample controls that keep a system stable, for example, knowing the state at which the control is applied is important. More...
 
void sampleNext (Control *control, const Control *previous) override
 Sample a control, given the previously applied control. The default implementation calls the first definition of sample(). For some systems it is possible that large changes in controls are not desirable. For example, switching from maximum acceleration to maximum deceleration is not desirable when driving a car. More...
 
void sampleNext (Control *control, const Control *previous, const base::State *state) override
 Sample a control, given the previously applied control and that it is applied to a specific state. The default implementation calls the first definition of sample(), even if other implementations of the sampleNext() shown above are provided. Often this function needs to be overridden as it is the function planners typically call.
More...
 
- Public Member Functions inherited from ompl::control::ControlSampler
 ControlSampler (const ControlSampler &)=delete
 
ControlSampleroperator= (const ControlSampler &)=delete
 
 ControlSampler (const ControlSpace *space)
 Constructor takes the state space to construct samples for as argument. More...
 
virtual void sample (Control *control)=0
 Sample a control. All other control sampling functions default to this one, unless a user-specified implementation is given. More...
 
virtual void sample (Control *control, const base::State *state)
 Sample a control, given it is applied to a specific state (state). The default implementation calls the previous definition of sample(). Providing a different implementation of this function is useful if, for example, the sampling of controls depends on the state of the system. When attempting to sample controls that keep a system stable, for example, knowing the state at which the control is applied is important. More...
 
virtual void sampleNext (Control *control, const Control *previous)
 Sample a control, given the previously applied control. The default implementation calls the first definition of sample(). For some systems it is possible that large changes in controls are not desirable. For example, switching from maximum acceleration to maximum deceleration is not desirable when driving a car. More...
 
virtual void sampleNext (Control *control, const Control *previous, const base::State *state)
 Sample a control, given the previously applied control and that it is applied to a specific state. The default implementation calls the first definition of sample(), even if other implementations of the sampleNext() shown above are provided. Often this function needs to be overridden as it is the function planners typically call.
More...
 
virtual unsigned int sampleStepCount (unsigned int minSteps, unsigned int maxSteps)
 Sample a number of steps to execute a control for. More...
 

Protected Attributes

std::vector< ControlSamplerPtrsamplers_
 The instances of samplers used for compound sampler. More...
 
- Protected Attributes inherited from ompl::control::ControlSampler
const ControlSpacespace_
 The control space this sampler operates on. More...
 
RNG rng_
 Instance of random number generator. More...
 

Detailed Description

Definition of a compound control sampler. This is useful to construct samplers for compound controls.

Definition at line 128 of file ControlSampler.h.

Constructor & Destructor Documentation

◆ CompoundControlSampler()

ompl::control::CompoundControlSampler::CompoundControlSampler ( const ControlSpace space)
inline

Constructor.

Definition at line 132 of file ControlSampler.h.

Member Function Documentation

◆ addSampler()

void ompl::control::CompoundControlSampler::addSampler ( const ControlSamplerPtr sampler)
virtual

Add a sampler as part of the new compound sampler. This sampler is used to sample part of the compound control.

Definition at line 61 of file ControlSampler.cpp.

◆ sample() [1/2]

void ompl::control::CompoundControlSampler::sample ( Control control)
overridevirtual

Sample a control. All other control sampling functions default to this one, unless a user-specified implementation is given.

Implements ompl::control::ControlSampler.

Definition at line 67 of file ControlSampler.cpp.

◆ sample() [2/2]

void ompl::control::CompoundControlSampler::sample ( Control control,
const base::State state 
)
overridevirtual

Sample a control, given it is applied to a specific state (state). The default implementation calls the previous definition of sample(). Providing a different implementation of this function is useful if, for example, the sampling of controls depends on the state of the system. When attempting to sample controls that keep a system stable, for example, knowing the state at which the control is applied is important.

Reimplemented from ompl::control::ControlSampler.

Definition at line 74 of file ControlSampler.cpp.

◆ sampleNext() [1/2]

void ompl::control::CompoundControlSampler::sampleNext ( Control control,
const Control previous 
)
overridevirtual

Sample a control, given the previously applied control. The default implementation calls the first definition of sample(). For some systems it is possible that large changes in controls are not desirable. For example, switching from maximum acceleration to maximum deceleration is not desirable when driving a car.

Reimplemented from ompl::control::ControlSampler.

Definition at line 81 of file ControlSampler.cpp.

◆ sampleNext() [2/2]

void ompl::control::CompoundControlSampler::sampleNext ( Control control,
const Control previous,
const base::State state 
)
overridevirtual

Sample a control, given the previously applied control and that it is applied to a specific state. The default implementation calls the first definition of sample(), even if other implementations of the sampleNext() shown above are provided. Often this function needs to be overridden as it is the function planners typically call.

Reimplemented from ompl::control::ControlSampler.

Definition at line 89 of file ControlSampler.cpp.

Member Data Documentation

◆ samplers_

std::vector<ControlSamplerPtr> ompl::control::CompoundControlSampler::samplers_
protected

The instances of samplers used for compound sampler.

Definition at line 151 of file ControlSampler.h.


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