moveit2
The MoveIt Motion Planning Framework for ROS 2.
|
Geometric Near-neighbor Access Tree (GNAT), a data structure for nearest neighbor search. More...
#include <NearestNeighborsGNAT.h>
Classes | |
class | Node |
Public Member Functions | |
NearestNeighborsGNAT (unsigned int degree=8, unsigned int minDegree=4, unsigned int maxDegree=12, unsigned int maxNumPtsPerLeaf=50, unsigned int removedCacheSize=500, bool rebalancing=false) | |
~NearestNeighborsGNAT () override | |
void | setDistanceFunction (const typename NearestNeighbors< _T >::DistanceFunction &distFun) override |
void | clear () override |
Clear the datastructure. | |
bool | reportsSortedResults () const override |
Return true if the solutions reported by this data structure are sorted, when calling nearestK / nearestR. | |
void | add (const _T &data) override |
Add an element to the datastructure. | |
void | add (const std::vector< _T > &data) override |
Add a vector of points. | |
void | rebuildDataStructure () |
bool | remove (const _T &data) override |
Remove an element from the datastructure. | |
_T | nearest (const _T &data) const override |
Get the nearest neighbor of a point. | |
void | nearestK (const _T &data, std::size_t k, std::vector< _T > &nbh) const override |
Get the k-nearest neighbors of a point. | |
void | nearestR (const _T &data, double radius, std::vector< _T > &nbh) const override |
Get the nearest neighbors of a point, within a specified radius. | |
std::size_t | size () const override |
Get the number of elements in the datastructure. | |
void | list (std::vector< _T > &data) const override |
Get all the elements in the datastructure. | |
void | integrityCheck () |
Public Member Functions inherited from cached_ik_kinematics_plugin::NearestNeighbors< _T > | |
NearestNeighbors ()=default | |
NearestNeighbors (const NearestNeighbors &)=default | |
NearestNeighbors (NearestNeighbors &&) noexcept=default | |
NearestNeighbors & | operator= (const NearestNeighbors &)=default |
NearestNeighbors & | operator= (NearestNeighbors &&) noexcept=default |
virtual | ~NearestNeighbors ()=default |
virtual void | setDistanceFunction (const DistanceFunction &distFun) |
Set the distance function to use. | |
const DistanceFunction & | getDistanceFunction () const |
Get the distance function used. | |
Protected Types | |
using | GNAT = NearestNeighborsGNAT< _T > |
Protected Member Functions | |
bool | isRemoved (const _T &data) const |
bool | nearestKInternal (const _T &data, std::size_t k, NearQueue &nbhQueue) const |
void | nearestRInternal (const _T &data, double radius, NearQueue &nbhQueue) const |
void | postprocessNearest (NearQueue &nbhQueue, std::vector< _T > &nbh) const |
Protected Attributes | |
Node * | tree_ { nullptr } |
unsigned int | degree_ |
unsigned int | minDegree_ |
unsigned int | maxDegree_ |
unsigned int | maxNumPtsPerLeaf_ |
std::size_t | size_ { 0 } |
std::size_t | rebuildSize_ |
std::size_t | removedCacheSize_ |
GreedyKCenters< _T > | pivotSelector_ |
std::unordered_set< const _T * > | removed_ |
Protected Attributes inherited from cached_ik_kinematics_plugin::NearestNeighbors< _T > | |
DistanceFunction | distFun_ |
The used distance function. | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const NearestNeighborsGNAT< _T > &gnat) |
Additional Inherited Members | |
Public Types inherited from cached_ik_kinematics_plugin::NearestNeighbors< _T > | |
typedef std::function< double(const _T &, const _T &)> | DistanceFunction |
The definition of a distance function. | |
Geometric Near-neighbor Access Tree (GNAT), a data structure for nearest neighbor search.
If GNAT_SAMPLER is defined, then extra code will be enabled to sample elements from the GNAT with probability inversely proportial to their local density.
B. Gipson, M. Moll, and L.E. Kavraki, Resolution independent density estimation for motion planning in high-dimensional spaces, in IEEE Intl. Conf. on Robotics and Automation, 2013. [PDF]
Definition at line 70 of file NearestNeighborsGNAT.h.
|
protected |
Definition at line 314 of file NearestNeighborsGNAT.h.
|
inline |
Definition at line 101 of file NearestNeighborsGNAT.h.
|
inlineoverride |
Definition at line 114 of file NearestNeighborsGNAT.h.
|
inlineoverridevirtual |
Add an element to the datastructure.
Implements cached_ik_kinematics_plugin::NearestNeighbors< _T >.
Definition at line 146 of file NearestNeighborsGNAT.h.
|
inlineoverridevirtual |
Add a vector of points.
Reimplemented from cached_ik_kinematics_plugin::NearestNeighbors< _T >.
Definition at line 160 of file NearestNeighborsGNAT.h.
|
inlineoverridevirtual |
Clear the datastructure.
Implements cached_ik_kinematics_plugin::NearestNeighbors< _T >.
Definition at line 128 of file NearestNeighborsGNAT.h.
|
inline |
|
inlineprotected |
|
inlineoverridevirtual |
Get all the elements in the datastructure.
Implements cached_ik_kinematics_plugin::NearestNeighbors< _T >.
Definition at line 251 of file NearestNeighborsGNAT.h.
|
inlineoverridevirtual |
Get the nearest neighbor of a point.
Implements cached_ik_kinematics_plugin::NearestNeighbors< _T >.
Definition at line 208 of file NearestNeighborsGNAT.h.
|
inlineoverridevirtual |
Get the k-nearest neighbors of a point.
All the nearest neighbor structures currently return the neighbors in sorted order, but this is not required.
Implements cached_ik_kinematics_plugin::NearestNeighbors< _T >.
Definition at line 221 of file NearestNeighborsGNAT.h.
|
inlineprotected |
Definition at line 326 of file NearestNeighborsGNAT.h.
|
inlineoverridevirtual |
Get the nearest neighbors of a point, within a specified radius.
All the nearest neighbor structures currently return the neighbors in sorted order, but this is not required.
Implements cached_ik_kinematics_plugin::NearestNeighbors< _T >.
Definition at line 235 of file NearestNeighborsGNAT.h.
|
inlineprotected |
Definition at line 349 of file NearestNeighborsGNAT.h.
|
inlineprotected |
|
inline |
Definition at line 177 of file NearestNeighborsGNAT.h.
|
inlineoverridevirtual |
Remove an element from the datastructure.
Implements cached_ik_kinematics_plugin::NearestNeighbors< _T >.
Definition at line 189 of file NearestNeighborsGNAT.h.
|
inlineoverridevirtual |
Return true if the solutions reported by this data structure are sorted, when calling nearestK / nearestR.
Implements cached_ik_kinematics_plugin::NearestNeighbors< _T >.
Definition at line 141 of file NearestNeighborsGNAT.h.
|
inlineoverride |
Definition at line 120 of file NearestNeighborsGNAT.h.
|
inlineoverridevirtual |
Get the number of elements in the datastructure.
Implements cached_ik_kinematics_plugin::NearestNeighbors< _T >.
Definition at line 246 of file NearestNeighborsGNAT.h.
|
friend |
Definition at line 260 of file NearestNeighborsGNAT.h.
|
protected |
Definition at line 727 of file NearestNeighborsGNAT.h.
|
protected |
Definition at line 737 of file NearestNeighborsGNAT.h.
|
protected |
Definition at line 740 of file NearestNeighborsGNAT.h.
|
protected |
Definition at line 732 of file NearestNeighborsGNAT.h.
|
protected |
Definition at line 751 of file NearestNeighborsGNAT.h.
|
protected |
Definition at line 745 of file NearestNeighborsGNAT.h.
|
protected |
Definition at line 753 of file NearestNeighborsGNAT.h.
|
protected |
Definition at line 749 of file NearestNeighborsGNAT.h.
|
protected |
Definition at line 742 of file NearestNeighborsGNAT.h.
|
protected |
Definition at line 725 of file NearestNeighborsGNAT.h.