NaN Control Inputs Cause Simulation Instability in Humanoid Task #2528
Unanswered
xiaochuanma
asked this question in
Asking for Help
Replies: 1 comment
-
MuJoCo is complaining that you are giving it nans. The issue is presumably in your code? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Intro
Hi!
I am a graduate student at TUM, I use MuJoCo for my research on the unitree g1 humanoid.
My setup
I'm doing some locomotion control tasks with the humanoid, and I'm working with the mjx for rollouts of numerous smaple controls using the force.
mujoco 3.2.4
mujoco-mjx 3.2.4
python 3.12
os: Linux 6.8.0-52-generic
My question
When running the Humanoid sampling and control task, the simulation becomes numerically unstable after 0.48 seconds. Specifically, NaN values appear in actuator 0, causing the simulation to crash.
Error message:
WARNING: Nan, Inf or huge value in CTRL at ACTUATOR 0. The simulation is unstable. Time = 0.4800.
The issue appears in the control input calculation:
Step the simulation
And here is how i evaluate the rollouts:
def _scan_fn(
x: mjx.Data, u: jax.Array,
) -> Tuple[mjx.Data, Tuple[mjx.Data, jax.Array, jax.Array]]:
"""Compute the cost and observation, then advance the state."""
x = mjx.forward(model, x) # compute site positions
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:
mjx_issue.zip
Confirmations
Beta Was this translation helpful? Give feedback.
All reactions