• Stars
    star
    275
  • Rank 149,216 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 3 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Deep RL for MPC control of Quadruped Robot Locomotion

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

Installation

  1. Clone this repository

    git clone [email protected]:silvery107/rl-mpc-locomotion.git
    git submodule update --init

    Or use the --recurse option to clone submodules at the same time.

  2. Create the conda environment:

    conda env create -f environment.yml
  3. Install the python binding of the MPC solver:

    pip install -e .

Quick Start

  1. Play the MPC controller on Aliengo:

    python RL_MPC_Locomotion.py --robot=Aliengo

    All supported robot types are Go1, A1 and Aliengo.

    Note that you need to plug in your Xbox-like gamepad to control it, or pass --disable-gamepad. The controller mode is default to Fsm (Finite State Machine), and you can also try Min for 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

  2. Train a new policy: Set bridge_MPC_to_RL to True in <MPC_Controller/Parameters.py>

    cd RL_Environment
    python train.py task=Aliengo headless=False

    Press the v key to disable viewer updates, and press again to resume. Set headless=True to train without rendering.

    Tensorboard support is available, run tensorboard --logdir runs.

  3. Load a pretrained checkpoint:

    python train.py task=Aliengo checkpoint=runs/Aliengo/nn/Aliengo.pth test=True num_envs=4

    Set test=False to continue training.

  4. Run the pretrained weight-policy for MPC controller on Aliengo: Set bridge_MPC_to_RL to False in <MPC_Controller/Parameters.py>

    python RL_MPC_Locomotion.py --robot=Aliengo --mode=Policy --checkpoint=path/to/ckpt

    If no checkpoint is given, it will load the default runs/{robot}/nn/{robot}.pth

Roadmaps

User Notes

Gallery

More Repositories

1

wheeled-bipedal-jumping

Height Control and Optimal Torque Planning for Jumping with Wheeled-Bipedal Robots
Python
36
star
2

monorec-slam

Dynamic Object Removing SLAM using MonoRec
Python
33
star
3

fast-inerf

Single-Image to Camera Pose with iNeRF and PoseCNN
Python
14
star
4

motion-planning-practice

Fast Python motion planning algorithm implementations with demos in pybullet
Python
12
star
5

ME336-Yellow-Team-Project

Waste Sorting with Robot Arm Tossing
Jupyter Notebook
10
star
6

auto-docking-vessels

Webots simulation environment and a vision-based autonomous docking algorithm for robotic vessels with a novel latching system.
Python
9
star
7

nmt-multi30k-pytorch

Neural Machine Translation with Transformer on Multi30K
Python
8
star
8

vision-line-follower

Vision Line Follower
C
7
star
9

bayesian-opt-gpytorch

Bayesian Optimization for MPPI Control of Robot Arm Planar Pushing
Python
4
star
10

segway-locomotion-stm32

C
4
star
11

hci-gesture-control

A gesture recognition HCI system based on OpenCV.
C++
4
star
12

ND-agjunction-webots

C
4
star
13

fast-photo-mosaic

Python
3
star
14

flappy-bird-pid-gui

Flappy Bird Controller with GUI in MATLAB
MATLAB
3
star
15

gtsam-pose-slam-practice

Pratice and example to solve the pose graph SLAM problem using GTSAM
Python
3
star
16

silvery107

Profile Readme
3
star
17

racetrack-lane-following-control

Autonomous driving on Turtlebot3 with bird's-eye-view and ArUco pose estimation.
Python
3
star
18

silvery-botlab-f22

Botlab for ROB 550 @ UMich Robotics
C
3
star
19

ee346-capstone-control

Autonomous Navigation and Lane Following with TurtleBot3
Python
2
star
20

aris-xyz-platform

C++
2
star
21

silvery-armlab-f22

Armlab for ROB 550 @ UMich Robotics
Python
2
star
22

EE346-Lab6

Python
1
star
23

gatech-computer-vision

Jupyter Notebook
1
star