Skip to content

osudrl/quadruped_locomotion

Repository files navigation

🧠 DRAIL Framework

Example Videos

Whole-body locomotion on flat ground

Walking on Flat ground

Whole-body control

Terrain locomotion

Stairs and steps

Slopes and Rough

Failure

Fall down

Sim-to-Real on Unitree Go2

Hardware walking

Hardware whole-body

🚀 Get Started

📁 Directory Structure

drail_extensions/
├── .vscode/                     # VSCode run configurations
│   ├── launch.core.json
│   ├── ...                      # Add your own run configs here in your own branch
├── drail_extensions/            # [Extension folders]
│   ├── core/                    # Verified, stable extension folder. Treat as the "main branch".
│   ├── ...
drail_learning/                  # [Learning Algorithms]
├── rsl_rl/                      # Default rsl_rl repo (v2.3.0)
├── rsl_rl_drail/                # Our own modifications/extensions to rsl_rl
├── point_cloud_encoders/        # Point cloud code
├── ...                          # ...

⚙️ Codebase Setup

Git LFS We use Git LFS to handle larger asset files like the `.usd` model files and pretrained `.pt` files
  1. Install Git LFS (if not already installed):
    See Github docs for installation instructions
  2. Initialize Git LFS in the repo:
    git lfs install
  3. Do Git LFS pull with:
    git lfs pull
Set up Conda environment
  1. Run the setup script:

    ./setup_conda_env.sh

    You’ll be prompted to name your environment.

  2. Activate it:

    conda activate <your_conda_env>
Activate Launch Configuration

We use VSCode-style launch.json files to organize runnable tasks per extension folder (e.g., launch.research_ashton.json).

  1. Link a launch configuration (e.g., for research_ashton):

    ./activate_launch.sh research_ashton
  2. You can now view and run scripts using the Run tab in VSCode. Alternatively, inspect .vscode/launch.json directly to see the tasks and their arguments.


▶️ Example Runs

Play an Existing Policy

Option 1: Using VSCode

  • Open the Run tab.
  • Select:
    Python: Play ashton Go2 Velocity SpotRew
    

Option 2: Using CLI

./run_launch_config.sh "Python: Play ashton Go2 Velocity SpotRew"

⏳ The first run may take a while before the GUI appears.

Train a Policy

Option 1: Using VSCode

  • Select:
    Python: Train ashton Go2 Velocity SpotRew
    

Option 2: Using CLI

./run_launch_config.sh "Python: Train ashton Go2 Velocity SpotRew"

🔑 Ensure your WANDB_USERNAME and your W&B API key is set in the environment. Make sure to change wandb_entity parameter in the rsl_rl_*.py file before starting the training. By default its left empty.


🧪 Development Workflow

Each user typically develops in their own personal branch (e.g., research/charlie). You should then make your own extension folder under drail_extensions/drail_extensions/ (eg. research_charlie). This allows experimentation without affecting the core extension folders. Merging the develop branch into your branch should then always happen without merge conflicts.

You will mainly inherit configs from core and modify/use them in your own research folder. If you want to make changes to core, you should do so through a PR. Likewise, if you want to use something from another user's branch, you are encouraged to have them first merge it into core, then you merge the updated core into your branch, and then inherit whatever you need.

Create a New Extension Folder
  1. Create your folder:

    drail_extensions/drail_extensions/research_charlie
    
  2. Add a corresponding launch config:

    .vscode/launch.research_charlie.json
    
  3. Reuse and extend code from core wherever possible via inheritance or import.

Install a New Learning Algorithm (If necessary)
  1. If your task requires installing new learning algorithm, add it as a module under drail_learning/, e.g., drail_learning/my_algorithm.

  2. Install it with:

    pip install -e drail_learning/my_algorithm

🔍 Exploring the Codebase

This repo builds on top of IsaacLab and rsl_rl. To understand the code structure:

  • Explore how MDPs, tasks, and environments are registered.
  • Refer to IsaacLab documentation for background.
  • Once familiar, extending this repo becomes much easier.

🙏 Acknowledgements and Notes

  • A large portion of the directory structure and setup was borrowed from rr-isaac repository.
  • This repository is work in progress, Currently built on top of Isaaclab 2.0 and rsl_rl (version here)
  • drail_extensions will hold all the data, tasks and script definitions.
  • drail_learning will hold the core learning algorithms.
  • drail_extensions/core will hold the core scripts for training and evaluation. This can be thought of as the stable branch. Once any part of the core is verified as stable, it will be marked frozen and must not be updated, unless to fix bugs or add new features in a backward compatible manner.
  • The repository will support manager based environments for all checkpoints and direct based environments for only major checkpoints.
    • Next major checkpoint is Full MHC on Go2 robot.

About

Whole-body RL locomotion for Quadruped

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors