Unverified Commit 403daeab authored by Xinpeng Liu's avatar Xinpeng Liu Committed by GitHub

Broadcasts environment ids inside `mdp.randomize_rigid_body_com` (#3164)

# Description

<!--
Thank you for your interest in sending a pull request. Please make sure
to check the contribution guidelines.

Link:
https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html
-->

In function `isaaclab.envs.mdp.events.randomize_rigid_body_com`, the
random CoM values were sampled with respect to `env_ids`, but when added
to the bodies' current CoMs, `env_ids` is omitted, resulting in
potential shape mismatch error if `len(env_ids) <> env.scene.num_envs`.


<!-- As a practice, it is recommended to open an issue to have
discussions on the proposed pull request.
This makes it easier for the community to keep track of what is being
developed or added, and if a given feature
is demanded by more than one party. -->

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------
Signed-off-by: 's avatarXinpeng Liu <43176336+Foruck@users.noreply.github.com>
Co-authored-by: 's avatarooctipus <zhengyuz@nvidia.com>
parent 5b7ac7b7
......@@ -127,6 +127,7 @@ Guidelines for modifications:
* Vladimir Fokow
* Wei Yang
* Xavier Nal
* Xinpeng Liu
* Yang Jin
* Yanzi Zhu
* Yijie Guo
......
[package]
# Note: Semantic Versioning is used: https://semver.org/
version = "0.45.4"
version = "0.45.6"
# Description
title = "Isaac Lab framework for Robot Learning"
......
Changelog
---------
0.45.6 (2025-08-22)
~~~~~~~~~~~~~~~~~~~~
Fixed
^^^^^
* Fixed :meth:`~isaaclab.envs.mdp.events.randomize_rigid_body_com` to broadcasts the environment ids.
0.45.5 (2025-08-21)
~~~~~~~~~~~~~~~~~~~~
Fixed
^^^^^
......@@ -11,6 +24,7 @@ Fixed
* Fixed :meth:`~isaaclab.assets.Articulation.write_joint_viscous_friction_coefficient_to_sim` to set the friction coefficients in the simulation.
0.45.4 (2025-08-21)
~~~~~~~~~~~~~~~~~~~~
......
......@@ -418,7 +418,7 @@ def randomize_rigid_body_com(
coms = asset.root_physx_view.get_coms().clone()
# Randomize the com in range
coms[:, body_ids, :3] += rand_samples
coms[env_ids[:, None], body_ids, :3] += rand_samples
# Set the new coms
asset.root_physx_view.set_coms(coms, env_ids)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment