Repository navigation
Warn when in-order asset selection skips names - #1520
Draft
cvolkcvolk wants to merge 16 commits into
Draft
cvolkcvolk wants to merge 16 commits into
cvolkcvolk wants to merge 16 commits into
Conversation
In-order asset selection spawns one name per rebuild, so with fewer rebuilds than names the later names never spawn, and nothing tells the user. The Experiment Runner now prints a warning once per Run that names the names no rebuild reaches. Replayed Runs, which spawn the recorded names, do not warn. Moved out of #1458 to keep that PR focused on the selection itself. Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
#1458 moved random_choice into AssetSelectionSamplerCfg, so the warning reads variation.cfg.sampler_cfg.random_choice and names that path in its message. Signed-off-by: Clemens Volk <[email protected]>
cvolkcvolk
added a commit
that referenced
this pull request
Oct 26, 2026
Add a disabled `asset_selection` variation to every rigid `Object`, so an Experiment Run can spawn a different registered asset in each rebuild. To support it, build the task contact sensors and the default task description after the selection, so they match the selected asset, and name the `pick_and_place_maple_table` objects `pick_up_object` and `destination_location`, so their variation keys stay the same whichever asset they spawn. ## Why this change? Lighting, HDR maps, camera poses and object mass are variations: an experiment turns them on, the seed decides their values, every episode row records them, and recorded variation replay repeats them. The pick-up object is not. An environment fixes it in code or with an option such as `pick_up_object`, so comparing objects takes one Run per object, and the object is not seeded, recorded or replayed like the variations. `RigidObjectSet` varies objects across the environments of one build, but it does not record which object an environment got, and `supports_recorded_placement()` turns off placement recording for a build that contains one. ## What changes? - Every rigid `Object` except a `RigidObjectSet` gets a disabled `asset_selection` variation, a `RigidAssetSelectionVariation`. When enabled, each build spawns one of its `registry_names` in all environments. Rebuild k takes the k-th name, using `SequentialSampler` from #1517, or a random one with `sampler_cfg.random_choice: true`. A name listed twice is selected more often. Each build checks every name but constructs only the selected one. - The selection runs before placement, so placement and the task's contact sensors use the selected asset. Episode rows record the name, and recorded variation replay spawns it again. A replay record with placement samples must include the value of every enabled build-time variation that sets the new `changes_object_geometry` flag, which `RigidAssetSelectionVariation` does. - The selected name becomes the object's `registry_name`, and the default descriptions of `PickAndPlaceTask` and `AssemblyTask` name it. - `Scene.validate_simulation_cfg()` runs the check of the asset a selection spawns, through the new `Asset.get_spawned_asset()`. A selected Newton-only gear fails a PhysX build, and a declared gear that selects a PhysX asset passes one. - The Experiment Runner passes the rebuild index to `ArenaEnvBuilder`. A warning for in-order selections with fewer rebuilds than names follows in #1520. - The `swap_objects` Run of `getting_started_experiment.yaml` selects its pick-up object from a list, one per build, and the variations docs cover it in the build-time explanation and the table of variations. Breaking changes: - `PickAndPlaceTask`, `ObjectInTask` and `SortMultiObjectTask` build their contact sensors in `get_scene_cfg()`. `scene_config`, `make_scene_cfg()` and `SortMultiObjectTask.pick_up_object_contact_sensor_list` are removed. - `PickAndPlaceTask.task_description` and `AssemblyTask.task_description` hold only a description passed to the constructor. Call `get_task_description()` for the generated one. - The `pick_and_place_maple_table` object names change, and with them their variation keys, scene entity names and placement keys. Variation overrides, replay files and HDF5 demos recorded on main with the old names need the new ones. - Variations that override `configure_at_build_time(seed, variation_key)` must also accept `rebuild_index`, because `ArenaEnvBuilder` now passes it. Limitations: - Only the spawn configuration, the simulation check and `registry_name` change. The object keeps its declared class's `scale`, `spawn_cfg_addon` and other methods. - An unknown name, or one whose class declares another object type, fails in the first build. A name the physics backend cannot simulate, or one whose type is known only after construction, such as an embodiment, fails when a rebuild selects it. - Outside the Experiment Runner, for example in `record_demos.py`, every build is rebuild 0, so in-order selection spawns the first name. - The descriptions of `GearInsertionTask` and `PlaceUprightTask` still name the declared asset, and a `SimReadyUsdObject` is described as `simready_usd_object`. - Metrics cover all selected objects together. Group episode rows by `pick_up_object.asset_selection` for per-object results. - A hand-written `language_instruction` applies to every rebuild. - A `bounding_box` override fails the build when the selection is enabled. - An `ObjectReference` into a selected object still reads the declared asset's `usd_path`. ## Usage example Before, one Run per object: ```yaml runs: rubiks_cube: environment: type: pick_and_place_maple_table pick_up_object: rubiks_cube_hot3d_robolab mustard_bottle: environment: type: pick_and_place_maple_table pick_up_object: mustard_bottle_hot3d_robolab ``` The object is set outside the variation system, so: - the seed, the episode rows' `variations` and recorded variation replay do not cover it; - objects cannot be drawn from a list, in order or at random; - every object needs its own Run. After, one Run that spawns another object in each rebuild (the `swap_objects` Run of `getting_started_experiment.yaml`, which takes the rest of the environment from `shared`): ```yaml runs: swap_objects: environment: destination_location: wooden_bowl_hot3d_robolab num_rebuilds: 3 rollout_limit: num_episodes: 3 variations: pick_up_object.asset_selection.enabled: true pick_up_object.asset_selection.registry_names: [mustard_bottle_hot3d_robolab, orange_01_fruits_veggies_robolab, rubiks_cube_hot3d_robolab] ``` Set `pick_up_object.asset_selection.sampler_cfg.random_choice: true` to draw a name at random in each build instead. ## Validation - On ce7302e, the getting-started Experiment loading tests pass in the local container. On d8596bf, so did the selection tests that run without simulation and `test_recorded_variation_samples.py`. - On d3623d0, the plain Python tests pass in the local container: the selection tests that run without simulation, `test_run_execution.py`, `test_recorded_variation_samples.py` and `test_variation_base.py`. - On 3588692, before the merge of main, 102 related tests pass in the local container, including the Experiment Runner rebuild and replay subprocess tests. The asset selection example experiment of that commit records the three objects in order over rebuilds 0 to 2. - The simulation tests cannot run locally after the merge of main: the local Docker image predates #1481, and Isaac Lab 3.0 fails to import with its warp 1.16.0. CI runs the full suite. --------- Signed-off-by: Clemens Volk <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warn once per Run when an in-order asset selection lists more registry names than the Run has rebuilds, and name the ones that never spawn.
Why this change?
In-order asset selection (#1458) spawns one name per rebuild. With fewer rebuilds than names, the names after the last rebuild never spawn, and nothing tells the user.
What changes?
sampler_cfg.random_choice: trueand replayed Runs do not warn.Validation
pre-commitpasses on the changed files.test_run_execution.pypasses in the local container (27 tests), run on the same files before they moved out of Make an object's asset a repeatable variation #1458.