Move further towards KdTreeNanoflann#6417
Merged
mvieth merged 2 commits intoPointCloudLibrary:masterfrom Apr 9, 2026
Merged
Conversation
382e785 to
b1441b8
Compare
b1441b8 to
814bf08
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR continues the migration away from explicit FLANN/KdTreeFLANN usage by letting algorithms auto-select the optimal spatial search backend, and by preferentially using KdTreeNanoflann in GICP6D when available.
Changes:
- Remove manual
KdTree/search-method wiring in multiple algorithms/examples and rely on internal/default search selection. - Expand usage of
pcl::search::autoSelectMethodand introduce a nanoflann-backed 6D tree for GICP6D. - Simplify test linkage by removing an explicit
FLANN::FLANNdependency fromtest_narf.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/cluster_extraction.cpp | Stop manually providing a KdTree to Euclidean cluster extraction. |
| test/keypoints/test_keypoints.cpp | Add missing include for kdtree usage in keypoint tests. |
| test/features/CMakeLists.txt | Remove explicit FLANN::FLANN link from test_narf. |
| surface/include/pcl/surface/impl/texture_mapping.hpp | Replace KdTreeFLANN<PointXY> with autoSelectMethod-selected search object. |
| segmentation/include/pcl/segmentation/impl/region_growing_rgb.hpp | Use autoSelectMethod for search initialization when unset. |
| segmentation/include/pcl/segmentation/impl/cpc_segmentation.hpp | Remove manual kdtree wiring for Euclidean clustering. |
| registration/src/gicp6d.cpp | Prefer KdTreeNanoflann (6D) when available; fallback to KdTree (FLANN). |
| registration/include/pcl/registration/gicp6d.h | Store target search structure as a pcl::search::KdTree pointer. |
| registration/include/pcl/registration/transformation_validation_euclidean.h | Remove legacy kdtree include; rely on search kdtree. |
| registration/include/pcl/registration/correspondence_estimation_backprojection.h | Remove unused KdTree type aliases. |
| registration/include/pcl/registration/bfgs.h | Add missing <cassert> include. |
| recognition/include/pcl/recognition/implicit_shape_model.h | Replace KdTreeFLANN member with pcl::search::Search pointer. |
| recognition/include/pcl/recognition/impl/implicit_shape_model.hpp | Build vote search tree via autoSelectMethod. |
| recognition/include/pcl/recognition/impl/hv/hv_go.hpp | Remove manual kdtree setup for normal estimation. |
| keypoints/include/pcl/keypoints/impl/sift_keypoint.hpp | Build octave search structure via autoSelectMethod. |
| gpu/people/tools/people_tracking.cpp | Remove unused kdtree include. |
| gpu/examples/segmentation/src/seg.cpp | Remove legacy kdtree include (relies on other headers). |
| features/include/pcl/features/impl/our_cvfh.hpp | Use autoSelectMethod for radius-search tree. |
| features/include/pcl/features/impl/flare.hpp | Use autoSelectMethod for sampled-surface search tree. |
| features/include/pcl/features/impl/cvfh.hpp | Use autoSelectMethod for radius-search tree. |
| examples/segmentation/example_extract_clusters_normals.cpp | Add an alternative Conditional Euclidean Clustering example and remove explicit normal-estimation tree wiring. |
| examples/keypoints/example_sift_z_keypoint_estimation.cpp | Remove explicit kdtree wiring for SIFT example. |
| examples/keypoints/example_sift_normal_keypoint_estimation.cpp | Remove explicit kdtree wiring for normals + SIFT example. |
| examples/keypoints/example_sift_keypoint_estimation.cpp | Remove explicit kdtree wiring for SIFT example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
larshg
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Failed build on macOS seems unrelated to the changes here. I will take a look and open another pull request to fix those.
Changes:
SIFTKeypoint,NormalEstimation,EuclideanClusterExtraction, etc. Instead, let them choose the search method automaticallyautoSelectMethodin more placesKdTreeNanoflannif availble, elseKdTree. ForKdTreeNanoflann, use 6 search dimensions to work correctly withMyPointRepresentation(X, Y, Z, L, A, B). ForKdTree, the search dimensions are always determined dynamically at run-time but this makes it a bit slowertest_narfhas to link toFLANN::FLANNexplicitly