43 #include <boost/shared_array.hpp> 84 double maxDistance = std::numeric_limits<double>::infinity()
88 distance = maxDistance;
89 nnInternal(point.template cast<PointT>(), neighbor, distance);
91 return neighbor !=
nullptr;
static size_t nearestNeighbors(KDTreePtr tree, SLAMScanPtr scan, Neighbor *neighbors, double maxDistance, Vector3d ¢roid_m, Vector3d ¢roid_d)
Finds the nearest neighbors of all points in a Scan using a pre-generated KDTree. ...
std::shared_ptr< KDTree > KDTreePtr
Representation of a point in 3D space.
Eigen::Vector3d Vector3d
Eigen 3D vector, double precision.
std::shared_ptr< KDTree > KDTreePtr
a kd-Tree Implementation for nearest Neighbor searches
Eigen::Matrix< T, 3, 1 > Vector3
Eigen 3D vector.
static std::shared_ptr< KDTree > create(SLAMScanPtr scan, int maxLeafSize=20)
Creates a new KDTree from the given Scan.
bool nearestNeighbor(const Vector3< T > &point, Neighbor &neighbor, double &distance, double maxDistance=std::numeric_limits< double >::infinity()) const
Finds the nearest neighbor of 'point' that is within 'maxDistance' (defaults to infinity). The resulting neighbor is written into 'neighbor' (or nullptr if none is found).
boost::shared_array< Point > points
virtual ~KDTree()=default
std::shared_ptr< SLAMScanWrapper > SLAMScanPtr
virtual void nnInternal(const Point &point, Neighbor &neighbor, double &maxDist) const =0