{"id":24741209,"url":"https://github.com/hybridrobotics/diffuseloco","last_synced_at":"2025-10-10T09:31:54.471Z","repository":{"id":259153382,"uuid":"872195150","full_name":"HybridRobotics/DiffuseLoco","owner":"HybridRobotics","description":"Source code for the paper DiffuseLoco: Real-Time Legged Locomotion Control with Diffusion from Offline Datasets","archived":false,"fork":false,"pushed_at":"2025-04-14T03:18:19.000Z","size":16466,"stargazers_count":92,"open_issues_count":5,"forks_count":9,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-06-02T18:03:41.835Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://diffuselo.co","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HybridRobotics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-10-14T02:13:52.000Z","updated_at":"2025-05-26T02:59:15.000Z","dependencies_parsed_at":"2025-04-14T04:33:21.314Z","dependency_job_id":null,"html_url":"https://github.com/HybridRobotics/DiffuseLoco","commit_stats":null,"previous_names":["hybridrobotics/diffuseloco"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HybridRobotics/DiffuseLoco","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HybridRobotics%2FDiffuseLoco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HybridRobotics%2FDiffuseLoco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HybridRobotics%2FDiffuseLoco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HybridRobotics%2FDiffuseLoco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HybridRobotics","download_url":"https://codeload.github.com/HybridRobotics/DiffuseLoco/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HybridRobotics%2FDiffuseLoco/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003405,"owners_count":26083581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-01-27T23:49:36.210Z","updated_at":"2025-10-10T09:31:49.463Z","avatar_url":"https://github.com/HybridRobotics.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DiffuseLoco: Real-Time Legged Locomotion Control with Diffusion from Offline Datasets\n\nThis repository contains the source code for the paper:\n\n#### [DiffuseLoco: Real-Time Legged Locomotion Control with Diffusion from Offline Datasets](https://arxiv.org/abs/2404.19264)\nThe Conference on Robot Learning (CoRL), 2024\n\n[Paper](https://diffuselo.co/static/paper/DiffuseLoco.pdf) / [Project Page](https://diffuselo.co)\n\n\n## Codebase Structure\n\n1. Model Defination:\n ```diffusion_policy/diffusion_policy/model/diffusion/transformer_for_diffusion.py```\n\n2. Evaluation Script:\n```scripts/eval.py```\n\n3. Config File:\n```diffusion_policy/config_files/cyber_diffusion_policy_n=8.yaml```\n\n4. Environment for evaluation and source policy training:\n```legged_gym/envs/cyberdog2```\n\n5. Environment Wrapper (RHC, Delayed Inputs, Uniform Obs Space):\n ```diffusion_policy/diffusion_policy/env_runner/cyber_runner.py```\n\n6. Deploy on real robots (This section is not completed yet) :\n```legged_gym/legged_gym/scripts``` and\n```csrc``` and ```scripts/pytorch_save.py```\n\n\n## Getting Started\n\nFirst, create the conda environment:\n\n```bash\nconda create -n diffuseloco python=3.8\n```\n\nfollowed by \n\n```bash\nconda activate diffuseloco\n```\n\nInstall necessary system packages:\n\n```bash\nsudo apt install cmake\n```\n\nDownload [required files](https://osf.io/kxt9w/?view_only=8c4633eaf94e4feaa6a6c92ae37d657e) and place them in DiffuseLoco root folder. \n\nThen, install the python dependencies:\n\n```bash\ncd DiffuseLoco\n\npip install -r requirements.txt\n```\n\nInstall IsaacGym for simulation environment:\n\n\u003e Note: in the public repo, this should come from NVIDIA's official source. We provide a zip file for easier review purpose only. \n\n```bash\nunzip isaacgym.zip\n\ncd isaacgym/python\n\npip install -e .\n```\n\nFinally, install the package\n\n```bash\ncd ../..\n\nbash ./install.sh\n```\n\n## Evaluate Pre-trained Checkpoints\n\nBipedal Walking Task\n\n```bash\nsource env.sh\n\npython ./scripts/eval.py --checkpoint=./cyberdog_final.ckpt --task=cyber2_stand\n```\n\nHop Task\n\n```bash\nsource env.sh\n\npython ./scripts/eval.py --checkpoint=./cyberdog_final.ckpt --task=cyber2_hop\n```\n\nBounce Task\n\n```bash\nsource env.sh\n\npython ./scripts/eval.py --checkpoint=./cyberdog_final.ckpt --task=cyber2_bounce\n```\n\nWalk Task\n\nYou will be able to see the probabilistic policy executing both trotting and pacing in different envs given the same command\n\n```bash\nsource env.sh\n\npython ./scripts/eval.py --checkpoint=./cyberdog_final.ckpt --task=cyber2_walk\n```\n\n## Training\n\n```bash\nsource env.sh\n\npython scripts/train.py\n```\nCurrently dataset generation is still pending. \n\n## Compatibility\n\nThe codebase is tested on the following systems:\n\n### System 1\n\n- NVIDIA RTX 4060M\n- Ubuntu 20.04\n- NVIDIA driver version: 535 (535.129.03)\n- CUDA version: 12.1.1\n- cuDNN version: 8.9.7 for CUDA 12.X\n- TensorRT version: 8.6 GA\n\n### System 2\n\n- NVIDIA RTX 4070\n- Ubuntu 22.04\n- NVIDIA driver version: 550 (550.90.07)\n- CUDA version: 12.4\n- cuDNN version: 8.9.7 for CUDA 12.4\n- TensorRT version: 10.3.0.26 GA\n\n\n## Accelerating for Real-Time Deployment (Optional for Simulation Env)\n\nWe use [TensorRT](https://developer.nvidia.com/tensorrt) to accelerate the policy inference and meet the real-time requirement.\n\nBefore installation, verify that the latest CUDA and cuDNN are installed on the system.\n\nDownload the \"TensorRT 10.3 GA for Linux x86_64 and CUDA 12.0 to 12.5 TAR Package\" and the \"TensorRT 10.3 GA for Ubuntu 22.04 and CUDA 12.0 to 12.5 DEB local repo Package\" installation package.\n\nInstall with the following commands:\n\n```bash\ncd ~/Downloads/\nsudo dpkg -i ./nv-tensorrt-local-repo-ubuntu2204-10.3.0-cuda-12.5_1.0-1_amd64.deb\nsudo cp /var/nv-tensorrt-local-repo-ubuntu2204-10.3.0-cuda-12.5/nv-tensorrt-local-620E7D29-keyring.gpg /usr/share/keyrings/\nsudo apt update\nsudo apt install nv-tensorrt-local-repo-ubuntu2204-10.3.0-cuda-12.5\n```\n\nWe also need to link the libraries. Unpack the tar package:\n\n```bash\ncd ~/Downloads/\ntar xzvf ./TensorRT-10.3.0.26.Linux.x86_64-gnu.cuda-12.5.tar.gz\n```\n\nThen. move the unpacked directory to the installation path (here, we will use `$TRT_INSTALL_PATH`), and add the following lines to bashrc\n\n```bash\n# TensorRT\nexport TRT_LIBPATH=$TRT_INSTALL_PATH/targets/x86_64-linux-gnu/lib/\nexport LD_LIBRARY_PATH=$TRT_INSTALL_PATH/lib/:$TRT_LIBPATH:$LD_LIBRARY_PATH\n```\n\nFinally, install the Python binding using the following command\n\n```bash\ncd $TRT_INSTALL_PATH/python/\npip install ./tensorrt-10.3.0-cp38-none-linux_x86_64.whl\n```\n\n# Citing the Project\n\nIf you find this code useful, we would appreciate if you would cite it with the following:\n\n```\n@article{huang2024diffuseloco,\n  title={DiffuseLoco: Real-Time Legged Locomotion Control with Diffusion from Offline Datasets},\n  author={Huang, Xiaoyu and Chi, Yufeng and Wang, Ruofeng and Li, Zhongyu and Peng, Xue Bin and Shao, Sophia and Nikolic, Borivoje and Sreenath, Koushil},\n  journal={arXiv preprint arXiv:2404.19264},\n  year={2024}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhybridrobotics%2Fdiffuseloco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhybridrobotics%2Fdiffuseloco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhybridrobotics%2Fdiffuseloco/lists"}