google-deepmind / mujoco_menagerie

A collection of high-quality models for the MuJoCo physics engine, curated by Google DeepMind.
Other
1.45k stars 202 forks source link

Query on Differences in Motor Properties Between Mujoco XML and MJX Variants #65

Closed jc-bao closed 5 months ago

jc-bao commented 5 months ago

Which model is the issue affecting?

go2

What is the issue?

I've noticed that the motor properties for the Mujoco XML and its MJX variant differ. For instance, in go2.xml, the motor is defined as <motor ctrlrange="-23.7 23.7"/>. However, in go2_mjx.xml, the motor is specified as <general forcerange="-24 24" biastype="affine" gainprm="50 0 0" biasprm="0 -50 -0.5"/>, which includes extra bias and gain terms.

I'm curious about the reasons behind this design choice in the MJX version. Can we revert to the original motor settings? Are the gainprm and biasprm values derived from hardware specifications, or are they introduced solely for simulation stability and performance?

I am planning to deploy a model trained with the MJX settings, so this discrepancy is significant for me. Any information would be highly appreciated. Thank you in advance!

Is there any additional context you can provide (e.g., a spec sheet or a URDF to show a value mismatch)?

The file are go2.xml and go2_mjx.xml.

yuvaltassa commented 5 months ago

cc @kevinzakka @btaba

kevinzakka commented 5 months ago

Hi @jc-bao,

To answer your first question, the difference in actuation isn't intentional, I believe the Go2 was contributed by @lonelyfluency and they used PD actuators whereas we used motors for the CPU variant. I think reverting is fine.

Now with respect to how accurate the model is, at the moment we respect whatever is defined in the URDF (e.g. torque limits). The model is indeed stable but you'll probably need to domain randomize if you're doing RL or sysID if you're doing something model-based.

jc-bao commented 5 months ago

Got it. Thanks for the response!