Class DiscreteControlSpace

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Class Documentation

class DiscreteControlSpace : public ompl::control::ControlSpace

A space representing discrete controls; i.e. there are a small number of discrete controls the system can react to. Controls are represented as integers [lowerBound, upperBound], where lowerBound and upperBound are inclusive.

Public Functions

inline DiscreteControlSpace(const base::StateSpacePtr &stateSpace, int lowerBound, int upperBound)

Construct a discrete space in wich controls can take values in the set [lowerBound, upperBound].

~DiscreteControlSpace() override = default
virtual unsigned int getDimension() const override

Get the dimension of this control space.

virtual void copyControl(Control *destination, const Control *source) const override

Copy a control to another.

virtual bool equalControls(const Control *control1, const Control *control2) const override

Check if two controls are the same.

virtual ControlSamplerPtr allocDefaultControlSampler() const override

Allocate the default control sampler.

virtual Control *allocControl() const override

Allocate memory for a control.

virtual void freeControl(Control *control) const override

Free the memory of a control.

virtual void nullControl(Control *control) const override

This sets the control value to lowerBound_.

virtual void printControl(const Control *control, std::ostream &out) const override

Print a control to a stream.

virtual void printSettings(std::ostream &out) const override

Print the settings for this control space to a stream.

inline unsigned int getControlCount() const

Returns the number of controls possible.

inline int getLowerBound() const

Returns the lowest possible control value.

inline int getUpperBound() const

Returns the highest possible control value.

inline void setBounds(int lowerBound, int upperBound)

Set the bounds for the states in this space (the states will be in the set [lowerBound, upperBound].

virtual void setup() override

Perform final setup steps. This function is automatically called by the SpaceInformation.

virtual unsigned int getSerializationLength() const override

Returns the serialization size for a single control in this space.

virtual void serialize(void *serialization, const Control *ctrl) const override

Serializes the given control into the serialization buffer.

virtual void deserialize(Control *ctrl, const void *serialization) const override

Deserializes a control from the serialization buffer.

Protected Attributes

int lowerBound_

The lowest integer state.

int upperBound_

The highest integer state.

class ControlType : public ompl::control::Control

The definition of a discrete control.

Public Members

int value

The current control - an int in range [lowerBound, upperBound].