{"id":46538085,"url":"https://github.com/mujocolab/g1_spinkick_example","last_synced_at":"2026-03-07T00:14:24.848Z","repository":{"id":321125499,"uuid":"1073406342","full_name":"mujocolab/g1_spinkick_example","owner":"mujocolab","description":"Train a Unitree G1 humanoid to perform a double spin kick using mjlab","archived":false,"fork":false,"pushed_at":"2025-11-23T00:05:47.000Z","size":3059,"stargazers_count":158,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-23T02:19:30.000Z","etag":null,"topics":["mjlab","mujoco","mujoco-warp","sim2real","unitree-g1"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mujocolab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-10T04:23:39.000Z","updated_at":"2025-11-23T00:05:50.000Z","dependencies_parsed_at":"2025-10-28T00:23:49.083Z","dependency_job_id":null,"html_url":"https://github.com/mujocolab/g1_spinkick_example","commit_stats":null,"previous_names":["mujocolab/g1_spinkick_example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mujocolab/g1_spinkick_example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujocolab%2Fg1_spinkick_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujocolab%2Fg1_spinkick_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujocolab%2Fg1_spinkick_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujocolab%2Fg1_spinkick_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mujocolab","download_url":"https://codeload.github.com/mujocolab/g1_spinkick_example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujocolab%2Fg1_spinkick_example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30204114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mjlab","mujoco","mujoco-warp","sim2real","unitree-g1"],"created_at":"2026-03-07T00:14:24.331Z","updated_at":"2026-03-07T00:14:24.835Z","avatar_url":"https://github.com/mujocolab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mjlab example: Unitree G1 Double Spin Kick\n\n![Sim-to-real double spin kick comparison](assets/teaser.gif)\n\nAn example of building on top of [mjlab](https://github.com/mujocolab/mjlab) to\nteach a Unitree G1 humanoid to perform a **double spin kick**. The reference\nmotion comes from Jason Peng's [MimicKit](https://github.com/xbpeng/MimicKit).\n\n**This repository provides:**\n- Data conversion script (MimicKit pkl → mjlab csv)\n- Full training results and hyperparameters\n- Pretrained ONNX checkpoint for deployment\n- Deployment instructions for real hardware\n\n\u003e ⚠️ **Disclaimer**\n\u003e\n\u003e This repository is provided as-is for educational purposes. We do not take any\n\u003e responsibility for damage to property or injury to persons that may occur from\n\u003e attempting to replicate the results shown here. Please exercise caution and\n\u003e good judgement when working with hardware.\n\n## Installation\n\n```bash\ngit clone https://github.com/mujocolab/g1_spinkick_example.git \u0026\u0026 cd g1_spinkick_example\nuv sync\n```\n\n## Data Conversion\n\nDownload the spin kick data using the link referenced in the MimicKit\n[installation instructions](https://github.com/xbpeng/MimicKit?tab=readme-ov-file#installation).\n\nThe conversion script adds smooth transitions from a safe standing pose at the\nstart and end of the motion to ensure safe deployment. Since the motion is\ncyclic, we also repeat it to reach the desired duration.\n\n```bash\n# Convert pkl to csv\nuv run pkl_to_csv.py \\\n    --pkl-file g1_spinkick.pkl \\\n    --csv-file g1_spinkick.csv \\\n    --duration 2.65 \\\n    --add-start-transition \\\n    --add-end-transition \\\n    --transition-duration 0.5 \\\n    --pad-duration 1.0\n\n# Convert csv to npz\nMUJOCO_GL=egl uv run -m mjlab.scripts.csv_to_npz \\\n    --input-file g1_spinkick.csv \\\n    --output-name mimickit_spinkick_safe \\\n    --input-fps 60 \\\n    --output-fps 50 \\\n    --render True\n```\n\nThis will upload the motion to your wandb registry and create a video showing\nthe reference motion like the one below:\n\n![spinkick reference](assets/motion.gif)\n\n## Training\n\nFollow the registry creation instructions in the mjlab\n[README](https://github.com/mujocolab/mjlab?tab=readme-ov-file#2-motion-imitation).\n\n```bash\nMUJOCO_GL=egl CUDA_VISIBLE_DEVICES=0 uv run train \\\n    Mjlab-Spinkick-Unitree-G1 \\\n    --registry-name {your-organization}/{registry-name}/mimickit_spinkick_safe \\\n    --env.scene.num-envs 4096 \\\n    --agent.max-iterations 20_000\n```\n\nFor full training details and reproducibility, see the\n[wandb report](https://api.wandb.ai/links/gcbc_researchers/nfi58457).\n\n## Evaluation\n\nTo evaluate your trained policy, you'll need your wandb run path. You can find\nthis in the run overview. It follows the format\n`{your-organization}/{project-name}/{run-id}`, where `run-id` is a unique\n8-character identifier.\n\nOnce you have your run path, evaluate the policy with:\n\n```bash\nuv run play \\\n    Mjlab-Spinkick-Unitree-G1 \\\n    --wandb-run-path {wandb-run-path} \\\n    --num-envs 8\n```\n\n## Deployment\n\nWe use\n[motion_tracking_controller](https://github.com/HybridRobotics/motion_tracking_controller)\nto deploy the trained policy. An ONNX file is provided for convenience, though\none will also be generated in your wandb artifacts. Download it and follow the\ninstructions in the motion_tracking_controller repo.\n\n### Alternative Implementation\n\nAn alternative option is available through\n[**RoboJuDo**](https://github.com/HansZ8/RoboJuDo), a lightweight deployment\nframework designed for **onboard execution** and flexible modular integration.\n\nRoboJuDo supports this mjlab example via the `BeyondmimicPolicy`, allowing\ndirect use of the provided configuration.\n\n\u003cdetails\u003e\n  \u003csummary\u003eA minimal configuration setup is shown below:\u003c/summary\u003e\n\n1. **Download** the ONNX model and place it in `assets/models/g1/beyondmimic`.\n\n2. **Edit** the `g1_beyondmimic` config in `robojudo/config/g1/g1_cfg.py` to set\n   policy name:\n\n```python\n@cfg_registry.register\nclass g1_beyondmimic(RlPipelineCfg):\n    robot: str = \"g1\"\n    env: G1MujocoEnvCfg = G1MujocoEnvCfg()\n    ctrl: list[KeyboardCtrlCfg] = [KeyboardCtrlCfg()]\n\n    policy: G1BeyondMimicPolicyCfg = G1BeyondMimicPolicyCfg(\n        policy_name=\"spinkick_safe\",\n        max_timestep=183,\n    )\n```\n\n3. For **real robot deployment**, you may use the `g1_locomimic_beyondmimic` or\n   `g1_locomimic_beyondmimic_real` config in\n   `robojudo/config/g1/g1_loco_mimic_cfg.py`, which includes smooth locomotion\n   interpolation.\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmujocolab%2Fg1_spinkick_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmujocolab%2Fg1_spinkick_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmujocolab%2Fg1_spinkick_example/lists"}