Unity Mujoco #3281
Replies: 2 comments
-
|
Hi, The "collapse & fly" behavior usually happens during MuJoCo → Unity export due to one of these:
I've dealt with the exact same instability in a biomechanical hand model. I manually aligned the joint axes to match anatomical motion vectors, added proper damping, and validated inertia tensors. The result is a stable simulation without collapsing or flying. You can see the stable behavior here: |
Beta Was this translation helpful? Give feedback.
-
|
The number one reason for stability mismatch is the timestep. The physics timestep of Unity and the underlying mujoco sim is matched. When you import a scene the Unity timestep is not updated (a warning is issued), since that is global for all scenes in Unity. Since the Unity timestep is usually much larger than the MuJoCo one, this often leads to instability. A simple fix is opening up the settings of your Unity, and changing the Physics dt to match the intended one from Unity. @salou07's suggestions are indeed good things to double check in general for a model. However, in general you are not expecting to see a mismatch in joint axes, masses or translations. If you do end up seeing an issue like that, then it is (most likely) a bug in the importer, please report it! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Intro
Hi!
I am a ([graduate / undergrad] student / professor / researcher) at XYZ, I use MuJoCo for my research on ABC.
My setup
MuJoCo :mujoco-3.8.1-windows-x86_64
unity :2022.3.62f2c1
My question
When I imported the XML file exported by Mujoco using Unity-related plugins, it worked normally. However, when I ran it, it collapsed and flew randomly everywhere. What was the cause of this?
Minimal model and/or code that explain my question
If you encountered the issue in a complex model, please simplify it as much as possible (while still reproducing the issue).
Model:
minimal XML
Code:
Confirmations
Beta Was this translation helpful? Give feedback.
All reactions