Loading...
Searching...
No Matches
ompl::base::ProjectionEvaluator Class Referenceabstract

Abstract definition for a class computing projections to Rn. Implicit integer grids are imposed on this projection space by setting cell sizes. Before use, the user must supply cell sizes for the integer grid (setCellSizes()). The implementation of this class is thread safe. More...

#include <ompl/base/ProjectionEvaluator.h>

Inheritance diagram for ompl::base::ProjectionEvaluator:

Public Member Functions

 ProjectionEvaluator (const ProjectionEvaluator &)=delete
ProjectionEvaluatoroperator= (const ProjectionEvaluator &)=delete
 ProjectionEvaluator (const StateSpace *space)
 Construct a projection evaluator for a specific state space.
 ProjectionEvaluator (const StateSpacePtr &space)
 Construct a projection evaluator for a specific state space.
virtual unsigned int getDimension () const =0
 Return the dimension of the projection defined by this evaluator.
virtual void project (const State *state, Eigen::Ref< Eigen::VectorXd > projection) const =0
 Compute the projection as an array of double values.
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 the dimension of the projection computed by the projection evaluator. After a call to this function, setup() will not call defaultCellSizes() or inferCellSizes() any more.
void setCellSizes (unsigned int dim, double cellSize)
 Set the cell sizes to cellSize for a particular dimension dim. This function simply calls getCellSizes(), modifies the desired dimension and then calls setCellSizes(). This is done intentionally to enforce a call to setCellSizes().
void mulCellSizes (double factor)
 Multiply the cell sizes in each dimension by a specified factor factor. This function does nothing if cell sizes have not been set. If cell sizes have been set (irrespective of source; e.g., user, default or inferred), this function will then call setCellSizes(), so the source of the cell sizes will be considered to be the user.
bool userConfigured () const
 Return true if any user configuration has been done to this projection evaluator (setCellSizes() was called)
const std::vector< double > & getCellSizes () const
 Get the size (each dimension) of a grid cell.
double getCellSizes (unsigned int dim) const
 Get the size of a particular dimension of a grid cell.
void checkCellSizes () const
 Check if cell dimensions match projection dimension.
void inferCellSizes ()
 Sample the state space and decide on default cell sizes. This function is called by setup() if no cell dsizes have been set and defaultCellSizes() does not fill the cell sizes either.
virtual void defaultCellSizes ()
 Set the default cell dimensions for this projection. The default implementation of this function is empty. setup() calls this function if no cell dimensions have been previously set.
void checkBounds () const
 Check if the projection dimension matched the dimension of the bounds.
bool hasBounds () const
 Check if bounds were specified for this projection.
void setBounds (const RealVectorBounds &bounds)
 Set bounds on the projection. The PDST planner needs to known the bounds on the projection. Default bounds are automatically computed by inferCellSizes().
const RealVectorBoundsgetBounds () const
 Get the bounds computed/set for this projection.
void inferBounds ()
 Compute an approximation of the bounds for this projection space. getBounds() will then report the computed bounds.
virtual void setup ()
 Perform configuration steps, if needed.
void computeCoordinates (const Eigen::Ref< Eigen::VectorXd > &projection, Eigen::Ref< Eigen::VectorXi > coord) const
 Compute integer coordinates for a projection.
void computeCoordinates (const State *state, Eigen::Ref< Eigen::VectorXi > coord) const
 Compute integer coordinates for a state.
ParamSetparams ()
 Get the parameters for this projection.
const ParamSetparams () const
 Get the parameters for this projection.
virtual void printSettings (std::ostream &out=std::cout) const
 Print settings about this projection.
virtual void printProjection (const Eigen::Ref< Eigen::VectorXd > &projection, std::ostream &out=std::cout) const
 Print a euclidean projection.

Protected Member Functions

void estimateBounds ()
 Fill estimatedBounds_ with an approximate bounding box for the projection space (via sampling)

Protected Attributes

const StateSpacespace_
 The state space this projection operates on.
std::vector< double > cellSizes_
 The size of a cell, in every dimension of the projected space, in the implicitly defined integer grid.
RealVectorBounds bounds_
 A bounding box for projected state values.
RealVectorBounds estimatedBounds_
 An approximate bounding box for projected state values; This is the cached result of estimateBounds() which may later be copied to bounds_ if bounds are needed but were not specified.
bool defaultCellSizes_
 Flag indicating whether cell sizes have been set by the user, or whether they were inferred automatically. This flag becomes false if setCellSizes() is called.
bool cellSizesWereInferred_
 Flag indicating whether projection cell sizes were automatically inferred.
ParamSet params_
 The set of parameters for this projection.

Detailed Description

Abstract definition for a class computing projections to Rn. Implicit integer grids are imposed on this projection space by setting cell sizes. Before use, the user must supply cell sizes for the integer grid (setCellSizes()). The implementation of this class is thread safe.

Definition at line 130 of file ProjectionEvaluator.h.

Constructor & Destructor Documentation

◆ ProjectionEvaluator() [1/2]

ompl::base::ProjectionEvaluator::ProjectionEvaluator ( const StateSpace * space)

Construct a projection evaluator for a specific state space.

Definition at line 110 of file ProjectionEvaluator.cpp.

◆ ProjectionEvaluator() [2/2]

ompl::base::ProjectionEvaluator::ProjectionEvaluator ( const StateSpacePtr & space)

Construct a projection evaluator for a specific state space.

Definition at line 116 of file ProjectionEvaluator.cpp.

Member Function Documentation

◆ checkBounds()

void ompl::base::ProjectionEvaluator::checkBounds ( ) const

Check if the projection dimension matched the dimension of the bounds.

Definition at line 182 of file ProjectionEvaluator.cpp.

◆ checkCellSizes()

void ompl::base::ProjectionEvaluator::checkCellSizes ( ) const

Check if cell dimensions match projection dimension.

Definition at line 174 of file ProjectionEvaluator.cpp.

◆ computeCoordinates() [1/2]

void ompl::base::ProjectionEvaluator::computeCoordinates ( const Eigen::Ref< Eigen::VectorXd > & projection,
Eigen::Ref< Eigen::VectorXi > coord ) const

Compute integer coordinates for a projection.

Definition at line 293 of file ProjectionEvaluator.cpp.

◆ computeCoordinates() [2/2]

void ompl::base::ProjectionEvaluator::computeCoordinates ( const State * state,
Eigen::Ref< Eigen::VectorXi > coord ) const
inline

Compute integer coordinates for a state.

Definition at line 235 of file ProjectionEvaluator.h.

◆ defaultCellSizes()

void ompl::base::ProjectionEvaluator::defaultCellSizes ( )
virtual

Set the default cell dimensions for this projection. The default implementation of this function is empty. setup() calls this function if no cell dimensions have been previously set.

Reimplemented in KoulesProjection, ompl::base::MorseProjection, ompl::base::RealVectorIdentityProjectionEvaluator, and ompl::base::RealVectorOrthogonalProjectionEvaluator.

Definition at line 189 of file ProjectionEvaluator.cpp.

◆ estimateBounds()

void ompl::base::ProjectionEvaluator::estimateBounds ( )
protected

Fill estimatedBounds_ with an approximate bounding box for the projection space (via sampling)

Definition at line 218 of file ProjectionEvaluator.cpp.

◆ getBounds()

const RealVectorBounds & ompl::base::ProjectionEvaluator::getBounds ( ) const
inline

Get the bounds computed/set for this projection.

Definition at line 218 of file ProjectionEvaluator.h.

◆ getCellSizes() [1/2]

const std::vector< double > & ompl::base::ProjectionEvaluator::getCellSizes ( ) const
inline

Get the size (each dimension) of a grid cell.

Definition at line 179 of file ProjectionEvaluator.h.

◆ getCellSizes() [2/2]

double ompl::base::ProjectionEvaluator::getCellSizes ( unsigned int dim) const

Get the size of a particular dimension of a grid cell.

Definition at line 155 of file ProjectionEvaluator.cpp.

◆ getDimension()

◆ hasBounds()

bool ompl::base::ProjectionEvaluator::hasBounds ( ) const
inline

Check if bounds were specified for this projection.

Definition at line 207 of file ProjectionEvaluator.h.

◆ inferBounds()

void ompl::base::ProjectionEvaluator::inferBounds ( )

Compute an approximation of the bounds for this projection space. getBounds() will then report the computed bounds.

Definition at line 211 of file ProjectionEvaluator.cpp.

◆ inferCellSizes()

void ompl::base::ProjectionEvaluator::inferCellSizes ( )

Sample the state space and decide on default cell sizes. This function is called by setup() if no cell dsizes have been set and defaultCellSizes() does not fill the cell sizes either.

Definition at line 255 of file ProjectionEvaluator.cpp.

◆ mulCellSizes()

void ompl::base::ProjectionEvaluator::mulCellSizes ( double factor)

Multiply the cell sizes in each dimension by a specified factor factor. This function does nothing if cell sizes have not been set. If cell sizes have been set (irrespective of source; e.g., user, default or inferred), this function will then call setCellSizes(), so the source of the cell sizes will be considered to be the user.

Definition at line 163 of file ProjectionEvaluator.cpp.

◆ params() [1/2]

ParamSet & ompl::base::ProjectionEvaluator::params ( )
inline

Get the parameters for this projection.

Definition at line 243 of file ProjectionEvaluator.h.

◆ params() [2/2]

const ParamSet & ompl::base::ProjectionEvaluator::params ( ) const
inline

Get the parameters for this projection.

Definition at line 249 of file ProjectionEvaluator.h.

◆ printProjection()

void ompl::base::ProjectionEvaluator::printProjection ( const Eigen::Ref< Eigen::VectorXd > & projection,
std::ostream & out = std::cout ) const
virtual

Print a euclidean projection.

Definition at line 322 of file ProjectionEvaluator.cpp.

◆ printSettings()

void ompl::base::ProjectionEvaluator::printSettings ( std::ostream & out = std::cout) const
virtual

Print settings about this projection.

Definition at line 299 of file ProjectionEvaluator.cpp.

◆ project()

virtual void ompl::base::ProjectionEvaluator::project ( const State * state,
Eigen::Ref< Eigen::VectorXd > projection ) const
pure virtual

◆ setBounds()

void ompl::base::ProjectionEvaluator::setBounds ( const RealVectorBounds & bounds)

Set bounds on the projection. The PDST planner needs to known the bounds on the projection. Default bounds are automatically computed by inferCellSizes().

Definition at line 137 of file ProjectionEvaluator.cpp.

◆ setCellSizes() [1/2]

void ompl::base::ProjectionEvaluator::setCellSizes ( const std::vector< double > & cellSizes)
virtual

Define the size (in each dimension) of a grid cell. The number of sizes set here must be the same as the dimension of the projection computed by the projection evaluator. After a call to this function, setup() will not call defaultCellSizes() or inferCellSizes() any more.

Definition at line 129 of file ProjectionEvaluator.cpp.

◆ setCellSizes() [2/2]

void ompl::base::ProjectionEvaluator::setCellSizes ( unsigned int dim,
double cellSize )

Set the cell sizes to cellSize for a particular dimension dim. This function simply calls getCellSizes(), modifies the desired dimension and then calls setCellSizes(). This is done intentionally to enforce a call to setCellSizes().

Definition at line 143 of file ProjectionEvaluator.cpp.

◆ setup()

void ompl::base::ProjectionEvaluator::setup ( )
virtual

◆ userConfigured()

bool ompl::base::ProjectionEvaluator::userConfigured ( ) const

Return true if any user configuration has been done to this projection evaluator (setCellSizes() was called)

Definition at line 124 of file ProjectionEvaluator.cpp.

Member Data Documentation

◆ bounds_

RealVectorBounds ompl::base::ProjectionEvaluator::bounds_
protected

A bounding box for projected state values.

Definition at line 274 of file ProjectionEvaluator.h.

◆ cellSizes_

std::vector<double> ompl::base::ProjectionEvaluator::cellSizes_
protected

The size of a cell, in every dimension of the projected space, in the implicitly defined integer grid.

Definition at line 271 of file ProjectionEvaluator.h.

◆ cellSizesWereInferred_

bool ompl::base::ProjectionEvaluator::cellSizesWereInferred_
protected

Flag indicating whether projection cell sizes were automatically inferred.

Definition at line 289 of file ProjectionEvaluator.h.

◆ defaultCellSizes_

bool ompl::base::ProjectionEvaluator::defaultCellSizes_
protected

Flag indicating whether cell sizes have been set by the user, or whether they were inferred automatically. This flag becomes false if setCellSizes() is called.

Definition at line 285 of file ProjectionEvaluator.h.

◆ estimatedBounds_

RealVectorBounds ompl::base::ProjectionEvaluator::estimatedBounds_
protected

An approximate bounding box for projected state values; This is the cached result of estimateBounds() which may later be copied to bounds_ if bounds are needed but were not specified.

Definition at line 279 of file ProjectionEvaluator.h.

◆ params_

ParamSet ompl::base::ProjectionEvaluator::params_
protected

The set of parameters for this projection.

Definition at line 292 of file ProjectionEvaluator.h.

◆ space_

const StateSpace* ompl::base::ProjectionEvaluator::space_
protected

The state space this projection operates on.

Definition at line 266 of file ProjectionEvaluator.h.


The documentation for this class was generated from the following files: