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

additional constructor for collisionrequest is a bad idea #39

Closed
stonneau opened this issue Jan 8, 2019 · 8 comments
Closed

additional constructor for collisionrequest is a bad idea #39

stonneau opened this issue Jan 8, 2019 · 8 comments

Comments

@stonneau
Copy link
Contributor

stonneau commented Jan 8, 2019

6732f69

Because of the default parameter signature in the other constructor, and
because bool and size_t can be used indifferently, the constructor called is undefined
depending on the parameters given. As a matter of fact, the constructor called
in CollisionValidation is not the one you think. This leads to a bug where max_num_contacts parameter
is in fact set to 0. I am creating a pull request to fix this in hpp-core, but the ambiguity should be removed

@florent-lamiraux
Copy link
Contributor

If you are true, there should be a compilation warning.

@jmirabel
Copy link
Contributor

jmirabel commented Jan 8, 2019

I would be in favor of using flags rather than constructors with a series of booleans.
I find CollisionRequest (Contact | DistanceLowerBound, 1) more readable than CollisionRequest (true, 1, true)...

@stonneau
Copy link
Contributor Author

stonneau commented Jan 8, 2019 via email

@florent-lamiraux
Copy link
Contributor

I meant that the constructor that is called is deprecated. The compiler should complain or call the other one.

@stonneau
Copy link
Contributor Author

stonneau commented Jan 8, 2019 via email

@florent-lamiraux
Copy link
Contributor

I agree with Joseph.

@stonneau
Copy link
Contributor Author

stonneau commented Jan 8, 2019

I'd agree as well, although this drives us further away from the original fcl api.
This is not only about an hypothetic merge, but also with respect to the rest of the api that does not follow this principle.

In any case, such modifications should be conducted on another branch than devel, until the api change is actually confirmed.

@stonneau
Copy link
Contributor Author

stonneau commented Feb 6, 2019

Here it is:
#54

@stonneau stonneau closed this as completed Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants