A control space representing the space of applicable controls. More...
#include <ompl/control/ControlSpace.h>

Public Member Functions | |
ControlSpace (const ControlSpace &)=delete | |
ControlSpace & | operator= (const ControlSpace &)=delete |
ControlSpace (base::StateSpacePtr stateSpace) | |
Construct a control space, given the state space. More... | |
template<class T > | |
T * | as () |
Cast this instance to a desired type. More... | |
template<class T > | |
const T * | as () const |
Cast this instance to a desired type. More... | |
const std::string & | getName () const |
Get the name of the control space. More... | |
void | setName (const std::string &name) |
Set the name of the control space. More... | |
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. More... | |
const base::StateSpacePtr & | getStateSpace () const |
Return the state space this control space depends on. More... | |
virtual unsigned int | getDimension () const =0 |
Get the dimension of this control space. More... | |
virtual Control * | allocControl () const =0 |
Allocate memory for a control. More... | |
virtual void | freeControl (Control *control) const =0 |
Free the memory of a control. More... | |
virtual void | copyControl (Control *destination, const Control *source) const =0 |
Copy a control to another. More... | |
virtual bool | equalControls (const Control *control1, const Control *control2) const =0 |
Check if two controls are the same. More... | |
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. More... | |
virtual ControlSamplerPtr | allocDefaultControlSampler () const =0 |
Allocate the default control sampler. More... | |
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. More... | |
void | setControlSamplerAllocator (const ControlSamplerAllocator &csa) |
Set the sampler allocator to use. More... | |
void | clearControlSamplerAllocator () |
Clear the control sampler allocator (reset to default) More... | |
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. More... | |
virtual void | printControl (const Control *control, std::ostream &out) const |
Print a control to a stream. More... | |
virtual void | printSettings (std::ostream &out) const |
Print the settings for this control space to a stream. More... | |
virtual void | setup () |
Perform final setup steps. This function is automatically called by the SpaceInformation. More... | |
virtual unsigned int | getSerializationLength () const |
Returns the serialization size for a single control in this space. More... | |
virtual void | serialize (void *serialization, const Control *ctrl) const |
Serializes the given control into the serialization buffer. More... | |
virtual void | deserialize (Control *ctrl, const void *serialization) const |
Deserializes a control from the serialization buffer. More... | |
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. More... | |
virtual bool | isCompound () const |
Check if the control space is compound. More... | |
Protected Attributes | |
int | type_ |
A type assigned for this control space. More... | |
base::StateSpacePtr | stateSpace_ |
The state space controls can be applied to. More... | |
ControlSamplerAllocator | csa_ |
An optional control sampler allocator. More... | |
Detailed Description
A control space representing the space of applicable controls.
Definition at line 63 of file ControlSpace.h.
Constructor & Destructor Documentation
◆ ControlSpace()
ompl::control::ControlSpace::ControlSpace | ( | base::StateSpacePtr | stateSpace | ) |
Construct a control space, given the state space.
Definition at line 64 of file ControlSpace.cpp.
Member Function Documentation
◆ allocControl()
|
pure virtual |
Allocate memory for a control.
Implemented in ompl::control::CompoundControlSpace, ompl::control::DiscreteControlSpace, and ompl::control::RealVectorControlSpace.
◆ allocControlSampler()
|
virtual |
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.
Definition at line 86 of file ControlSpace.cpp.
◆ allocDefaultControlSampler()
|
pure virtual |
Allocate the default control sampler.
Implemented in KoulesControlSpace, ompl::control::CompoundControlSpace, ompl::control::DiscreteControlSpace, and ompl::control::RealVectorControlSpace.
◆ as() [1/2]
|
inline |
Cast this instance to a desired type.
Make sure the type we are casting to is indeed a control space
Definition at line 77 of file ControlSpace.h.
◆ as() [2/2]
|
inline |
Cast this instance to a desired type.
Make sure the type we are casting to is indeed a control space
Definition at line 87 of file ControlSpace.h.
◆ clearControlSamplerAllocator()
void ompl::control::ControlSpace::clearControlSamplerAllocator | ( | ) |
Clear the control sampler allocator (reset to default)
Definition at line 98 of file ControlSpace.cpp.
◆ computeSignature()
void ompl::control::ControlSpace::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.
Definition at line 131 of file ControlSpace.cpp.
◆ copyControl()
|
pure virtual |
Copy a control to another.
Implemented in ompl::control::CompoundControlSpace, ompl::control::DiscreteControlSpace, and ompl::control::RealVectorControlSpace.
◆ deserialize()
|
virtual |
Deserializes a control from the serialization buffer.
Reimplemented in ompl::control::CompoundControlSpace, ompl::control::DiscreteControlSpace, and ompl::control::RealVectorControlSpace.
Definition at line 127 of file ControlSpace.cpp.
◆ equalControls()
|
pure virtual |
Check if two controls are the same.
Implemented in ompl::control::CompoundControlSpace, ompl::control::DiscreteControlSpace, and ompl::control::RealVectorControlSpace.
◆ freeControl()
|
pure virtual |
Free the memory of a control.
Implemented in ompl::control::CompoundControlSpace, ompl::control::DiscreteControlSpace, and ompl::control::RealVectorControlSpace.
◆ getDimension()
|
pure virtual |
Get the dimension of this control space.
Implemented in ompl::control::CompoundControlSpace, ompl::control::DiscreteControlSpace, and ompl::control::RealVectorControlSpace.
◆ getName()
const std::string & ompl::control::ControlSpace::getName | ( | ) | const |
Get the name of the control space.
Definition at line 72 of file ControlSpace.cpp.
◆ getSerializationLength()
|
virtual |
Returns the serialization size for a single control in this space.
Reimplemented in ompl::control::CompoundControlSpace, ompl::control::DiscreteControlSpace, and ompl::control::RealVectorControlSpace.
Definition at line 118 of file ControlSpace.cpp.
◆ getStateSpace()
|
inline |
Return the state space this control space depends on.
Definition at line 110 of file ControlSpace.h.
◆ getType()
|
inline |
Get the type of the control space. The type can be used to verify whether two space instances are of the same type.
Definition at line 104 of file ControlSpace.h.
◆ getValueAddressAtIndex()
|
virtual |
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.
Reimplemented in ompl::control::CompoundControlSpace, and ompl::control::RealVectorControlSpace.
Definition at line 103 of file ControlSpace.cpp.
◆ isCompound()
|
virtual |
Check if the control space is compound.
Reimplemented in ompl::control::CompoundControlSpace.
Definition at line 138 of file ControlSpace.cpp.
◆ nullControl()
|
pure virtual |
Make the control have no effect if it were to be applied to a state for any amount of time.
Implemented in ompl::control::CompoundControlSpace, ompl::control::DiscreteControlSpace, and ompl::control::RealVectorControlSpace.
◆ printControl()
|
virtual |
Print a control to a stream.
Reimplemented in ompl::control::DiscreteControlSpace, ompl::control::RealVectorControlSpace, and ompl::control::CompoundControlSpace.
Definition at line 108 of file ControlSpace.cpp.
◆ printSettings()
|
virtual |
Print the settings for this control space to a stream.
Reimplemented in ompl::control::CompoundControlSpace, ompl::control::DiscreteControlSpace, and ompl::control::RealVectorControlSpace.
Definition at line 113 of file ControlSpace.cpp.
◆ serialize()
|
virtual |
Serializes the given control into the serialization buffer.
Reimplemented in ompl::control::CompoundControlSpace, ompl::control::DiscreteControlSpace, and ompl::control::RealVectorControlSpace.
Definition at line 123 of file ControlSpace.cpp.
◆ setControlSamplerAllocator()
void ompl::control::ControlSpace::setControlSamplerAllocator | ( | const ControlSamplerAllocator & | csa | ) |
Set the sampler allocator to use.
Definition at line 93 of file ControlSpace.cpp.
◆ setName()
void ompl::control::ControlSpace::setName | ( | const std::string & | name | ) |
Set the name of the control space.
Definition at line 77 of file ControlSpace.cpp.
◆ setup()
|
virtual |
Perform final setup steps. This function is automatically called by the SpaceInformation.
Reimplemented in ompl::control::CompoundControlSpace, ompl::control::DiscreteControlSpace, and ompl::control::RealVectorControlSpace.
Definition at line 82 of file ControlSpace.cpp.
Member Data Documentation
◆ csa_
|
protected |
An optional control sampler allocator.
Definition at line 190 of file ControlSpace.h.
◆ stateSpace_
|
protected |
The state space controls can be applied to.
Definition at line 187 of file ControlSpace.h.
◆ type_
|
protected |
A type assigned for this control space.
Definition at line 184 of file ControlSpace.h.
The documentation for this class was generated from the following files:
- ompl/control/ControlSpace.h
- ompl/control/src/ControlSpace.cpp