Loading...
Searching...
No Matches
ompl::geometric::Discretization< Motion > Class Template Reference

One-level discretization used for KPIECE. More...

#include <ompl/geometric/planners/kpiece/Discretization.h>

Classes

struct  CellData
 The data held by a cell in the grid of motions. More...
struct  OrderCellsByImportance
 Definintion of an operator passed to the Grid structure, to order cells by importance. More...

Public Types

using Grid = GridB<CellData *, OrderCellsByImportance>
 The datatype for the maintained grid datastructure.
using Cell = typename Grid::Cell
 The datatype for the maintained grid cells.
using Coord = typename Grid::Coord
 The datatype for the maintained grid coordinates.
using FreeMotionFn = typename std::function<void(Motion *)>
 The signature of a function that frees the memory for a motion.

Public Member Functions

 Discretization (FreeMotionFn freeMotion)
void setBorderFraction (double bp)
 Set the fraction of time for focusing on the border (between 0 and 1). This is the minimum fraction used to select cells that are exterior (minimum because if 95% of cells are on the border, they will be selected with 95% chance, even if this fraction is set to 90%)
double getBorderFraction () const
 Set the fraction of time for focusing on the border (between 0 and 1).
void setDimension (unsigned int dim)
 Set the dimension of the grid to be maintained.
void clear ()
 Restore the discretization to its original form.
void countIteration ()
std::size_t getMotionCount () const
std::size_t getCellCount () const
void freeMemory ()
 Free the memory for the motions contained in a grid.
unsigned int addMotion (Motion *motion, const Coord &coord, double dist=0.0)
 Add a motion to the grid containing motions. As a hint, dist specifies the distance to the goal from the state of the motion being added. The function returns the number of cells created to accommodate the new motion (0 or 1). The discretization takes ownership of the motion passed as argument, and the memory for the motion is freed by calling the function passed to the constructor.
void selectMotion (Motion *&smotion, Cell *&scell)
 Select a motion and the cell it is part of from the grid of motions. This is where preference is given to cells on the boundary of the grid.
bool removeMotion (Motion *motion, const Coord &coord)
void updateCell (Cell *cell)
const GridgetGrid () const
void getPlannerData (base::PlannerData &data, int tag, bool start, const Motion *lastGoalMotion) const

Detailed Description

template<typename Motion>
class ompl::geometric::Discretization< Motion >

One-level discretization used for KPIECE.

Definition at line 58 of file Discretization.h.

Member Typedef Documentation

◆ Cell

template<typename Motion>
using ompl::geometric::Discretization< Motion >::Cell = typename Grid::Cell

The datatype for the maintained grid cells.

Definition at line 107 of file Discretization.h.

◆ Coord

template<typename Motion>
using ompl::geometric::Discretization< Motion >::Coord = typename Grid::Coord

The datatype for the maintained grid coordinates.

Definition at line 110 of file Discretization.h.

◆ FreeMotionFn

template<typename Motion>
using ompl::geometric::Discretization< Motion >::FreeMotionFn = typename std::function<void(Motion *)>

The signature of a function that frees the memory for a motion.

Definition at line 113 of file Discretization.h.

◆ Grid

template<typename Motion>
using ompl::geometric::Discretization< Motion >::Grid = GridB<CellData *, OrderCellsByImportance>

The datatype for the maintained grid datastructure.

Definition at line 104 of file Discretization.h.

Constructor & Destructor Documentation

◆ Discretization()

template<typename Motion>
ompl::geometric::Discretization< Motion >::Discretization ( FreeMotionFn freeMotion)
inline

Definition at line 115 of file Discretization.h.

◆ ~Discretization()

template<typename Motion>
ompl::geometric::Discretization< Motion >::~Discretization ( )
inline

Definition at line 122 of file Discretization.h.

Member Function Documentation

◆ addMotion()

template<typename Motion>
unsigned int ompl::geometric::Discretization< Motion >::addMotion ( Motion * motion,
const Coord & coord,
double dist = 0.0 )
inline

Add a motion to the grid containing motions. As a hint, dist specifies the distance to the goal from the state of the motion being added. The function returns the number of cells created to accommodate the new motion (0 or 1). The discretization takes ownership of the motion passed as argument, and the memory for the motion is freed by calling the function passed to the constructor.

Definition at line 193 of file Discretization.h.

◆ clear()

template<typename Motion>
void ompl::geometric::Discretization< Motion >::clear ( )
inline

Restore the discretization to its original form.

Definition at line 154 of file Discretization.h.

◆ countIteration()

template<typename Motion>
void ompl::geometric::Discretization< Motion >::countIteration ( )
inline

Definition at line 162 of file Discretization.h.

◆ freeMemory()

template<typename Motion>
void ompl::geometric::Discretization< Motion >::freeMemory ( )
inline

Free the memory for the motions contained in a grid.

Definition at line 178 of file Discretization.h.

◆ getBorderFraction()

template<typename Motion>
double ompl::geometric::Discretization< Motion >::getBorderFraction ( ) const
inline

Set the fraction of time for focusing on the border (between 0 and 1).

Definition at line 142 of file Discretization.h.

◆ getCellCount()

template<typename Motion>
std::size_t ompl::geometric::Discretization< Motion >::getCellCount ( ) const
inline

Definition at line 172 of file Discretization.h.

◆ getGrid()

template<typename Motion>
const Grid & ompl::geometric::Discretization< Motion >::getGrid ( ) const
inline

Definition at line 277 of file Discretization.h.

◆ getMotionCount()

template<typename Motion>
std::size_t ompl::geometric::Discretization< Motion >::getMotionCount ( ) const
inline

Definition at line 167 of file Discretization.h.

◆ getPlannerData()

template<typename Motion>
void ompl::geometric::Discretization< Motion >::getPlannerData ( base::PlannerData & data,
int tag,
bool start,
const Motion * lastGoalMotion ) const
inline

Definition at line 282 of file Discretization.h.

◆ removeMotion()

template<typename Motion>
bool ompl::geometric::Discretization< Motion >::removeMotion ( Motion * motion,
const Coord & coord )
inline

Definition at line 247 of file Discretization.h.

◆ selectMotion()

template<typename Motion>
void ompl::geometric::Discretization< Motion >::selectMotion ( Motion *& smotion,
Cell *& scell )
inline

Select a motion and the cell it is part of from the grid of motions. This is where preference is given to cells on the boundary of the grid.

Definition at line 224 of file Discretization.h.

◆ setBorderFraction()

template<typename Motion>
void ompl::geometric::Discretization< Motion >::setBorderFraction ( double bp)
inline

Set the fraction of time for focusing on the border (between 0 and 1). This is the minimum fraction used to select cells that are exterior (minimum because if 95% of cells are on the border, they will be selected with 95% chance, even if this fraction is set to 90%)

Definition at line 133 of file Discretization.h.

◆ setDimension()

template<typename Motion>
void ompl::geometric::Discretization< Motion >::setDimension ( unsigned int dim)
inline

Set the dimension of the grid to be maintained.

Definition at line 148 of file Discretization.h.

◆ updateCell()

template<typename Motion>
void ompl::geometric::Discretization< Motion >::updateCell ( Cell * cell)
inline

Definition at line 272 of file Discretization.h.


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