Template Class GridN

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Derived Types

Class Documentation

template<typename _T>
class GridN : public ompl::Grid<_T>

Representation of a grid where cells keep track of how many neighbors they have.

Subclassed by ompl::GridB< CellData *, OrderCellsByImportance >, ompl::GridB< _T, LessThanExternal, LessThanInternal >

Public Types

using BaseCell = typename Grid<_T>::Cell

Datatype for cell in base class.

using BaseCellArray = typename Grid<_T>::CellArray

Datatype for array of cells in base class.

using Coord = typename Grid<_T>::Coord

Datatype for cell coordinates.

using CellArray = std::vector<Cell*>

The datatype for arrays of cells.

Public Functions

inline explicit GridN(unsigned int dimension)

The constructor takes the dimension of the grid as argument.

~GridN() override = default
inline void setDimension(unsigned int dimension)

Update the dimension of the grid; this should not be done unless the grid is empty

inline void setBounds(const Coord &low, const Coord &up)

If bounds for the grid need to be considered, we can set them here. When the number of neighbors are counted, whether the Space is bounded matters, in the sense that if a cell is on the boundary, we know some of its neighbors cannot exist. In order to allow such a cell to reflect the fact it has Achieved its maximal number of neighbors, the boundary is counted as the number of neighbors it prevents from existing.

inline void setInteriorCellNeighborLimit(unsigned int count)

Set the limit of neighboring cells to determine when a cell becomes interior by default, this is 2 * dimension of grid

inline Cell *getCell(const Coord &coord) const

Get the cell at a specified coordinate.

inline void neighbors(const Cell *cell, CellArray &list) const

Get the list of neighbors for a given cell.

inline void neighbors(const Coord &coord, CellArray &list) const

Get the list of neighbors for a given coordinate.

inline void neighbors(Coord &coord, CellArray &list) const

Get the list of neighbors for a given coordinate.

inline virtual BaseCell *createCell(const Coord &coord, BaseCellArray *nbh = nullptr) override

Instantiate a new cell at given coordinates; Optionally return the list of future neighbors. Note: this call only creates the cell, but does not add it to the grid. It however updates the neighbor count for neighboring cells

inline bool remove(BaseCell *cell) override

Remove a cell from the grid. If the cell has not been Added to the grid, only update the neighbor list

inline void getCells(CellArray &cells) const

Get the set of instantiated cells in the grid.

Protected Functions

inline unsigned int numberOfBoundaryDimensions(const Coord &coord) const

Compute how many sides of a coordinate touch the boundaries of the grid.

Protected Attributes

bool hasBounds_

Flag indicating whether bounds are in effect for this grid.

Coord lowBound_

If bounds are set, this defines the lower corner cell.

Coord upBound_

If bounds are set, this defines the upper corner cell.

unsigned int interiorCellNeighborsLimit_

By default, cells are considered on the border if 2n neighbors are created, for a space of dimension n. this value is overridden and set in this member variable

bool overrideCellNeighborsLimit_

Flag indicating whether the neighbor count used to determine whether a cell is on the border or not

struct Cell : public BaseCell

Definition of a cell in this grid.

Public Functions

Cell() = default
~Cell() override = default

Public Members

unsigned int neighbors = {0}

The number of neighbors.

bool border = {true}

A flag indicating whether this cell is on the border or not.