I have been using Hydroelastic Contact to simulate a peg-in-hole task. The simulation scene is like
The blue peg is a compliant hydroelastic cylinder and the hole is a rigid hydroelastic mesh. The wire frame view of the hole mesh is
When I push the peg down and apply an external force on it (downward force at the left end of the peg, pointed into the hole's surface), I find that the peg tilted unexpectly.
It can be seen that the left part of the peg's tip penetrated into the surface of the hole and thus the tilt angle. Since the peg is a compliant body, penetraction is expected. However, what confuses me is the tilt angle and the contact surface. What I expect is that the contact surface should contain all areas of the penetration part of the peg, however, what I really get is just a strip. The illustration is shown in the figure below. The left shows the contact surface that I really get and the right shows the contact surface that I expect.
Since the contact between the hole's surface and the peg's end is surface-to-surface, I would expect that after contact between the hole's surface and the peg's end, the peg will be in norminal position (vertically oriented) and the tilt angle of the peg will be small despite of the external applied force. However, since the contact surface is a strip, the peg can rotate along that strip and the tilt angle can be large. At first I suspect that the reason is that the triangles of my hole's mesh are sparse. However, after I add more triangles to my hole's surface, I get nealy the same result. Increasing the hydroelastic modulus also does not help. I have also tried to add small collision sphere at the peg's tip like the point contact case. However, I get
RuntimeError: Bad tetrahedron. Cannot compute gradient.
What modifications should I make to get the correct contact surface? Or are there workaround ways that can make the penetration tilt angle of the peg small after surface-to-surface contact?
I have run the ball and plate
hydroelastic contact example and find that the contact between the plate and the plane seems do not have this issue.
Thank you very much for your answer!