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

Public Member Functions

 XXLPositionDecomposition (const base::RealVectorBounds &bounds, const std::vector< int > &slices, bool diagonalEdges=false)
 
virtual int getNumRegions () const
 Returns the number of regions in this XXLDecomposition. More...
 
virtual int getDimension () const
 Return the dimension of this HiLoDecomposition. More...
 
virtual int numLayers () const =0
 Return the number of layers possible in this decomposition. Must be at least 1. More...
 
virtual int locateRegion (const base::State *s) const
 Return the id of the region that this state falls in. More...
 
virtual int locateRegion (const std::vector< double > &coord) const
 Return the id of the region that this coordinate falls in. More...
 
virtual void getNeighbors (int rid, std::vector< int > &neighbors) const
 Stores the given region's neighbors into a given vector. More...
 
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. More...
 
virtual double distanceHeuristic (int r1, int r2) const
 An admissible and consistent distance heuristic between two regions. Manhattan distance on grid. More...
 
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. More...
 
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. More...
 
virtual void project (const base::State *s, std::vector< double > &coord, int layer=0) const =0
 Project the given State into the XXLDecomposition. More...
 
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. More...
 
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. More...
 
int coordToRegion (const std::vector< double > &coord) const
 Return the region id of the given coordinate in the decomposition. More...
 
int coordToRegion (const double *coord) const
 
bool hasDiagonalEdges () const
 Return true if the decomposition has diagonal edges. More...
 
- Public Member Functions inherited from ompl::geometric::XXLDecomposition
 XXLDecomposition ()
 Constructor. More...
 
virtual int getNumRegions () const =0
 Returns the number of regions in this XXLDecomposition. More...
 
virtual int getDimension () const =0
 Return the dimension of this XXLDecomposition. More...
 
virtual int numLayers () const =0
 Return the number of layers possible in this decomposition. Must be at least 1. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual double distanceHeuristic (int r1, int r2) const =0
 An admissible and consistent distance heuristic between two regions. More...
 
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. More...
 
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. More...
 
virtual void project (const base::State *s, std::vector< double > &coord, int layer=0) const =0
 Project the given State into the XXLDecomposition. More...
 
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. More...
 
virtual bool canSteer () const
 Returns true if the method steerToRegion is available. More...
 
virtual bool steerToRegion (int, int, const ompl::base::State *, std::vector< ompl::base::State * > &) const
 

Protected Member Functions

void getNonDiagonalNeighbors (int rid, std::vector< int > &neighbors) const
 
void getDiagonalNeighbors (int rid, std::vector< int > &neighbors) const
 

Protected Attributes

base::RealVectorBounds bounds_
 
const std::vector< int > slices_
 
std::vector< double > cellSizes_
 
bool diagonalEdges_
 
int numRegions_
 

Detailed Description

Definition at line 49 of file XXLPositionDecomposition.h.

Constructor & Destructor Documentation

◆ XXLPositionDecomposition()

ompl::geometric::XXLPositionDecomposition::XXLPositionDecomposition ( const base::RealVectorBounds bounds,
const std::vector< int > &  slices,
bool  diagonalEdges = false 
)

Definition at line 41 of file XXLPositionDecomposition.cpp.

◆ ~XXLPositionDecomposition()

ompl::geometric::XXLPositionDecomposition::~XXLPositionDecomposition ( )
virtual

Definition at line 64 of file XXLPositionDecomposition.cpp.

Member Function Documentation

◆ coordToRegion() [1/2]

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

Definition at line 151 of file XXLPositionDecomposition.cpp.

◆ coordToRegion() [2/2]

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

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

Definition at line 146 of file XXLPositionDecomposition.cpp.

◆ distanceHeuristic()

double ompl::geometric::XXLPositionDecomposition::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 103 of file XXLPositionDecomposition.cpp.

◆ getDiagonalNeighbors()

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

Definition at line 189 of file XXLPositionDecomposition.cpp.

◆ getDimension()

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

Return the dimension of this HiLoDecomposition.

Implements ompl::geometric::XXLDecomposition.

Definition at line 73 of file XXLPositionDecomposition.cpp.

◆ getNeighborhood()

void ompl::geometric::XXLPositionDecomposition::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 98 of file XXLPositionDecomposition.cpp.

◆ getNeighbors()

void ompl::geometric::XXLPositionDecomposition::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 90 of file XXLPositionDecomposition.cpp.

◆ getNonDiagonalNeighbors()

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

Definition at line 164 of file XXLPositionDecomposition.cpp.

◆ getNumRegions()

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

Returns the number of regions in this XXLDecomposition.

Implements ompl::geometric::XXLDecomposition.

Definition at line 68 of file XXLPositionDecomposition.cpp.

◆ gridCellToRid()

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

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

Definition at line 134 of file XXLPositionDecomposition.cpp.

◆ hasDiagonalEdges()

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

Return true if the decomposition has diagonal edges.

Definition at line 159 of file XXLPositionDecomposition.cpp.

◆ locateRegion() [1/2]

int ompl::geometric::XXLPositionDecomposition::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 78 of file XXLPositionDecomposition.cpp.

◆ locateRegion() [2/2]

int ompl::geometric::XXLPositionDecomposition::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 85 of file XXLPositionDecomposition.cpp.

◆ numLayers()

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

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

Implements ompl::geometric::XXLDecomposition.

◆ project() [1/2]

virtual void ompl::geometric::XXLPositionDecomposition::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.

◆ project() [2/2]

virtual void ompl::geometric::XXLPositionDecomposition::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.

◆ ridToGridCell()

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

Definition at line 119 of file XXLPositionDecomposition.cpp.

◆ sampleFromRegion() [1/2]

virtual bool ompl::geometric::XXLPositionDecomposition::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.

◆ sampleFromRegion() [2/2]

virtual bool ompl::geometric::XXLPositionDecomposition::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.

Member Data Documentation

◆ bounds_

base::RealVectorBounds ompl::geometric::XXLPositionDecomposition::bounds_
protected

Definition at line 113 of file XXLPositionDecomposition.h.

◆ cellSizes_

std::vector<double> ompl::geometric::XXLPositionDecomposition::cellSizes_
protected

Definition at line 118 of file XXLPositionDecomposition.h.

◆ diagonalEdges_

bool ompl::geometric::XXLPositionDecomposition::diagonalEdges_
protected

Definition at line 121 of file XXLPositionDecomposition.h.

◆ numRegions_

int ompl::geometric::XXLPositionDecomposition::numRegions_
protected

Definition at line 123 of file XXLPositionDecomposition.h.

◆ slices_

const std::vector<int> ompl::geometric::XXLPositionDecomposition::slices_
protected

Definition at line 116 of file XXLPositionDecomposition.h.


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