MuJoCo simulation for the H1_2 robot.
-
This repo depends on Unitree Python SDK to communicate with the robot.
-
Download Unitree SDK under
submodules/unitree_sdk2_pythonby initializing git submodules:git submodule update --init --recursive
-
Easiest way to run scripts in this repo is to use
uv -
Commands:
uv sync # install dependencies for this repo including unitree sdk uv run PATH_TO_SCRIPT
-
requirements.txtlists dependencies that can be installed bypip. -
Commands:
pip install -r requirements.txt # install dependencies for this repo including unitree sdk
archive/contains old implementations not in use.unitree_robots/contains the robot description files.utility/contains useful scripts.h12_mujoco.pyis the main simulation program of h12 robot.mujoco_env.pyprovides utilities for MuJoCo simulation.pv_interface.pyprovides visualization in pyvista is needed.unitree_interface.pycontains wrappers for the Unitree SDK.
- Run
python h12_mujoco.pyto simulate the robot in Mujoco, subscribe tort/lowcmdand publish tort/lowstate. - The simulation is a good test before deploying controllers on the real robot in debug mode.
--handless: use handless model scenes (default).--inspire: use inspire-hand model scenes.--fixed: use pelvis-fixed scene variant (no elastic band).--force <link1> <link2> ...: enable external force interface on given links.
Scene selection behavior:
- default /
--handless:scene_handless.xml --inspire:scene.xml--fixed+ default /--handless:scene_handless_pelvis_fixed.xml--fixed+--inspire:scene_pelvis_fixed.xml