-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Scaling down body size results in ValueError: Error: mass and inertia of moving bodies must be larger than mjMINVAL #1086
Description
I have a MuJoCo xml model of a worm made of a series of box geometries, and an ellipsoid head with a free joint. This is meant to model C. elegans, which is a 1mm nematode.
When I scale down the model (in terms of geometry size and relative position), I get the following error in simulate.exe: ValueError: Error: mass and inertia of moving bodies must be larger than mjMINVAL.
To give a slightly broader context, I am training a PPO agent to make the worm model do sine wave undulations (as a simple test case). Hence, scaling down gradually was important to adjust parameters in order to maintain similar dynamics across scales. I started from a ~0.3m long worm model, and then scaled it down by factors of 0.5, 0.1, 0.05, 0.02 and 0.01.
Until 0.05, the model behaves similarly and training results are good. At 0.02, training curves (mean episode length and reward) look very different and unstable, and training stopped after 2M steps with the following error: mujoco.FatalError: HessianDirect: rank-defficient Hessian. At 0.01, training doesn't even start, and I get the following error: ValueError: Error: mass and inertia of moving bodies must be larger than mjMINVAL. In this last case, the xml model cannot even be loaded to simulate.exe (due to the same error).
I attached xml files for scales 1, 0.05, 0.02 and 0.01 (worm.zip).
I am using MuJoCo 2.3.7 on Windows 11.