-
Notifications
You must be signed in to change notification settings - Fork 27
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
Improve how links with no collision elements are handled in contact detection #334
Conversation
So if I call |
I checked again the logic in the case you described. The desiderata is the following: Contacts disabled
Contacts enabled
I spotted a problem in 2, the method was returning true without error message. Fixed in 7aaa8d1.
Now, this scenario remains as you described, but the exit status of |
I think the thing that I do not understand why enabling contact on a link without collision should fail in the first place. Let's say I want to enable collision on all the links of a model, should I manually check if a link has a collision before calling |
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.
Some comments inline, not a big problem anyhow.
Mmh. Let's assume a user enables contact on a link with
The model-wise methods are actually more convoluted. After the previous modifications, You're right that the logic is not optimal, especially for the model-wise methods. Let's see if we can find a workaround that prevents any kind of surprise:
How does it sound? |
In general, collision and visual shapes are different, so that can happen even if a link has a collision element, and that is the reason why I would personally prefer to keep the thing as simple as possible and just permit to enable collision on links without collisions. If a user want to check collision, it should visualize collision meshes, not the visual ones. However, if you think the complexity <--> advantaged tradeoff make sense, I think keeping things as they are is probably the safest option, not sure that even more complexity is helping. |
When writing my previous comment, I convinced myself that what wrote there, that I think complies with your comment, is the best approach. I try to implement it rolling back to a behavior that is more similar to the original implementation. At first sight, the real changes are a more verbose output for links with no collision elements. |
7aaa8d1
to
253c1d0
Compare
Link::contactsEnabled
output when the link has no collision elements
PR updated with the logic described in #334 (comment). Title updated accordingly. @traversaro thanks for the feedback! |
253c1d0
to
19f6574
Compare
This seems much simpler so it is good for me, but why |
If I understood what you meant, I have to point out a very very subtle thing to consider. Implementing what you proposed would mean adding a boolean value in the All the ScenarIO Gazebo classes (World, Model, Link, ...) are in theory kind-of stateless. And this means that objects can be destroyed and re-created being able to restore their state just by reading the ECM. If I managed to clarify the situation, by inspecting the logic used in |
I see, that make sense! |
Before this PR, if ascenario:gazebo::Link
had no collisions, the methodLink::contactsEnabled
was returning true.Refer to discussion below #334 (comment).