37 #ifndef OMPL_CONTROL_PLANNERS_SYCLOP_GRIDDECOMPOSITION_
38 #define OMPL_CONTROL_PLANNERS_SYCLOP_GRIDDECOMPOSITION_
41 #include <boost/shared_ptr.hpp>
42 #include <boost/unordered_map.hpp>
43 #include "ompl/base/spaces/RealVectorBounds.h"
44 #include "ompl/base/State.h"
45 #include "ompl/control/planners/syclop/Decomposition.h"
46 #include "ompl/util/RandomNumbers.h"
70 virtual void getNeighbors(
unsigned int rid, std::vector<unsigned int>& neighbors)
const;
74 virtual void sampleFromRegion(
unsigned int rid,
RNG& rng, std::vector<double>& coord)
const;
87 unsigned int coordToRegion(
const std::vector<double>& coord)
const;
90 void coordToGridCoord(
const std::vector<double>& coord, std::vector<unsigned int>& gridCoord)
const;
97 unsigned int dim, std::vector <unsigned int> &candidate)
const;
101 mutable boost::unordered_map<int, boost::shared_ptr<base::RealVectorBounds> > regToBounds_;
105 unsigned int calcNumRegions(
unsigned int len,
unsigned int dim)
const;
void computeGridNeighbors(unsigned int rid, std::vector< unsigned int > &neighbors) const
Computes the neighbors of the given region in a n-dimensional grid.
virtual double getRegionVolume(unsigned int)
Returns the volume of a given region in this Decomposition.
virtual const base::RealVectorBounds & getRegionBounds(unsigned int rid) const
Helper method to return the bounds of a given region.
virtual void getNeighbors(unsigned int rid, std::vector< unsigned int > &neighbors) const
Stores a given region's neighbors into a given vector.
A GridDecomposition is a Decomposition implemented using a grid.
A Decomposition is a partition of a bounded Euclidean space into a fixed number of regions which are ...
virtual int locateRegion(const base::State *s) const
Returns the index of the region containing a given State. Most often, this is obtained by first calli...
Random number generation. An instance of this class cannot be used by multiple threads at once (membe...
virtual void sampleFromRegion(unsigned int rid, RNG &rng, std::vector< double > &coord) const
Samples a projected coordinate from a given region.
Definition of an abstract state.
void computeGridNeighborsSub(const std::vector< unsigned int > &coord, std::vector< unsigned int > &neighbors, unsigned int dim, std::vector< unsigned int > &candidate) const
The lower and upper bounds for an Rn space.
void regionToGridCoord(unsigned int rid, std::vector< unsigned int > &coord) const
Converts a given region to a coordinate in the grid.
unsigned int coordToRegion(const std::vector< double > &coord) const
Converts a decomposition space coordinate to the ID of the region that contains iit.
GridDecomposition(unsigned int len, unsigned int dim, const base::RealVectorBounds &b)
Constructor. Creates a GridDecomposition as a hypercube with a given dimension, side length...
void coordToGridCoord(const std::vector< double > &coord, std::vector< unsigned int > &gridCoord) const
Converts a decomposition space coordinate to a grid coordinate.
unsigned int gridCoordToRegion(const std::vector< unsigned int > &coord) const
Converts the given grid coordinate to its corresponding region ID.