Skip to content
Draft
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
3 changes: 2 additions & 1 deletion isaaclab_arena/assets/background_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ class KitchenBackground(LibraryBackground):
name = "kitchen"
tags = ["background"]
usd_path = f"{ISAACLAB_NUCLEUS_DIR}/Arena/assets/background_library/kitchen_background/kitchen_background.usd"
initial_pose = Pose(position_xyz=(0.772, 3.39, -0.895), rotation_wxyz=(0.70711, 0, 0, -0.70711))
initial_pose = Pose(position_xyz=(0.772, 3.39, -0.895), rotation_wxyz=(1.0, 0.0, 0.0, 0.0))
# initial_pose = Pose(position_xyz=(0.772, 3.39, -0.895), rotation_wxyz=(0.70711, 0, 0, -0.70711))
object_min_z = -0.2

def __init__(self):
Expand Down
14 changes: 13 additions & 1 deletion isaaclab_arena/assets/object_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from isaaclab.assets import ArticulationCfg, AssetBaseCfg, RigidObjectCfg
from isaaclab.sensors.contact_sensor.contact_sensor_cfg import ContactSensorCfg
from pxr import Usd
from pxr import Usd, UsdPhysics

from isaaclab_arena.affordances.openable import Openable
from isaaclab_arena.assets.asset import Asset
Expand Down Expand Up @@ -91,6 +91,18 @@ def get_contact_sensor_cfg(self, contact_against_prim_paths: list[str] | None =

def _generate_rigid_cfg(self) -> RigidObjectCfg:
assert self.object_type == ObjectType.RIGID
# Validate that the referenced prim has RigidBodyAPI applied
with open_stage(self.parent_asset.usd_path) as parent_stage:
prim_path_in_usd = self.isaaclab_prim_path_to_original_prim_path(
self.prim_path, self.parent_asset, parent_stage
)
prim = parent_stage.GetPrimAtPath(prim_path_in_usd)
if prim and not prim.HasAPI(UsdPhysics.RigidBodyAPI):
raise ValueError(
f"ObjectReference '{self.name}' has object_type=RIGID but the prim "
f"'{prim_path_in_usd}' does not have USD RigidBodyAPI applied. "
"Consider using object_type=BASE for static prims that are part of a background asset."
)
initial_pose = self.get_initial_pose()
object_cfg = RigidObjectCfg(
prim_path=self.prim_path,
Expand Down
4 changes: 2 additions & 2 deletions isaaclab_arena/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ Please check the relevant environment files to see what CLI arguments are suppor
Examples are launched with a zero action runner (with some example arguments) like:

```bash
python isaaclab_arena/examples/policy_runner.py --policy_type zero_action kitchen_pick_and_place --object cracker_box --embodiment gr1_joint
python isaaclab_arena/evaluation/policy_runner.py --policy_type zero_action kitchen_pick_and_place --object cracker_box --embodiment gr1_joint
```

or

```bash
python isaaclab_arena/examples/policy_runner.py --policy_type zero_action gr1_open_microwave --object tomato_soup_can
python isaaclab_arena/evaluation/policy_runner.py --policy_type zero_action gr1_open_microwave --object tomato_soup_can
```

**NOTE:** CLI arguments are sensitive to order. They must appear in the following order:
Expand Down
17 changes: 10 additions & 7 deletions isaaclab_arena_environments/kitchen_pick_and_place_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def get_env(self, args_cli: argparse.Namespace): # -> IsaacLabArenaEnvironment:
from isaaclab_arena.assets.object_reference import ObjectReference
from isaaclab_arena.assets.object_set import RigidObjectSet
from isaaclab_arena.environments.isaaclab_arena_environment import IsaacLabArenaEnvironment
from isaaclab_arena.relations.relations import AtPosition, IsAnchor, On
from isaaclab_arena.scene.scene import Scene
from isaaclab_arena.tasks.pick_and_place_task import PickAndPlaceTask
from isaaclab_arena.utils.pose import Pose
Expand All @@ -31,12 +32,14 @@ def get_env(self, args_cli: argparse.Namespace): # -> IsaacLabArenaEnvironment:
pick_up_object = self.asset_registry.get_asset_by_name(args_cli.object)()
embodiment = self.asset_registry.get_asset_by_name(args_cli.embodiment)(enable_cameras=args_cli.enable_cameras)

pick_up_object.set_initial_pose(
Pose(
position_xyz=(0.4, 0.0, 0.1),
rotation_wxyz=(1.0, 0.0, 0.0, 0.0),
)
table_top_reference = ObjectReference(
name="table_top_reference",
prim_path="{ENV_REGEX_NS}/kitchen/Kitchen_Counter/TRS_Base/TRS_Static/Counter_Top_A",
parent_asset=background,
)
table_top_reference.add_relation(IsAnchor())
pick_up_object.add_relation(On(table_top_reference, clearance_m=0.02))
pick_up_object.add_relation(AtPosition(x=4.0, y=3.0))

# TODO(alexmillane, 2025.09.24): Add automatic object type detection of ObjectReferences.
destination_location = ObjectReference(
Expand All @@ -57,10 +60,10 @@ def get_env(self, args_cli: argparse.Namespace): # -> IsaacLabArenaEnvironment:
objects.append(obj_from_set)
object_set = RigidObjectSet(name="object_set", objects=objects)
object_set.set_initial_pose(Pose(position_xyz=(0.4, 0.2, 0.1), rotation_wxyz=(1.0, 0.0, 0.0, 0.0)))
scene = Scene(assets=[background, pick_up_object, destination_location, object_set])
scene = Scene(assets=[background, table_top_reference, pick_up_object, destination_location, object_set])

else:
scene = Scene(assets=[background, pick_up_object, destination_location])
scene = Scene(assets=[background, table_top_reference, pick_up_object, destination_location])
isaaclab_arena_environment = IsaacLabArenaEnvironment(
name=self.name,
embodiment=embodiment,
Expand Down
Loading