google-deepmind / mujoco_mpc

Real-time behaviour synthesis with MuJoCo, using Predictive Control
https://github.com/deepmind/mujoco_mpc
Apache License 2.0
1.06k stars 157 forks source link

Add Unitree H1 Walk task #336

Open AntoSave opened 3 months ago

AntoSave commented 3 months ago

This PR adds a new task to make the Unitree H1 humanoid robot walk towards a given setpoint with MJPC. Some remarks on this PR:

Here is a video that showcases the agent's performances:

https://github.com/user-attachments/assets/c1e93c3f-f943-44a8-93c9-65d1fa03b4a1

I would like to get some feedback on the overall implementation as well as any modification needed to merge this PR. Thanks for your time!

google-cla[bot] commented 3 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

thowell commented 3 months ago

This is a great task, thanks for the contribution!

Things to improve performance:

Additionally, can you please sign the CLA? Thanks!

thowell commented 3 months ago

Have you tried this task with the G1 model?

AntoSave commented 3 months ago

Thank you for the time you spent on reviewing the PR, I really appreciate it.

This is a great task, thanks for the contribution!

Things to improve performance:

  • shorten the planning horizon: <numeric name="agent_horizon" data="0.35" />
  • change the integrator to implicitfast: <numeric name="agent_integrator" data="3"/>
  • modify the model (see the MJX humanoid example)

I managed to get a ~30% speed gain by moving to the implicitfast integrator and reducing the agent's horizon to 0.4s. I am reluctant to go lower as I experienced some instability, but I will surely try to reduce the number of contatcts to see if that helps.

Additionally, can you please sign the CLA? Thanks!

Signed it

Have you tried this task with the G1 model?

Not yet, but I'm going to. However, for the time being I will focus on H1 tasks as it is part of my master's thesis.