A GridDecomposition is a Decomposition implemented using a grid. More...
#include <ompl/control/planners/syclop/GridDecomposition.h>

Public Member Functions | |
GridDecomposition (int len, int dim, const base::RealVectorBounds &b) | |
Constructor. Creates a GridDecomposition as a hypercube with a given dimension, side length, and bounds. The cells of the hypercube are referenced by integer coordinates of the form \((r_1,\ldots,r_k)\), where \( 0 \leq r_i < \texttt{len}\). | |
int | getNumRegions () const override |
Returns the number of regions in this Decomposition. | |
double | getRegionVolume (int) override |
Returns the volume of a given region in this Decomposition. | |
void | getNeighbors (int rid, std::vector< int > &neighbors) const override |
Stores a given region's neighbors into a given vector. | |
int | locateRegion (const base::State *s) const override |
Returns the index of the region containing a given State. Most often, this is obtained by first calling project(). Returns -1 if no region contains the State. | |
void | sampleFromRegion (int rid, RNG &rng, std::vector< double > &coord) const override |
Samples a projected coordinate from a given region. | |
![]() | |
Decomposition (int dim, const base::RealVectorBounds &b) | |
Constructor. Creates a Decomposition with a given dimension and a given set of bounds. Accepts as an optional argument a given number of regions. | |
virtual int | getDimension () const |
Returns the dimension of this Decomposition. | |
virtual const base::RealVectorBounds & | getBounds () const |
Returns the bounds of this Decomposition. | |
virtual void | project (const base::State *s, std::vector< double > &coord) const =0 |
Project a given State to a set of coordinates in R^k, where k is the dimension of this Decomposition. | |
virtual void | sampleFullState (const base::StateSamplerPtr &sampler, const std::vector< double > &coord, base::State *s) const =0 |
Samples a State using a projected coordinate and a StateSampler. | |
Protected Member Functions | |
virtual const base::RealVectorBounds & | getRegionBounds (int rid) const |
Helper method to return the bounds of a given region. | |
void | regionToGridCoord (int rid, std::vector< int > &coord) const |
Converts a given region to a coordinate in the grid. | |
int | gridCoordToRegion (const std::vector< int > &coord) const |
Converts the given grid coordinate to its corresponding region ID. | |
int | coordToRegion (const std::vector< double > &coord) const |
Converts a decomposition space coordinate to the ID of the region that contains iit. | |
void | coordToGridCoord (const std::vector< double > &coord, std::vector< int > &gridCoord) const |
Converts a decomposition space coordinate to a grid coordinate. | |
void | computeGridNeighbors (int rid, std::vector< int > &neighbors) const |
Computes the neighbors of the given region in a n-dimensional grid. | |
void | computeGridNeighborsSub (const std::vector< int > &coord, std::vector< int > &neighbors, int dim, std::vector< int > &candidate) const |
Protected Attributes | |
int | length_ |
double | cellVolume_ |
std::unordered_map< int, std::shared_ptr< base::RealVectorBounds > > | regToBounds_ |
![]() | |
int | dimension_ |
base::RealVectorBounds | bounds_ |
Detailed Description
A GridDecomposition is a Decomposition implemented using a grid.
Definition at line 53 of file GridDecomposition.h.
Constructor & Destructor Documentation
◆ GridDecomposition()
ompl::control::GridDecomposition::GridDecomposition | ( | int | len, |
int | dim, | ||
const base::RealVectorBounds & | b ) |
Constructor. Creates a GridDecomposition as a hypercube with a given dimension, side length, and bounds. The cells of the hypercube are referenced by integer coordinates of the form \((r_1,\ldots,r_k)\), where \( 0 \leq r_i < \texttt{len}\).
Definition at line 45 of file GridDecomposition.cpp.
Member Function Documentation
◆ computeGridNeighbors()
|
protected |
Computes the neighbors of the given region in a n-dimensional grid.
Definition at line 117 of file GridDecomposition.cpp.
◆ computeGridNeighborsSub()
|
protected |
Recursive subroutine for grid neighbor computation
Definition at line 126 of file GridDecomposition.cpp.
◆ coordToGridCoord()
|
protected |
Converts a decomposition space coordinate to a grid coordinate.
Definition at line 211 of file GridDecomposition.cpp.
◆ coordToRegion()
|
protected |
Converts a decomposition space coordinate to the ID of the region that contains iit.
Definition at line 191 of file GridDecomposition.cpp.
◆ getNeighbors()
|
overridevirtual |
Stores a given region's neighbors into a given vector.
Implements ompl::control::Decomposition.
Definition at line 53 of file GridDecomposition.cpp.
◆ getNumRegions()
|
inlineoverridevirtual |
Returns the number of regions in this Decomposition.
Implements ompl::control::Decomposition.
Definition at line 64 of file GridDecomposition.h.
◆ getRegionBounds()
|
protectedvirtual |
Helper method to return the bounds of a given region.
Definition at line 226 of file GridDecomposition.cpp.
◆ getRegionVolume()
|
inlineoverridevirtual |
Returns the volume of a given region in this Decomposition.
Implements ompl::control::Decomposition.
Definition at line 69 of file GridDecomposition.h.
◆ gridCoordToRegion()
|
protected |
Converts the given grid coordinate to its corresponding region ID.
Definition at line 176 of file GridDecomposition.cpp.
◆ locateRegion()
|
overridevirtual |
Returns the index of the region containing a given State. Most often, this is obtained by first calling project(). Returns -1 if no region contains the State.
Implements ompl::control::Decomposition.
Definition at line 102 of file GridDecomposition.cpp.
◆ regionToGridCoord()
|
protected |
Converts a given region to a coordinate in the grid.
Definition at line 165 of file GridDecomposition.cpp.
◆ sampleFromRegion()
|
overridevirtual |
Samples a projected coordinate from a given region.
Implements ompl::control::Decomposition.
Definition at line 109 of file GridDecomposition.cpp.
Member Data Documentation
◆ cellVolume_
|
protected |
Definition at line 104 of file GridDecomposition.h.
◆ length_
|
protected |
Definition at line 103 of file GridDecomposition.h.
◆ regToBounds_
|
mutableprotected |
Definition at line 105 of file GridDecomposition.h.
The documentation for this class was generated from the following files:
- ompl/control/planners/syclop/GridDecomposition.h
- ompl/control/planners/syclop/src/GridDecomposition.cpp