Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- reinforcement-learning
|
| 4 |
+
- robotics
|
| 5 |
+
- locomotion
|
| 6 |
+
- unitree
|
| 7 |
+
- go2
|
| 8 |
+
- mujoco
|
| 9 |
+
- ppo
|
| 10 |
+
library_name: rsl-rl
|
| 11 |
+
license: bsd-3-clause
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# Unitree Go2 — Velocity Flat (PPO)
|
| 15 |
+
|
| 16 |
+
RL locomotion policy for the [Unitree Go2](https://www.unitree.com/go2/) quadruped robot, trained on flat terrain using PPO.
|
| 17 |
+
|
| 18 |
+
## Training
|
| 19 |
+
|
| 20 |
+
- **Framework**: [unitree_rl_mjlab](https://github.com/unitreerobotics/unitree_rl_mjlab) (MuJoCo Warp)
|
| 21 |
+
- **Task**: `Mjlab-Velocity-Flat-Unitree-Go2`
|
| 22 |
+
- **Algorithm**: PPO (RSL-RL)
|
| 23 |
+
- **Hardware**: 10× NVIDIA RTX A4000, 56 CPU cores
|
| 24 |
+
- **Environments**: 8192 parallel
|
| 25 |
+
- **Training time**: ~18 minutes (506 iterations)
|
| 26 |
+
|
| 27 |
+
## Results
|
| 28 |
+
|
| 29 |
+
| Metric | Value |
|
| 30 |
+
|---|---|
|
| 31 |
+
| Mean reward | **52.9** |
|
| 32 |
+
| Mean episode length | **1000** (max, no falls) |
|
| 33 |
+
| Steps/sec | 628K-738K |
|
| 34 |
+
|
| 35 |
+
## Files
|
| 36 |
+
|
| 37 |
+
| File | Description |
|
| 38 |
+
|---|---|
|
| 39 |
+
| `policy.onnx` + `policy.onnx.data` | ONNX model for deployment (go2_ctrl) |
|
| 40 |
+
| `model_500.pt` | Final PyTorch checkpoint (best for fine-tuning) |
|
| 41 |
+
| `model_0.pt` ... `model_400.pt` | Intermediate checkpoints every 100 steps |
|
| 42 |
+
| `params/env.yaml` | Environment configuration |
|
| 43 |
+
| `params/agent.yaml` | Agent/PPO configuration |
|
| 44 |
+
| `events.out.tfevents.*` | TensorBoard training logs |
|
| 45 |
+
|
| 46 |
+
## Usage
|
| 47 |
+
|
| 48 |
+
### Deploy in MuJoCo simulator
|
| 49 |
+
|
| 50 |
+
```bash
|
| 51 |
+
# Copy ONNX model
|
| 52 |
+
cp policy.onnx policy.onnx.data \
|
| 53 |
+
unitree_rl_mjlab/deploy/robots/go2/config/policy/velocity/v0/exported/
|
| 54 |
+
|
| 55 |
+
# Run simulator + controller
|
| 56 |
+
cd unitree_mujoco/simulate/build && ./unitree_mujoco
|
| 57 |
+
cd unitree_rl_mjlab/deploy/robots/go2/build && ./go2_ctrl --network=lo
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
### Fine-tune on rough terrain
|
| 61 |
+
|
| 62 |
+
```bash
|
| 63 |
+
# Place model_500.pt in logs/rsl_rl/go2_velocity/<run_name>/
|
| 64 |
+
python scripts/train.py Mjlab-Velocity-Rough-Unitree-Go2 \
|
| 65 |
+
--agent.resume=True \
|
| 66 |
+
--agent.load-run="<run_name>" \
|
| 67 |
+
--agent.load-checkpoint="model_500.pt" \
|
| 68 |
+
--agent.algorithm.learning-rate=1e-4
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
## Known Issues
|
| 72 |
+
|
| 73 |
+
The upstream `unitree_rl_mjlab` has bugs that crash multi-GPU training on rough terrain — see [Issue #9](https://github.com/unitreerobotics/unitree_rl_mjlab/issues/9) and [PR #8](https://github.com/unitreerobotics/unitree_rl_mjlab/pull/8).
|