Skip to content

Add fixed asset selection through variations - #1425

Closed
cvolkcvolk wants to merge 2 commits into
cvolkcvolk/refactor/object-asset-resolutionfrom
cvolkcvolk/feature/asset-selection-variation
Closed

cvolkcvolk wants to merge 2 commits into
cvolkcvolk/refactor/object-asset-resolutionfrom
cvolkcvolk/feature/asset-selection-variation

Conversation

@cvolkcvolk

@cvolkcvolk cvolkcvolk commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Add fixed asset selection through variations on a named Object. Separate reusable native asset settings from the scene object that tasks and placement refer to.

Why this change?

RigidObjectSet gives parallel environments different assets through a separate authoring path. Asset selection belongs alongside the other variations so experiments can enable it, configure sampling, and record the chosen asset for each episode.

Build on the Object refactor in #1424, stacked on #1419. That refactor shares geometry and assignment support through Object and defers task scene configuration. This change adds selection, sampling, and recording on that foundation.

What changes?

  • Add get_asset_definition() as a small adapter over existing rigid library constructors. It returns the registry name and a copy of the native spawn configuration. No new definition class or library migration is required.
  • Let Object receive a default through asset=..., or leave its asset unassigned until build time. The builder applies overrides and selection before placement. A missing asset is an error; the first candidate is never an implicit default.
  • Copy candidate definitions into the variation. Assign them in declaration order by default, with optional random sampling or one shared choice. Record each environment's candidate ID and keep assignments fixed across resets.
  • Keep Object independent of AssetSelectionVariation. The builder resolves selection, and the variation checks that its resolved source settings remain unchanged. Existing assignment validation checks the composed simulation configuration against placement.
  • Pass environment count and seed into build-time sampling. Preserve shared lighting/HDR sampling and per-environment runtime sampling through the common sample_per_environment setting.

The adapter transfers native spawn settings, including scale and spawn physics settings. Scene poses, relations, variations, subclass behavior, and enclosing asset configuration settings stay with the scene object. Existing library constructors remain available.

Custom variations must accept the optional VariationBuildContext argument in overridden build hooks. Custom runtime configs must set sample_per_environment=True; runtime preparation must not draw from the runtime sampler.

Selection replay, build manifests, YAML candidate authoring, and deprecation of RigidObjectSet remain future work. Enabled selection rejects recorded variation/placement replay, references into the selected target, and another enabled build-time variation on that target.

Usage example

Before:

pick_up_object = RigidObjectSet(
    name="pickup",
    objects=[CrackerBox(), SugarBox()],
)

After:

from isaaclab_arena.assets.object import Object
from isaaclab_arena.assets.registries import AssetRegistry
from isaaclab_arena.variations.asset_selection_variation import (
    AssetSelectionVariation,
    AssetSelectionVariationCfg,
)

asset_registry = AssetRegistry()
cracker_box_asset = asset_registry.get_asset_definition("cracker_box")
sugar_box_asset = asset_registry.get_asset_definition("sugar_box")

pick_up_object = Object(name="pickup")
pick_up_object.add_variation(
    AssetSelectionVariation(
        asset_candidates=[cracker_box_asset, sugar_box_asset],
        cfg=AssetSelectionVariationCfg(enabled=True),
    )
)

Both examples alternate candidates across environments under the scene name pickup. Episode records contain cracker_box or sugar_box under pickup.asset_selection. Another build requires fresh objects and variations.

For an ordinary object, use Object(name="pickup", asset=cracker_box_asset). Selection can also be attached to that object; when disabled, its default stays in use. Variations retain the existing disabled-by-default convention.

Validation

206 targeted tests passed across asset definition lookup, selection, native physics and cloning, resets, geometry, placement, scene export, object sets, and variation recording. This includes regressions that reject source settings changed during the final configuration callback or before scene export.

The all-assets registry smoke test failed because the container lacks pytetwild, an optional dependency needed to tetrahedralize its deformable cube. The remaining selected tests passed when continued separately. The full suite, camera phase, and subprocess phase were not rerun for this API revision.

All repository pre-commit checks passed. Tests used the existing per-process Isaac Sim fast-exit option, disabled telemetry, and one OpenBLAS thread. The design document separates the implemented Python API from the proposed replay format.

Signed-off-by: Clemens Volk <cvolk@nvidia.com>
Signed-off-by: Clemens Volk <cvolk@nvidia.com>
@cvolkcvolk

Copy link
Copy Markdown
Collaborator Author

Replaced by #1458, which adds AssetSelectionVariation with one asset per build, on top of #1467. Different objects per environment stay with RigidObjectSet; per-environment selection is deferred.

@cvolkcvolk cvolkcvolk closed this Oct 16, 2026
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.

1 participant