All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator

Representation of a space in which planning can be performed. Topology specific sampling, interpolation and distance are defined. More...

#include <StateManifold.h>

Inheritance diagram for ompl::base::StateManifold:

List of all members.

Public Types

typedef State StateType
 Define the type of state allocated by this manifold.

Public Member Functions

 StateManifold (void)
 Constructor. Assigns a unique name to the manifold.
template<class T >
T * as (void)
 Cast this instance to a desired type.
template<class T >
const T * as (void) const
 Cast this instance to a desired type.
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 printProjections (std::ostream &out) const
 Print the list of registered projections. This function is also called by printSettings()
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.
Generic functionality for manifolds
virtual bool isCompound (void) const
 Check if the manifold is compound.
const std::string & getName (void) const
 Get the name of the manifold.
void setName (const std::string &name)
 Set the name of the manifold.
int getType (void) const
 Get the type of the manifold. The type can be used to verify whether two manifold instances are of the same type (e.g., SO2)
bool includes (const StateManifoldPtr &other) const
 Return true if other is a manifold included (perhaps equal, perhaps a submanifold) in this one.
bool covers (const StateManifoldPtr &other) const
 Return true if other is a manifold that is either included (perhaps equal, perhaps a submanifold) in this one, or all of its submanifolds are included in this one.
Functionality specific to the manifold (to be implemented by inherited manifolds)
virtual unsigned int getDimension (void) const =0
 Get the dimension of the space.
virtual double getMaximumExtent (void) const =0
 Get the maximum value a call to distance() can return.
virtual void enforceBounds (State *state) const =0
 Bring the state within the bounds of the state space.
virtual bool satisfiesBounds (const State *state) const =0
 Check if a state is inside the bounding box.
virtual void copyState (State *destination, const State *source) const =0
 Copy a state to another. The memory of source and destination should NOT overlap.
virtual double distance (const State *state1, const State *state2) const =0
 Computes distance to between two states. This value will always be between 0 and getMaximumExtent()
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 double getLongestValidSegmentFraction (void) const
 When performing discrete validation of motions, the length of the longest segment that does not require state validation needs to be specified. This function returns this length, for this manifold, as a fraction of the manifold's maximum extent.
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.
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.
void setValidSegmentCountFactor (unsigned int factor)
 Set factor to be the value to multiply the return value of validSegmentCount(). By default, this value is 1. The higher the value, the smaller the size of the segments considered valid. The effect of this function is immediate (setup() does not need to be called).
unsigned int getValidSegmentCountFactor (void) const
 Get the value used to multiply the return value of validSegmentCount().
virtual bool equalStates (const State *state1, const State *state2) const =0
 Checks whether two states are equal.
virtual void interpolate (const State *from, const State *to, const double t, State *state) const =0
 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 =0
 Allocate an instance of a uniform state sampler for this space.
virtual StateallocState (void) const =0
 Allocate a state that can store a point in the described space.
virtual void freeState (State *state) const =0
 Free the memory of the allocated state.
Management of projections from this manifold to Euclidean spaces
void registerProjection (const std::string &name, const ProjectionEvaluatorPtr &projection)
 Register a projection for this manifold under a specified name.
void registerDefaultProjection (const ProjectionEvaluatorPtr &projection)
 Register the default projection for this manifold.
virtual void registerProjections (void)
 Register the projections for this manifold. Usually, this is at least the default projection. These are implicit projections, set by the implementation of the manifold. This is called by setup().
ProjectionEvaluatorPtr getProjection (const std::string &name) const
 Get the projection registered under a specific name.
ProjectionEvaluatorPtr getDefaultProjection (void) const
 Get the default projection.
bool hasProjection (const std::string &name) const
 Check if a projection with a specified name is available.
bool hasDefaultProjection (void) const
 Check if a default projection is available.
const std::map< std::string,
ProjectionEvaluatorPtr > & 
getRegisteredProjections (void) const
 Get all the registered projections.

Static Public Member Functions

static void diagram (std::ostream &out)
 Print a Graphviz digraph that represents the containment diagram for all the available manifolds.

Protected Attributes

int type_
 A type assigned for this manifold.
double maxExtent_
 The extent of this manifold at the time setup() was called.
double longestValidSegmentFraction_
 The fraction of the longest valid segment.
double longestValidSegment_
 The longest valid segment at the time setup() was called.
unsigned int longestValidSegmentCountFactor_
 The factor to multiply the value returned by validSegmentCount()
msg::Interface msg_
 Interface used for console output.
std::map< std::string,
ProjectionEvaluatorPtr
projections_
 List of available projections.

Static Protected Attributes

static const std::string DEFAULT_PROJECTION_NAME = ""
 The name used for the default projection.

Detailed Description

Representation of a space in which planning can be performed. Topology specific sampling, interpolation and distance are defined.

See Implementing State Manifolds.

Definition at line 70 of file StateManifold.h.


Member Function Documentation

template<class T >
T* ompl::base::StateManifold::as ( void  ) [inline]

Cast this instance to a desired type.

Make sure the type we are casting to is indeed a state manifold

Definition at line 84 of file StateManifold.h.

template<class T >
const T* ompl::base::StateManifold::as ( void  ) const [inline]

Cast this instance to a desired type.

Make sure the type we are casting to is indeed a state manifold

Definition at line 94 of file StateManifold.h.

void ompl::base::StateManifold::setLongestValidSegmentFraction ( double  segmentFraction) [virtual]

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.

Note:
This function's effect is not considered until after setup() has been called. For immediate effects (i.e., during planning) use setValidSegmentCountFactor()

Reimplemented in ompl::base::CompoundStateManifold.

Definition at line 301 of file StateManifold.cpp.


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