Skip to content

Commit 3b6d615

Browse files
shendredmMayankm96
andauthored
Fixes shape mismatch in body COM randomization (#2561)
# 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 --> Shape mismatched for randomised sample values in randomize_rigid_body_com in `events.py.` Fixes #2557 <!-- 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) for #2557 ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] 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 <!-- As you go through the checklist above, you can mark something as done by putting an x character in it For example, - [x] I have done this task - [ ] I have not done this task --> --------- Signed-off-by: Dhananjay M Shendre <shendredm1999@gmail.com> Signed-off-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com> Signed-off-by: DJ <shendredm1999@gmail.com> Co-authored-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com>
1 parent a1e81cc commit 3b6d615

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,7 @@ def randomize_rigid_body_com(
380380
# sample random CoM values
381381
range_list = [com_range.get(key, (0.0, 0.0)) for key in ["x", "y", "z"]]
382382
ranges = torch.tensor(range_list, device="cpu")
383-
rand_samples = math_utils.sample_uniform(
384-
ranges[:, 0], ranges[:, 1], (len(env_ids), len(body_ids), 3), device="cpu"
385-
).unsqueeze(1)
383+
rand_samples = math_utils.sample_uniform(ranges[:, 0], ranges[:, 1], (len(env_ids), 3), device="cpu").unsqueeze(1)
386384

387385
# get the current com of the bodies (num_assets, num_bodies)
388386
coms = asset.root_physx_view.get_coms().clone()

0 commit comments

Comments
 (0)