Skip to content

[Feature]: Dynamic morph variant loading for heterogeneous entity #2531

@Milotrince

Description

@Milotrince

What feature or enhancement are you proposing?

Support loading different morphs for a heterogeneous entity after the scene is built.

Currently:

Variant Assignment Rules:
    When passing a list of morphs to scene.add_entity(), variants are distributed
    across environments using the following rules:

    1. When n_envs >= n_variants:
       Balanced block assignment. Environments are divided into blocks, with each
       block assigned to one variant. For example, with 4 variants and 8 environments:
       - Environments 0-1 -> Variant 0
       - Environments 2-3 -> Variant 1
       - Environments 4-5 -> Variant 2
       - Environments 6-7 -> Variant 3

    2. When n_envs < n_variants:
       Each environment i gets variant i (0-indexed). Variants beyond n_envs are
       unused. For example, with 4 variants and 2 environments:
       - Environment 0 -> Variant 0 (first morph in list)
       - Environment 1 -> Variant 1 (second morph in list)
       - Variants 2 and 3 are unused

Desiderata:

The same as above, and
    2. When n_envs < n_variants:
       All variants are preloaded. *Initially*, variants beyond n_envs are unused.
       Calling a function entity.load_morph_variants(variants_idx, envs_idx) makes it active.

Motivation

Want to be able to sample from many different objects (N) while training with num_envs < N. Currently, heterogeneous entity assigns a different obj per environment on build, so cannot load more kinds of objects than there are num_envs

Potential Benefit

Allow for training with larger datasets of objects, like https://arxiv.org/pdf/2504.05287 (which uses RaiSim which is cpu based)

What is the expected outcome of the implementation work?

  • A function on entity, e.g. entity.load_morph_variants(variants_idx, envs_idx), which allows for changing the active morph.
  • If needed, a new options on entity, enable_variant_loading
  • Preprocessed geoms are stored as file in .cache

Additional information

Isaac sim multi asset spawning: https://isaac-sim.github.io/IsaacLab/main/source/how-to/multi_asset_spawning.html -- see Rigid Object Collections

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions