Skip to content

Support Multi-part Collision Geometry#946

Open
zhx06 wants to merge 3 commits into
zxiao/feature/robo_placement_prototypefrom
zxiao/feature/compound_robo
Open

Support Multi-part Collision Geometry#946
zhx06 wants to merge 3 commits into
zxiao/feature/robo_placement_prototypefrom
zxiao/feature/compound_robo

Conversation

@zhx06

@zhx06 zhx06 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Contracts for multi-part collision geometry.

Detailed description

  • Add CollisionComponent, a rigid sub-volume with a pose, per-env bounding box, and optional mesh.
  • Add AxisAlignedBoundingBox.union to merge boxes.
  • Add PlacementAsset.get_relation_bounding_box() and get_collision_components(), defaulting to one component per asset.

@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces the contracts for multi-part collision geometry. It adds a CollisionComponent frozen dataclass (name, local pose, per-env bounding box, optional mesh), extends PlacementAsset with get_relation_bounding_box() and get_collision_components() concrete defaults, and adds AxisAlignedBoundingBox.union() with N=1 broadcast semantics.

  • CollisionComponent and the two new PlacementAsset methods are cleanly designed; subclasses can override each independently to represent compound assets.
  • AxisAlignedBoundingBox.union() is correct: it guards against empty input and mismatched batch sizes, then uses expand + amin/amax for efficient per-env merging.
  • The CollisionObject protocol (the solver-facing interface) is not updated with the new get_relation_bounding_box/get_collision_components declarations, which may require a cast in solver code that later consumes these methods.

Confidence Score: 4/5

Safe to merge; all changes are additive defaults with no effect on existing behaviour.

The core logic — AxisAlignedBoundingBox.union() and the two new PlacementAsset defaults — is correct and well-tested. The only findings are a missing row-0 assertion in one broadcast test and the CollisionObject protocol not being extended with the new multi-part collision methods, leaving a potential gap for solver code that will consume this API.

collision_object.py — worth deciding whether CollisionObject should declare the new methods before solver code is written against it.

Important Files Changed

Filename Overview
isaaclab_arena/relations/collision_object.py Adds CollisionComponent frozen dataclass for multi-part collision sub-volumes; CollisionObject protocol is unchanged and does not declare the new get_relation_bounding_box/get_collision_components API.
isaaclab_arena/relations/placement_asset.py Adds get_relation_bounding_box() (delegates to get_bounding_box()) and get_collision_components() (returns a single identity-posed component) as concrete default methods on PlacementAsset. Clean implementation; subclasses can override both independently.
isaaclab_arena/utils/bounding_box.py Adds AxisAlignedBoundingBox.union() static method: validates non-empty input, enforces matching num_envs or N=1 broadcast semantics, then uses torch.stack + amin/amax to compute the enclosing box. Logic is correct and well-guarded.
isaaclab_arena/tests/test_bounding_box.py Adds five new union tests covering empty input, single-box, per-env, and broadcast cases; the broadcast test (test_union_broadcasts_single_box_over_batch) only checks row 1 and leaves row 0 unverified.
isaaclab_arena/tests/test_relation_solver_embodiment.py Adds test_placement_asset_defaults_to_single_component which correctly validates the default component count, identity pose, bbox reference, and null mesh; all assertions are well-formed.

Class Diagram

%%{init: {'theme': 'neutral'}}%%
classDiagram
    class CollisionObject {
        <<Protocol>>
        +name: str
        +collision_mode: CollisionMode | None
        +get_bounding_box() AxisAlignedBoundingBox
        +get_world_bounding_box() AxisAlignedBoundingBox
        +get_collision_mesh() Trimesh | None
    }

    class PlacementAsset {
        <<Abstract>>
        +get_bounding_box() AxisAlignedBoundingBox
        +get_relation_bounding_box() AxisAlignedBoundingBox
        +get_collision_components() list~CollisionComponent~
        +get_collision_mesh() Trimesh | None
    }

    class CollisionComponent {
        <<dataclass, frozen>>
        +name: str
        +local_pose: Pose
        +bounding_box: AxisAlignedBoundingBox
        +mesh: Trimesh | None
    }

    class AxisAlignedBoundingBox {
        +min_point: Tensor
        +max_point: Tensor
        +num_envs: int
        +union(boxes)$ AxisAlignedBoundingBox
        +overlaps(other) Tensor
    }

    PlacementAsset ..|> CollisionObject : structural subtype
    PlacementAsset "1" --> "*" CollisionComponent : get_collision_components()
    CollisionComponent --> AxisAlignedBoundingBox : bounding_box
    PlacementAsset --> AxisAlignedBoundingBox : get_bounding_box / get_relation_bounding_box
Loading

Comments Outside Diff (1)

  1. isaaclab_arena/relations/collision_object.py, line 43-65 (link)

    P2 Protocol not updated with new collision API

    CollisionObject is documented as "Object the collision solver can query for pose, bounds, and mesh," but the two new multi-part collision methods (get_relation_bounding_box and get_collision_components) added to PlacementAsset are not declared in this protocol. Any solver or utility typed against CollisionObject (rather than PlacementAsset directly) will not see these methods, and a type checker will reject any attempt to call them through a CollisionObject-typed reference. Since this PR's stated goal is to define the multi-part collision contracts, it seems like the protocol should be extended now so downstream solver code can be typed correctly from the start.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Reviews (1): Last reviewed commit: "add compound" | Re-trigger Greptile

Comment thread isaaclab_arena/relations/placement_asset.py
Comment thread isaaclab_arena/tests/test_bounding_box.py
@arena-review-bot

Copy link
Copy Markdown
Contributor

🤖 Isaac Lab-Arena Review Bot

Summary

This PR adds pure-domain contracts for multi-part collision geometry: a frozen CollisionComponent dataclass, AxisAlignedBoundingBox.union, and two default methods on PlacementAsset. The logic is clean, stays sim-agnostic, and the union tests cover the edge cases well (broadcast, per-env, mismatch, empty). Only one scope question.

Design, Boundaries & Scope

All four new pieces (CollisionComponent, union, get_relation_bounding_box, get_collision_components) currently have no production caller — they are exercised only by tests — and get_relation_bounding_box is a verbatim alias of get_bounding_box. On a stacked feature branch, landing contracts ahead of consumers is a defensible workflow, so this is a question rather than a blocker: is it intentional to merge these before the MR that constrains against them, or would they read more clearly landing together with that consumer?

Findings

🔵 Improvement: placement_asset.py:98 — New methods (and CollisionComponent/union) land with no production consumer; get_relation_bounding_box is an alias of get_bounding_box. Confirm intentional scaffolding, or defer to the consuming MR.

Test Coverage

Good. union is tested for enclosure, N=1 broadcast, genuine per-env union, mismatched-batch assertion, and empty-sequence assertion; the default-single-component path is covered. These are pure-tensor/domain tests with no sim dependency, so the inner/outer run_simulation_app_function pattern is not required here.

Verdict

Ship it — just confirm the contracts-ahead-of-consumer sequencing is intentional.

@zhx06
zhx06 force-pushed the zxiao/feature/robo_placement_prototype branch 3 times, most recently from ee9f659 to dedf07a Compare July 24, 2026 16:38
zhx06 added 3 commits July 24, 2026 12:10
Signed-off-by: zhx06 <zihaox@nvidia.com>
Signed-off-by: zhx06 <zihaox@nvidia.com>
Signed-off-by: zhx06 <zihaox@nvidia.com>
@zhx06
zhx06 force-pushed the zxiao/feature/compound_robo branch from e680d5c to 5f63733 Compare July 24, 2026 19:58
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