Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes infinite loop in repeated_objects_terrain: respawn only wrong object samples #1612

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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
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