Add English README with intro, usage, and training data link
Browse files
README.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- reinforcement-learning
|
| 5 |
+
- robotics
|
| 6 |
+
- quadruped
|
| 7 |
+
- manipulation
|
| 8 |
+
- recovery
|
| 9 |
+
- isaac-lab
|
| 10 |
+
- ppo
|
| 11 |
+
- rsl-rl
|
| 12 |
+
library_name: rsl-rl
|
| 13 |
+
pipeline_tag: reinforcement-learning
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Go2+Z1 Standup Recovery Policy (RL, full 18-DOF)
|
| 17 |
+
|
| 18 |
+
PPO policy that lets the **Unitree Go2 + Z1** composite robot recover from arbitrary fallen poses by using its **legs and Z1 arm together as a self-righting kinematic chain**, then automatically folds the Z1 back to the carry pose once the trunk is upright.
|
| 19 |
+
|
| 20 |
+
## Behaviour
|
| 21 |
+
|
| 22 |
+
1. Reset spawns the robot at `trunk_z = 0.18 m` with random orientation (full quaternion sampled by `reset_root_state_with_random_orientation`)
|
| 23 |
+
2. Policy commands all 18 joints (12 leg + 6 arm) for up to 5 s
|
| 24 |
+
3. Reward favours: trunk lifted, projected gravity aligned with -Z, Z1 close to its `Z1_FOLDED_DEFAULT` pose, sparse +10 success bonus when all three are satisfied
|
| 25 |
+
4. Episode ends if `trunk_z < 0.05 m` (collapsed) or time-out
|
| 26 |
+
|
| 27 |
+
## Highlights
|
| 28 |
+
|
| 29 |
+
- 4096 parallel envs × 3000 PPO iters
|
| 30 |
+
- Mean reward climbs from 0.6 (random) → 89+ (final)
|
| 31 |
+
- `standup_success` sparse bonus reaches 8.6 / episode (≈86 % of timesteps satisfy the success criterion)
|
| 32 |
+
- `trunk_collapsed` termination rate ≈ 0 — robot does not give up
|
| 33 |
+
|
| 34 |
+
## Architecture
|
| 35 |
+
|
| 36 |
+
Same rsl-rl actor-critic shape as our walking policies (3-layer MLP 512-256-128 ELU). Action dim = 18.
|
| 37 |
+
|
| 38 |
+
## Reward composition
|
| 39 |
+
|
| 40 |
+
```python
|
| 41 |
+
trunk_height_reward weight +5.0 # clamp(z / 0.32, 0, 1)
|
| 42 |
+
upright_alignment weight +3.0 # clamp(-projected_gravity_b[2], 0, 1)
|
| 43 |
+
z1_fold weight +2.0 # exp(-||z1_pos - Z1_FOLDED_DEFAULT||)
|
| 44 |
+
standup_success (sparse) weight +10.0 # 1 if z>0.28 ∧ upright>0.92 ∧ fold_err<0.3
|
| 45 |
+
action_rate_l2 weight -0.005
|
| 46 |
+
joint_acc_l2 weight -2.5e-7
|
| 47 |
+
joint_torques_l2 weight -1e-5
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
## Files
|
| 51 |
+
|
| 52 |
+
- `standup_v1.pt` — rsl-rl `OnPolicyRunner` checkpoint
|
| 53 |
+
|
| 54 |
+
## Usage
|
| 55 |
+
|
| 56 |
+
```python
|
| 57 |
+
import torch, torch.nn as nn
|
| 58 |
+
|
| 59 |
+
state = torch.load("standup_v1.pt", map_location="cuda:0", weights_only=False)
|
| 60 |
+
sd = state["actor_state_dict"]
|
| 61 |
+
h, obs_dim = sd["mlp.0.weight"].shape[0], sd["mlp.0.weight"].shape[1]
|
| 62 |
+
act_dim = sd["mlp.6.weight"].shape[0] # 18 for full-body recovery
|
| 63 |
+
actor = nn.Sequential(
|
| 64 |
+
nn.Linear(obs_dim, h), nn.ELU(),
|
| 65 |
+
nn.Linear(h, h), nn.ELU(),
|
| 66 |
+
nn.Linear(h, h), nn.ELU(),
|
| 67 |
+
nn.Linear(h, act_dim),
|
| 68 |
+
).cuda().eval()
|
| 69 |
+
actor.load_state_dict({k.replace("mlp.", ""): v for k, v in sd.items() if k.startswith("mlp.")})
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
For a full integration example (drop fallen robot into warehouse, run standup, verify Z1 auto-folds), see [`stage4_joint_eval/standup_recovery.py`](https://github.com/aws300/go2_z1_warehouse/blob/main/go2_z1_warehouse/stage4_joint_eval/standup_recovery.py).
|
| 73 |
+
|
| 74 |
+
## Training data
|
| 75 |
+
|
| 76 |
+
On-policy RL — no offline dataset. The Isaac Lab task is registered as `Isaac-Standup-Go2Z1-v0` and lives at:
|
| 77 |
+
|
| 78 |
+
- Repo: <https://github.com/aws300/go2_z1_warehouse>
|
| 79 |
+
- Task config: `go2_z1_warehouse/stage5_standup/standup_env_cfg.py`
|
| 80 |
+
- Training launcher: `go2_z1_warehouse/stage5_standup/train_launcher.py`
|
| 81 |
+
|
| 82 |
+
## Citation
|
| 83 |
+
|
| 84 |
+
```bibtex
|
| 85 |
+
@misc{go2z1-standup-v1,
|
| 86 |
+
title = {Go2+Z1 Standup Recovery Policy (RL, full 18-DOF)},
|
| 87 |
+
author = {m3},
|
| 88 |
+
year = {2026},
|
| 89 |
+
url = {https://huggingface.co/m3/go2z1-standup-rl-v1}
|
| 90 |
+
}
|
| 91 |
+
```
|