A robotics simulation framework for legged robots built on IsaacLab & CusRL, focusing on legged robot control using Deep Reinforcement Learning.
- Python 3.10
- CUDA-capable GPU (recommended)
git clone --recurse-submodules https://github.com/legnAray/CusLab.git
# If already cloned, initialize submodules
git submodule update --init --recursivecd third_party/IsaacLabthen follow the official Isaac Lab v2.1.0 installation guide.
pip install -e .
# Optional: Install development dependencies
pip install -e ".[dev]"pre-commit installpython scripts/list_envs.py# 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 joystickTo export a trained model, run:
python scripts/cusrl_cli/export.py --task b2_base --load_run path/to/your_experimentUpon completion, a folder containing actor.onnx and actor.yml will be generated in the exported/ directory.
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
- actoractor.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.1Once configured, you can perform Sim2Sim or Sim2Real verification using StepIt Sim and StepIt.
The project uses some code from the following open-source code repositories: