-
Notifications
You must be signed in to change notification settings - Fork 276
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
ContactSensor does not contain information about Contact Depth, Normal and Wrench #2037
Comments
After investigating a bit it seems that the issue is that the physics engine does not fill the
I can see that the contacts in this line |
Yes, this is a missing feature. |
I'd be happy to try my hand at adding this fix. I don't have too much experience with the gz libraries so maybe a few pointers on how to go about the implementation would be helpful. Given my limited experience I currently see two ways to implement this:
Any hints would be appreciated. |
I think just updating the Physics system (where gz-sim interfaces with gz-physics) would be sufficient for this. If you look at gz-sim/src/systems/physics/Physics.cc Line 3764 in 50a99e6
we're only retrieving the |
Now the EntityContactMap contains a deque of pairs of ContactPoint and ExtraContactData. That way the messages can be populated with Normals, Forces, and Depth. The force on body 2 is equal and opposite to the force on body 1. Fixes Issue gazebosim#2037
Now the EntityContactMap contains a deque of pairs of ContactPoint and ExtraContactData. That way the messages can be populated with Normals, Forces, and Depth. The force on body 2 is equal and opposite to the force on body 1. Fixes Issue gazebosim#2037 Signed-off-by: Anton Bredenbeck <a.bredenbeck@tudelft.nl>
Now the EntityContactMap contains a deque of pairs of ContactPoint and ExtraContactData. That way the messages can be populated with Normals, Forces, and Depth. The force on body 2 is equal and opposite to the force on body 1. Fixes Issue gazebosim#2037 Signed-off-by: Anton Bredenbeck <a.bredenbeck@tudelft.nl>
Environment
Description
depth_size()
,normal_size()
,wrench_size()
each returning 0 as the arrays are empty.Steps to reproduce
gz sim visualize_contacts.sdf
gz topic -e -t /world/visualize_contacts/model/cylinder/link/link/sensor/contact_sensor/contact
and observe that the topic only contains information about the contact position.Output
An example of a single
gz::msgs::Contacts
message:I suppose this is related to the (closed) issue #112 and when testing I can see the blue spheres but no green cylinders as shown in pull #234.
The text was updated successfully, but these errors were encountered: