Skip to content

Commit 55fcbb0

Browse files
committed
fix shap issue
1 parent 22c9ce4 commit 55fcbb0

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

source/isaaclab/isaaclab/envs/mdp/events.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,12 @@ def reset_joints_by_scale(
10551055
joint_vel = joint_vel.clamp_(-joint_vel_limits, joint_vel_limits)
10561056

10571057
# set into the physics simulation
1058-
asset.write_joint_state_to_sim(joint_pos, joint_vel, env_ids=env_ids, joint_ids=asset_cfg.joint_ids)
1058+
asset.write_joint_state_to_sim(
1059+
joint_pos.view(len(env_ids), -1),
1060+
joint_vel.view(len(env_ids), -1),
1061+
env_ids=env_ids,
1062+
joint_ids=asset_cfg.joint_ids
1063+
)
10591064

10601065

10611066
def reset_joints_by_offset(
@@ -1089,7 +1094,12 @@ def reset_joints_by_offset(
10891094
joint_vel = joint_vel.clamp_(-joint_vel_limits, joint_vel_limits)
10901095

10911096
# set into the physics simulation
1092-
asset.write_joint_state_to_sim(joint_pos, joint_vel, env_ids=env_ids, joint_ids=asset_cfg.joint_ids)
1097+
asset.write_joint_state_to_sim(
1098+
joint_pos.view(len(env_ids), -1),
1099+
joint_vel.view(len(env_ids), -1),
1100+
env_ids=env_ids,
1101+
joint_ids=asset_cfg.joint_ids
1102+
)
10931103

10941104

10951105
def reset_nodal_state_uniform(

0 commit comments

Comments
 (0)