Class ControlSpace

Inheritance Relationships

Derived Types

Class Documentation

class ControlSpace

A control space representing the space of applicable controls.

Subclassed by ompl::control::CompoundControlSpace, ompl::control::DiscreteControlSpace, ompl::control::RealVectorControlSpace

Public Types

using ControlType = ompl::control::Control

Define the type of control allocated by this control space.

Public Functions

ControlSpace(const ControlSpace&) = delete
ControlSpace &operator=(const ControlSpace&) = delete
ControlSpace(base::StateSpacePtr stateSpace)

Construct a control space, given the state space.

virtual ~ControlSpace()
template<class T>
inline T *as()

Cast this instance to a desired type.

template<class T>
inline const T *as() const

Cast this instance to a desired type.

const std::string &getName() const

Get the name of the control space.

void setName(const std::string &name)

Set the name of the control space.

inline int getType() const

Get the type of the control space. The type can be used to verify whether two space instances are of the same type.

inline const base::StateSpacePtr &getStateSpace() const

Return the state space this control space depends on.

virtual unsigned int getDimension() const = 0

Get the dimension of this control space.

virtual Control *allocControl() const = 0

Allocate memory for a control.

virtual void freeControl(Control *control) const = 0

Free the memory of a control.

virtual void copyControl(Control *destination, const Control *source) const = 0

Copy a control to another.

virtual bool equalControls(const Control *control1, const Control *control2) const = 0

Check if two controls are the same.

virtual void nullControl(Control *control) const = 0

Make the control have no effect if it were to be applied to a state for any amount of time.

virtual ControlSamplerPtr allocDefaultControlSampler() const = 0

Allocate the default control sampler.

virtual ControlSamplerPtr allocControlSampler() const

Allocate an instance of the control sampler for this space. This sampler will be allocated with the sampler allocator that was previously specified by setControlSamplerAllocator() or, if no sampler allocator was specified, allocDefaultControlSampler() is called.

void setControlSamplerAllocator(const ControlSamplerAllocator &csa)

Set the sampler allocator to use.

void clearControlSamplerAllocator()

Clear the control sampler allocator (reset to default)

virtual double *getValueAddressAtIndex(Control *control, unsigned int index) const

Many controls contain a number of double values. This function provides a means to get the memory address of a double value from a control control located at position index. The first double value is returned for index = 0. If index is too large (does not point to any double values in the control), the return value is nullptr.

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

Print a control to a stream.

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

Print the settings for this control space to a stream.

virtual void setup()

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

virtual unsigned int getSerializationLength() const

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

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

Serializes the given control into the serialization buffer.

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

Deserializes a control from the serialization buffer.

void computeSignature(std::vector<int> &signature) const

Compute an array of ints that uniquely identifies the structure of the control space. The first element of the signature is the number of integers that follow.

virtual bool isCompound() const

Check if the control space is compound.

Protected Attributes

int type_

A type assigned for this control space.

base::StateSpacePtr stateSpace_

The state space controls can be applied to.

ControlSamplerAllocator csa_

An optional control sampler allocator.