Skip to content

Commit 328854d

Browse files
committed
Revert feet_slide defensive slicing; simplify Digit asset_cfg
The feet_slide change in 07265de added `asset_cfg.body_ids[:contacts.shape[1]]` to work around an assumed Newton body-name duplication for closed-loop bodies. Verified empirically: USD has 2 bodies matching `.*_leg_toe_roll` on both backends; the regex does not over-match `.*_rod_roll` auxiliary joints. The slicing was unnecessary and crashed with the default `SceneEntityCfg('robot')` (where body_ids is `slice(None)`) — flagged by review bot. Fixes: - rewards.py: restore `body_lin_vel_w[:, asset_cfg.body_ids, :2]` - digit/rough_env_cfg.py: restore regex `body_names='.*_leg_toe_roll'` matching the sensor_cfg pattern; remove misleading comment. Tested: Digit PhysX 10-iter and Digit Newton 5-iter both run feet_slide without crashes.
1 parent fdd2cbd commit 328854d

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/config/digit/rough_env_cfg.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ class DigitRewards:
4949
weight=-0.25,
5050
params={
5151
"sensor_cfg": SceneEntityCfg("contact_forces", body_names=".*_leg_toe_roll"),
52-
# Use exact body names to avoid matching extra MuJoCo constraint bodies from ball-joint rods
53-
"asset_cfg": SceneEntityCfg("robot", body_names=["left_leg_toe_roll", "right_leg_toe_roll"]),
52+
"asset_cfg": SceneEntityCfg("robot", body_names=".*_leg_toe_roll"),
5453
},
5554
)
5655
dof_torques_l2 = RewardTermCfg(

source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/mdp/rewards.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ def feet_slide(env, sensor_cfg: SceneEntityCfg, asset_cfg: SceneEntityCfg = Scen
8484
)
8585
asset = env.scene[asset_cfg.name]
8686

87-
# Use sensor body count to slice asset velocities — ensures matching dimensions
88-
# even when Newton reports duplicate body entries for closed-loop constraints.
89-
body_vel = wp.to_torch(asset.data.body_lin_vel_w)[:, asset_cfg.body_ids[:contacts.shape[1]], :2]
87+
body_vel = wp.to_torch(asset.data.body_lin_vel_w)[:, asset_cfg.body_ids, :2]
9088
reward = torch.sum(body_vel.norm(dim=-1) * contacts, dim=1)
9189
return reward
9290

0 commit comments

Comments
 (0)