RealVectorStateSpace.cpp
56 void ompl::base::RealVectorStateSampler::sampleUniformNear(State *state, const State *near, const double distance)
62 const RealVectorStateSpace::StateType *rnear = static_cast<const RealVectorStateSpace::StateType*>(near);
69 void ompl::base::RealVectorStateSampler::sampleGaussian(State *state, const State *mean, const double stdDev)
75 const RealVectorStateSpace::StateType *rmean = static_cast<const RealVectorStateSpace::StateType*>(mean);
96 registerDefaultProjection(ProjectionEvaluatorPtr(new RealVectorRandomLinearProjectionEvaluator(this, p)));
99 registerDefaultProjection(ProjectionEvaluatorPtr(new RealVectorIdentityProjectionEvaluator(this)));
109 void ompl::base::RealVectorStateSpace::addDimension(const std::string &name, double minBound, double maxBound)
160 void ompl::base::RealVectorStateSpace::setDimensionName(unsigned int index, const std::string &name)
231 void ompl::base::RealVectorStateSpace::deserialize(State *state, const void *serialization) const
236 double ompl::base::RealVectorStateSpace::distance(const State *state1, const State *state2) const
250 bool ompl::base::RealVectorStateSpace::equalStates(const State *state1, const State *state2) const
263 void ompl::base::RealVectorStateSpace::interpolate(const State *from, const State *to, const double t, State *state) const
291 double* ompl::base::RealVectorStateSpace::getValueAddressAtIndex(State *state, const unsigned int index) const
316 out << "Real vector state space '" << getName() << "' of dimension " << dimension_ << " with bounds: " << std::endl;
void log(const char *file, int line, LogLevel level, const char *m,...)
Root level logging function. This should not be invoked directly, but rather used via a logging macro...
Definition: Console.cpp:104
A boost shared pointer wrapper for ompl::base::StateSampler.
virtual unsigned int getDimension() const =0
Get the dimension of the space (not the dimension of the surrounding ambient space) ...
virtual void serialize(void *serialization, const State *state) const
Write the binary representation of state to serialization.
Definition: RealVectorStateSpace.cpp:226
virtual unsigned int getSerializationLength() const
Get the number of chars in the serialization of a state in this space.
Definition: RealVectorStateSpace.cpp:221
virtual void sampleUniformNear(State *state, const State *near, const double distance)
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:56
virtual void printSettings(std::ostream &out) const
Print the settings for this state space to a stream.
Definition: RealVectorStateSpace.cpp:314
virtual void freeState(State *state) const
Free the memory of the allocated state.
Definition: RealVectorStateSpace.cpp:284
Define the identity projection.
Definition: RealVectorStateProjections.h:165
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:147
virtual double getMeasure() const
Get a measure of the space (this can be thought of as a generalization of volume) ...
Definition: RealVectorStateSpace.cpp:182
virtual void registerProjections()
Register the projections for this state space. Usually, this is at least the default projection...
Definition: RealVectorStateSpace.cpp:88
virtual void enforceBounds(State *state) const
Bring the state within the bounds of the state space. For unbounded spaces this function can be a no-...
Definition: RealVectorStateSpace.cpp:192
Definition for a class computing a random linear projections.
Definition: RealVectorStateProjections.h:89
void setLow(double value)
Set the lower bound in each dimension to a specific value.
Definition: RealVectorBounds.cpp:42
void setHigh(double value)
Set the upper bound in each dimension to a specific value.
Definition: RealVectorBounds.cpp:47
virtual bool satisfiesBounds(const State *state) const
Check if a state is inside the bounding box. For unbounded spaces this function can always return tru...
Definition: RealVectorStateSpace.cpp:205
virtual double distance(const State *state1, const State *state2) const
Computes distance between two states. This function satisfies the properties of a metric if isMetricS...
Definition: RealVectorStateSpace.cpp:236
virtual void printState(const State *state, std::ostream &out) const
Print a state to a stream.
Definition: RealVectorStateSpace.cpp:296
void check() const
Check if the bounds are valid (same length for low and high, high[i] > low[i]). Throw an exception if...
Definition: RealVectorBounds.cpp:89
A boost shared pointer wrapper for ompl::base::ProjectionEvaluator.
double uniformReal(double lower_bound, double upper_bound)
Generate a random real within given bounds: [lower_bound, upper_bound)
Definition: RandomNumbers.h:68
A state space representing Rn. The distance function is the L2 norm.
Definition: RealVectorStateSpace.h:75
virtual void setup()
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: StateSpace.cpp:231
virtual bool equalStates(const State *state1, const State *state2) const
Checks whether two states are equal.
Definition: RealVectorStateSpace.cpp:250
virtual void sampleGaussian(State *state, const State *mean, const double stdDev)
Sample a state such that each component state[i] has a Gaussian distribution with mean mean[i] and st...
Definition: RealVectorStateSpace.cpp:69
void setDimensionName(unsigned int index, const std::string &name)
Set the name of a dimension.
Definition: RealVectorStateSpace.cpp:160
virtual void deserialize(State *state, const void *serialization) const
Read the binary representation of a state from serialization and write it to state.
Definition: RealVectorStateSpace.cpp:231
The lower and upper bounds for an Rn space.
Definition: RealVectorBounds.h:48
The definition of a state in Rn
Definition: RealVectorStateSpace.h:80
virtual double getMaximumExtent() const
Get the maximum value a call to distance() can return (or an upper bound). For unbounded state spaces...
Definition: RealVectorStateSpace.cpp:171
virtual State * allocState() const
Allocate a state that can store a point in the described space.
Definition: RealVectorStateSpace.cpp:277
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:115
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 addre...
Definition: RealVectorStateSpace.cpp:291
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...
Definition: RealVectorStateSpace.cpp:263
virtual StateSamplerPtr allocDefaultStateSampler() const
Allocate an instance of the default uniform state sampler for this space.
Definition: RealVectorStateSpace.cpp:272
virtual void copyState(State *destination, const State *source) const
Copy a state to another. The memory of source and destination should NOT overlap. ...
Definition: RealVectorStateSpace.cpp:215
virtual unsigned int getDimension() const
Get the dimension of the space (not the dimension of the surrounding ambient space) ...
Definition: RealVectorStateSpace.cpp:142
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:154
virtual void setup()
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:103
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:124
double gaussian(double mean, double stddev)
Generate a random real using a normal distribution with given mean and variance.
Definition: RandomNumbers.h:94