Skip to content

legnAray/CusLab

Repository files navigation

CusLab: Direct IsaacLab Workflow using CusRL

A robotics simulation framework for legged robots built on IsaacLab & CusRL, focusing on legged robot control using Deep Reinforcement Learning.

📋 Requirements

  • Python 3.10
  • CUDA-capable GPU (recommended)

🛠️ Installation

1. Clone the Repository

git clone --recurse-submodules https://github.com/legnAray/CusLab.git

# If already cloned, initialize submodules
git submodule update --init --recursive

2. Install Isaac Lab v2.1.0 (submodule)

cd third_party/IsaacLab

then follow the official Isaac Lab v2.1.0 installation guide.

4. Install CusLab

pip install -e .

# Optional: Install development dependencies
pip install -e ".[dev]"

5. Setup Pre-commit Hooks

pre-commit install

🏃 Quick Start

List Available Environments

python scripts/list_envs.py

Training with CusRL

# Train a policy
python scripts/cusrl_cli/train.py --task b2_base --run_name your_experiment --headless

# Play with a trained model
python scripts/cusrl_cli/play.py --task b2_base --num_envs 1 --load_run path/to/your_experiment --controller joystick

🚀 Export and Deployment

Export the Policy

To export a trained model, run:

python scripts/cusrl_cli/export.py --task b2_base --load_run path/to/your_experiment

Upon completion, a folder containing actor.onnx and actor.yml will be generated in the exported/ directory.

Configuration for StepIt

To prepare for deployment, please follow the requirements of StepIt by modifying and adding necessary configuration files. Below is a standard example:

policy.yml

control_freq: 50
actuator:
  type: position
  Kp: 30.0
  Kd: 0.5
  scale: [1,1,1,1,1,1,1,1,1,1,1,1]
  bias:  [0,0,0,0,0,0,0,0,0,0,0,0]
action_mean: [0.0, 0.7, -1.5, 0.0, 0.7, -1.5, 0.0, 0.7, -1.5, 0.0, 0.7, -1.5]
module:
  - cmd_vel
  - action_history
  - actor

actor.yml

input_field:
  observation:
    - { name: ang_vel,    size: 3  }
    - { name: gravity,    size: 3  }
    - { name: cmd_vel,    size: 3  }
    - { name: joint_pos,  size: 12 }
    - { name: joint_vel,  size: 12 }
    - { name: action_p1,  size: 12 }
output_field:
  - { name: action, size: 12 }

cmd_vel.yml

velocity_scale_factor: [1.5, 0.5, 1.5]
velocity_turbo_factor: [0.0, 0.0, 0.0]
velocity_deadzone: 0.1

Once configured, you can perform Sim2Sim or Sim2Real verification using StepIt Sim and StepIt.

🤝 Acknowledgements

The project uses some code from the following open-source code repositories:

About

Direct IsaacLab Workflow using CusRL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages