rl-mpc-locomotion
Deep RL for MPC control of Quadruped Robot Locomotion
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.2%) to scientific vocabulary
Keywords
Repository
Deep RL for MPC control of Quadruped Robot Locomotion
Basic Info
- Host: GitHub
- Owner: silvery107
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://docs.google.com/presentation/d/18bznpYrkCPnhCisySPDz18hvL3Ytere7JiJEbdLvpgU/edit?usp=sharing
- Size: 147 MB
Statistics
- Stars: 741
- Watchers: 4
- Forks: 79
- Open Issues: 3
- Releases: 0
Topics
Metadata Files
README.md
RL MPC Locomotion
This repo aims to provide a fast simulation and RL training framework for a quadruped locomotion task by dynamically predicting the weight parameters of a MPC controller. The control framework is a hierarchical controller composed of a higher-level policy network and a lower-level model predictive controller.
The MPC controller refers to Cheetah Software but written in python, and it completely opens the interface between sensor data and motor commands, so that the controller can be easily ported to any mainstream simulators.
The RL training utilizes the NVIDIA Isaac Gym in parallel using Unitree Robotics Aliengo model, and transferring it from simulation to reality on a real Aliengo robot (sim2real is not included in this codebase).
Frameworks

Dependencies
- Python - 3.8
- PyTorch - 1.10.0 with CUDA 11.3
- Isaac Gym - Preview 4 <!-- - OSQP - 0.6.2 -->
Installation
- Clone this repository
bash git clone git@github.com:silvery107/rl-mpc-locomotion.git - Initialize submodules
bash git submodule update --initOr use the--recurseoption in step 1 to clone submodules at the same time. - Create the conda environment:
bash conda env create -f environment.yml - Install
rsl_rlat commit 2ad79cf under<extern>folderbash cd extern/rsl_rl pip install -e . - Compile python binding of the MPC solver:
bash pip install -e .
Quick Start
Play the MPC controller on Aliengo:
bash python RL_MPC_Locomotion.py --robot=AliengoAll supported robot types areGo1,A1andAliengo.Note that you need to plug in your Xbox-like gamepad to control it, or pass
--disable-gamepad. The controller mode is default toFsm(Finite State Machine), and you can also tryMinfor the minimum MPC controller without FSM.
- Gamepad keymap
> Press `LB` to switch gait types between `Trot`, `Walk` and `Bound`.
> Press `RB` to switch FSM states between `Locomotion` and `Recovery Stand`
Train a new policy:
bash cd RL_Environment python train.py task=Aliengo headless=FalsePress thevkey to disable viewer updates, and press again to resume. Setheadless=Trueto train without rendering.Tensorboard support is available, run
tensorboard --logdir runs.Load a pretrained checkpoint:
bash python train.py task=Aliengo checkpoint=runs/Aliengo/nn/Aliengo.pth test=True num_envs=4Settest=Falseto continue training.Run the pretrained weight-policy for MPC controller on Aliengo: Set
bridge_MPC_to_RLtoFalsein<MPC_Controller/Parameters.py>bash python RL_MPC_Locomotion.py --robot=Aliengo --mode=Policy --checkpoint=path/to/ckptIf nocheckpointis given, it will load the latest run.
Roadmap

- [x] MPC Controller
- Quadruped,
- RobotRunner ->

- [x] RL Environment
- Gamepad Reader,
- Simulation Utils,
- Weight Policy,
- Train ->
User Notes
- Setup a Simulation in Isaac Gym
- Install MIT Cheetah Software
- OSQP, qpOASES and CVXOPT Solver Instructions
- Development Logs
Gallery
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - family-names: "Zhuang" given-names: "Yulun" - family-names: "Zhang" given-names: "Wei" title: "rl-mpc-locomotion" version: 1.0.0 date-released: 2022-7-15 url: "https://github.com/silvery107/rl-mpc-locomotion"
GitHub Events
Total
- Issues event: 32
- Watch event: 351
- Issue comment event: 66
- Push event: 2
- Pull request event: 1
- Fork event: 37
Last Year
- Issues event: 32
- Watch event: 351
- Issue comment event: 66
- Push event: 2
- Pull request event: 1
- Fork event: 37
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 9
- Total pull requests: 1
- Average time to close issues: 25 days
- Average time to close pull requests: 3 minutes
- Total issue authors: 9
- Total pull request authors: 1
- Average comments per issue: 2.67
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 9
- Pull requests: 1
- Average time to close issues: 25 days
- Average time to close pull requests: 3 minutes
- Issue authors: 9
- Pull request authors: 1
- Average comments per issue: 2.67
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- silvery107 (7)
- heartInsert (3)
- zhagao380 (3)
- MaRuiXiang1201 (2)
- chendayuxixi (2)
- lingengrou (1)
- zhshubs (1)
- MacQWER (1)
- mengchongxi (1)
- Simease (1)
- jingdaliang (1)
- lk-greenbird (1)
- Seas00n (1)
- ltf1001 (1)
- jiangtaohu1206 (1)
Pull Request Authors
- silvery107 (2)