Loss of contact under acceleration #111
-
I've been trying to use mujoco for grasp simulations, and have noticed that under acceleration some contact distances go above zero and lose contact (even if the acceleration and contact normal are perpendicular). Increasing the contact normal force far above what what ideally would maintain contact reduces the frequency of the contact loss, but isn't desirable for my application. Is there any way to reduce or address this occurrence? I thought that adjusting the solref and impratio parameters might help, but so far the parameters I have tried did not seem to produce any significant changes. I have attached some code (written using mujocopy) that demonstrates what I've described. (a .txt because I couldn't attach a .py) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Unfortunately we do not support mujoco-py. If you can attach a pure XML file where your issue can be observed using |
Beta Was this translation helpful? Give feedback.
-
Thanks for the colab, I've taken a look. Firstly, two recommendations.
Second, I could stabilise all three objects by reducing You are dividing by gear when setting ctrl, why? It means gear has no effect (why not just set it to 1?) and you are using a grip force that is insufficient to hold to objects in place at high forces/accelerations (e.g. when hitting the top slider limit), so they slip. Remember that the thing that is bounded are impulses; forces are unbounded as objects are more and more rigid (though of course real objects are never infinitely rigid). E.g. when you gently tap a coin onto a glass window you are easily creating instantaneous forces of 100 Newtons [1]. Regarding the cylinder specifically, yes, it is harder to stabilise. The issue is that cylinder/box creates only one contact point, at the cylinder edge. So the cylinder has no other option than to vibrate since the two contact points with each box are always at opposite edges and therefore apply significant alternating torque, which causes vibration. The solution is not in the contact parameters, but in the object design. If you construct your cylinder as a stack of two cylinders, it will be as stable as the others. Again, I strongly recommend using [1] Coin of mass = 0.01 Kg, traveling at 0.1 m/s, hits a window and stops after 10 μs -> average force = 1e2 Newtons. |
Beta Was this translation helpful? Give feedback.
Thanks for the colab, I've taken a look.
Firstly, two recommendations.
simulate
where you can interactively pull on objects, visualise contact forces / points and change contact parameters interactively (using the contact override mechanism). This will allow you to develop an intuition for the effects of different settings.scene_option.flags[enums.mjtVisFlag.mjVIS_CONTACTPOINT] = True
so you'll see the contact points.Second, I could stabilise all three objects by reducing
solref[0]
to 5ms (=.005) (while reverting everything else to …