[filters/VoxelGrid] Provide a way to override CentroidPoint or add my own Accumulators
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- computer-vision
Research direction
Start by reading the VoxelGrid and CentroidPoint implementations described in the issue, focusing on how predefined Accumulators are selected and applied. Compare the requested override and custom-Accumulator approaches, then define a focused extension design whose completion is demonstrated by support for a user-defined bitwise-OR accumulator.
Written by the indexing model from the issue text.
Description
Context
I have defined my own points, with x, y, z and color, and an extra field that is essentially a bit mask.
I have been using this for years, and it works fine everywhere, with the exception of VoxelGrid.
VoxelGrid uses CentroidPoint to combine points, and it uses a set of predefined Accumulators to combine the fields within points according to the correct semantics for those fields.
This works fine for coordinates, normals, colours and a few other attribute types that pcl support, but there does not appear to be a way to extend the field types supported by supplying my own Accumulator type for my bit mask fields (which would is essence do a bitwise or on the fields in the incoming points).
With the current code structure it is impossible to override any of the implementations without copying everything up to VoxelGrid into my own code, which seems a bit gross.
Expected behavior
I would like to have full control over the way attributes of my points are treated, especially attributes that pcl doesn't know about as distributed because they are specific to my usage, but I can also see use cases for enabling use of different combination strategies for "standard" attributed like position or color.
Current Behavior
Currently I keep the leaf layout and then make an extra pass over the source points, call getCentroidIndex() and then manually modify the field.
Describe the solution you'd like
If I could override CentroidPoint when instantiating VoxelGrid I would only need to subclass CentroidPoint to do what I want. And I think it would allow all sorts of potentially useful other uses as well (for example create a CentroidPoint that uses a completely different way of combining points. I can think of random selection, for example, or modifying some attributes based on the values of some other attributes.
Describe alternatives you've considered
An alternative that would work for my use case is if I could add my own Accumulator implementation to the Accumulator.types list, but I'm not sure that there is a construct in C++ that would allow that.
Additional context
Add any other context or screenshots about the feature request here.
- Dominant language
- C++
- Stars
- 11.2k
- Forks
- 4.7k
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from PointCloudLibrary/pcl
-
kind: bug status: triage
Difficulty 1/5 Under an hour Newbie friendliness 82/100
PointCloudLibrary/pcl#6536 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
PointCloudLibrary/pcl#6509 · 1 comment ·
Maintainers usually reply within 3 days
-
kind: bug status: triage
Difficulty 4/5 3-5 days Newbie friendliness 48/100
PointCloudLibrary/pcl#6537 ·
Maintainers usually reply within 3 days
-
[cmake] QHULL/FLANN dll missing when linking single modulePossibly taken @SIDDARTHAREDDY8 claimed this 5 days ago. Openkind: bug module: cmake
Difficulty 3/5 Half a day Newbie friendliness 50/100
PointCloudLibrary/pcl#6522 · 1 comment ·
Maintainers usually reply within 3 days
-
kind: bug status: triage
Difficulty 4/5 3-5 days Newbie friendliness 35/100
PointCloudLibrary/pcl#6395 ·
Maintainers usually reply within 3 days
All issues in PointCloudLibrary/pcl
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
nextcloud/passman-android#214 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
feature wsl2
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
microsoft/WSL#42306 · 3 comments ·
Maintainers usually reply within 1 day
-
2026.11.0 fails to install on Intel macOS: requirements.txt pins cryptography==50.0.2 for Darwin x86_64May be free again A pull request for this issue was closed without being merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 87/100
esphome/esphome#22892 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
distante/esphome-components#50 · 1 comment ·
Maintainers usually reply within 1 day