google-deepmind / mujoco

Multi-Joint dynamics with Contact. A general purpose physics simulator.
https://mujoco.org
Apache License 2.0
8.1k stars 811 forks source link

Catch warning unstable simulation #1570

Closed giorgionicola closed 6 months ago

giorgionicola commented 6 months ago

Hi, I'm a researcher and I'm trying to use MuJoCo for simulating deformable linear objects and specifically acquiring synthetic datasets. Therefore, I have written a script that runs many simulations each with different physical parameters. However, some combinations of physical parameters lead to unstable simulations, and the following warning is shown in the terminal.

WARNING: Nan, Inf or huge value in QACC at DOF 0. The simulation is unstable. Time = 0.0280.

I would like to catch that warning so I can run the simulation with new parameters. I am using Python bindings.

yuvaltassa commented 6 months ago

You want to inspect mjData.warning