-
-
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
Better performance, error handling and other improvements in SAC classes #3642
Better performance, error handling and other improvements in SAC classes #3642
Conversation
9ccc1f7
to
9c05326
Compare
Might be better to not modify the public API (or add overloads instead of replacing the original functions) |
I could add adapters for |
Might not, because based on feedback on RFC-002, we might make |
I wasn't aware that there are RFCs in the wiki. I thought this kind of stuff is discussed in issues. I made a comment in the issue linked in the RFC. |
It is. I created RFC since it turns out a fleshing out a topic is hard to do in an issue. RFC allows people to comment and discuss in the relevant gitter rooms without creating noise for other non-interested people. |
Well, nobody is forced to read an issue or its comments. As long as an issue is confined to one topic, I see no problem with discussing things that way. I just wanted to note that many people may not know about the RFCs in the wiki and thus don't participate in the discussion. |
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.
Is there a reason behind changing the behavior of isModelValid
?
sample_consensus/include/pcl/sample_consensus/impl/sac_model_circle3d.hpp
Outdated
Show resolved
Hide resolved
sample_consensus/include/pcl/sample_consensus/impl/sac_model_cone.hpp
Outdated
Show resolved
Hide resolved
What do you mean? Where did I do that? |
You deleted the |
I added a |
The number of model coefficients is checked there
- Add braces for clarity - Move n_inliers_count to where it is used - Remove initialization of d_cur_penalty because that value is overwritten, thus never read
62bbf45
to
3201899
Compare
PS: I started work on a |
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.
Most of the PR LGTM. I'll take a deeper look after the weekend.
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.
If it's possible, I'd remove the changes wrt sort, partition, nth_element from this PR so we can highlight them in the change-log separately.
Broken build tools environment in CI. |
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.
Overall, LGTM. I have 2 minor comments. Sergio is correct regarding the CI. Apples like to break stuff.
Thanks a lot for this @mvieth. Parts of the patch are awesome ❤️
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.
LGTM. Thanks 👍 Before I give the green light, here are some things which raised my eyebrow.
Important things:
Not a consequence from this PR, but the inliers checks look fishy. But I might be overlooking something. See inline comments.
Commits that should be squashed after the entire review process is complete
3201899
0ad9e94
8bc774a
818c07c
Minor things:
This commit 8d68a6d is a style preference that I do not agree with but I don't mind when one is the code author. For the future, don't submit commits with just these types of changes unless the code is really cryptic. Ultimately everything is going to be formatted with clang-format
at some point, so the style is going to be unified there.
Future work (?):
Commit 78760f0 is asking for for-range loop replacements on those index loops.
sample_consensus/include/pcl/sample_consensus/impl/sac_model_circle3d.hpp
Show resolved
Hide resolved
sample_consensus/include/pcl/sample_consensus/impl/sac_model_cylinder.hpp
Outdated
Show resolved
Hide resolved
sample_consensus/include/pcl/sample_consensus/impl/sac_model_stick.hpp
Outdated
Show resolved
Hide resolved
sample_consensus/include/pcl/sample_consensus/impl/sac_model_stick.hpp
Outdated
Show resolved
Hide resolved
sample_consensus/include/pcl/sample_consensus/impl/sac_model_stick.hpp
Outdated
Show resolved
Hide resolved
sample_consensus/include/pcl/sample_consensus/impl/sac_model_stick.hpp
Outdated
Show resolved
Hide resolved
sample_consensus/include/pcl/sample_consensus/impl/sac_model_circle.hpp
Outdated
Show resolved
Hide resolved
sample_consensus/include/pcl/sample_consensus/impl/sac_model_circle3d.hpp
Show resolved
Hide resolved
sample_consensus/include/pcl/sample_consensus/impl/sac_model_circle3d.hpp
Outdated
Show resolved
Hide resolved
sample_consensus/include/pcl/sample_consensus/impl/sac_model_sphere.hpp
Outdated
Show resolved
Hide resolved
sample_consensus/include/pcl/sample_consensus/impl/sac_model_stick.hpp
Outdated
Show resolved
Hide resolved
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.
LGTM. Thanks. Squash those commits I mentioned early and it's good to merge.
- If there are NaN values in distances, sorting does not work. So move all NaN value to the end and continue with the valid sub range. erase-ing them could also be an option, but that might be slower. - When searching for the median, it is much faster to use nth_element instead of sort-ing the entire array. My benchmarks suggest that this can make computeModel 4 times faster
30599f2
to
eb3a8de
Compare
Done. Let me know if there are more commits you would like me to squash. |
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.
LGTM. Nice commits. I don't feel any further reorganization is needed
No description provided.