Loading...
Searching...
No Matches
ompl::control::RealVectorControlSpace Class Reference

A control space representing Rn. More...

#include <ompl/control/spaces/RealVectorControlSpace.h>

Inheritance diagram for ompl::control::RealVectorControlSpace:

Classes

class  ControlType
 The definition of a control in Rn More...
 

Public Member Functions

 RealVectorControlSpace (const base::StateSpacePtr &stateSpace, unsigned int dim)
 Constructor takes the state space the controls correspond to and the dimension of the space of controls, dim.
 
void setBounds (const base::RealVectorBounds &bounds)
 Set the bounds (min max values for each dimension) for the control.
 
const base::RealVectorBoundsgetBounds () const
 Get the bounds (min max values for each dimension) for the control.
 
unsigned int getDimension () const override
 Get the dimension of this control space.
 
void copyControl (Control *destination, const Control *source) const override
 Copy a control to another.
 
bool equalControls (const Control *control1, const Control *control2) const override
 Check if two controls are the same.
 
ControlSamplerPtr allocDefaultControlSampler () const override
 Allocate the default control sampler.
 
ControlallocControl () const override
 Allocate memory for a control.
 
void freeControl (Control *control) const override
 Free the memory of a control.
 
void nullControl (Control *control) const override
 Make the control have no effect if it were to be applied to a state for any amount of time.
 
void printControl (const Control *control, std::ostream &out) const override
 Print a control to a stream.
 
double * getValueAddressAtIndex (Control *control, unsigned int index) const override
 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.
 
void printSettings (std::ostream &out) const override
 Print the settings for this control space to a stream.
 
void setup () override
 Perform final setup steps. This function is automatically called by the SpaceInformation.
 
unsigned int getSerializationLength () const override
 Returns the serialization size for a single control in this space.
 
void serialize (void *serialization, const Control *ctrl) const override
 Serializes the given control into the serialization buffer.
 
void deserialize (Control *ctrl, const void *serialization) const override
 Deserializes a control from the serialization buffer.
 
- Public Member Functions inherited from ompl::control::ControlSpace
 ControlSpace (const ControlSpace &)=delete
 
ControlSpaceoperator= (const ControlSpace &)=delete
 
 ControlSpace (base::StateSpacePtr stateSpace)
 Construct a control space, given the state space.
 
template<class T >
T * as ()
 Cast this instance to a desired type.
 
template<class T >
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.
 
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.
 
const base::StateSpacePtr & getStateSpace () const
 Return the state space this control space depends on.
 
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)
 
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

unsigned int dimension_
 The dimension of the state space.
 
base::RealVectorBounds bounds_
 The bounds on controls.
 
- Protected Attributes inherited from ompl::control::ControlSpace
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.
 

Additional Inherited Members

- Public Types inherited from ompl::control::ControlSpace
using ControlType = ompl::control::Control
 Define the type of control allocated by this control space.
 

Detailed Description

A control space representing Rn.

Definition at line 61 of file RealVectorControlSpace.h.

Constructor & Destructor Documentation

◆ RealVectorControlSpace()

ompl::control::RealVectorControlSpace::RealVectorControlSpace ( const base::StateSpacePtr & stateSpace,
unsigned int dim )
inline

Constructor takes the state space the controls correspond to and the dimension of the space of controls, dim.

Definition at line 88 of file RealVectorControlSpace.h.

Member Function Documentation

◆ allocControl()

ompl::control::Control * ompl::control::RealVectorControlSpace::allocControl ( ) const
overridevirtual

Allocate memory for a control.

Implements ompl::control::ControlSpace.

Definition at line 96 of file RealVectorControlSpace.cpp.

◆ allocDefaultControlSampler()

ompl::control::ControlSamplerPtr ompl::control::RealVectorControlSpace::allocDefaultControlSampler ( ) const
overridevirtual

Allocate the default control sampler.

Implements ompl::control::ControlSpace.

Definition at line 91 of file RealVectorControlSpace.cpp.

◆ copyControl()

void ompl::control::RealVectorControlSpace::copyControl ( Control * destination,
const Control * source ) const
overridevirtual

Copy a control to another.

Implements ompl::control::ControlSpace.

Definition at line 72 of file RealVectorControlSpace.cpp.

◆ deserialize()

void ompl::control::RealVectorControlSpace::deserialize ( Control * ctrl,
const void * serialization ) const
overridevirtual

Deserializes a control from the serialization buffer.

Reimplemented from ompl::control::ControlSpace.

Definition at line 168 of file RealVectorControlSpace.cpp.

◆ equalControls()

bool ompl::control::RealVectorControlSpace::equalControls ( const Control * control1,
const Control * control2 ) const
overridevirtual

Check if two controls are the same.

Implements ompl::control::ControlSpace.

Definition at line 78 of file RealVectorControlSpace.cpp.

◆ freeControl()

void ompl::control::RealVectorControlSpace::freeControl ( Control * control) const
overridevirtual

Free the memory of a control.

Implements ompl::control::ControlSpace.

Definition at line 103 of file RealVectorControlSpace.cpp.

◆ getBounds()

const base::RealVectorBounds & ompl::control::RealVectorControlSpace::getBounds ( ) const
inline

Get the bounds (min max values for each dimension) for the control.

Definition at line 101 of file RealVectorControlSpace.h.

◆ getDimension()

unsigned int ompl::control::RealVectorControlSpace::getDimension ( ) const
overridevirtual

Get the dimension of this control space.

Implements ompl::control::ControlSpace.

Definition at line 67 of file RealVectorControlSpace.cpp.

◆ getSerializationLength()

unsigned int ompl::control::RealVectorControlSpace::getSerializationLength ( ) const
overridevirtual

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

Reimplemented from ompl::control::ControlSpace.

Definition at line 158 of file RealVectorControlSpace.cpp.

◆ getValueAddressAtIndex()

double * ompl::control::RealVectorControlSpace::getValueAddressAtIndex ( Control * control,
unsigned int index ) const
overridevirtual

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 from ompl::control::ControlSpace.

Definition at line 122 of file RealVectorControlSpace.cpp.

◆ nullControl()

void ompl::control::RealVectorControlSpace::nullControl ( Control * control) const
overridevirtual

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

Implements ompl::control::ControlSpace.

Definition at line 110 of file RealVectorControlSpace.cpp.

◆ printControl()

void ompl::control::RealVectorControlSpace::printControl ( const Control * control,
std::ostream & out ) const
overridevirtual

Print a control to a stream.

Reimplemented from ompl::control::ControlSpace.

Definition at line 127 of file RealVectorControlSpace.cpp.

◆ printSettings()

void ompl::control::RealVectorControlSpace::printSettings ( std::ostream & out) const
overridevirtual

Print the settings for this control space to a stream.

Reimplemented from ompl::control::ControlSpace.

Definition at line 145 of file RealVectorControlSpace.cpp.

◆ serialize()

void ompl::control::RealVectorControlSpace::serialize ( void * serialization,
const Control * ctrl ) const
overridevirtual

Serializes the given control into the serialization buffer.

Reimplemented from ompl::control::ControlSpace.

Definition at line 163 of file RealVectorControlSpace.cpp.

◆ setBounds()

void ompl::control::RealVectorControlSpace::setBounds ( const base::RealVectorBounds & bounds)

Set the bounds (min max values for each dimension) for the control.

Definition at line 58 of file RealVectorControlSpace.cpp.

◆ setup()

void ompl::control::RealVectorControlSpace::setup ( )
overridevirtual

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

Reimplemented from ompl::control::ControlSpace.

Definition at line 52 of file RealVectorControlSpace.cpp.

Member Data Documentation

◆ bounds_

base::RealVectorBounds ompl::control::RealVectorControlSpace::bounds_
protected

The bounds on controls.

Definition at line 142 of file RealVectorControlSpace.h.

◆ dimension_

unsigned int ompl::control::RealVectorControlSpace::dimension_
protected

The dimension of the state space.

Definition at line 139 of file RealVectorControlSpace.h.


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