RealVectorStateSpace.h
void setName(const std::string &name)
Set the name of the state space.
Definition: StateSpace.cpp:212
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: RealVectorStateSpace.cpp:200
const RealVectorBounds & getBounds() const
Get the bounds for this state space.
Definition: RealVectorStateSpace.h:130
State sampler for the Rn state space.
Definition: RealVectorStateSpace.h:51
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: RealVectorStateSpace.cpp:188
std::vector< std::string > dimensionNames_
Optional names for individual dimensions.
Definition: RealVectorStateSpace.h:194
A shared pointer wrapper for ompl::base::StateSampler.
void registerProjections() override
Register the projections for this state space. Usually, this is at least the default projection...
Definition: RealVectorStateSpace.cpp:85
void printState(const State *state, std::ostream &out) const override
Print a state to a stream.
Definition: RealVectorStateSpace.cpp:291
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: RealVectorStateSpace.cpp:286
void copyState(State *destination, const State *source) const override
Copy a state to another. The memory of source and destination should NOT overlap. ...
Definition: RealVectorStateSpace.cpp:210
State * allocState() const override
Allocate a state that can store a point in the described space.
Definition: RealVectorStateSpace.cpp:272
void sampleGaussian(State *state, const State *mean, double stdDev) override
Sample a state such that each component state[i] has a Gaussian distribution with mean mean[i] and st...
Definition: RealVectorStateSpace.cpp:67
const std::string & getDimensionName(unsigned int index) const
Each dimension can optionally have a name associated to it. If it does, this function returns that na...
Definition: RealVectorStateSpace.cpp:143
bool equalStates(const State *state1, const State *state2) const override
Checks whether two states are equal.
Definition: RealVectorStateSpace.cpp:244
void serialize(void *serialization, const State *state) const override
Write the binary representation of state to serialization.
Definition: RealVectorStateSpace.cpp:220
void freeState(State *state) const override
Free the memory of the allocated state.
Definition: RealVectorStateSpace.cpp:279
double & operator[](unsigned int i)
Access element i of values. This does not check whether the index is within bounds.
Definition: RealVectorStateSpace.h:91
std::map< std::string, unsigned int > dimensionIndex_
Map from names to index values for dimensions.
Definition: RealVectorStateSpace.h:197
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: RealVectorStateSpace.cpp:257
RealVectorBounds bounds_
The bounds of the space (used for sampling)
Definition: RealVectorStateSpace.h:191
StateSamplerPtr allocDefaultStateSampler() const override
Allocate an instance of the default uniform state sampler for this space.
Definition: RealVectorStateSpace.cpp:267
A state space representing Rn. The distance function is the L2 norm.
Definition: RealVectorStateSpace.h:73
Representation of a space in which planning can be performed. Topology specific sampling, interpolation and distance are defined.
Definition: StateSpace.h:70
double operator[](unsigned int i) const
Access element i of values. This does not check whether the index is within bounds.
Definition: RealVectorStateSpace.h:84
void setDimensionName(unsigned int index, const std::string &name)
Set the name of a dimension.
Definition: RealVectorStateSpace.cpp:156
double getMaximumExtent() const override
Get the maximum value a call to distance() can return (or an upper bound). For unbounded state spaces...
Definition: RealVectorStateSpace.cpp:167
unsigned int getSerializationLength() const override
Get the number of chars in the serialization of a state in this space.
Definition: RealVectorStateSpace.cpp:215
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: RealVectorStateSpace.cpp:230
The lower and upper bounds for an Rn space.
Definition: RealVectorBounds.h:47
ompl::base::RealVectorStateSpace
Definition: StateSpaceTypes.h:52
The definition of a state in Rn
Definition: RealVectorStateSpace.h:77
RealVectorStateSpace(unsigned int dim=0)
Constructor. The dimension of of the space needs to be specified. A space representing Rdim will be i...
Definition: RealVectorStateSpace.h:102
void deserialize(State *state, const void *serialization) const override
Read the binary representation of a state from serialization and write it to state.
Definition: RealVectorStateSpace.cpp:225
void addDimension(double minBound=0.0, double maxBound=0.0)
Increase the dimensionality of the state space by 1. Optionally, bounds can be specified for this add...
Definition: RealVectorStateSpace.cpp:112
double getMeasure() const override
Get a measure of the space (this can be thought of as a generalization of volume) ...
Definition: RealVectorStateSpace.cpp:178
void printSettings(std::ostream &out) const override
Print the settings for this state space to a stream.
Definition: RealVectorStateSpace.cpp:309
unsigned int getDimension() const override
Get the dimension of the space (not the dimension of the surrounding ambient space) ...
Definition: RealVectorStateSpace.cpp:138
void sampleUniformNear(State *state, const State *near, double distance) override
Sample a state such that each component state[i] is uniformly sampled from [near[i]-distance, near[i]+distance]. If this interval exceeds the state space bounds, the interval is truncated.
Definition: RealVectorStateSpace.cpp:55
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.
Definition: RealVectorStateSpace.cpp:100
int getDimensionIndex(const std::string &name) const
Get the index of a specific dimension, by name. Return -1 if name is not found.
Definition: RealVectorStateSpace.cpp:150
void setBounds(const RealVectorBounds &bounds)
Set the bounds of this state space. This defines the range of the space in which sampling is performe...
Definition: RealVectorStateSpace.cpp:121