Loading...
Searching...
No Matches
ompl::geometric::XXLPlanarDecomposition Class Referenceabstract
Inheritance diagram for ompl::geometric::XXLPlanarDecomposition:

Public Member Functions

 XXLPlanarDecomposition (const base::RealVectorBounds &xyBounds, const std::vector< int > &xySlices, const int thetaSlices, bool diagonalEdges=false)
 
 XXLPlanarDecomposition (const base::RealVectorBounds &xyBounds, const std::vector< int > &xySlices, const int thetaSlices, double thetaLowerBound, double thetaUpperBound, bool diagonalEdges=false)
 
virtual int getNumRegions () const
 Return the total number of regions in this decomposition.
 
virtual int getDimension () const
 Return the dimension of this HiLoDecomposition.
 
virtual int numLayers () const =0
 Return the number of layers possible in this decomposition. Must be at least 1.
 
virtual int locateRegion (const base::State *s) const
 Return the id of the region that this state falls in.
 
virtual int locateRegion (const std::vector< double > &coord) const
 Return the id of the region that this coordinate falls in.
 
virtual void getNeighbors (int rid, std::vector< int > &neighbors) const
 Stores the given region's neighbors into a given vector.
 
virtual void getNeighborhood (int rid, std::vector< int > &neighborhood) const
 Stores the given region's neighbors into the vector. This returns the 8-connected grid neighbors of the cell, regardless of whether diagonal edges exist.
 
virtual double distanceHeuristic (int r1, int r2) const
 An admissible and consistent distance heuristic between two regions. Manhattan distance on grid.
 
virtual bool sampleFromRegion (int r, base::State *s, const base::State *seed=nullptr) const =0
 Sample a state s from region r in layer 0.
 
virtual bool sampleFromRegion (int r, base::State *s, const base::State *seed, int layer) const =0
 Sample a state s from region r in the given layer.
 
virtual void project (const base::State *s, std::vector< double > &coord, int layer=0) const =0
 Project the given State into the XXLDecomposition.
 
virtual void project (const base::State *s, std::vector< int > &layers) const =0
 Project the state into the decomposition and retrieve the region for all valid layers.
 
void ridToGridCell (int rid, std::vector< int > &cell) const
 
int gridCellToRid (const std::vector< int > &cell) const
 Return the region id corresponding to the (discrete) grid cell coordinates.
 
int coordToRegion (const std::vector< double > &coord) const
 Return the region id of the given coordinate in the decomposition.
 
int coordToRegion (const double *coord) const
 
bool hasDiagonalEdges () const
 Return true if the decomposition has diagonal edges.
 
- Public Member Functions inherited from ompl::geometric::XXLDecomposition
 XXLDecomposition ()
 Constructor.
 
virtual int getNumRegions () const =0
 Returns the number of regions in this XXLDecomposition.
 
virtual int getDimension () const =0
 Return the dimension of this XXLDecomposition.
 
virtual int numLayers () const =0
 Return the number of layers possible in this decomposition. Must be at least 1.
 
virtual int locateRegion (const base::State *s) const =0
 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.
 
virtual int locateRegion (const std::vector< double > &coord) const =0
 Return the region that this coordinate lies in. Returns -1 if this coord is out of bounds.
 
virtual void getNeighbors (int rid, std::vector< int > &neighbors) const =0
 Stores the given region's neighbors into a given vector. These are adjacent neighbors.
 
virtual void getNeighborhood (int rid, std::vector< int > &neighborhood) const
 Return a list of regions in the neighborhood of rid. This method is intended to retrieve all regions with in a 'radius'. This method should return a superset of getNeighbors (or equal). The neighborhood may or not be adjacent regions. Think of this as the 8-connected neighborhood of a grid, and getNeighbors as the 4-connected neighborhood of a grid.
 
virtual double distanceHeuristic (int r1, int r2) const =0
 An admissible and consistent distance heuristic between two regions.
 
virtual bool sampleFromRegion (int r, base::State *s, const base::State *seed=nullptr) const =0
 Sample a state s from region r in layer 0.
 
virtual bool sampleFromRegion (int r, base::State *s, const base::State *seed, int layer) const =0
 Sample a state s from region r in the given layer.
 
virtual void project (const base::State *s, std::vector< double > &coord, int layer=0) const =0
 Project the given State into the XXLDecomposition.
 
virtual void project (const base::State *s, std::vector< int > &layers) const =0
 Project the state into the decomposition and retrieve the region for all valid layers.
 
virtual bool canSteer () const
 Returns true if the method steerToRegion is available.
 
virtual bool steerToRegion (int, int, const ompl::base::State *, std::vector< ompl::base::State * > &) const
 

Protected Member Functions

void constructGraph ()
 
void getNonDiagonalNeighbors (int rid, std::vector< int > &neighbors) const
 
void getDiagonalNeighbors (int rid, std::vector< int > &neighbors) const
 
void sampleCoordinateFromRegion (int r, std::vector< double > &coord) const
 
void sampleCoordinateFromRegion (int r, double *coord) const
 

Protected Attributes

bool diagonalEdges_
 
base::RealVectorBounds xyBounds_
 
double thetaLow_ {-boost::math::constants::pi<double>()}
 
double thetaHigh_ {boost::math::constants::pi<double>()}
 
std::vector< int > xySlices_
 
int thetaSlices_
 
int numRegions_
 
double dx_
 
double dy_
 
double xSize_
 
double ySize_
 
double dTheta_
 
double thetaSize_
 
int dimension_
 
ompl::RNG rng_
 

Detailed Description

Definition at line 50 of file XXLPlanarDecomposition.h.

Constructor & Destructor Documentation

◆ XXLPlanarDecomposition() [1/2]

ompl::geometric::XXLPlanarDecomposition::XXLPlanarDecomposition ( const base::RealVectorBounds xyBounds,
const std::vector< int > &  xySlices,
const int  thetaSlices,
bool  diagonalEdges = false 
)

Definition at line 42 of file XXLPlanarDecomposition.cpp.

◆ XXLPlanarDecomposition() [2/2]

ompl::geometric::XXLPlanarDecomposition::XXLPlanarDecomposition ( const base::RealVectorBounds xyBounds,
const std::vector< int > &  xySlices,
const int  thetaSlices,
double  thetaLowerBound,
double  thetaUpperBound,
bool  diagonalEdges = false 
)

Definition at line 84 of file XXLPlanarDecomposition.cpp.

◆ ~XXLPlanarDecomposition()

ompl::geometric::XXLPlanarDecomposition::~XXLPlanarDecomposition ( )
virtual

Definition at line 133 of file XXLPlanarDecomposition.cpp.

Member Function Documentation

◆ coordToRegion() [1/2]

int ompl::geometric::XXLPlanarDecomposition::coordToRegion ( const double *  coord) const

Definition at line 279 of file XXLPlanarDecomposition.cpp.

◆ coordToRegion() [2/2]

int ompl::geometric::XXLPlanarDecomposition::coordToRegion ( const std::vector< double > &  coord) const

Return the region id of the given coordinate in the decomposition.

Definition at line 274 of file XXLPlanarDecomposition.cpp.

◆ distanceHeuristic()

double ompl::geometric::XXLPlanarDecomposition::distanceHeuristic ( int  r1,
int  r2 
) const
virtual

An admissible and consistent distance heuristic between two regions. Manhattan distance on grid.

Implements ompl::geometric::XXLDecomposition.

Definition at line 311 of file XXLPlanarDecomposition.cpp.

◆ getDiagonalNeighbors()

void ompl::geometric::XXLPlanarDecomposition::getDiagonalNeighbors ( int  rid,
std::vector< int > &  neighbors 
) const
protected

Definition at line 224 of file XXLPlanarDecomposition.cpp.

◆ getDimension()

int ompl::geometric::XXLPlanarDecomposition::getDimension ( ) const
virtual

Return the dimension of this HiLoDecomposition.

Implements ompl::geometric::XXLDecomposition.

Definition at line 142 of file XXLPlanarDecomposition.cpp.

◆ getNeighborhood()

void ompl::geometric::XXLPlanarDecomposition::getNeighborhood ( int  rid,
std::vector< int > &  neighborhood 
) const
virtual

Stores the given region's neighbors into the vector. This returns the 8-connected grid neighbors of the cell, regardless of whether diagonal edges exist.

Reimplemented from ompl::geometric::XXLDecomposition.

Definition at line 169 of file XXLPlanarDecomposition.cpp.

◆ getNeighbors()

void ompl::geometric::XXLPlanarDecomposition::getNeighbors ( int  rid,
std::vector< int > &  neighbors 
) const
virtual

Stores the given region's neighbors into a given vector.

Implements ompl::geometric::XXLDecomposition.

Definition at line 159 of file XXLPlanarDecomposition.cpp.

◆ getNonDiagonalNeighbors()

void ompl::geometric::XXLPlanarDecomposition::getNonDiagonalNeighbors ( int  rid,
std::vector< int > &  neighbors 
) const
protected

Definition at line 174 of file XXLPlanarDecomposition.cpp.

◆ getNumRegions()

int ompl::geometric::XXLPlanarDecomposition::getNumRegions ( ) const
virtual

Return the total number of regions in this decomposition.

Implements ompl::geometric::XXLDecomposition.

Definition at line 137 of file XXLPlanarDecomposition.cpp.

◆ gridCellToRid()

int ompl::geometric::XXLPlanarDecomposition::gridCellToRid ( const std::vector< int > &  cell) const

Return the region id corresponding to the (discrete) grid cell coordinates.

Definition at line 302 of file XXLPlanarDecomposition.cpp.

◆ hasDiagonalEdges()

bool ompl::geometric::XXLPlanarDecomposition::hasDiagonalEdges ( ) const

Return true if the decomposition has diagonal edges.

Definition at line 333 of file XXLPlanarDecomposition.cpp.

◆ locateRegion() [1/2]

int ompl::geometric::XXLPlanarDecomposition::locateRegion ( const base::State s) const
virtual

Return the id of the region that this state falls in.

Implements ompl::geometric::XXLDecomposition.

Definition at line 147 of file XXLPlanarDecomposition.cpp.

◆ locateRegion() [2/2]

int ompl::geometric::XXLPlanarDecomposition::locateRegion ( const std::vector< double > &  coord) const
virtual

Return the id of the region that this coordinate falls in.

Implements ompl::geometric::XXLDecomposition.

Definition at line 154 of file XXLPlanarDecomposition.cpp.

◆ numLayers()

virtual int ompl::geometric::XXLPlanarDecomposition::numLayers ( ) const
pure virtual

Return the number of layers possible in this decomposition. Must be at least 1.

Implements ompl::geometric::XXLDecomposition.

Implemented in PMXXLDecomposition.

◆ project() [1/2]

virtual void ompl::geometric::XXLPlanarDecomposition::project ( const base::State s,
std::vector< double > &  coord,
int  layer = 0 
) const
pure virtual

Project the given State into the XXLDecomposition.

Implements ompl::geometric::XXLDecomposition.

Implemented in PMXXLDecomposition.

◆ project() [2/2]

virtual void ompl::geometric::XXLPlanarDecomposition::project ( const base::State s,
std::vector< int > &  layers 
) const
pure virtual

Project the state into the decomposition and retrieve the region for all valid layers.

Implements ompl::geometric::XXLDecomposition.

Implemented in PMXXLDecomposition.

◆ ridToGridCell()

void ompl::geometric::XXLPlanarDecomposition::ridToGridCell ( int  rid,
std::vector< int > &  cell 
) const

Definition at line 290 of file XXLPlanarDecomposition.cpp.

◆ sampleCoordinateFromRegion() [1/2]

void ompl::geometric::XXLPlanarDecomposition::sampleCoordinateFromRegion ( int  r,
double *  coord 
) const
protected

Definition at line 345 of file XXLPlanarDecomposition.cpp.

◆ sampleCoordinateFromRegion() [2/2]

void ompl::geometric::XXLPlanarDecomposition::sampleCoordinateFromRegion ( int  r,
std::vector< double > &  coord 
) const
protected

Definition at line 339 of file XXLPlanarDecomposition.cpp.

◆ sampleFromRegion() [1/2]

virtual bool ompl::geometric::XXLPlanarDecomposition::sampleFromRegion ( int  r,
base::State s,
const base::State seed,
int  layer 
) const
pure virtual

Sample a state s from region r in the given layer.

Implements ompl::geometric::XXLDecomposition.

Implemented in PMXXLDecomposition.

◆ sampleFromRegion() [2/2]

virtual bool ompl::geometric::XXLPlanarDecomposition::sampleFromRegion ( int  r,
base::State s,
const base::State seed = nullptr 
) const
pure virtual

Sample a state s from region r in layer 0.

Implements ompl::geometric::XXLDecomposition.

Implemented in PMXXLDecomposition.

Member Data Documentation

◆ diagonalEdges_

bool ompl::geometric::XXLPlanarDecomposition::diagonalEdges_
protected

Definition at line 128 of file XXLPlanarDecomposition.h.

◆ dimension_

int ompl::geometric::XXLPlanarDecomposition::dimension_
protected

Definition at line 155 of file XXLPlanarDecomposition.h.

◆ dTheta_

double ompl::geometric::XXLPlanarDecomposition::dTheta_
protected

Definition at line 150 of file XXLPlanarDecomposition.h.

◆ dx_

double ompl::geometric::XXLPlanarDecomposition::dx_
protected

Definition at line 145 of file XXLPlanarDecomposition.h.

◆ dy_

double ompl::geometric::XXLPlanarDecomposition::dy_
protected

Definition at line 145 of file XXLPlanarDecomposition.h.

◆ numRegions_

int ompl::geometric::XXLPlanarDecomposition::numRegions_
protected

Definition at line 142 of file XXLPlanarDecomposition.h.

◆ rng_

ompl::RNG ompl::geometric::XXLPlanarDecomposition::rng_
mutableprotected

Definition at line 158 of file XXLPlanarDecomposition.h.

◆ thetaHigh_

double ompl::geometric::XXLPlanarDecomposition::thetaHigh_ {boost::math::constants::pi<double>()}
protected

Definition at line 134 of file XXLPlanarDecomposition.h.

◆ thetaLow_

double ompl::geometric::XXLPlanarDecomposition::thetaLow_ {-boost::math::constants::pi<double>()}
protected

Definition at line 133 of file XXLPlanarDecomposition.h.

◆ thetaSize_

double ompl::geometric::XXLPlanarDecomposition::thetaSize_
protected

Definition at line 152 of file XXLPlanarDecomposition.h.

◆ thetaSlices_

int ompl::geometric::XXLPlanarDecomposition::thetaSlices_
protected

Definition at line 139 of file XXLPlanarDecomposition.h.

◆ xSize_

double ompl::geometric::XXLPlanarDecomposition::xSize_
protected

Definition at line 147 of file XXLPlanarDecomposition.h.

◆ xyBounds_

base::RealVectorBounds ompl::geometric::XXLPlanarDecomposition::xyBounds_
protected

Definition at line 131 of file XXLPlanarDecomposition.h.

◆ xySlices_

std::vector<int> ompl::geometric::XXLPlanarDecomposition::xySlices_
protected

Definition at line 137 of file XXLPlanarDecomposition.h.

◆ ySize_

double ompl::geometric::XXLPlanarDecomposition::ySize_
protected

Definition at line 147 of file XXLPlanarDecomposition.h.


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