PointCloudLibrary / PointCloudLibrary/pcl
Adjust code to match current FLANN API
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 4.7k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 6
Description
With FLANN 1.8 they switched from int to size_t. PCL is still using int, so there is always an implicit conversion.
I tried to fix it in context of CLang-Tidy warning performance-implicit-conversion-in-loop here:
https://github.com/PointCloudLibrary/pcl/blob/816391762918f3a026b1822fe42c74bb83129eb4/registration/include/pcl/registration/impl/ppf_registration.hpp#L108
But after this I had to change a lot of further PCL code, so I stopped my work after I had already ~100 lines adjusted, because I don't know if you want such a big change before release of 1.10.
Necessary adjustments:
- nearestKSearch
https://github.com/PointCloudLibrary/pcl/blob/816391762918f3a026b1822fe42c74bb83129eb4/kdtree/include/pcl/kdtree/kdtree_flann.h#L160-L162
=>
size_t
nearestKSearch (const PointT &point, size_t k,
std::vector<size_t> &k_indices, std::vector<float> &k_sqr_distances) const override;
- radiusSearch
https://github.com/PointCloudLibrary/pcl/blob/816391762918f3a026b1822fe42c74bb83129eb4/kdtree/include/pcl/kdtree/kdtree_flann.h#L180-L182
=>
int
radiusSearch (const PointT &point, double radius, std::vector<size_t> &k_indices,
std::vector<float> &k_sqr_distances, int max_nn = 0) const override;
Some things you should notice about this:
max_nnis anintinstead ofunsigned int. We should think if we adjust meaning of 0, because-1means to return all points in FLANN during I don't know what FLANN is doing with 0.radiusSearchreturnsintduringnearestKSearchreturnssize_t, asnearestKSearchjust returnk. Maybe we should not returnk, but return value ofknnSearch.
And in general: Increase required FLANN version in CMake from 1.7 to 1.8.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with kdtree/include/pcl/kdtree/kdtree_flann.h and the ppf_registration.hpp loop, then inspect the related PCL call sites affected by FLANN 1.8's size_t API. Decide the intended max_nn and search-result semantics, update the CMake minimum FLANN version, and confirm all affected declarations and uses are consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system, computer-vision
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100