-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented a class to generate point clouds of 3D geometric primitives #508
Implemented a class to generate point clouds of 3D geometric primitives #508
Conversation
Add to whitelist |
This looks good as it is. We are indeed generating these kinds of shapes often in our lab as toy examples to test new functionalities. Maybe @simonpierredeschenes and @boxanm want to comment. A few improvements:
Since it is fresh in your mind, you might want to address them right away or we can transfer them to an issue. |
Hi @YoshuaNava, thank you for this contribution! I don't think you need to add 2D shapes for now, this can be added later if people need it. As for the API, I think that with François' comments, it will be flexible enough for different use cases. It is true that this could be added to a different header file, something like PointMatcherTools.h, since it is not related to registration directly. If you have time, this would be greatly appreciated. Thank you! |
This sounds great 👍 I would have an API-design question: How would you like me to encode the property of which faces the shape has?
Separate scaling on X, Y and Z?
As some shapes use closed-form Polar/Cartesian expressions, I need to identify where to add the noise. I'll give the idea a spin and get back to you.
Separate documentation under
I can add assertions to prevent that users call the generator when using 2D-pointmatcher (e.g. a user calls generateSphere, thinking he/she would get a 2-sphere)
Will do!
A priori I think the aspect that could take me the most to address is the generation of open shapes, just because it needs some deeper thought to create a good API. But I'll give it a try before we move it to an issue. |
@simonpierredeschenes @pomerlef Kind ping to get your view on #508 (comment) 🙂 |
Hi @simonpierredeschenes @pomerlef, I recently worked on the CoM conditioning topic, and recently pushed a fix with unit tests. If possible I would like to get your feedback and check whether we can go forward with this PR, so that I can continue pushing the changes I did before I have to switch to work on a different project. Note: before merging I need to push one more commit with a small fix to the orientation of normals for the Box shape. Best, |
@boxanm , can you have a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution, there are some minor changes to make, but it looks good overall!
Looks like our build server complains about compilation on Ubuntu Jammy:
I'll try to build it locally and see what causes the issue. In the meantime, thanks for the contribution! I know it has been sitting here for a while, we've been waiting to stabilize our build infrastructure.
Overall, I find such geometric primitives useful for testing. However, the same functionality can be achieved in Python with way fewer lines of code. So, without questioning the usefulness of this particular contribution, I thought about the general idea of the cases that |
Indeed, the main motivation for this class was to have a way to test other classes. For example, we implemented an extensive test for ICP conditioning, that was enabled by the box point cloud generator: https://github.com/ANYbotics/libpointmatcher/blob/master/utest/ui/icp/Conditioning.cpp It would be easy to take these primitives and test filters, as well as other operators, with the guarantee that you have total control over the data / a ground truth. In my experience, relying on other languages for this task can block unit tests. As I understand it, one would need to implement C++ bindings for Python classes, which may run with overhead.
Personally I wouldn't see it as a bad thing if libpointmatcher grows. The foundations of the library are extremely solid, yet lightweight. They have passed the test of time, and they have a key differentiating factor: the representation of point clouds as a struct of arrays (a Matrix), which was quite a nice idea (relatively similar to sparse tensors) back in the days 🚀 |
…r' into feature/point_cloud_generator
Quality Gate passedIssues Measures |
Description
This PR introduces the
PointCloudGenerator
, a class for procedural generation of point clouds corresponding to 3D geometric primitives (sphere, cylinder, plane, box). My motivation for introducing it is to have synthetic data with perfect normals that we can use to test ICP and filters.I implemented unit tests covering 100% of the new code.
Open questions
PointMatcher.h
, but I think if we keep most declarations there that file will grow in size quickly.