Skip to content

Replace RigidObjectSet with PerEnvironmentObject - #1420

Closed
cvolkcvolk wants to merge 3 commits into
cvolkcvolk/refactor/native-heterogeneous-spawningfrom
cvolkcvolk/refactor/per-environment-object-api
Closed

cvolkcvolk wants to merge 3 commits into
cvolkcvolk/refactor/native-heterogeneous-spawningfrom
cvolkcvolk/refactor/per-environment-object-api

Conversation

@cvolkcvolk

@cvolkcvolk cvolkcvolk commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Replace the Python RigidObjectSet API with PerEnvironmentObject and explicit assignment settings. Migrate Python environments, CLI options, and examples while preserving the existing object_sets YAML format.

Why this change?

RigidObjectSet represents one named scene object whose asset can differ between environments. PerEnvironmentObject makes that role explicit; assign_to_environments describes how its alternatives are distributed.

The native spawning and placement changes are in #1419. This PR changes the Python API on top of that runtime. The YAML and authoring migration follows in #1421.

What changes?

  • Keep Object for one concrete asset; use PerEnvironmentObject for rigid alternatives assigned across environments.
  • Replace random_choice with assign_to_environments="sequential" or "random". Sequential assignment repeats the declared order; random assignment samples each environment independently. Assignments stay fixed across resets.
  • Accept concrete Object instances or native spawn configurations. Copy member asset settings; configure the scene name, pose, and relations on the enclosing object.
  • Rename Python environment CLI options from --object_set to --object_variants.
  • Keep old YAML working through a small converter marked TODO(migration). It translates random_choice to the Python assignment setting until Add per-environment objects to YAML and authoring tools #1421.

The old Python class and constructor are removed without a compatibility alias.

Usage example

Before:

fruit = RigidObjectSet(
    name="fruit",
    objects=[banana, orange],
    random_choice=False,
)

After:

fruit = PerEnvironmentObject(
    name="fruit",
    objects=[banana, orange],
    assign_to_environments="sequential",
)

Both examples assign banana, orange, banana, orange across four environments. For the same banana in every environment, use banana directly.

Validation

After syncing with main (2cc9e9766f): all-files pre-commit passed on this branch. At stack tip #1421, 168 CPU-compatible replay, inference, schema, and GUI tests passed (5 live-service/subprocess cases deselected). GPU simulation checks could not start because the existing container lost CUDA access.

Earlier validation:

93 tests passed: 38 Python API/integration/assignment/old-YAML conversion checks, 49 schema/CLI checks, and 6 native/singleton export checks. pre-commit passed. Camera integration and the full test suite were not run.

Part 6/7 · Stack overview · Based on #1419 · Next: #1421

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

Copy link
Copy Markdown
Collaborator Author

Closing this draft because we are proceeding with Object plus AssetSelectionVariation in #1424 and #1425. That API supports both fixed assets and per-environment asset selection, so the separate PerEnvironmentObject class and rename are no longer needed. RigidObjectSet migration and deprecation remain follow-up work.

@cvolkcvolk cvolkcvolk closed this Oct 9, 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