moveit2
The MoveIt Motion Planning Framework for ROS 2.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
cached_ik_kinematics_plugin::NearestNeighbors< _T > Class Template Referenceabstract

Abstract representation of a container that can perform nearest neighbors queries. More...

#include <NearestNeighbors.h>

Inheritance diagram for cached_ik_kinematics_plugin::NearestNeighbors< _T >:
Inheritance graph
[legend]

Public Types

typedef std::function< double(const _T &, const _T &)> DistanceFunction
 The definition of a distance function.
 

Public Member Functions

 NearestNeighbors ()=default
 
 NearestNeighbors (const NearestNeighbors &)=default
 
 NearestNeighbors (NearestNeighbors &&) noexcept=default
 
NearestNeighborsoperator= (const NearestNeighbors &)=default
 
NearestNeighborsoperator= (NearestNeighbors &&) noexcept=default
 
virtual ~NearestNeighbors ()=default
 
virtual void setDistanceFunction (const DistanceFunction &distFun)
 Set the distance function to use.
 
const DistanceFunctiongetDistanceFunction () const
 Get the distance function used.
 
virtual bool reportsSortedResults () const =0
 Return true if the solutions reported by this data structure are sorted, when calling nearestK / nearestR.
 
virtual void clear ()=0
 Clear the datastructure.
 
virtual void add (const _T &data)=0
 Add an element to the datastructure.
 
virtual void add (const std::vector< _T > &data)
 Add a vector of points.
 
virtual bool remove (const _T &data)=0
 Remove an element from the datastructure.
 
virtual _T nearest (const _T &data) const =0
 Get the nearest neighbor of a point.
 
virtual void nearestK (const _T &data, std::size_t k, std::vector< _T > &nbh) const =0
 Get the k-nearest neighbors of a point.
 
virtual void nearestR (const _T &data, double radius, std::vector< _T > &nbh) const =0
 Get the nearest neighbors of a point, within a specified radius.
 
virtual std::size_t size () const =0
 Get the number of elements in the datastructure.
 
virtual void list (std::vector< _T > &data) const =0
 Get all the elements in the datastructure.
 

Protected Attributes

DistanceFunction distFun_
 The used distance function.
 

Detailed Description

template<typename _T>
class cached_ik_kinematics_plugin::NearestNeighbors< _T >

Abstract representation of a container that can perform nearest neighbors queries.

Definition at line 48 of file NearestNeighbors.h.

Member Typedef Documentation

◆ DistanceFunction

template<typename _T >
typedef std::function<double(const _T&, const _T&)> cached_ik_kinematics_plugin::NearestNeighbors< _T >::DistanceFunction

The definition of a distance function.

Definition at line 52 of file NearestNeighbors.h.

Constructor & Destructor Documentation

◆ NearestNeighbors() [1/3]

template<typename _T >
cached_ik_kinematics_plugin::NearestNeighbors< _T >::NearestNeighbors ( )
default

◆ NearestNeighbors() [2/3]

template<typename _T >
cached_ik_kinematics_plugin::NearestNeighbors< _T >::NearestNeighbors ( const NearestNeighbors< _T > &  )
default

◆ NearestNeighbors() [3/3]

template<typename _T >
cached_ik_kinematics_plugin::NearestNeighbors< _T >::NearestNeighbors ( NearestNeighbors< _T > &&  )
defaultnoexcept

◆ ~NearestNeighbors()

template<typename _T >
virtual cached_ik_kinematics_plugin::NearestNeighbors< _T >::~NearestNeighbors ( )
virtualdefault

Member Function Documentation

◆ add() [1/2]

template<typename _T >
virtual void cached_ik_kinematics_plugin::NearestNeighbors< _T >::add ( const _T &  data)
pure virtual

Add an element to the datastructure.

Implemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >.

Here is the caller graph for this function:

◆ add() [2/2]

template<typename _T >
virtual void cached_ik_kinematics_plugin::NearestNeighbors< _T >::add ( const std::vector< _T > &  data)
inlinevirtual

Add a vector of points.

Reimplemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >.

Definition at line 84 of file NearestNeighbors.h.

Here is the call graph for this function:

◆ clear()

template<typename _T >
virtual void cached_ik_kinematics_plugin::NearestNeighbors< _T >::clear ( )
pure virtual

◆ getDistanceFunction()

template<typename _T >
const DistanceFunction & cached_ik_kinematics_plugin::NearestNeighbors< _T >::getDistanceFunction ( ) const
inline

Get the distance function used.

Definition at line 68 of file NearestNeighbors.h.

◆ list()

template<typename _T >
virtual void cached_ik_kinematics_plugin::NearestNeighbors< _T >::list ( std::vector< _T > &  data) const
pure virtual

Get all the elements in the datastructure.

Implemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >.

◆ nearest()

template<typename _T >
virtual _T cached_ik_kinematics_plugin::NearestNeighbors< _T >::nearest ( const _T &  data) const
pure virtual

Get the nearest neighbor of a point.

Implemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >.

◆ nearestK()

template<typename _T >
virtual void cached_ik_kinematics_plugin::NearestNeighbors< _T >::nearestK ( const _T &  data,
std::size_t  k,
std::vector< _T > &  nbh 
) const
pure virtual

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.

Implemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >.

◆ nearestR()

template<typename _T >
virtual void cached_ik_kinematics_plugin::NearestNeighbors< _T >::nearestR ( const _T &  data,
double  radius,
std::vector< _T > &  nbh 
) const
pure virtual

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.

Implemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >.

◆ operator=() [1/2]

template<typename _T >
NearestNeighbors & cached_ik_kinematics_plugin::NearestNeighbors< _T >::operator= ( const NearestNeighbors< _T > &  )
default

◆ operator=() [2/2]

template<typename _T >
NearestNeighbors & cached_ik_kinematics_plugin::NearestNeighbors< _T >::operator= ( NearestNeighbors< _T > &&  )
defaultnoexcept

◆ remove()

template<typename _T >
virtual bool cached_ik_kinematics_plugin::NearestNeighbors< _T >::remove ( const _T &  data)
pure virtual

Remove an element from the datastructure.

Implemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >.

◆ reportsSortedResults()

template<typename _T >
virtual bool cached_ik_kinematics_plugin::NearestNeighbors< _T >::reportsSortedResults ( ) const
pure virtual

Return true if the solutions reported by this data structure are sorted, when calling nearestK / nearestR.

Implemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >, and cached_ik_kinematics_plugin::NearestNeighborsGNAT< IKEntry * >.

◆ setDistanceFunction()

template<typename _T >
virtual void cached_ik_kinematics_plugin::NearestNeighbors< _T >::setDistanceFunction ( const DistanceFunction distFun)
inlinevirtual

Set the distance function to use.

Definition at line 62 of file NearestNeighbors.h.

Here is the caller graph for this function:

◆ size()

template<typename _T >
virtual std::size_t cached_ik_kinematics_plugin::NearestNeighbors< _T >::size ( ) const
pure virtual

Member Data Documentation

◆ distFun_

template<typename _T >
DistanceFunction cached_ik_kinematics_plugin::NearestNeighbors< _T >::distFun_
protected

The used distance function.

Definition at line 118 of file NearestNeighbors.h.


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