A control space to allow the composition of control spaces. More...
#include <ControlSpace.h>
Public Types | |
typedef CompoundControl | ControlType |
Define the type of control allocated by this control space. | |
Public Member Functions | |
virtual void | addSubSpace (const ControlSpacePtr &component) |
Adds a control space as a component of the compound control space. | |
virtual Control * | allocControl (void) const |
Allocate memory for a control. | |
virtual ControlSamplerPtr | allocControlSampler (void) const |
Allocate a control sampler. | |
template<class T > | |
T * | as (const unsigned int index) const |
Cast a component of this instance to a desired type. | |
virtual bool | canPropagateBackward (void) const |
Some systems can only propagate forward in time (i.e., the duration argument for the propagate() function is always positive). If this is the case, this function should return false. Planners that need backward propagation (negative durations) will call this function to check. If backward propagation is possible, this function should return true (this is the default). | |
CompoundControlSpace (const base::StateSpacePtr &stateSpace) | |
Constructor. The corresponding state space needs to be specified. | |
virtual void | copyControl (Control *destination, const Control *source) const |
Copy a control to another. | |
virtual bool | equalControls (const Control *control1, const Control *control2) const |
Check if two controls are the same. | |
virtual void | freeControl (Control *control) const |
Free the memory of a control. | |
virtual unsigned int | getDimension (void) const |
Get the dimension of this control space. | |
const ControlSpacePtr & | getSubSpace (const std::string &name) const |
Get a specific subspace from the compound control space. | |
const ControlSpacePtr & | getSubSpace (const unsigned int index) const |
Get a specific subspace from the compound control space. | |
unsigned int | getSubSpaceCount (void) const |
Get the number of control spaces that make up the compound control space. | |
virtual double * | getValueAddressAtIndex (Control *control, const 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 NULL. | |
void | lock (void) |
Lock this control space. This means no further control spaces can be added as components. This function can be for instance called from the constructor of a state space that inherits from CompoundControlSpace to prevent the user to add further components. | |
virtual void | nullControl (Control *control) const |
Make the control have no effect if it were to be applied to a state for any amount of time. | |
virtual void | printControl (const Control *control, std::ostream &out=std::cout) 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 | propagate (const base::State *state, const Control *control, const double duration, base::State *result) const |
Propagate from a state, given a control, for some specified amount of time (the amount of time can also be negative, if canPropagateBackward() returns true). | |
virtual void | setup (void) |
Perform final setup steps. This function is automatically called by the SpaceInformation. | |
virtual | ~CompoundControlSpace (void) |
Protected Attributes | |
unsigned int | componentCount_ |
The number of contained components. | |
std::vector< ControlSpacePtr > | components_ |
The component control spaces that make up the compound control space. | |
bool | locked_ |
Flag indicating whether adding further components is allowed or not. |
A control space to allow the composition of control spaces.
Definition at line 185 of file ControlSpace.h.
Define the type of control allocated by this control space.
Definition at line 190 of file ControlSpace.h.
ompl::control::CompoundControlSpace::CompoundControlSpace | ( | const base::StateSpacePtr & | stateSpace | ) | [inline] |
Constructor. The corresponding state space needs to be specified.
Definition at line 193 of file ControlSpace.h.
virtual ompl::control::CompoundControlSpace::~CompoundControlSpace | ( | void | ) | [inline, virtual] |
Definition at line 197 of file ControlSpace.h.
virtual void ompl::control::CompoundControlSpace::addSubSpace | ( | const ControlSpacePtr & | component | ) | [virtual] |
Adds a control space as a component of the compound control space.
virtual Control* ompl::control::CompoundControlSpace::allocControl | ( | void | ) | const [virtual] |
Allocate memory for a control.
Implements ompl::control::ControlSpace.
virtual ControlSamplerPtr ompl::control::CompoundControlSpace::allocControlSampler | ( | void | ) | const [virtual] |
Allocate a control sampler.
Implements ompl::control::ControlSpace.
T* ompl::control::CompoundControlSpace::as | ( | const unsigned int | index | ) | const [inline] |
Cast a component of this instance to a desired type.
Make sure the type we are casting to is indeed a control space
Definition at line 203 of file ControlSpace.h.
virtual bool ompl::control::CompoundControlSpace::canPropagateBackward | ( | void | ) | const [virtual] |
Some systems can only propagate forward in time (i.e., the duration argument for the propagate() function is always positive). If this is the case, this function should return false. Planners that need backward propagation (negative durations) will call this function to check. If backward propagation is possible, this function should return true (this is the default).
Reimplemented from ompl::control::ControlSpace.
virtual void ompl::control::CompoundControlSpace::copyControl | ( | Control * | destination, | |
const Control * | source | |||
) | const [virtual] |
Copy a control to another.
Implements ompl::control::ControlSpace.
virtual bool ompl::control::CompoundControlSpace::equalControls | ( | const Control * | control1, | |
const Control * | control2 | |||
) | const [virtual] |
Check if two controls are the same.
Implements ompl::control::ControlSpace.
virtual void ompl::control::CompoundControlSpace::freeControl | ( | Control * | control | ) | const [virtual] |
Free the memory of a control.
Implements ompl::control::ControlSpace.
virtual unsigned int ompl::control::CompoundControlSpace::getDimension | ( | void | ) | const [virtual] |
Get the dimension of this control space.
Implements ompl::control::ControlSpace.
const ControlSpacePtr& ompl::control::CompoundControlSpace::getSubSpace | ( | const std::string & | name | ) | const |
Get a specific subspace from the compound control space.
const ControlSpacePtr& ompl::control::CompoundControlSpace::getSubSpace | ( | const unsigned int | index | ) | const |
Get a specific subspace from the compound control space.
unsigned int ompl::control::CompoundControlSpace::getSubSpaceCount | ( | void | ) | const |
Get the number of control spaces that make up the compound control space.
virtual double* ompl::control::CompoundControlSpace::getValueAddressAtIndex | ( | Control * | control, | |
const unsigned int | index | |||
) | const [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 NULL.
Reimplemented from ompl::control::ControlSpace.
void ompl::control::CompoundControlSpace::lock | ( | void | ) |
Lock this control space. This means no further control spaces can be added as components. This function can be for instance called from the constructor of a state space that inherits from CompoundControlSpace to prevent the user to add further components.
virtual void ompl::control::CompoundControlSpace::nullControl | ( | Control * | control | ) | const [virtual] |
Make the control have no effect if it were to be applied to a state for any amount of time.
Implements ompl::control::ControlSpace.
virtual void ompl::control::CompoundControlSpace::printControl | ( | const Control * | control, | |
std::ostream & | out = std::cout | |||
) | const [virtual] |
Print a control to a stream.
Reimplemented from ompl::control::ControlSpace.
virtual void ompl::control::CompoundControlSpace::printSettings | ( | std::ostream & | out | ) | const [virtual] |
Print the settings for this control space to a stream.
Reimplemented from ompl::control::ControlSpace.
virtual void ompl::control::CompoundControlSpace::propagate | ( | const base::State * | state, | |
const Control * | control, | |||
const double | duration, | |||
base::State * | result | |||
) | const [virtual] |
Propagate from a state, given a control, for some specified amount of time (the amount of time can also be negative, if canPropagateBackward() returns true).
state | the state to start propagating from | |
control | the control to apply | |
duration | the duration for which the control is applied | |
result | the state the system is brought to |
Reimplemented from ompl::control::ControlSpace.
virtual void ompl::control::CompoundControlSpace::setup | ( | void | ) | [virtual] |
Perform final setup steps. This function is automatically called by the SpaceInformation.
Reimplemented from ompl::control::ControlSpace.
unsigned int ompl::control::CompoundControlSpace::componentCount_ [protected] |
The number of contained components.
Definition at line 262 of file ControlSpace.h.
std::vector<ControlSpacePtr> ompl::control::CompoundControlSpace::components_ [protected] |
The component control spaces that make up the compound control space.
Definition at line 259 of file ControlSpace.h.
bool ompl::control::CompoundControlSpace::locked_ [protected] |
Flag indicating whether adding further components is allowed or not.
Definition at line 265 of file ControlSpace.h.