Skip to content

Conversation

@nicolaloi
Copy link
Contributor

Description

Currently, the repeated_objects_terrain function attempts to respawn all N required objects if even a single object lies within the central platform. However, the probability of successfully spawning all objects outside the central platform depends on the object density (i.e., the number of required objects relative to the terrain size) and the size of the central platform. For high object densities, this probability quickly approaches zero, causing the function to enter an infinite respawn loop.

This PR addresses the issue by respawning only the objects that lie within the central platform during each loop, while leaving objects outside the platform untouched. This leads to faster terrain generation and prevents the worst-case scenario of getting stuck in an infinite respawn loop when object density is high.

Type of change

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

Checklist

  • I have run the pre-commit checks 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

- speed-up the terrain generation and fixes an infinite respawn loop if the object density is large.
@nicolaloi nicolaloi changed the title Respawn only wrong object samples in repeated_objects_terrain Fix repeated_objects_terrain: respawn only wrong object samples Jan 2, 2025
@nicolaloi nicolaloi changed the title Fix repeated_objects_terrain: respawn only wrong object samples Fixes infinite loop in repeated_objects_terrain: respawn only wrong object samples Jan 3, 2025
@kellyguo11 kellyguo11 self-assigned this Jan 13, 2025
Signed-off-by: Nicola Loi <nicolaloi@outlook.com>
@kellyguo11 kellyguo11 merged commit 7ed94ce into isaac-sim:main Jan 20, 2025
5 checks passed
hapatel-bdai pushed a commit that referenced this pull request Jan 21, 2025
…bject samples (#1612)

# Description

Currently, the
[`repeated_objects_terrain`](https://github.com/isaac-sim/IsaacLab/blob/v1.4.0/source/extensions/omni.isaac.lab/omni/isaac/lab/terrains/trimesh/mesh_terrains.py#L721)
function attempts to respawn all *N* required objects if even a single
object lies within the central platform. However, the probability of
successfully spawning *all objects* outside the central platform depends
on the object density (i.e., the number of required objects relative to
the terrain size) and the size of the central platform. For high object
densities, this probability quickly approaches zero, causing the
function to enter an infinite respawn loop.

This PR addresses the issue by respawning only the objects that lie
within the central platform during each loop, while leaving objects
outside the platform untouched. This leads to faster terrain generation
and prevents the worst-case scenario of getting stuck in an infinite
respawn loop when object density is high.

## 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
- [x] 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: Nicola Loi <nicolaloi@outlook.com>
jtigue-bdai pushed a commit that referenced this pull request Apr 14, 2025
…bject samples (#1612)

Currently, the
[`repeated_objects_terrain`](https://github.com/isaac-sim/IsaacLab/blob/v1.4.0/source/extensions/omni.isaac.lab/omni/isaac/lab/terrains/trimesh/mesh_terrains.py#L721)
function attempts to respawn all *N* required objects if even a single
object lies within the central platform. However, the probability of
successfully spawning *all objects* outside the central platform depends
on the object density (i.e., the number of required objects relative to
the terrain size) and the size of the central platform. For high object
densities, this probability quickly approaches zero, causing the
function to enter an infinite respawn loop.

This PR addresses the issue by respawning only the objects that lie
within the central platform during each loop, while leaving objects
outside the platform untouched. This leads to faster terrain generation
and prevents the worst-case scenario of getting stuck in an infinite
respawn loop when object density is high.

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

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

- [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
- [x] 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: Nicola Loi <nicolaloi@outlook.com>
SevenFo pushed a commit to SevenFo/IsaacLab that referenced this pull request May 19, 2025
…bject samples (isaac-sim#1612)

# Description

Currently, the
[`repeated_objects_terrain`](https://github.com/isaac-sim/IsaacLab/blob/v1.4.0/source/extensions/omni.isaac.lab/omni/isaac/lab/terrains/trimesh/mesh_terrains.py#L721)
function attempts to respawn all *N* required objects if even a single
object lies within the central platform. However, the probability of
successfully spawning *all objects* outside the central platform depends
on the object density (i.e., the number of required objects relative to
the terrain size) and the size of the central platform. For high object
densities, this probability quickly approaches zero, causing the
function to enter an infinite respawn loop.

This PR addresses the issue by respawning only the objects that lie
within the central platform during each loop, while leaving objects
outside the platform untouched. This leads to faster terrain generation
and prevents the worst-case scenario of getting stuck in an infinite
respawn loop when object density is high.

## 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
- [x] 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: Nicola Loi <nicolaloi@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants