Repository navigation
Prevents randomizing mass to zero or less - #4060
Merged
kellyguo11 merged 5 commits intoDec 11, 2025
Merged
kellyguo11 merged 5 commits into
kellyguo11 merged 5 commits into
Conversation
Contributor
Greptile OverviewGreptile SummaryAdded a single line of code to clamp randomized rigid body masses to a minimum value of 1e-6 kg in the Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant randomize_rigid_body_mass
participant _randomize_prop_by_op
participant PhysX
User->>randomize_rigid_body_mass: Call with mass_distribution_params
randomize_rigid_body_mass->>PhysX: Get current masses
randomize_rigid_body_mass->>randomize_rigid_body_mass: Reset to default_mass
randomize_rigid_body_mass->>_randomize_prop_by_op: Apply randomization (add/scale/abs)
_randomize_prop_by_op-->>randomize_rigid_body_mass: Return randomized masses
randomize_rigid_body_mass->>randomize_rigid_body_mass: Clamp masses to min=1e-6
Note over randomize_rigid_body_mass: Prevents zero/negative masses
randomize_rigid_body_mass->>PhysX: Set masses
alt recompute_inertia=True
randomize_rigid_body_mass->>randomize_rigid_body_mass: Calculate mass ratios
randomize_rigid_body_mass->>randomize_rigid_body_mass: Scale inertia tensors
randomize_rigid_body_mass->>PhysX: Set inertias
end
|
Mayankm96
reviewed
Nov 23, 2025
| @@ -360,6 +360,7 @@ def __call__( | |||
| masses = _randomize_prop_by_op( | |||
| masses, mass_distribution_params, env_ids, body_ids, operation=operation, distribution=distribution | |||
| ) | |||
| masses = torch.clamp(masses, min=1e-6) # ensure masses are positive | |||
Contributor
There was a problem hiding this comment.
Maybe good to have as an arg?
jtigue-bdai
force-pushed
the
jat/fix/prevent_randomizing_mass_negative
branch
from
December 1, 2025 19:01
28f9c7c to
5b44405
Compare
kellyguo11
approved these changes
Dec 11, 2025
Signed-off-by: Kelly Guo <[email protected]>
T-K-233
pushed a commit
to ucb-bar/IsaacLab
that referenced
this pull request
Dec 29, 2025
# Description This PR prevents users from accidentally randomizing the mass of rigid body to small and negative by clamping at 1e-6 kg. Fixes isaac-sim#518 ## 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 - [ ] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [ ] I have made corresponding changes to the documentation - [ ] 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 - [ ] 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: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]>
Edify0991
pushed a commit
to Edify0991/IsaacLab
that referenced
this pull request
Jan 14, 2026
# Description This PR prevents users from accidentally randomizing the mass of rigid body to small and negative by clamping at 1e-6 kg. Fixes isaac-sim#518 ## 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 - [ ] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [ ] I have made corresponding changes to the documentation - [ ] 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 - [ ] 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: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]>
nitesh-subedi
pushed a commit
to nitesh-subedi/IsaacLab
that referenced
this pull request
Feb 5, 2026
# Description This PR prevents users from accidentally randomizing the mass of rigid body to small and negative by clamping at 1e-6 kg. Fixes isaac-sim#518 ## 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 - [ ] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [ ] I have made corresponding changes to the documentation - [ ] 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 - [ ] 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: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]>
csj-275
pushed a commit
to csj-275/IsaacLab
that referenced
this pull request
Jul 8, 2026
# Description This PR prevents users from accidentally randomizing the mass of rigid body to small and negative by clamping at 1e-6 kg. Fixes isaac-sim#518 ## 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 - [ ] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [ ] I have made corresponding changes to the documentation - [ ] 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 - [ ] 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: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR prevents users from accidentally randomizing the mass of rigid body to small and negative by clamping at 1e-6 kg.
Fixes #518
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there