Genesis icon indicating copy to clipboard operation
Genesis copied to clipboard

How to retrieve contact normal vectors for collisions (Possibly via SDF gradient)?

Open junny-kim opened this issue 11 months ago • 1 comments
trafficstars

We want to retrieve the contact normal vector at each contact point. Currently, the contact information includes geom_a, geom_b, link_a, link_b, positions, and forces, but not the contact normal. The direction of the normal is often crucial for tasks like manipulation, friction modeling, or force distribution.

Is there a built-in way to access contact normals? If the geometry is stored or represented via a Signed Distance Function (SDF), it seems possible to compute the local surface normal from the gradient of the SDF at the contact point. However, I haven’t found a direct API for that.

Is there a recommended approach or workaround to obtaining the contact normal? If so, could you point us toward any relevant documentation or methods? If not, do you have plans to expose the contact normal in a future release? Any guidance is appreciated.

junny-kim avatar Dec 23 '24 13:12 junny-kim

There's a function here drawing visualizing rigid contacts. contact_data.normal reflect the normal of this contact pair.

wangyian-me avatar Dec 23 '24 17:12 wangyian-me