ProjectionEvaluator.cpp
48 ompl::base::ProjectionMatrix::Matrix ompl::base::ProjectionMatrix::ComputeRandom(const unsigned int from,
64 projection = Eigen::JacobiSVD<Eigen::MatrixXd>(projection, Eigen::ComputeThinV).matrixV().transpose();
83 ompl::base::ProjectionMatrix::Matrix ompl::base::ProjectionMatrix::ComputeRandom(const unsigned int from,
100 void ompl::base::ProjectionMatrix::project(const double *from, Eigen::Ref<Eigen::VectorXd> to) const
111 : space_(space), bounds_(0), estimatedBounds_(0), defaultCellSizes_(true), cellSizesWereInferred_(false)
113 params_.declareParam<double>("cellsize_factor", [this](double factor) { mulCellSizes(factor); });
117 : space_(space.get()), bounds_(0), estimatedBounds_(0), defaultCellSizes_(true), cellSizesWereInferred_(false)
119 params_.declareParam<double>("cellsize_factor", [this](double factor) { mulCellSizes(factor); });
179 throw Exception("Number of dimensions in projection space does not match number of cell sizes");
203 coord = (projection.array() / Eigen::Map<const Eigen::VectorXd>(cellSizes.data(), cellSizes.size()).array())
268 OMPL_WARN("Inferred cell size for dimension %u of a projection for state space %s is 0. Setting arbitrary "
293 void ompl::base::ProjectionEvaluator::computeCoordinates(const Eigen::Ref<Eigen::VectorXd> &projection,
322 void ompl::base::ProjectionEvaluator::printProjection(const Eigen::Ref<Eigen::VectorXd> &projection,
328 ompl::base::SubspaceProjectionEvaluator::SubspaceProjectionEvaluator(const StateSpace *space, unsigned int index,
333 throw Exception("Cannot construct a subspace projection evaluator for a space that is not compound");
357 void ompl::base::SubspaceProjectionEvaluator::project(const State *state, Eigen::Ref<Eigen::VectorXd> projection) const
void mulCellSizes(double factor)
Multiply the cell sizes in each dimension by a specified factor factor. This function does nothing if...
Definition: ProjectionEvaluator.cpp:163
Random number generation. An instance of this class cannot be used by multiple threads at once (membe...
Definition: RandomNumbers.h:89
ProjectionEvaluatorPtr getDefaultProjection() const
Get the default projection.
Definition: StateSpace.cpp:723
double gaussian01()
Generate a random real using a normal distribution with mean 0 and variance 1.
Definition: RandomNumbers.h:157
void inferCellSizes()
Sample the state space and decide on default cell sizes. This function is called by setup() if no cel...
Definition: ProjectionEvaluator.cpp:255
void setBounds(const RealVectorBounds &bounds)
Set bounds on the projection. The PDST planner needs to known the bounds on the projection....
Definition: ProjectionEvaluator.cpp:137
static const double PROJECTION_EXPAND_FACTOR
When a bounding box of projected states cannot be inferred, it will be estimated by sampling states....
Definition: MagicConstants.h:130
A space to allow the composition of state spaces.
Definition: StateSpace.h:637
Representation of a space in which planning can be performed. Topology specific sampling,...
Definition: StateSpace.h:134
void computeRandom(unsigned int from, unsigned int to, const std::vector< double > &scale)
Wrapper for ComputeRandom(from, to, scale)
Definition: ProjectionEvaluator.cpp:89
virtual void printSettings(std::ostream &out=std::cout) const
Print settings about this projection.
Definition: ProjectionEvaluator.cpp:299
virtual void setCellSizes(const std::vector< double > &cellSizes)
Define the size (in each dimension) of a grid cell. The number of sizes set here must be the same as ...
Definition: ProjectionEvaluator.cpp:129
unsigned int getSubspaceCount() const
Get the number of state spaces that make up the compound state space.
Definition: StateSpace.cpp:904
virtual void printProjection(const Eigen::Ref< Eigen::VectorXd > &projection, std::ostream &out=std::cout) const
Print a euclidean projection.
Definition: ProjectionEvaluator.cpp:322
void project(const double *from, Eigen::Ref< Eigen::VectorXd > to) const
Multiply the vector from by the contained projection matrix to obtain the vector to.
Definition: ProjectionEvaluator.cpp:100
void computeCoordinates(const Eigen::Ref< Eigen::VectorXd > &projection, Eigen::Ref< Eigen::VectorXi > coord) const
Compute integer coordinates for a projection.
Definition: ProjectionEvaluator.cpp:293
void estimateBounds()
Fill estimatedBounds_ with an approximate bounding box for the projection space (via sampling)
Definition: ProjectionEvaluator.cpp:218
A shared pointer wrapper for ompl::base::ProjectionEvaluator.
void checkCellSizes() const
Check if cell dimensions match projection dimension.
Definition: ProjectionEvaluator.cpp:174
void project(const State *state, Eigen::Ref< Eigen::VectorXd > projection) const override
Compute the projection as an array of double values.
Definition: ProjectionEvaluator.cpp:357
static const unsigned int PROJECTION_EXTENTS_SAMPLES
When no cell sizes are specified for a projection, they are inferred like so:
Definition: MagicConstants.h:124
Abstract definition for a class computing projections to Rn. Implicit integer grids are imposed on th...
Definition: ProjectionEvaluator.h:194
void inferBounds()
Compute an approximation of the bounds for this projection space. getBounds() will then report the co...
Definition: ProjectionEvaluator.cpp:211
bool userConfigured() const
Return true if any user configuration has been done to this projection evaluator (setCellSizes() was ...
Definition: ProjectionEvaluator.cpp:124
unsigned int index_
The index of the subspace from which to project.
Definition: ProjectionEvaluator.h:383
static const double PROJECTION_DIMENSION_SPLITS
When the cell sizes for a projection are automatically computed, this value defines the number of par...
Definition: MagicConstants.h:119
SubspaceProjectionEvaluator(const StateSpace *space, unsigned int index, ProjectionEvaluatorPtr projToUse=ProjectionEvaluatorPtr())
The constructor states that for space space, the projection to use is the same as the component at po...
Definition: ProjectionEvaluator.cpp:328
unsigned int getDimension() const override
Return the dimension of the projection defined by this evaluator.
Definition: ProjectionEvaluator.cpp:352
void checkBounds() const
Check if the projection dimension matched the dimension of the bounds.
Definition: ProjectionEvaluator.cpp:182
void declareParam(const std::string &name, const typename SpecificParam< T >::SetterFn &setter, const typename SpecificParam< T >::GetterFn &getter=[] { return T();})
This function declares a parameter name, and specifies the setter and getter functions.
Definition: GenericParam.h:295
A shared pointer wrapper for ompl::base::StateSpace.
const std::vector< double > & getCellSizes() const
Get the size (each dimension) of a grid cell
Definition: ProjectionEvaluator.h:243
static Matrix ComputeRandom(unsigned int from, unsigned int to, const std::vector< double > &scale)
Compute a random projection matrix with from columns and to rows. A vector with from elements can be ...
Definition: ProjectionEvaluator.cpp:48
A shared pointer wrapper for ompl::base::StateSampler.
const StateSpace * space_
The state space this projection operates on.
Definition: ProjectionEvaluator.h:330
virtual void defaultCellSizes()
Set the default cell dimensions for this projection. The default implementation of this function is e...
Definition: ProjectionEvaluator.cpp:189
void print(std::ostream &out=std::cout) const
Print the contained projection matrix to a stram.
Definition: ProjectionEvaluator.cpp:105
Main namespace. Contains everything in this library.
Definition: MultiLevelPlanarManipulatorDemo.cpp:65
The lower and upper bounds for an Rn space.
Definition: RealVectorBounds.h:111