Skip to content

Add open-top object containment predicate - #979

Open
cvolkcvolk wants to merge 5 commits into
mainfrom
cvolk/fix/object-in-container-predicate
Open

Add open-top object containment predicate#979
cvolkcvolk wants to merge 5 commits into
mainfrom
cvolk/fix/object-in-container-predicate

Conversation

@cvolkcvolk

@cvolkcvolk cvolkcvolk commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Prevent false-positive object placements

Detailed description

  • Why: Contact plus low velocity could previously report success while a pickup was touching the outside or side of its destination.
  • Geometry: Require the pickup bounding-box centroid inside the destination-local horizontal bounds and above its bottom while leaving the top open.
  • Support: Require filtered destination contact to point upward within a configurable cone and the pickup linear speed to remain below its threshold.
  • Impact: Pick-and-place and sorting now use the stricter success criterion, including rotated references and per-environment object-set bounds.

@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds open-top containment semantics to pick-and-place and sorting success predicates.

  • Assigns per-environment object-set variants before relation solving so runtime predicates can use matching cached bounds.
  • Preserves Arena asset identity through copied manager configurations with lightweight asset handles.
  • Requires the pickup bounding-box centroid to lie within destination-local horizontal bounds and above its bottom.
  • Requires destination-filtered contact force to provide upward support within a configurable cone while the object remains below the velocity threshold.
  • Adds predicate coverage and updates sorting simulations for the new containment behavior.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete correctness or security failures identified in the changed paths.

The new predicate consistently combines per-environment bounds, destination-local centroid containment, filtered upward support, and velocity checks, while task configurations provide the required asset identities and tests cover the principal geometry and force cases.

Important Files Changed

Filename Overview
isaaclab_arena/environments/arena_env_builder.py Assigns object-set variants before relation solving and scene configuration materialization.
isaaclab_arena/tasks/predicates/predicate_utils.py Adds identity-preserving Arena asset handles and world-pose resolution for registered and nested assets.
isaaclab_arena/tasks/predicates/spatial.py Implements open-top centroid containment, upward-support filtering, and the composed destination predicate.
isaaclab_arena/tasks/pick_and_place_task.py Wires asset handles and configurable support-cone behavior into standard and Mimic success predicates.
isaaclab_arena/tasks/sorting_task.py Supplies per-object and per-destination asset handles to multi-object sorting success evaluation.
isaaclab_arena/tests/test_object_in_container_predicate.py Covers copied asset handles, transformed containment bounds, support-force cones, and combined success conditions.
isaaclab_arena/tests/test_sorting_task.py Updates simulated object poses and quaternion ordering to exercise containment inside destination bounds.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Assign per-environment asset variants] --> B[Read matching cached bounds]
  B --> C[Transform pickup centroid into destination-local frame]
  C --> D{Inside X/Y and above bottom?}
  E[Destination-filtered contact forces] --> F{Upward force within support cone?}
  G[Pickup linear velocity] --> H{Below threshold?}
  D --> I[Containment success]
  F --> I
  H --> I
Loading

Reviews (1): Last reviewed commit: "Add open-top object containment predicat..." | Re-trigger Greptile

@cvolkcvolk
cvolkcvolk force-pushed the cvolk/fix/object-in-container-predicate branch from d8917bd to 993b4bd Compare July 30, 2026 12:19
@cvolkcvolk
cvolkcvolk changed the base branch from main to cvolk/feature/environment-runner July 30, 2026 12:20
Comment thread isaaclab_arena/tasks/predicates/predicate_utils.py Outdated


@dataclass(frozen=True, slots=True, repr=False)
class ArenaAssetHandle:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 ArenaAssetHandle smuggles a live asset through config copies

This wrapper exists only to hold a live PlaceableAsset in a termination term's params and defeat deepcopy so the asset's cached bounds/variants survive config copying. Predicates elsewhere reference scene entities by name (SceneEntityCfg) and resolve them from env.scene at eval time, keeping params as plain data.

Is there a way to resolve the Arena asset (and its bounds) by name from the env/scene at eval time instead, so the term params stay plain data? If holding the object by identity is genuinely required, a short NOTE explaining why it must survive deepcopy would help the next reader.

Comment thread isaaclab_arena/tasks/predicates/spatial.py Outdated
@arena-review-bot

Copy link
Copy Markdown
Contributor

🤖 Isaac Lab-Arena Review Bot

Summary

This PR replaces the old contact+velocity object_on_destination success check with an open-top containment predicate: the pickup object's bounding-box centroid must sit inside the destination's local X/Y and lower-Z bounds, filtered contact must push upward within a configurable support cone, and linear velocity must be low. The geometry is well factored and the new test_object_in_container_predicate covers the centroid transform, the ObjectReference parent-frame case, the support cone, and the combined predicate. Comments below are design questions, not blockers.

Note this changes the success criteria for all pick-and-place and sorting tasks (that is the point of the PR, and the sorting test was updated accordingly) — worth a heads-up for downstream eval baselines.

Findings

🟡 predicate_utils.py:75 — asset-type branching via getattr. get_asset_pose_w accepts a PlaceableAsset then switches on subtype with getattr(asset, "object_type"/"parent_asset"/"initial_pose_relative_to_parent", None) (repeated in spatial._get_bounding_box_pose_w). These are known names the asset classes own — capability detection for a missing interface. A polymorphic get_pose_w(env) on the asset types would move this logic to its owner and drop the getattr switching.

🔵 predicate_utils.py:24ArenaAssetHandle smuggles a live asset through config deepcopy. The wrapper only exists to keep a live PlaceableAsset in a term's params and defeat deepcopy. Could the asset (and its bounds) be resolved by name from the env/scene at eval time, keeping params plain data? If identity really must survive deepcopy, a NOTE on why would help.

🔵 spatial.py:227object_in_contact appears unused. No caller after the refactor; drop it or confirm it's an intended public building block.

Test Coverage

Good. The new test uses the inner/outer run_simulation_app_function pattern with deferred imports, asserts concrete boolean vectors across meaningful geometry cases, and verifies the ArenaAssetHandle deepcopy behavior. The sorting-task tests were updated to match the new containment semantics. New file carries a correct single-year (2026) header.

Verdict

Minor fixes needed — the design questions are worth a look, but nothing here blocks.

Require pick-and-place success to combine centroid containment, upward destination support, and low linear speed. Preserve Arena asset identity so cached bounds and object-set variants remain aligned through manager configuration copies.

Signed-off-by: Clemens Volk <cvolk@nvidia.com>
Signed-off-by: Clemens Volk <cvolk@nvidia.com>
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
cvolkcvolk force-pushed the cvolk/fix/object-in-container-predicate branch from 3341614 to bad0457 Compare July 31, 2026 15:19
@cvolkcvolk
cvolkcvolk changed the base branch from cvolk/feature/environment-runner to main July 31, 2026 15:19
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