Skip to content

Allows for custom TerrainGenerator without modifications of the TerrainImporter #2487

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

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

Conversation

pascal-roth
Copy link
Collaborator

@pascal-roth pascal-roth commented May 13, 2025

Description

Currently, the TerrainGenerator class is hardcoded in the TerrainImporter. This class resolves this issue and allows for custom implementations.

TODO: adjust changelog and versoning after review

Type of change

  • New feature (non-breaking change which adds functionality)

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

@pascal-roth pascal-roth requested a review from Mayankm96 as a code owner May 13, 2025 13:33
@pascal-roth pascal-roth self-assigned this May 13, 2025
@pascal-roth pascal-roth added the enhancement New feature or request label May 13, 2025
@@ -108,6 +113,8 @@ def __init__(self, cfg: TerrainGeneratorCfg, device: str = "cpu"):
self.device = device

# set common values to all sub-terrains config
from .height_field import HfTerrainBaseCfg # prevent circular import
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm how is the circular import happening? Is there a smarter way to avoid this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure because we do a instance checking of a configclass, this usually doesn't work. But open for suggestions

@pascal-roth pascal-roth requested a review from Mayankm96 May 15, 2025 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants