Replies: 1 comment 2 replies
-
|
I don't know if there's a hard rule about which appears as A or B. It might be the directionality of the force. Generally, though, I think it's best to explicitly match the forces to the link IDs returned. The other thing to realize is that often there will be multiple contact forces reported for each A/B link pair. A framework I created, Genesis Forge, has a contact sensor that lets you filter the Genesis contact forces to entities/links: You can see how it does it, here: In your case, you'd want to know about any collision between anything and the robot arm. In Genesis Forge, it might look like this self.contact_manager = ContactManager(
self,
entity_attr="robot",
sensor_links=["arm"],
)Without Genesis Forge, you would grab the contact forces and link IDs and then loop over the values (or create complex tensor masks) to filter out matching forces. This can be very slow to do manually in a vectorized environment, but you can create a gstaichi function to do it much faster. You can see the gstaichi function used for Genesis Forge, here. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I have a quick question about how the order of the contact pairs in determined in
.get_contacts( ). Specifically, what determines which entity / geometry isgeom_aand which isgeom_b?For example, in my case I want to be able to determine in simulation when an object exerts a force downward on a robot arm. So I tested using
.get_contacts()on both the object entity and the robot entity, but the return result always has the object asgeom_aand the robot asgeom_b.Even when I changed the order of the entities when adding them to the scene (robot first vs object first), the object is still always designated as
geom_ain.get_contacts().I assumed
geom_avsgeom_bwould be determined by the order of the geometry ids in the global entity and geom buffers, but now I am no longer sure. Does anyone have some insight into this?Beta Was this translation helpful? Give feedback.
All reactions