A manifold to allow the composition of state manifolds. More...
#include <StateManifold.h>
Public Types | |
typedef CompoundState | StateType |
Define the type of state allocated by this manifold. | |
Public Member Functions | |
CompoundStateManifold (void) | |
Construct an empty compound manifold. | |
CompoundStateManifold (const std::vector< StateManifoldPtr > &components, const std::vector< double > &weights) | |
Construct a compound manifold from a list of sub-manifolds (components) and their corresponding weights (weights) | |
template<class T > | |
T * | as (const unsigned int index) const |
Cast a component of this instance to a desired type. | |
template<class T > | |
T * | as (const std::string &name) const |
Cast a component of this instance to a desired type. | |
virtual bool | isCompound (void) const |
Check if the manifold is compound. | |
virtual double * | getValueAddressAtIndex (State *state, const unsigned int index) const |
Many states contain a number of double values. This function provides a means to get the memory address of a double value from state state 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 state), the return value is NULL. | |
virtual void | printState (const State *state, std::ostream &out) const |
Print a state to a stream. | |
virtual void | printSettings (std::ostream &out) const |
Print the settings for this manifold to a stream. | |
virtual void | setup (void) |
Perform final setup steps. This function is automatically called by the SpaceInformation. If any default projections are to be registered, this call will set them. It is safe to call this function multiple times. | |
void | lock (void) |
Lock this manifold. This means no further manifolds can be added as components. This function can be for instance called from the constructor of a manifold that inherits from CompoundStateManifold to prevent the user to add further components. | |
Management of contained manifolds | |
virtual void | addSubManifold (const StateManifoldPtr &component, double weight) |
Adds a new manifold as part of the compound space. For computing distances within the compound space, the weight of the component also needs to be specified. | |
unsigned int | getSubManifoldCount (void) const |
Get the number of manifolds that make up the compound manifold. | |
const StateManifoldPtr & | getSubManifold (const unsigned int index) const |
Get a specific manifold from the compound manifold. | |
const StateManifoldPtr & | getSubManifold (const std::string &name) const |
Get a specific manifold from the compound manifold. | |
unsigned int | getSubManifoldIndex (const std::string &name) const |
Get the index of a specific manifold from the compound manifold. | |
bool | hasSubManifold (const std::string &name) const |
Check if a specific submanifold is contained in this manifold. | |
double | getSubManifoldWeight (const unsigned int index) const |
Get a specific manifold's weight from the compound manifold (used in distance computation) | |
double | getSubManifoldWeight (const std::string &name) const |
Get a specific manifold's weight from the compound manifold (used in distance computation) | |
void | setSubManifoldWeight (const unsigned int index, double weight) |
Set a specific manifold's weight in the compound manifold (used in distance computation) | |
void | setSubManifoldWeight (const std::string &name, double weight) |
Set a specific manifold's weight in the compound manifold (used in distance computation) | |
const std::vector < StateManifoldPtr > & | getSubManifolds (void) const |
Get the list of components. | |
const std::vector< double > & | getSubManifoldWeights (void) const |
Get the list of component weights. | |
bool | isLocked (void) const |
Return true if the manifold is locked. A value of true means that no further manifolds can be added as components. | |
Functionality specific to the compound manifold | |
virtual unsigned int | getDimension (void) const |
Get the dimension of the space. | |
virtual double | getMaximumExtent (void) const |
Get the maximum value a call to distance() can return. | |
virtual void | enforceBounds (State *state) const |
Bring the state within the bounds of the state space. | |
virtual bool | satisfiesBounds (const State *state) const |
Check if a state is inside the bounding box. | |
virtual void | copyState (State *destination, const State *source) const |
Copy a state to another. The memory of source and destination should NOT overlap. | |
virtual double | distance (const State *state1, const State *state2) const |
Computes distance to between two states. This value will always be between 0 and getMaximumExtent() | |
virtual void | setLongestValidSegmentFraction (double segmentFraction) |
When performing discrete validation of motions, the length of the longest segment that does not require state validation needs to be specified. This function sets this length as a fraction of the manifold's maximum extent. The call is passed to all contained manifolds. | |
virtual unsigned int | validSegmentCount (const State *state1, const State *state2) const |
Count how many segments of the "longest valid length" fit on the motion from state1 to state2. This is the max() of the counts returned by contained manifolds. | |
virtual bool | equalStates (const State *state1, const State *state2) const |
Checks whether two states are equal. | |
virtual void | interpolate (const State *from, const State *to, const double t, State *state) const |
Computes the state that lies at time t in [0, 1] on the segment that connects from state to to state. The memory location of state is not required to be different from the memory of either from or to. | |
virtual ManifoldStateSamplerPtr | allocStateSampler (void) const |
Allocate an instance of a uniform state sampler for this space. | |
virtual State * | allocState (void) const |
Allocate a state that can store a point in the described space. | |
virtual void | freeState (State *state) const |
Free the memory of the allocated state. | |
Protected Member Functions | |
void | allocStateComponents (CompoundState *state) const |
Allocate the state components. Called by allocState() | |
Protected Attributes | |
std::vector< StateManifoldPtr > | components_ |
The component manifolds that make up the compound state manifold. | |
unsigned int | componentCount_ |
The number of components. | |
std::vector< double > | weights_ |
The weight assigned to each component of the manifold when computing the compound distance. | |
bool | locked_ |
Flag indicating whether adding further components is allowed or not. |
A manifold to allow the composition of state manifolds.
Definition at line 295 of file StateManifold.h.
T* ompl::base::CompoundStateManifold::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 state manifold
Definition at line 314 of file StateManifold.h.
T* ompl::base::CompoundStateManifold::as | ( | const std::string & | name | ) | const [inline] |
Cast a component of this instance to a desired type.
Make sure the type we are casting to is indeed a state manifold
Definition at line 324 of file StateManifold.h.