Skip to content

Commit 4c2e76e

Browse files
committed
Add thigh collision penalty for Go1
1 parent d866a1a commit 4c2e76e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/mjlab/tasks/velocity/config/go1/env_cfgs.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ def unitree_go1_rough_env_cfg(
220220
weight=-0.1,
221221
params={"sensor_name": shank_ground_cfg.name},
222222
)
223+
cfg.rewards["thigh_collision"] = RewardTermCfg(
224+
func=mdp.self_collision_cost,
225+
weight=-0.5,
226+
params={"sensor_name": thigh_ground_cfg.name},
227+
)
223228
cfg.rewards["trunk_head_collision"] = RewardTermCfg(
224229
func=mdp.self_collision_cost,
225230
weight=-0.1,
@@ -290,7 +295,12 @@ def unitree_go1_flat_env_cfg(play: bool = False) -> ManagerBasedRlEnvCfg:
290295
cfg.rewards["upright"].params.pop("terrain_sensor_names", None)
291296

292297
# Remove granular collision rewards (not useful on flat ground).
293-
for key in ("self_collisions", "shank_collision", "trunk_head_collision"):
298+
for key in (
299+
"self_collisions",
300+
"shank_collision",
301+
"thigh_collision",
302+
"trunk_head_collision",
303+
):
294304
cfg.rewards.pop(key, None)
295305

296306
# On flat terrain fell_over is sufficient; thigh contact implies fallen.

0 commit comments

Comments
 (0)