Skip to content

Commit 2f21392

Browse files
committed
Assign default Index type size_t
Signed-off-by: haider8645 <haider_lodhi@hotmail.com>
1 parent 22845a9 commit 2f21392

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

include/ground_detection.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class PointCloudGrid
111111
// Build KD-Tree
112112
typedef nanoflann::KDTreeSingleIndexAdaptor<nanoflann::L2_Simple_Adaptor<double,
113113
PCLPointCloudAdaptor<PointT>>,
114-
PCLPointCloudAdaptor<PointT>, 3> KDTree;
114+
PCLPointCloudAdaptor<PointT>, 3, size_t> KDTree;
115115
bool checkIndex3DInGrid(const Index3D & index) const;
116116

117117
void setDistToGround(double z)
@@ -681,7 +681,7 @@ void PointCloudGrid<PointT>::expandGrid(std::queue<Index3D> q)
681681
KDTree tree(3, pclAdaptor, build_params);
682682
tree.buildIndex();
683683

684-
const float radius = grid_config.centroidSearchRadius * grid_config.centroidSearchRadius; // nanoflann uses squared radius
684+
const double radius = grid_config.centroidSearchRadius * grid_config.centroidSearchRadius; // nanoflann uses squared radius
685685

686686
while (!q.empty()) {
687687
Index3D idx = q.front();
@@ -699,9 +699,9 @@ void PointCloudGrid<PointT>::expandGrid(std::queue<Index3D> q)
699699

700700
// Prepare radius search
701701
#if NANOFLANN_VERSION >= 0x150
702-
using Neighbor = nanoflann::ResultItem<unsigned int, double>;
702+
using Neighbor = nanoflann::ResultItem<size_t, double>;
703703
#else
704-
using Neighbor = std::pair<unsigned int, double>;
704+
using Neighbor = std::pair<size_t, double>;
705705
#endif
706706

707707
std::vector<Neighbor> neighbors;

0 commit comments

Comments
 (0)