Reduce dependency on FLANN, move towards nanoflann as default - #6332
Conversation
dfb69ee to
a031e8c
Compare
Current behaviour: FLANN is the default search method for unorganized point clouds. If FLANN is not available, many PCL modules will not be built. Desired new behaviour (work in progress): Both FLANN and nanoflann are installed: use nanoflann as default search method for unorganized clouds (faster than FLANN) Only FLANN is installed: use FLANN as default (same as before) Only nanoflann is installed: use nanoflann as default (different than before, all PCL modules should be built, all classes should be available) Neither FLANN nor nanoflann is installed: to discuss, maybe use PCL's octree as default search method for unorganized clouds?
4997298 to
e46775a
Compare
e46775a to
29f97a7
Compare
| set(srcs | ||
| src/kdtree_flann.cpp | ||
| ) | ||
| if(FLANN_FOUND) |
There was a problem hiding this comment.
Shouldn't kdtree_flann.h also be added conditionally? Else this header gets installed, but FLANN is not really supported?
There was a problem hiding this comment.
Currently this condition does not make any difference because flann is still a required external dependency of the kdtree module (if flann is not avalable, the module will not be built, so FLANN_FOUND is currently always true here if the module is built). I added this condition when I was experimenting with making flann an optional dependency of this module, but kdtree_flann.h still had to be available to make KdTreeNanoflann work (as the parent class of KdTreeNanoflann, KdTree, has KdTreeFLANN as the default template parameter).
If you like, I could also remove all if(FLANN_FOUND)-statements in this file, and then check again in a future PR, which files should be included/excluded.
There was a problem hiding this comment.
Lets just merge this one then and adjust accordingly when possible.
Current behaviour
FLANN is the default search method for unorganized point clouds. If FLANN is not available, many PCL modules will not be built.
Desired new behaviour (work in progress):
What this PR does
autoSelectMethodto ... well, automatically select the best search method based on the cloud and whether FLANN and/or nanoflann are installed. Use the new function in some classes (more to follow in future PRs)setSearchMethodwith KdTree and instead let the class decide which search method to use (viaautoSelectMethod)I am planning to do one or more follow-up PRs.