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

Adds event term for visual texture randomization #1642

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Mayankm96
Copy link
Contributor

Description

This MR adds a new event term that allows randomizing textures of bodies in an asset using the Replicator API. It is a basic implementation that needs the following improvements:

  • Support for other parameters provided by the replicator API
  • Triggering the omnigraph for a subset of environment indices

Type of change

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

Screenshots

An example configuration:

    object_panel_visual_texture = EventTerm(
        func=mdp.randomize_visual_texture,
        mode="scene",
        params={
            "asset_cfg": SceneEntityCfg("door", body_names=["door_panel"]),
            "texture_paths": [
                f"{NVIDIA_NUCLEUS_DIR}/Materials/Base/Wood/Bamboo_Planks/Bamboo_Planks_BaseColor.png",
                f"{NVIDIA_NUCLEUS_DIR}/Materials/Base/Wood/Cherry/Cherry_BaseColor.png",
                f"{NVIDIA_NUCLEUS_DIR}/Materials/Base/Wood/Oak/Oak_BaseColor.png",
                f"{NVIDIA_NUCLEUS_DIR}/Materials/Base/Wood/Timber/Timber_BaseColor.png",
                f"{NVIDIA_NUCLEUS_DIR}/Materials/Base/Wood/Timber_Cladding/Timber_Cladding_BaseColor.png",
                f"{NVIDIA_NUCLEUS_DIR}/Materials/Base/Wood/Walnut_Planks/Walnut_Planks_BaseColor.png",
            ],
            "event_name": "object_panel_visual_texture",
            "texture_rotation": (math.pi / 2, math.pi / 2),
        },
    )

image

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

@Mayankm96 Mayankm96 requested a review from jtigue-bdai January 7, 2025 21:42
@Mayankm96 Mayankm96 added the enhancement New feature or request label Jan 7, 2025
@Mayankm96 Mayankm96 self-assigned this Jan 7, 2025
@kellyguo11
Copy link
Contributor

Thanks for the addition! Do you also have an example script that we can include in the PR to help users get started with this feature? and looks like we need a pre-commit run :)

The function assumes that the asset follows the prim naming convention as:
"{asset_prim_path}/{body_name}/visuals" where the body name is the name of the body to
which the texture is applied. This is the default prim ordering when importing assets
from the asset converters in Isaac Lab.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this pattern still hold if a user imports a USD file. Or does everything after "{asset_prim_path}/...." just follow how the USD was setup?

Comment on lines +243 to +244
# note: This triggers the nodes for all the environments.
# We need to investigate how to make it happen only for a subset based on env_ids.
Copy link
Collaborator

Choose a reason for hiding this comment

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

should do a warning for this this behavior?

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.

4 participants