Skip to content

Commit 0de3114

Browse files
committed
fix: complete reward config injection for all algos and add verification tests
- Fix APPO: pass env_cfg_override and sim_backend through runner → worker → registry.make - Fix MultiGPU offpolicy: add missing env_cfg_override to collector_kwargs - Fix offpolicy play mode: extract and pass env_cfg_override - Fix MLX PPO: add reward extraction in both train and play paths - Add reward: default to PPO and MLX PPO config defaults - Add sim_backend to APPO config - Add PPO reward configs for Go1/Go2/G1 × mujoco/motrix (5 new files) - Add PPO task reward overrides for all 3 locomotion robots - Add 67 config system verification tests covering Hydra composition, reward injection end-to-end, YAML↔dataclass consistency, and extraction logic
1 parent 9cbda2a commit 0de3114

19 files changed

Lines changed: 686 additions & 8 deletions

‎README.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,13 @@ UniLab 支持两种仿真后端:
133133

134134
```bash
135135
# 训练
136+
uv run python scripts/train_rsl_rl.py task=go1_joystick
137+
138+
# 指定motrix后端
136139
uv run python scripts/train_rsl_rl.py task=go1_joystick training.sim_backend=motrix
137140

138141
# 回放(交互式可视化)
139-
uv run python scripts/train_rsl_rl.py task=go1_joystick training.sim_backend=motrix training.play_only=true
142+
uv run python scripts/train_rsl_rl.py task=go1_joystick training.play_only=true
140143
```
141144

142145
## 训练与回放指南

‎conf/appo/config.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ training:
5050
device: null
5151
collector_device: null
5252
logger: tensorboard
53+
sim_backend: mujoco
5354
log_dir: null
5455
play_only: false
5556
no_play: false

‎conf/ppo/config.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
defaults:
22
- _self_
3+
- reward: default
34
- task: go1_joystick
45

56
algo:

‎conf/ppo/config_mlx.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
defaults:
22
- _self_
3+
- reward: default
34
- task: go1_joystick
45

56
algo:

‎conf/ppo/reward/g1_ppo_motrix.yaml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# @package _global_
2+
reward:
3+
scales:
4+
tracking_lin_vel: 2.4
5+
tracking_ang_vel: 0.3
6+
feet_phase: 1.2
7+
lin_vel_z: -1.2
8+
ang_vel_xy: -0.3
9+
base_height: -600.0
10+
orientation: -6.0
11+
action_rate: -0.012
12+
pose: -0.12
13+
tracking_sigma: 0.25
14+
gait_frequency: 1.5
15+
feet_phase_swing_height: 0.09
16+
feet_phase_tracking_sigma: 0.008
17+
base_height_target: 0.754
18+
min_base_height: 0.55
19+
max_tilt_deg: 25.0

‎conf/ppo/reward/g1_ppo_mujoco.yaml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# @package _global_
2+
reward:
3+
scales:
4+
tracking_lin_vel: 2.0
5+
tracking_ang_vel: 0.2
6+
feet_phase: 1.0
7+
lin_vel_z: -1.0
8+
ang_vel_xy: -0.25
9+
base_height: -500.0
10+
orientation: -5.0
11+
action_rate: -0.01
12+
pose: -0.1
13+
tracking_sigma: 0.25
14+
gait_frequency: 1.5
15+
feet_phase_swing_height: 0.09
16+
feet_phase_tracking_sigma: 0.008
17+
base_height_target: 0.754
18+
min_base_height: 0.55
19+
max_tilt_deg: 25.0
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# @package _global_
2+
reward:
3+
scales:
4+
tracking_lin_vel: 1.2
5+
tracking_ang_vel: 0.3
6+
lin_vel_z: -6.0
7+
ang_vel_xy: -0.15
8+
base_height: -120.0
9+
action_rate: -0.006
10+
similar_to_default: -0.12
11+
contact: 0.28
12+
tracking_sigma: 0.25
13+
base_height_target: 0.3
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# @package _global_
2+
reward:
3+
scales:
4+
tracking_lin_vel: 1.2
5+
tracking_ang_vel: 0.3
6+
lin_vel_z: -6.0
7+
ang_vel_xy: -0.03
8+
base_height: -120.0
9+
action_rate: -0.006
10+
similar_to_default: -0.12
11+
alive: 0.0
12+
foot_lift_reward: 0.24
13+
foot_drag_penalty: -0.0
14+
tracking_sigma: 0.25
15+
base_height_target: 0.3
16+
target_foot_height: 0.08
17+
foot_clearance_sigma: 0.02
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# @package _global_
2+
reward:
3+
scales:
4+
tracking_lin_vel: 1.0
5+
tracking_ang_vel: 0.2
6+
lin_vel_z: -5.0
7+
ang_vel_xy: -0.02
8+
base_height: -100.0
9+
action_rate: -0.005
10+
similar_to_default: -0.1
11+
alive: 0.0
12+
foot_lift_reward: 0.2
13+
foot_drag_penalty: -0.0
14+
tracking_sigma: 0.25
15+
base_height_target: 0.3
16+
target_foot_height: 0.08
17+
foot_clearance_sigma: 0.02

‎conf/ppo/task/g1_joystick.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# @package _global_
2+
defaults:
3+
- override /reward: g1_ppo_mujoco
4+
25
training:
36
task_name: G1JoystickFlatTerrain
47
algo:

0 commit comments

Comments
 (0)