How to initialize objects in collision free random states? #47
-
The current approach I am using is to initialize in random states and then check for collision using a script which is similar to the following.
It works most of the time but once in a while it fails. The object is initialized in a collision state and gets thrown away in the scene and the snippet above doesn't detect the collision. Since I am calling sim.forward (and NOT sim.step), there shouldn't be any integration in time as per documentation and correspondingly the plate shouldn't have been thrown away. How can I avoid the object being thrown away or how can I correctly sample collision free random states using an alternate approach? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Your approach is correct, so this seems to me like a |
Beta Was this translation helpful? Give feedback.
Your approach is correct, so this seems to me like a
mujoco-py
issue. One idea to work around it could be to look at efc_force or qfrc_constraint -- these should be 0 if and only if there are no contacts (and your model doesn't use constraints).