Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions isaaclab_arena/assets/dummy_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0

import torch

from isaaclab_arena.relations.relations import Relation, RelationBase, UnaryRelation
Expand All @@ -10,23 +11,23 @@


class DummyObject:
"""
Dummy object for testing purposes without Isaac Sim dependencies.
"""
"""Dummy object for testing without Isaac Sim dependencies."""

def __init__(
self,
name: str,
bounding_box: AxisAlignedBoundingBox,
initial_pose: Pose | None = None,
relations: list[RelationBase] = [],
collision_mesh: object | None = None,

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.

🟡 This adds a collision_mesh field (and get_collision_mesh() below) to the public DummyObject, but nothing in the repo actually reads it — the only consumer is the mesh benchmark path, which itself depends on an isaaclab_arena.relations.collision_mode module and RelationSolverParams(collision_mode=..., num_spheres=...) that don't exist on this branch. Could we hold this off until the mesh / collision_mode feature actually lands, rather than adding public asset surface for an unmerged feature?

**kwargs,
):
self.name = name
self.initial_pose = initial_pose
self.bounding_box = bounding_box
assert self.bounding_box is not None
self.relations = list(relations)
self._collision_mesh = collision_mesh

def add_relation(self, relation: RelationBase) -> None:
self.relations.append(relation)
Expand All @@ -35,18 +36,15 @@ def get_relations(self) -> list[RelationBase]:
return self.relations

def get_spatial_relations(self) -> list[RelationBase]:
"""Get only spatial relations (On, NextTo, AtPosition, etc.), excluding markers like IsAnchor."""
"""Spatial relations (On, NextTo, ), excluding markers like IsAnchor."""
return [r for r in self.relations if isinstance(r, (Relation, UnaryRelation))]

def get_bounding_box(self) -> AxisAlignedBoundingBox:
"""Get local bounding box (relative to object origin)."""
"""Local bounding box relative to the object origin."""
return self.bounding_box

def get_world_bounding_box(self) -> AxisAlignedBoundingBox:
"""Get bounding box in world coordinates (local bbox rotated and translated).

Only 90° rotations around Z axis are supported.
"""
"""World-frame bounding box (Z-only rotation supported)."""
if self.initial_pose is None:
return self.bounding_box
quarters = quaternion_to_90_deg_z_quarters(self.initial_pose.rotation_xyzw)
Expand All @@ -63,3 +61,7 @@ def get_initial_pose(self) -> Pose | None:

def is_initial_pose_set(self) -> bool:
return self.initial_pose is not None

def get_collision_mesh(self) -> object | None:
"""The object's collision mesh, or None if it has none."""
return self._collision_mesh
5 changes: 5 additions & 0 deletions isaaclab_arena/relations/object_placer.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,3 +820,8 @@ def last_loss_history(self) -> list[float]:
def last_position_history(self) -> list:
"""Position snapshots from the most recent place() call."""
return self._solver.last_position_history

@property
def last_no_overlap_pair_count(self) -> int:
"""Directed no-overlap pair count from the most recent place() call."""
return self._solver.last_no_overlap_pair_count
5 changes: 5 additions & 0 deletions isaaclab_arena/relations/relation_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ def last_position_history(self) -> list:
"""Position snapshots from the most recent solve() call."""
return self._last_position_history

@property
def last_no_overlap_pair_count(self) -> int:
"""Directed no-overlap pair count from the most recent solve() call."""
return self._last_no_overlap_pair_count

def debug_losses(self, objects: list[ObjectBase]) -> None:
"""Print detailed loss breakdown for all relations using final positions.

Expand Down
Loading
Loading