Class CompoundControlSampler

Inheritance Relationships

Base Type

Class Documentation

class CompoundControlSampler : public ompl::control::ControlSampler

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

Public Functions

inline CompoundControlSampler(const ControlSpace *space)

Constructor.

~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.

virtual void sample(Control *control) override

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

virtual 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.

virtual 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.

virtual 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.

Protected Attributes

std::vector<ControlSamplerPtr> samplers_

The instances of samplers used for compound sampler.