-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
div 0 compute3DCentroid #2663
div 0 compute3DCentroid #2663
Conversation
The test you referenced only checks the output of the function (number of processed points), not the values in the computed centroid. As such I don't think we can expect it to fail. pcl/common/include/pcl/common/centroid.h Lines 56 to 63 in 72f41b6
Pay attention to the note that the centroid is not changed if no points were processed. This is not how the actual implementation behaves (it unconditionally sets centroid to zero in the very beginning). So we have a decision to make here: either we change implementation to match the documentation or the other way round. I'd probably go with the latter (shouldn't break existing code). Opinions? |
Here's my thoughts:
|
OK, I actually agree with you, let's follow docstring. |
…accumulation variable
@SergioRAgostinho @taketwo that is a good catch. I have responded to the feedback given. |
Could you elaborate what is this |
@taketwo the comment was C+V'd from https://github.com/PointCloudLibrary/pcl/blob/master/common/include/pcl/common/impl/centroid.hpp#L559 where it made sense. I can delete the comments as I don't think they add any value in these functions, or simplify to the params they are actually taking place of in their respective functions |
Even in that function I don't quite understand what the comment wants to say. |
@taketwo sounds good, I can add that on Sunday, as well as address the CI failure Edit: need to delay to 12/12 due to scheduling |
This pull request has been automatically marked as stale because it hasn't had Come back whenever you have time. We look forward to your contribution. |
This pull request has been automatically marked as stale because it hasn't had Come back whenever you have time. We look forward to your contribution. |
Superseded by #5181 |
div 0 safety for centroids calculated on clouds with only NAN/inf values
I would be happy to see why the unit test at https://github.com/PointCloudLibrary/pcl/blob/master/test/common/test_centroid.cpp#L77 did not catch this, but I was unable to get the googletest runner to start for test_centroid (it is only running 174 tests for me currently)
closes #2480