google-deepmind / mujoco

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

Inverse dynamics in `mjx` #1211

Closed alberthli closed 9 months ago

alberthli commented 9 months ago

In the mjx feature matrix, I see that inverse dynamics are unimplemented - is there an estimate for when this will be ready at the same level as mjx.forward? This would be very useful for trajectory-optimization-based applications.

erez-tom commented 9 months ago

We don't know yet when we'll implement it, because we haven't yet explored enough how it may be used; so we'd love to hear more about your intended use!

We recently implemented direct trajectory optimization using inverse dynamics in C++ (so on CPU), and we currently solve the optimization problem by Banded Cholesky Factorization, an algorithm that (we expect) would not run efficiently on accelerators. Trajax also runs mostly on CPU, even though it's written in JAX.

What do you have in mind for inverse-dynamics MJX? Can you suggest a trajectory optimization algorithm that uses inverse dynamics and is amenable to fast computation on an accelerator? If not, why would you want use inverse dynamics in MJX instead of simply using MuJoCo-C's existing implementation?

If any of this seems interesting / relevant to your research, please get in touch with us at mujoco@deepmind.com .

Best of luck!