Git Product home page Git Product logo

rl-mpc-locomotion's Introduction

RL MPC Locomotion

This repo is aim to provide a fast simulation and RL training platform for quadrupad locomotion. The control framework is a hierarchical controller composed of an higher-level policy network and a lower-level model predictive controller (MPC).

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 mainstream simulators like MuJoCo.

The RL training is carried out in the NVDIA Isaac Gym in parallel using Unitree Robotics Aliengo model, and transferring it from simulation to reality on a real Aliengo robot.

Frameworks

Dependencies

Be sure you have Isaac Gym Benchmark Environments installed after Isaac Gym.

Installation

  1. Clone this repository

    git clone https://github.com/silvery107/rl-mpc-locomotion.git
    git submodule init

    Or use --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 --robot=Aliengo

    All supported robot types are Aliengo, A1 and Mini_Cheetah. Note that by default you need to plug in your Xbox-like gamepad to control it.

    • Gamepad keymap

      Press LB to switch gait types between Trot, Fly Tort, Gallop, Walk and Pace.

      Press RB to switch FSM states between Locomotion and Recovery Stand

  2. Train a new policy:

    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 avaliable, run tensorboard --logdir runs.

  3. Load a trained 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 trained weight-policy for MPC controller on Aliengo:

    python RL_MPC_Locomotion --robot=Aliengo --mode=Policy

    By default the controller mode is Fsm, and you can also try Min for the minimum MPC controller (without FSM).

Roadmaps

User Notes

Gallery

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.