Loading...
Searching...
No Matches
pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree > Class Template Reference
Module search

pcl::search::KdTreeNanoflann is a faster and flexible alternative to pcl::search::KdTree. More...

`#include <pcl/search/kdtree_nanoflann.h>`

Inheritance diagram for pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >:

## Public Types

using | PointCloud = typename Search<PointT>::PointCloud
using | PointCloudConstPtr = typename pcl::PointCloud<PointT>::ConstPtr
using | Ptr = shared_ptr<KdTreeNanoflann<PointT, Dim, Distance, Tree>>
using | ConstPtr = shared_ptr<const KdTreeNanoflann<PointT, Dim, Distance, Tree>>
using | KdTreePtr = shared_ptr<Tree>
using | KdTreeConstPtr = shared_ptr<const Tree>
using | PointRepresentationConstPtr = shared_ptr<const PointRepresentation<PointT>>
Public Types inherited from pcl::search::KdTree< PointT, Tree >
using | PointCloud = typename Search<PointT>::PointCloud
using | PointCloudConstPtr = typename Search<PointT>::PointCloudConstPtr
using | Ptr = shared_ptr<KdTree<PointT, Tree> >
using | ConstPtr = shared_ptr<const KdTree<PointT, Tree> >
using | KdTreePtr = typename Tree::Ptr
using | KdTreeConstPtr = typename Tree::ConstPtr
using | PointRepresentationConstPtr = typename PointRepresentation<PointT>::ConstPtr
Public Types inherited from pcl::search::Search< PointT >
using | PointCloud = pcl::PointCloud<PointT>
using | PointCloudPtr = typename PointCloud::Ptr
using | PointCloudConstPtr = typename PointCloud::ConstPtr
using | Ptr = shared_ptr<pcl::search::Search<PointT> >
using | ConstPtr = shared_ptr<const pcl::search::Search<PointT> >
using | IndicesPtr = pcl::IndicesPtr
using | IndicesConstPtr = pcl::IndicesConstPtr

## Public Member Functions

| KdTreeNanoflann (bool sorted, std::size_t leaf_max_size, unsigned int n_thread_build=1)
| Constructor for KdTreeNanoflann.
| KdTreeNanoflann (bool sorted=false)
| Constructor for KdTreeNanoflann.
| ~KdTreeNanoflann () override=default
| Destructor for KdTreeNanoflann.
void | setPointRepresentation (const PointRepresentationConstPtr &point_representation)
| Provide a pointer to the point representation to use to convert points into k-D vectors.
PointRepresentationConstPtr | getPointRepresentation () const
| Get a pointer to the point representation used when converting points into k-D vectors.
void | setSortedResults (bool sorted_results) override
| Sets whether the results have to be sorted or not.
void | setEpsilon (float eps)
| Set the search epsilon precision (error bound) for nearest neighbors searches.
float | getEpsilon () const
| Get the search epsilon precision (error bound) for nearest neighbors searches.
void | setUseRKNN (bool use_rknn)
| Influences the results of radiusSearch when max_nn is not set to zero.
bool | setInputCloud (const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr()) override
| Provide a pointer to the input dataset, this will build the kd-tree.
KdTreePtr | getNanoflannTree ()
| Get pointer to internal nanoflann tree.
int | nearestKSearch (const PointT &point, int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const override
| Search for the k-nearest neighbors for the given query point.
int | radiusSearch (const PointT &point, double radius, Indices &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const override
| Search for all the nearest neighbors of the query point in a given radius.
Public Member Functions inherited from pcl::search::KdTree< PointT, Tree >
| KdTree (bool sorted=true)
| Constructor for KdTree.
| ~KdTree () override=default
| Destructor for KdTree.
void | setPointRepresentation (const PointRepresentationConstPtr &point_representation)
| Provide a pointer to the point representation to use to convert points into k-D vectors.
PointRepresentationConstPtr | getPointRepresentation () const
| Get a pointer to the point representation used when converting points into k-D vectors.
void | setEpsilon (float eps)
| Set the search epsilon precision (error bound) for nearest neighbors searches.
float | getEpsilon () const
| Get the search epsilon precision (error bound) for nearest neighbors searches.
Public Member Functions inherited from pcl::search::Search< PointT >
| Search (const std::string &name="", bool sorted=false)
| Constructor.
virtual | ~Search ()=default
| Destructor.
virtual const std::string & | getName () const
| Returns the search method name.
virtual bool | getSortedResults ()
| Gets whether the results should be sorted (ascending in the distance) or not Otherwise the results may be returned in any order.
virtual PointCloudConstPtr | getInputCloud () const
| Get a pointer to the input point cloud dataset.
virtual IndicesConstPtr | getIndices () const
| Get a pointer to the vector of indices used.
template<typename PointTDiff>
int | nearestKSearchT (const PointTDiff &point, int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const
| Search for k-nearest neighbors for the given query point.
virtual int | nearestKSearch (const PointCloud &cloud, index_t index, int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const
| Search for k-nearest neighbors for the given query point.
virtual int | nearestKSearch (index_t index, int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const
| Search for k-nearest neighbors for the given query point (zero-copy).
virtual void | nearestKSearch (const PointCloud &cloud, const Indices &indices, int k, std::vector< Indices > &k_indices, std::vector< std::vector< float > > &k_sqr_distances) const
| Search for the k-nearest neighbors for the given query point.
template<typename PointTDiff>
void | nearestKSearchT (const pcl::PointCloud< PointTDiff > &cloud, const Indices &indices, int k, std::vector< Indices > &k_indices, std::vector< std::vector< float > > &k_sqr_distances) const
| Search for the k-nearest neighbors for the given query point.
template<typename PointTDiff>
int | radiusSearchT (const PointTDiff &point, double radius, Indices &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const
| Search for all the nearest neighbors of the query point in a given radius.
virtual int | radiusSearch (const PointCloud &cloud, index_t index, double radius, Indices &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const
| Search for all the nearest neighbors of the query point in a given radius.
virtual int | radiusSearch (index_t index, double radius, Indices &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const
| Search for all the nearest neighbors of the query point in a given radius (zero-copy).
virtual void | radiusSearch (const PointCloud &cloud, const Indices &indices, double radius, std::vector< Indices > &k_indices, std::vector< std::vector< float > > &k_sqr_distances, unsigned int max_nn=0) const
| Search for all the nearest neighbors of the query point in a given radius.
template<typename PointTDiff>
void | radiusSearchT (const pcl::PointCloud< PointTDiff > &cloud, const Indices &indices, double radius, std::vector< Indices > &k_indices, std::vector< std::vector< float > > &k_sqr_distances, unsigned int max_nn=0) const
| Search for all the nearest neighbors of the query points in a given radius.

## Additional Inherited Members

Protected Member Functions inherited from pcl::search::KdTree< PointT, Tree >
| KdTree (const std::string &name, bool sorted)
| This leaves the internal tree_ object uninitialized!
Protected Member Functions inherited from pcl::search::Search< PointT >
void | sortResults (Indices &indices, std::vector< float > &distances) const
Protected Attributes inherited from pcl::search::KdTree< PointT, Tree >
KdTreePtr | tree_
| A pointer to the internal KdTree object.
Protected Attributes inherited from pcl::search::Search< PointT >
PointCloudConstPtr | input_
IndicesConstPtr | indices_
bool | sorted_results_
std::string | name_

## Detailed Description

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>
class pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >

pcl::search::KdTreeNanoflann is a faster and flexible alternative to pcl::search::KdTree.

It is based on the nanoflann library by Jose Luis Blanco-Claraco ( https://github.com/jlblancoc/nanoflann ). Since nanoflann is treated as an optional dependency to PCL, you must test the preprocessor symbol PCL_HAS_NANOFLANN after including pcl/search/kdtree_nanoflann.h.

// Example 1: using KdTreeNanoflann in NormalEstimation:
pcl::NormalEstimation<pcl::PointXYZ, pcl::Normal> ne;
auto tree = pcl::make_shared<pcl::search::KdTreeNanoflann<pcl::PointXYZ>>();
ne.setSearchMethod (tree);
// rest as usual
// Example 2: using KdTreeNanoflannn in ICP:
pcl::IterativeClosestPoint<pcl::PointXYZ, pcl::PointXYZ> icp;
icp.setSearchMethodSource(pcl::make_shared<pcl::search::KdTreeNanoflann<pcl::PointXYZ>>());
icp.setSearchMethodTarget(pcl::make_shared<pcl::search::KdTreeNanoflann<pcl::PointXYZ>>());
// rest as usual
// Example 3: using a L1 distance norm:
pcl::search::KdTreeNanoflann<PointXYZ, 3, pcl::search::L1_Adaptor> kdtree_nanoflann;
kdtree_nanoflann.setInputCloud (my_cloud);
// now ready to use kdtree_nanoflann.nearestKSearch(...) and
// kdtree_nanoflann.radiusSearch(...);
// Example 4: using KdTreeNanoflann with features instead of 3D points:
pcl::search::KdTreeNanoflann<pcl::FPFHSignature33, 33> kdtree_nanoflann_feat;
kdtree_nanoflann_feat.setInputCloud(my_features_cloud);
// now ready for searching
pcl::Feature::setSearchMethod
void setSearchMethod(const KdTreePtr &tree)
Provide a pointer to the search object.
Definition feature.h:164
pcl::IterativeClosestPoint
IterativeClosestPoint provides a base implementation of the Iterative Closest Point algorithm.
Definition icp.h:98
pcl::NormalEstimation
NormalEstimation estimates local surface properties (surface normals and curvatures)at each 3D point.
Definition normal_3d.h:244
pcl::Registration::setSearchMethodSource
void setSearchMethodSource(const KdTreeReciprocalPtr &tree, bool force_no_recompute=false)
Provide a pointer to the search object used to find correspondences in the source cloud (usually used...
Definition registration.h:239
pcl::Registration::setSearchMethodTarget
void setSearchMethodTarget(const KdTreePtr &tree, bool force_no_recompute=false)
Provide a pointer to the search object used to find correspondences in the target cloud.
Definition registration.h:215
pcl::search::KdTreeNanoflann
pcl::search::KdTreeNanoflann is a faster and flexible alternative to pcl::search::KdTree.
Definition kdtree_nanoflann.h:186
pcl::search::KdTreeNanoflann::setInputCloud
bool setInputCloud(const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr()) override
Provide a pointer to the input dataset, this will build the kd-tree.
Definition kdtree_nanoflann.h:408
pcl::make_shared
shared_ptr< T > make_shared(Args &&... args)
Returns a pcl::shared_ptr compliant with type T's allocation policy.

Template Parameters

  PointT | Can be a point like pcl::PointXYZ or a feature like pcl::SHOT352
  Dim | Dimension of the KdTree to build. If set to -1, it will infer the dimension at runtime from the given point representation, but with a performance penalty. Default is 3, appropriate for all xyz point types.
  Distance | The distance to use. Possible values include pcl::L1_Adaptor (taxicab/manhattan distance), pcl::L2_Simple_Adaptor (euclidean distance, optimized for few dimensions), pcl::L2_Adaptor (euclidean distance, optimized for many dimensions), pcl::SO2_Adaptor, pcl::SO3_Adaptor. Default is pcl::L2_Simple_Adaptor

Author
  Markus Vieth

Definition at line 186 of file kdtree_nanoflann.h.

## Member Typedef Documentation

## ConstPtr

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

using pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::ConstPtr = shared_ptr<const KdTreeNanoflann<PointT, Dim, Distance, Tree>>

Definition at line 292 of file kdtree_nanoflann.h.

## KdTreeConstPtr

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

using pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::KdTreeConstPtr = shared_ptr<const Tree>

Definition at line 295 of file kdtree_nanoflann.h.

## KdTreePtr

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

using pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::KdTreePtr = shared_ptr<Tree>

Definition at line 294 of file kdtree_nanoflann.h.

## PointCloud

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

using pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::PointCloud = typename Search<PointT>::PointCloud

Definition at line 279 of file kdtree_nanoflann.h.

## PointCloudConstPtr

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

using pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::PointCloudConstPtr = typename pcl::PointCloud<PointT>::ConstPtr

Definition at line 280 of file kdtree_nanoflann.h.

## PointRepresentationConstPtr

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

using pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::PointRepresentationConstPtr = shared_ptr<const PointRepresentation<PointT>>

Definition at line 296 of file kdtree_nanoflann.h.

## Ptr

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

using pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::Ptr = shared_ptr<KdTreeNanoflann<PointT, Dim, Distance, Tree>>

Definition at line 291 of file kdtree_nanoflann.h.

## Constructor & Destructor Documentation

## KdTreeNanoflann() [1/2]

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::KdTreeNanoflann | ( | bool | sorted,
|  | std::size_t | leaf_max_size,
|  | unsigned int | n_thread_build = 1 )

inline

Constructor for KdTreeNanoflann.

Parameters

  [in] | sorted | Set to true if the nearest neighbor search results need to be sorted in ascending order based on their distance to the query point (default is false, which is faster)
  [in] | leaf_max_size | Max number of points/samples in a leaf, can be tuned to achieve best performance. When using this for 1nn search (e.g. correspondence estimation in icp/registration), then leaf_max_size=10 is usually fastest. Otherwise, leaf_max_size=20 is a good choice.
  [in] | n_thread_build | Number of threads for concurrent tree build (default is 1, meaning no concurrent build)

Definition at line 310 of file kdtree_nanoflann.h.

References pcl::search::KdTree< PointT, Tree >::KdTree().

Referenced by KdTreeNanoflann().

## KdTreeNanoflann() [2/2]

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::KdTreeNanoflann | ( | bool | sorted = false | ) |

inline

Constructor for KdTreeNanoflann.

Parameters

  [in] | sorted | set to true if the nearest neighbor search results need to be sorted in ascending order based on their distance to the query point

Definition at line 325 of file kdtree_nanoflann.h.

References KdTreeNanoflann().

## ~KdTreeNanoflann()

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::~KdTreeNanoflann | ( |  | ) |

override default

Destructor for KdTreeNanoflann.

## Member Function Documentation

## getEpsilon()

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

float pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::getEpsilon | ( |  | ) | const

inline

Get the search epsilon precision (error bound) for nearest neighbors searches.

Definition at line 386 of file kdtree_nanoflann.h.

## getNanoflannTree()

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

KdTreePtr pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::getNanoflannTree | ( |  | ) |

inline

Get pointer to internal nanoflann tree.

Use with caution.

Definition at line 420 of file kdtree_nanoflann.h.

## getPointRepresentation()

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

PointRepresentationConstPtr pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::getPointRepresentation | ( |  | ) | const

inline

Get a pointer to the point representation used when converting points into k-D vectors.

Definition at line 359 of file kdtree_nanoflann.h.

## nearestKSearch()

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

int pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::nearestKSearch | ( | const PointT & | point,
|  | int | k,
|  | Indices & | k_indices,
|  | std::vector< float > & | k_sqr_distances ) const

inline override virtual

Search for the k-nearest neighbors for the given query point.

Parameters

  [in] | point | the given query point
  [in] | k | the number of neighbors to search for
  [out] | k_indices | the resultant indices of the neighboring points (must be resized to k a priori!)
  [out] | k_sqr_distances | the resultant squared distances to the neighboring points (must be resized to k a priori!)

Returns
  number of neighbors found

Reimplemented from pcl::search::KdTree< PointT, Tree >.

Definition at line 435 of file kdtree_nanoflann.h.

## radiusSearch()

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

int pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::radiusSearch | ( | const PointT & | point,
|  | double | radius,
|  | Indices & | k_indices,
|  | std::vector< float > & | k_sqr_distances,
|  | unsigned int | max_nn = 0 ) const

inline override virtual

Search for all the nearest neighbors of the query point in a given radius.

Parameters

  [in] | point | the given query point
  [in] | radius | the radius of the sphere bounding all of p_q's neighbors
  [out] | k_indices | the resultant indices of the neighboring points
  [out] | k_sqr_distances | the resultant squared distances to the neighboring points
  [in] | max_nn | if given, bounds the maximum returned neighbors to this value. If max_nn is set to 0 or to a number higher than the number of points in the input cloud, all neighbors in radius will be returned.

Returns
  number of neighbors found in radius

Reimplemented from pcl::search::KdTree< PointT, Tree >.

Definition at line 486 of file kdtree_nanoflann.h.

References pcl::search::Search< PointT >::sorted_results_, pcl::search::Search< PointT >::sortResults(), and pcl::search::internal::square_if_l2().

## setEpsilon()

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

void pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::setEpsilon | ( | float | eps | ) |

inline

Set the search epsilon precision (error bound) for nearest neighbors searches.

Parameters

  [in] | eps | precision (error bound) for nearest neighbors searches

Definition at line 378 of file kdtree_nanoflann.h.

## setInputCloud()

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

bool pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::setInputCloud | ( | const PointCloudConstPtr & | cloud,
|  | const IndicesConstPtr & | indices = IndicesConstPtr() )

inline override virtual

Provide a pointer to the input dataset, this will build the kd-tree.

Parameters

  [in] | cloud | the const shared pointer to a PointCloud
  [in] | indices | the point indices subset that is to be used from cloud

Reimplemented from pcl::search::KdTree< PointT, Tree >.

Definition at line 408 of file kdtree_nanoflann.h.

References pcl::search::Search< PointT >::indices_, and pcl::search::Search< PointT >::input_.

## setPointRepresentation()

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

void pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::setPointRepresentation | ( | const PointRepresentationConstPtr & | point_representation | ) |

inline

Provide a pointer to the point representation to use to convert points into k-D vectors.

If you want to use this function, it is recommended to do so before calling setInputCloud, to avoid setting up the kd-tree twice.

Parameters

  [in] | point_representation | the const shared pointer to a PointRepresentation

Definition at line 336 of file kdtree_nanoflann.h.

## setSortedResults()

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

void pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::setSortedResults | ( | bool | sorted_results | ) |

inline override virtual

Sets whether the results have to be sorted or not.

Parameters

  [in] | sorted_results | set to true if the radius search results should be sorted

Reimplemented from pcl::search::KdTree< PointT, Tree >.

Definition at line 368 of file kdtree_nanoflann.h.

References pcl::search::Search< PointT >::sorted_results_.

## setUseRKNN()

template<typename PointT, std::int32_t Dim = 3, typename Distance = std::conditional_t<Dim >= 4, L2_Adaptor, L2_Simple_Adaptor, typename Tree = nanoflann::KDTreeSingleIndexAdaptor< Distance, pcl::search::internal::PointCloudAdaptor<float>, Dim, pcl::index_t>>

void pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::setUseRKNN | ( | bool | use_rknn | ) |

inline

Influences the results of radiusSearch when max_nn is not set to zero.

If the parameter max_nn of radiusSearch is set to a value greater than zero, it will return at most that many points. If you set use_rknn=true, it will always return the points closest to the query point. If you set use_rknn=false, it may return any points within the radius, which can be faster.

Definition at line 398 of file kdtree_nanoflann.h.

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

- pcl/search/kdtree_nanoflann.h