Class WrapperStateSpace

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class WrapperStateSpace : public ompl::base::StateSpace

State space wrapper that transparently passes state space operations through to the underlying space. Allows augmentation of state spaces with additional information.

Subclassed by ompl::base::ConstrainedStateSpace

Public Functions

inline WrapperStateSpace(const StateSpacePtr &space)
inline virtual bool isCompound() const override

Check if the state space is compound.

inline virtual bool isDiscrete() const override

Check if the set of states is discrete.

Note

In fact, because of limited numerical precision, the representation of all spaces is discrete; this function returns true if the corresponding mathematical object is a discrete one.

inline virtual bool isHybrid() const override

Check if this is a hybrid state space (i.e., both discrete and continuous components exist)

inline virtual bool isMetricSpace() const override

Return true if the distance function associated with the space is a metric.

inline virtual bool hasSymmetricDistance() const override

Check if the distance function on this state space is symmetric, i.e. distance(s1,s2) = distance(s2,s1). Default implementation returns true.

inline virtual bool hasSymmetricInterpolate() const override

Check if the interpolation function on this state space is symmetric, i.e. interpolate(from, to,

t, state) = interpolate(to, from, 1-t, state). Default implementation returns true.

inline const std::string &getName() const
inline void setName(const std::string &name)
inline int getType() const
inline bool includes(const StateSpacePtr &other) const
inline bool includes(const StateSpace *other) const
inline bool covers(const StateSpacePtr &other) const
inline bool covers(const StateSpace *other) const
inline ParamSet &params()
inline const ParamSet &params() const

Get the parameters for this space.

inline virtual double getLongestValidSegmentFraction() const override

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 state space, as a fraction of the space’s maximum extent.

inline virtual void setLongestValidSegmentFraction(double segmentFraction) override

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 space’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()

inline virtual unsigned int validSegmentCount(const State *state1, const State *state2) const override

Count how many segments of the “longest valid length” fit on the motion from state1 to state2.

inline virtual void setValidSegmentCountFactor(unsigned int factor) override

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).

inline virtual unsigned int getValidSegmentCountFactor() const override

Get the value used to multiply the return value of validSegmentCount().

inline virtual double getLongestValidSegmentLength() const override

Get the longest valid segment at the time setup() was called.

inline virtual void computeSignature(std::vector<int> &signature) const override

Compute an array of ints that uniquely identifies the structure of the state space. The first element of the signature is the number of integers that follow.

inline virtual unsigned int getDimension() const override

Get the dimension of the space (not the dimension of the surrounding ambient space)

inline virtual double getMaximumExtent() const override

Get the maximum value a call to distance() can return (or an upper bound). For unbounded state spaces, this function can return infinity.

Note

Tight upper bounds are preferred because the value of the extent is used in the automatic computation of parameters for planning. If the bounds are less tight, the automatically computed parameters will be less useful.

inline virtual double getMeasure() const override

Get a measure of the space (this can be thought of as a generalization of volume)

inline virtual void enforceBounds(State *state) const override

Bring the state within the bounds of the state space. For unbounded spaces this function can be a no-op.

inline virtual bool satisfiesBounds(const State *state) const override

Check if a state is inside the bounding box. For unbounded spaces this function can always return true.

inline virtual void copyState(State *destination, const State *source) const override

Copy a state to another. The memory of source and destination should NOT overlap.

Note

For more advanced state copying methods (partial copy, for example), see Advanced methods for copying states.

inline virtual double distance(const State *state1, const State *state2) const override

Computes distance between two states. This function satisfies the properties of a metric if isMetricSpace() is true, and its return value will always be between 0 and getMaximumExtent()

inline virtual unsigned int getSerializationLength() const override

Get the number of chars in the serialization of a state in this space.

inline virtual void serialize(void *serialization, const State *state) const override

Write the binary representation of state to serialization.

inline virtual void deserialize(State *state, const void *serialization) const override

Read the binary representation of a state from serialization and write it to state.

inline virtual bool equalStates(const State *state1, const State *state2) const override

Checks whether two states are equal.

inline virtual void interpolate(const State *from, const State *to, double t, State *state) const override

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.

inline virtual StateSamplerPtr allocDefaultStateSampler() const override

Allocate an instance of the default uniform state sampler for this space.

inline virtual State *allocState() const override

Allocate a state that can store a point in the described space.

inline virtual void freeState(State *state) const override

Free the memory of the allocated state.

inline virtual double *getValueAddressAtIndex(State *state, unsigned int index) const override

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 nullptr.

Note

This function does not map a state to an array of doubles. There may be components of a state that do not correspond to double values and they are ‘invisible’ to this function. Furthermore, this function is slow and is not intended for use in the implementation of planners. Ideally, state values should not be accessed by index. If accessing of individual state elements is however needed, getValueAddressAtLocation() provides a faster implementation.

inline virtual const double *getValueAddressAtIndex(const State *state, unsigned int index) const override

Const variant of the same function as above;.

inline virtual const std::vector<ValueLocation> &getValueLocations() const override

Get the locations of values of type double contained in a state from this space. The order of the values is consistent with getValueAddressAtIndex(). The setup() function must have been previously called.

inline virtual const std::map<std::string, ValueLocation> &getValueLocationsByName() const override

Get the named locations of values of type double contained in a state from this space. The setup() function must have been previously called.

inline virtual double *getValueAddressAtLocation(State *state, const ValueLocation &loc) const override

Get a pointer to the double value in state that loc points to.

inline virtual const double *getValueAddressAtLocation(const State *state, const ValueLocation &loc) const override

Const variant of the same function as above;.

inline virtual double *getValueAddressAtName(State *state, const std::string &name) const override

Get a pointer to the double value in state that name points to.

inline virtual const double *getValueAddressAtName(const State *state, const std::string &name) const override

Const variant of the same function as above;.

inline virtual void copyToReals(std::vector<double> &reals, const State *source) const override

Copy all the real values from a state source to the array reals using getValueAddressAtLocation()

inline virtual void copyFromReals(State *destination, const std::vector<double> &reals) const override

Copy the values from reals to the state destination using getValueAddressAtLocation()

inline virtual void registerProjections() override

Register the projections for this state space. Usually, this is at least the default projection. These are implicit projections, set by the implementation of the state space. This is called by setup().

inline virtual void printState(const State *state, std::ostream &out = std::cout) const override

Print a state to a stream.

inline virtual void printSettings(std::ostream &out) const override

Print the settings for this state space to a stream.

inline virtual void printProjections(std::ostream &out) const override

Print the list of registered projections. This function is also called by printSettings()

inline virtual void sanityChecks(double zero, double eps, unsigned int flags) const override

Perform sanity checks for this state space. Throws an exception if failures are found.

Note

This checks if distances are always positive, whether the integration works as expected, etc.

inline virtual void sanityChecks() const override

Convenience function that allows derived state spaces to choose which checks should pass (see SanityChecks flags) and how strict the checks are. This just calls sanityChecks() with some default arguments.

inline virtual StateSamplerPtr allocSubspaceStateSampler(const StateSpace *subspace) const override

Allocate a sampler that actually samples only components that are part of subspace.

inline virtual void computeLocations() override

Compute the location information for various components of the state space. Either this function or setup() must be called before any calls to getValueAddressAtName(), getValueAddressAtLocation() (and other functions where those are used).

virtual void setup() override

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 and call their setup() functions. It is safe to call this function multiple times. At a subsequent call, projections that have been previously user configured are not re-instantiated, but their setup() method is still called.

inline const StateSpacePtr &getSpace() const

Protected Attributes

const StateSpacePtr space_
class StateType : public ompl::base::State

Wrapper state type. Contains a reference to an underlying state.

Subclassed by ompl::base::ConstrainedStateSpace::StateType

Public Functions

inline StateType(State *state)

Constructor. Takes a reference state to the underlying state.

inline const State *getState() const

Get a const pointer to the underlying state.

inline State *getState()

Get a pointer to the underlying state.

Protected Attributes

State *state_

Underlying state.