WrapperStateSpace.h
271 space_->copyState(destination->as<StateType>()->getState(), source->as<StateType>()->getState());
276 return space_->distance(state1->as<StateType>()->getState(), state2->as<StateType>()->getState());
296 return space_->equalStates(state1->as<StateType>()->getState(), state2->as<StateType>()->getState());
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.
Definition: WrapperStateSpace.h:218
bool isDiscrete() const override
Check if the set of states is discrete.
Definition: WrapperStateSpace.h:137
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()
Definition: WrapperStateSpace.h:362
unsigned int getDimension() const override
Return the dimension of the projection defined by this evaluator.
Definition: WrapperStateSpace.cpp:67
Representation of a space in which planning can be performed. Topology specific sampling,...
Definition: StateSpace.h:71
Wrapper state type. Contains a reference to an underlying state.
Definition: WrapperStateSpace.h:104
void serialize(void *serialization, const State *state) const override
Write the binary representation of state to serialization.
Definition: WrapperStateSpace.h:284
StateType(State *state)
Constructor. Takes a reference state to the underlying state.
Definition: WrapperStateSpace.h:107
void printSettings(std::ostream &out) const override
Print the settings for this state space to a stream.
Definition: WrapperStateSpace.h:382
A projection evaluator that wraps around another projection evaluator.
Definition: WrapperStateSpace.h:81
void computeLocations() override
Compute the location information for various components of the state space. Either this function or s...
Definition: WrapperStateSpace.h:407
StateSamplerPtr allocSubspaceStateSampler(const StateSpace *subspace) const override
Allocate a sampler that actually samples only components that are part of subspace.
Definition: WrapperStateSpace.h:402
double distance(const State *state1, const State *state2) const override
Computes distance between two states. This function satisfies the properties of a metric if isMetricS...
Definition: WrapperStateSpace.h:274
A state sampler that wraps around another state sampler.
Definition: WrapperStateSpace.h:55
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 addre...
Definition: WrapperStateSpace.h:322
unsigned int getValidSegmentCountFactor() const override
Get the value used to multiply the return value of validSegmentCount().
Definition: WrapperStateSpace.h:229
void sampleUniformNear(State *state, const State *near, double distance) override
Sample a nearby state using underlying sampler.
Definition: WrapperStateSpace.cpp:44
bool isHybrid() const override
Check if this is a hybrid state space (i.e., both discrete and continuous components exist)
Definition: WrapperStateSpace.h:142
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.
Definition: WrapperStateSpace.h:392
A shared pointer wrapper for ompl::base::ProjectionEvaluator.
void registerProjections() override
Register the projections for this state space. Usually, this is at least the default projection....
Definition: WrapperStateSpace.h:372
void setValidSegmentCountFactor(unsigned int factor) override
Set factor to be the value to multiply the return value of validSegmentCount(). By default,...
Definition: WrapperStateSpace.h:224
double getMeasure() const override
Get a measure of the space (this can be thought of as a generalization of volume)
Definition: WrapperStateSpace.h:254
State * allocState() const override
Allocate a state that can store a point in the described space.
Definition: WrapperStateSpace.h:310
ompl::base::State StateType
Define the type of state allocated by this space.
Definition: StateSpace.h:78
void copyFromReals(State *destination, const std::vector< double > &reals) const override
Copy the values from reals to the state destination using getValueAddressAtLocation()
Definition: WrapperStateSpace.h:367
bool hasSymmetricInterpolate() const override
Check if the interpolation function on this state space is symmetric, i.e. interpolate(from,...
Definition: WrapperStateSpace.h:157
void project(const State *state, Eigen::Ref< Eigen::VectorXd > projection) const override
Compute the projection as an array of double values.
Definition: WrapperStateSpace.cpp:72
void computeSignature(std::vector< int > &signature) const override
Compute an array of ints that uniquely identifies the structure of the state space....
Definition: WrapperStateSpace.h:239
WrapperStateSampler(const StateSpace *space, StateSamplerPtr sampler)
Constructor. Requires the wrapper state space space and the underlying sampler sampler.
Definition: WrapperStateSpace.h:59
StateSamplerPtr allocDefaultStateSampler() const override
Allocate an instance of the default uniform state sampler for this space.
Definition: WrapperStateSpace.h:305
Abstract definition for a class computing projections to Rn. Implicit integer grids are imposed on th...
Definition: ProjectionEvaluator.h:131
void deserialize(State *state, const void *serialization) const override
Read the binary representation of a state from serialization and write it to state.
Definition: WrapperStateSpace.h:289
void sampleGaussian(State *state, const State *mean, double stdDev) override
Sample a state within a Gaussian distribution using underlying sampler.
Definition: WrapperStateSpace.cpp:50
void freeState(State *state) const override
Free the memory of the allocated state.
Definition: WrapperStateSpace.h:315
double getLongestValidSegmentLength() const override
Get the longest valid segment at the time setup() was called.
Definition: WrapperStateSpace.h:234
const State * getState() const
Get a const pointer to the underlying state.
Definition: WrapperStateSpace.h:112
void setLongestValidSegmentFraction(double segmentFraction) override
When performing discrete validation of motions, the length of the longest segment that does not requi...
Definition: WrapperStateSpace.h:213
bool satisfiesBounds(const State *state) const override
Check if a state is inside the bounding box. For unbounded spaces this function can always return tru...
Definition: WrapperStateSpace.h:264
void printProjections(std::ostream &out) const override
Print the list of registered projections. This function is also called by printSettings()
Definition: WrapperStateSpace.h:387
const ParamSet & params() const
Get the parameters for this space.
Definition: WrapperStateSpace.h:203
unsigned int getSerializationLength() const override
Get the number of chars in the serialization of a state in this space.
Definition: WrapperStateSpace.h:279
void setup() override
Perform final setup steps. This function is automatically called by the SpaceInformation....
Definition: WrapperStateSpace.cpp:77
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....
Definition: WrapperStateSpace.h:299
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-...
Definition: WrapperStateSpace.h:259
unsigned int getDimension() const override
Get the dimension of the space (not the dimension of the surrounding ambient space)
Definition: WrapperStateSpace.h:244
void sanityChecks() const override
Convenience function that allows derived state spaces to choose which checks should pass (see SanityC...
Definition: WrapperStateSpace.h:397
A shared pointer wrapper for ompl::base::StateSpace.
double getLongestValidSegmentFraction() const override
When performing discrete validation of motions, the length of the longest segment that does not requi...
Definition: WrapperStateSpace.h:208
A shared pointer wrapper for ompl::base::StateSampler.
void printState(const State *state, std::ostream &out=std::cout) const override
Print a state to a stream.
Definition: WrapperStateSpace.h:377
bool isMetricSpace() const override
Return true if the distance function associated with the space is a metric.
Definition: WrapperStateSpace.h:147
void copyState(State *destination, const State *source) const override
Copy a state to another. The memory of source and destination should NOT overlap.
Definition: WrapperStateSpace.h:269
bool equalStates(const State *state1, const State *state2) const override
Checks whether two states are equal.
Definition: WrapperStateSpace.h:294
bool isCompound() const override
Check if the state space is compound.
Definition: WrapperStateSpace.h:132
State space wrapper that transparently passes state space operations through to the underlying space....
Definition: WrapperStateSpace.h:100
void sampleUniform(State *state) override
Sample a state using underlying sampler.
Definition: WrapperStateSpace.cpp:39
double getMaximumExtent() const override
Get the maximum value a call to distance() can return (or an upper bound). For unbounded state spaces...
Definition: WrapperStateSpace.h:249
bool hasSymmetricDistance() const override
Check if the distance function on this state space is symmetric, i.e. distance(s1,...
Definition: WrapperStateSpace.h:152