Skip to content
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

Merged
merged 12 commits into from
Mar 19, 2020

Conversation

mvieth
Copy link
Member

@mvieth mvieth commented Feb 10, 2020

No description provided.

@kunaltyagi
Copy link
Member

Might be better to not modify the public API (or add overloads instead of replacing the original functions)

@mvieth
Copy link
Member Author

mvieth commented Feb 11, 2020

I could add adapters for getSamples, computeModelCoefficients, isSampleGood, and the other functions, but I would mark them as deprecated right away.

@kunaltyagi
Copy link
Member

Might not, because based on feedback on RFC-002, we might make pcl::index_t be either 32 bit or 64 bit at build time. The deprecation will need to be undone in case someone is building pcl::index_t in 32-bit mode (which might be the default)

@mvieth
Copy link
Member Author

mvieth commented Feb 15, 2020

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.

@kunaltyagi
Copy link
Member

I thought this kind of stuff is discussed in issues

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.

@mvieth
Copy link
Member Author

mvieth commented Feb 15, 2020

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.

Copy link
Member

@kunaltyagi kunaltyagi left a 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?

@mvieth
Copy link
Member Author

mvieth commented Feb 16, 2020

Is there a reason behind changing the behavior of isModelValid?

What do you mean? Where did I do that?

@kunaltyagi
Copy link
Member

You deleted the pcl::SampleConsensusModelNormalSphere<PointT, PointNT>::isModelValid function which effectively changes the behavior of isModelValid since it defaults to the base-class function

@mvieth
Copy link
Member Author

mvieth commented Feb 16, 2020

I added a using SampleConsensusModelSphere<PointT>::isModelValid; in sac_model_normal_sphere.h, and that one looks exactly like the function I deleted. So the behaviour should be the same, no?

@kunaltyagi
Copy link
Member

PS: I started work on a pcl::index_t and I'll create a PR soon. May take a day or two. Could you wait for that PR to merge so you can use that instead of breaking the public API.

@mvieth mvieth marked this pull request as ready for review February 22, 2020 09:06
@mvieth mvieth requested a review from kunaltyagi February 22, 2020 09:07
Copy link
Member

@kunaltyagi kunaltyagi left a 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.

@kunaltyagi kunaltyagi added effort: medium Rough estimate of time needed to fix/implement/solve effort: high Rough estimate of time needed to fix/implement/solve and removed effort: medium Rough estimate of time needed to fix/implement/solve labels Feb 24, 2020
Copy link
Member

@kunaltyagi kunaltyagi left a 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.

@kunaltyagi kunaltyagi changed the title Improve module sample consensus [sample consensus] Better error handling and other improvements Feb 24, 2020
@SergioRAgostinho
Copy link
Member

@kunaltyagi Ok, I think I applied all of your suggestions. But what is going on with the MacOS checks?

Broken build tools environment in CI.

@kunaltyagi kunaltyagi added the changelog: enhancement Meta-information for changelog generation label Mar 11, 2020
@kunaltyagi kunaltyagi changed the title [sample consensus] Better error handling and other improvements [sample consensus] Better performance, error handling and other improvements Mar 11, 2020
Copy link
Member

@kunaltyagi kunaltyagi left a 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 ❤️

kunaltyagi
kunaltyagi previously approved these changes Mar 11, 2020
@SergioRAgostinho SergioRAgostinho self-requested a review March 11, 2020 10:26
@SergioRAgostinho SergioRAgostinho added needs: code review Specify why not closed/merged yet and removed needs: more work Specify why not closed/merged yet labels Mar 11, 2020
Copy link
Member

@SergioRAgostinho SergioRAgostinho left a 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.

@kunaltyagi kunaltyagi dismissed their stale review March 15, 2020 05:45

New code has been added

@SergioRAgostinho SergioRAgostinho self-requested a review March 17, 2020 11:55
Copy link
Member

@SergioRAgostinho SergioRAgostinho left a 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.

@SergioRAgostinho SergioRAgostinho added needs: author reply Specify why not closed/merged yet and removed needs: code review Specify why not closed/merged yet labels Mar 18, 2020
mvieth added 4 commits March 19, 2020 09:54
- 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
@mvieth mvieth force-pushed the sample_consensus branch from 30599f2 to eb3a8de Compare March 19, 2020 08:55
@mvieth
Copy link
Member Author

mvieth commented Mar 19, 2020

Done. Let me know if there are more commits you would like me to squash.

Copy link
Member

@kunaltyagi kunaltyagi left a 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

@kunaltyagi kunaltyagi removed the needs: author reply Specify why not closed/merged yet label Mar 19, 2020
@kunaltyagi kunaltyagi added the needs: code review Specify why not closed/merged yet label Mar 19, 2020
@SergioRAgostinho SergioRAgostinho merged commit 55fc3fa into PointCloudLibrary:master Mar 19, 2020
@taketwo taketwo removed the needs: code review Specify why not closed/merged yet label Mar 19, 2020
@taketwo taketwo changed the title [sample consensus] Better performance, error handling and other improvements Better performance, error handling and other improvements in SAC classes Mar 19, 2020
@mvieth mvieth deleted the sample_consensus branch March 21, 2020 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: enhancement Meta-information for changelog generation module: sample_consensus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants