Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ae998ea
Fix IndexError in reset_joints_by_scale and reset_joints_by_offset
Creampelt Jul 15, 2025
d704b57
Update CONTRIBUTORS.md, CHANGELOG, and extension.toml
Creampelt Jul 15, 2025
220131c
Merge branch 'main' into fix/reset_joints_index_error
Creampelt Jul 16, 2025
bfa65ef
Merge branch 'main' into fix/reset_joints_index_error
kellyguo11 Jul 24, 2025
68f8fd5
Update CHANGELOG.rst
Creampelt Jul 26, 2025
b6b7004
Apply suggestions from code review
Creampelt Jul 26, 2025
bae6441
Merge branch 'main' into fix/reset_joints_index_error
Creampelt Jul 26, 2025
017d3da
Merge branch 'main' into fix/reset_joints_index_error
kellyguo11 Jul 29, 2025
1524f09
Merge branch 'main' into fix/reset_joints_index_error
kellyguo11 Jul 29, 2025
856b698
Update extension.toml
kellyguo11 Jul 29, 2025
f981b27
Merge branch 'main' into fix/reset_joints_index_error
kellyguo11 Jul 30, 2025
1b6d25f
Merge branch 'main' into fix/reset_joints_index_error
kellyguo11 Jul 30, 2025
2f72d05
Merge branch 'main' into fix/reset_joints_index_error
kellyguo11 Jul 30, 2025
425ecbf
Improve performance if asset_cfg.joint_ids is a slice
Creampelt Aug 6, 2025
3ae79b5
Merge branch 'main' into fix/reset_joints_index_error
Creampelt Aug 6, 2025
9133350
Merge branch 'main' into fix/reset_joints_index_error
Creampelt Aug 12, 2025
8079ace
Merge branch 'main' into fix/reset_joints_index_error
ooctipus Aug 13, 2025
134c616
Merge branch 'main' into fix/reset_joints_index_error
ooctipus Aug 14, 2025
5752bf6
Update CHANGELOG.rst
ooctipus Aug 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Guidelines for modifications:
* David Yang
* Dhananjay Shendre
* Dorsa Rohani
* Emily Sturman
* Fabian Jenelten
* Felipe Mohr
* Felix Yu
Expand Down
10 changes: 10 additions & 0 deletions source/isaaclab/docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Changelog
---------

0.44.12 (2025-08-12)
~~~~~~~~~~~~~~~~~~~

Fixed
^^^^^

* Fixed IndexError in :meth:`isaaclab.envs.mdp.events.reset_joints_by_scale`,
:meth:`isaaclab.envs.mdp.events.reset_joints_by_offsets` by adding dimension to env_ids when indexing.


0.44.11 (2025-08-11)
~~~~~~~~~~~~~~~~~~~

Expand Down
43 changes: 23 additions & 20 deletions source/isaaclab/isaaclab/envs/mdp/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,28 +1041,30 @@ def reset_joints_by_scale(
"""
# extract the used quantities (to enable type-hinting)
asset: Articulation = env.scene[asset_cfg.name]

# cast env_ids to allow broadcasting
if asset_cfg.joint_ids != slice(None):
iter_env_ids = env_ids[:, None]
else:
iter_env_ids = env_ids

# get default joint state
joint_pos = asset.data.default_joint_pos[env_ids, asset_cfg.joint_ids].clone()
joint_vel = asset.data.default_joint_vel[env_ids, asset_cfg.joint_ids].clone()
joint_pos = asset.data.default_joint_pos[iter_env_ids, asset_cfg.joint_ids].clone()
joint_vel = asset.data.default_joint_vel[iter_env_ids, asset_cfg.joint_ids].clone()

# scale these values randomly
joint_pos *= math_utils.sample_uniform(*position_range, joint_pos.shape, joint_pos.device)
joint_vel *= math_utils.sample_uniform(*velocity_range, joint_vel.shape, joint_vel.device)

# clamp joint pos to limits
joint_pos_limits = asset.data.soft_joint_pos_limits[env_ids, asset_cfg.joint_ids]
joint_pos_limits = asset.data.soft_joint_pos_limits[iter_env_ids, asset_cfg.joint_ids]
joint_pos = joint_pos.clamp_(joint_pos_limits[..., 0], joint_pos_limits[..., 1])
# clamp joint vel to limits
joint_vel_limits = asset.data.soft_joint_vel_limits[env_ids, asset_cfg.joint_ids]
joint_vel_limits = asset.data.soft_joint_vel_limits[iter_env_ids, asset_cfg.joint_ids]
joint_vel = joint_vel.clamp_(-joint_vel_limits, joint_vel_limits)

# set into the physics simulation
asset.write_joint_state_to_sim(
joint_pos.view(len(env_ids), -1),
joint_vel.view(len(env_ids), -1),
env_ids=env_ids,
joint_ids=asset_cfg.joint_ids,
)
asset.write_joint_state_to_sim(joint_pos, joint_vel, joint_ids=asset_cfg.joint_ids, env_ids=env_ids)


def reset_joints_by_offset(
Expand All @@ -1080,28 +1082,29 @@ def reset_joints_by_offset(
# extract the used quantities (to enable type-hinting)
asset: Articulation = env.scene[asset_cfg.name]

# cast env_ids to allow broadcasting
if asset_cfg.joint_ids != slice(None):
iter_env_ids = env_ids[:, None]
else:
iter_env_ids = env_ids

# get default joint state
joint_pos = asset.data.default_joint_pos[env_ids, asset_cfg.joint_ids].clone()
joint_vel = asset.data.default_joint_vel[env_ids, asset_cfg.joint_ids].clone()
joint_pos = asset.data.default_joint_pos[iter_env_ids, asset_cfg.joint_ids].clone()
joint_vel = asset.data.default_joint_vel[iter_env_ids, asset_cfg.joint_ids].clone()

# bias these values randomly
joint_pos += math_utils.sample_uniform(*position_range, joint_pos.shape, joint_pos.device)
joint_vel += math_utils.sample_uniform(*velocity_range, joint_vel.shape, joint_vel.device)

# clamp joint pos to limits
joint_pos_limits = asset.data.soft_joint_pos_limits[env_ids, asset_cfg.joint_ids]
joint_pos_limits = asset.data.soft_joint_pos_limits[iter_env_ids, asset_cfg.joint_ids]
joint_pos = joint_pos.clamp_(joint_pos_limits[..., 0], joint_pos_limits[..., 1])
# clamp joint vel to limits
joint_vel_limits = asset.data.soft_joint_vel_limits[env_ids, asset_cfg.joint_ids]
joint_vel_limits = asset.data.soft_joint_vel_limits[iter_env_ids, asset_cfg.joint_ids]
joint_vel = joint_vel.clamp_(-joint_vel_limits, joint_vel_limits)

# set into the physics simulation
asset.write_joint_state_to_sim(
joint_pos.view(len(env_ids), -1),
joint_vel.view(len(env_ids), -1),
env_ids=env_ids,
joint_ids=asset_cfg.joint_ids,
)
asset.write_joint_state_to_sim(joint_pos, joint_vel, joint_ids=asset_cfg.joint_ids, env_ids=env_ids)


def reset_nodal_state_uniform(
Expand Down