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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"libero_90.kitchen_scene10_close_the_top_drawer_of_the_cabinet",
"kitchen_scene10_close_the_top_drawer_of_the_cabinet",
)
class LiberoKitchenScene10CloseTopDrawerAndPutBowlOnTopTask(Libero90BaseTask):
class LiberoKitchenScene10CloseTheTopDrawerOfTheCabinetTask(Libero90BaseTask):
"""Configuration for the Libero kitchen scene10 close the top drawer of the cabinet task.

Task Description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"libero_90.kitchen_scene10_close_the_top_drawer_of_the_cabinet_and_put_the_black_bowl_on_top_of_it",
"kitchen_scene10_close_the_top_drawer_of_the_cabinet_and_put_the_black_bowl_on_top_of_it",
)
class LiberoKitchenScene10CloseTopDrawerAndPutBowlOnTopTask(Libero90BaseTask):
class LiberoKitchenScene10CloseTheTopDrawerOfTheCabinetAndPutTheBlackBowlOnTopOfItTask(Libero90BaseTask):
"""Configuration for the Libero kitchen scene10 close the top drawer of the cabinet and put the black bowl on top of it task.

Task Description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"libero_90.kitchen_scene10_put_the_black_bowl_in_the_top_drawer_of_the_cabinet",
"kitchen_scene10_put_the_black_bowl_in_the_top_drawer_of_the_cabinet",
)
class LiberoKitchenScene10PutBlackBowlInTopDrawerTask(Libero90BaseTask):
class LiberoKitchenScene10PutTheBlackBowlInTheTopDrawerOfTheCabinetTask(Libero90BaseTask):
"""Configuration for the Libero kitchen scene10 put the black bowl in the top drawer of the cabinet task.

Task Description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"libero_90.kitchen_scene10_put_the_butter_at_the_back_in_the_top_drawer_of_the_cabinet_and_close_it",
"kitchen_scene10_put_the_butter_at_the_back_in_the_top_drawer_of_the_cabinet_and_close_it",
)
class LiberoKitchenScene10PutButterInTopDrawerAndCloseTask(Libero90BaseTask):
class LiberoKitchenScene10PutTheButterAtTheBackInTheTopDrawerOfTheCabinetAndCloseItTask(Libero90BaseTask):
"""Configuration for the Libero kitchen scene10 put the butter at the back in the top drawer of the cabinet and close it task.

Task Description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"libero_90.kitchen_scene10_put_the_butter_at_the_front_in_the_top_drawer_of_the_cabinet_and_close_it",
"kitchen_scene10_put_the_butter_at_the_front_in_the_top_drawer_of_the_cabinet_and_close_it",
)
class LiberoKitchenScene10PutButterAtFrontInTopDrawerAndCloseTask(Libero90BaseTask):
class LiberoKitchenScene10PutTheButterAtTheFrontInTheTopDrawerOfTheCabinetAndCloseItTask(Libero90BaseTask):
"""Configuration for the Libero kitchen scene10 put the butter at the front in the top drawer of the cabinet and close it task.

Task Description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"libero_90.kitchen_scene10_put_the_chocolate_pudding_in_the_top_drawer_of_the_cabinet_and_close_it",
"kitchen_scene10_put_the_chocolate_pudding_in_the_top_drawer_of_the_cabinet_and_close_it",
)
class LiberoKitchenScene10PutChocolatePuddingInTopDrawerAndCloseTask(Libero90BaseTask):
class LiberoKitchenScene10PutTheChocolatePuddingInTheTopDrawerOfTheCabinetAndCloseItTask(Libero90BaseTask):
"""Configuration for the Libero kitchen scene10 put the chocolate pudding in the top drawer of the cabinet and close it task.

Task Description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class LiberoKitchenOpenBottomDrawerTask(Libero90BaseTask):
ArticulationObjCfg(
name="wooden_cabinet",
fix_base_link=True,
usd_path="roboverse_data/assets/libero/COMMON/articulated_objects/wooden_cabinet/usd/wooden_cabinet.usda",
usd_path="roboverse_data/assets/libero/COMMON/articulated_objects/wooden_cabinet/usd/wooden_cabinet.usd",
urdf_path="roboverse_data/assets/libero/COMMON/articulated_objects/wooden_cabinet/urdf/wooden_cabinet.urdf",
mjcf_path="roboverse_data/assets/libero/COMMON/articulated_objects/wooden_cabinet/mjcf/wooden_cabinet.xml",
),
Expand Down Expand Up @@ -87,7 +87,7 @@ class LiberoKitchenOpenBottomDrawerTask(Libero90BaseTask):
"roboverse_data/trajs/libero90/libero_90_kitchen_scene1_open_the_bottom_drawer_of_the_cabinet_traj_v2.pkl"
)

# # rewrite terminate
# rewrite terminate
# def _terminated(self, states: TensorState) -> torch.Tensor:
# """No terminate condition yet. Will terminate when time is up."""
# return torch.tensor([False])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def _terminated(self, states: TensorState) -> torch.Tensor: # 需要仔细检
"""Task success checker."""
# get bowl/cabinet poses
bowl_pos = states.objects["akita_black_bowl"].root_state[:, :3] # (N,3)
plate_pos = states.objects["plate"].root_state[:, :3]
cabinet_pos = states.objects["wooden_cabinet"].root_state[:, :3] # (N,3)
cabinet_quat = states.objects["wooden_cabinet"].root_state[:, 3:7] # (N,4)
top_idx = self.handler.get_joint_names("wooden_cabinet").index("top_level")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@register_task(
"libero_90.kitchen_scene1_put_the_black_bowl_on_the_plate", "kitchen_scene1_put_the_black_bowl_on_the_plate"
)
class LiberoKitchen1PutBowlOnPlateTask(Libero90BaseTask):
class LiberoKitchen1PutTheBlackBowlOnThePlateTask(Libero90BaseTask):
"""Configuration for the Libero kitchen put the black bowl on the plate task.

This task is transferred from:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def pose_to_mat(pos: torch.Tensor, quat: torch.Tensor | None = None) -> torch.Te
"libero_90.kitchen_scene1_put_the_black_bowl_on_top_of_the_cabinet",
"kitchen_scene1_put_the_black_bowl_on_top_of_the_cabinet",
)
class LiberoKitchen1PutBowlOnCabinetTask(Libero90BaseTask):
class LiberoKitchen1PutTheBlackBowlOnTopOfTheCabinetTask(Libero90BaseTask):
"""Configuration for the Libero kitchen put the black bowl on top of the cabinet task.

This task is transferred from:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@register_task(
"libero_90.kitchen_scene2_open_the_top_drawer_of_the_cabinet", "kitchen_scene2_open_the_top_drawer_of_the_cabinet"
)
class LiberoKitchenScene2OpenTopDrawerTask(Libero90BaseTask):
class LiberoKitchenScene2OpenTheTopDrawerOfTheCabinetTask(Libero90BaseTask):
"""Configuration for the Libero kitchen scene2 open the top drawer of the cabinet task.

This task is transferred from:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"libero_90.kitchen_scene2_put_the_black_bowl_at_the_back_on_the_plate",
"kitchen_scene2_put_the_black_bowl_at_the_back_on_the_plate",
)
class LiberoKitchenScene2PutBowlAtBackOnPlateTask(Libero90BaseTask):
class LiberoKitchenScene2PutTheBlackBowlAtTheBackOnThePlateTask(Libero90BaseTask):
"""Configuration for the Libero kitchen scene2 put the black bowl at the back on the plate task.

This task is transferred from:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"libero_90.kitchen_scene2_put_the_black_bowl_at_the_front_on_the_plate",
"kitchen_scene2_put_the_black_bowl_at_the_front_on_the_plate",
)
class LiberoKitchenScene2PutBowlAtFrontOnPlateTask(Libero90BaseTask):
class LiberoKitchenScene2PutTheBlackBowlAtTheFrontOnThePlateTask(Libero90BaseTask):
"""Configuration for the Libero kitchen scene2 put the black bowl at the front on the plate task.

This task is transferred from:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"libero_90.kitchen_scene2_put_the_black_bowl_in_the_middle_on_the_plate",
"kitchen_scene2_put_the_black_bowl_in_the_middle_on_the_plate",
)
class LiberoKitchenScene2PutBowlInMiddleOnPlateTask(Libero90BaseTask):
class LiberoKitchenScene2PutTheBlackBowlInTheMiddleOnThePlateTask(Libero90BaseTask):
"""Configuration for the Libero kitchen scene2 put the black bowl in the middle on the plate task.

This task is transferred from:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def pose_to_mat(pos: torch.Tensor, quat: torch.Tensor | None = None) -> torch.Te
"libero_90.kitchen_scene2_put_the_middle_black_bowl_on_top_of_the_cabinet",
"kitchen_scene2_put_the_middle_black_bowl_on_top_of_the_cabinet",
)
class LiberoKitchenScene2PutMiddleBowlOnCabinetTask(Libero90BaseTask):
class LiberoKitchenScene2PutTheMiddleBlackBowlOnTopOfTheCabinetTask(Libero90BaseTask):
"""Configuration for the Libero kitchen scene2 put the middle black bowl on top of the cabinet task.

This task is transferred from:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"libero_90.kitchen_scene2_stack_the_black_bowl_at_the_front_on_the_black_bowl_in_the_middle",
"kitchen_scene2_stack_the_black_bowl_at_the_front_on_the_black_bowl_in_the_middle",
)
class LiberoKitchenScene2StackBowlFrontOnMiddleTask(Libero90BaseTask):
class LiberoKitchenScene2StackTheBlackBowlAtTheFrontOnTheBlackBowlInTheMiddleTask(Libero90BaseTask):
"""Configuration for the Libero kitchen scene2 stack the black bowl at the front on the black bowl in the middle task.

This task is transferred from:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"libero_90.kitchen_scene2_stack_the_middle_black_bowl_on_the_back_black_bowl",
"kitchen_scene2_stack_the_middle_black_bowl_on_the_back_black_bowl",
)
class LiberoKitchenScene2StackMiddleBowlOnBackBowlTask(Libero90BaseTask):
class LiberoKitchenScene2StackTheMiddleBlackBowlOnTheBackBlackBowlTask(Libero90BaseTask):
"""Configuration for the Libero kitchen scene2 stack the middle black bowl on the back black bowl task.

This task is transferred from:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"libero_90.kitchen_scene3_put_the_frying_pan_on_the_stove",
"kitchen_scene3_put_the_frying_pan_on_the_stove",
)
class LiberoKitchenScene3PutFryingPanOnStoveTask(Libero90BaseTask):
class LiberoKitchenScene3PutTheFryingPanOnTheStoveTask(Libero90BaseTask):
"""Configuration for the Libero kitchen scene3 put the frying pan on the stove task.

This task is transferred from:
Expand All @@ -43,24 +43,24 @@ class LiberoKitchenScene3PutFryingPanOnStoveTask(Libero90BaseTask):
# Movable objects
RigidObjCfg(
name="chefmate_8_frypan",
# usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/chefmate_8_frypan/usd/chefmate_8_frypan.usd",
# urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/chefmate_8_frypan/urdf/chefmate_8_frypan.urdf",
usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/chefmate_8_frypan/usd/chefmate_8_frypan.usd",
urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/chefmate_8_frypan/urdf/chefmate_8_frypan.urdf",
mjcf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/chefmate_8_frypan/mjcf/chefmate_8_frypan.xml",
physics=PhysicStateType.RIGIDBODY,
),
RigidObjCfg(
name="moka_pot",
# usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/moka_pot/usd/moka_pot.usd",
# urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/moka_pot/urdf/moka_pot.urdf",
usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/moka_pot/usd/moka_pot.usd",
urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/moka_pot/urdf/moka_pot.urdf",
mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/moka_pot/mjcf/moka_pot.xml",
physics=PhysicStateType.RIGIDBODY,
),
# Fixed fixtures
ArticulationObjCfg(
name="flat_stove",
fix_base_link=True,
# usd_path="roboverse_data/assets/libero/COMMON/articulated_objects/flat_stove/usd/flat_stove.usd",
# urdf_path="roboverse_data/assets/libero/COMMON/articulated_objects/flat_stove/urdf/flat_stove.urdf",
usd_path="roboverse_data/assets/libero/COMMON/articulated_objects/flat_stove/usd/flat_stove.usd",
urdf_path="roboverse_data/assets/libero/COMMON/articulated_objects/flat_stove/urdf/flat_stove.urdf",
mjcf_path="roboverse_data/assets/libero/COMMON/articulated_objects/flat_stove/mjcf/flat_stove.xml",
),
],
Expand All @@ -82,8 +82,12 @@ class LiberoKitchenScene3PutFryingPanOnStoveTask(Libero90BaseTask):

def _terminated(self, states: TensorState) -> torch.Tensor:
"""Task success checker."""
frypan_pos = states.objects["moka_pot"].root_state[:, :3] # (N,3)
stove_center_pos = self.handler.physics.named.data.site_xpos["flat_stove/burner"]
frypan_pos = states.objects["chefmate_8_frypan"].root_state[:, :3] # (N,3)
stove_center_single = self.handler.physics.named.data.site_xpos["flat_stove/cook_region"]
N = frypan_pos.shape[0]
stove_center_pos = (
torch.tensor(stove_center_single, device=frypan_pos.device).reshape(1, 3).repeat(N, 1)
) # (N,3)

# Check if frying pan is within a region above the stove
range_threshold = 0.08 # Radius of the range in xy plane
Expand All @@ -93,7 +97,6 @@ def _terminated(self, states: TensorState) -> torch.Tensor:
xy_distance = torch.norm(frypan_pos[:, :2] - stove_center_pos[:, :2], dim=-1) # (N,)
# Calculate height difference (frypan z - stove z)
height_diff = frypan_pos[:, 2] - stove_center_pos[:, 2] # (N,)

# Check both conditions: xy distance < range AND 0 < height_diff < height_threshold
xy_close = xy_distance < range_threshold # (N,)
height_valid = (height_diff > 0) & (height_diff < height_threshold) # (N,)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"libero_90.kitchen_scene3_put_the_moka_pot_on_the_stove",
"kitchen_scene3_put_the_moka_pot_on_the_stove",
)
class LiberoKitchenScene3PutMokaPotOnStoveTask(Libero90BaseTask):
class LiberoKitchenScene3PutTheMokaPotOnTheStoveTask(Libero90BaseTask):
"""Configuration for the Libero kitchen scene3 put the moka pot on the stove task.

This task is transferred from:
Expand All @@ -43,24 +43,24 @@ class LiberoKitchenScene3PutMokaPotOnStoveTask(Libero90BaseTask):
# Movable objects
RigidObjCfg(
name="moka_pot",
# usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/moka_pot/usd/moka_pot.usd",
# urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/moka_pot/urdf/moka_pot.urdf",
usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/moka_pot/usd/moka_pot.usd",
urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/moka_pot/urdf/moka_pot.urdf",
mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/moka_pot/mjcf/moka_pot.xml",
physics=PhysicStateType.RIGIDBODY,
),
RigidObjCfg(
name="chefmate_8_frypan",
# usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/chefmate_8_frypan/usd/chefmate_8_frypan.usd",
# urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/chefmate_8_frypan/urdf/chefmate_8_frypan.urdf",
usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/chefmate_8_frypan/usd/chefmate_8_frypan.usd",
urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/chefmate_8_frypan/urdf/chefmate_8_frypan.urdf",
mjcf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/chefmate_8_frypan/mjcf/chefmate_8_frypan.xml",
physics=PhysicStateType.RIGIDBODY,
),
# Fixed fixtures
ArticulationObjCfg(
name="flat_stove",
fix_base_link=True,
# usd_path="roboverse_data/assets/libero/COMMON/articulated_objects/flat_stove/usd/flat_stove.usd",
# urdf_path="roboverse_data/assets/libero/COMMON/articulated_objects/flat_stove/urdf/flat_stove.urdf",
usd_path="roboverse_data/assets/libero/COMMON/articulated_objects/flat_stove/usd/flat_stove.usd",
urdf_path="roboverse_data/assets/libero/COMMON/articulated_objects/flat_stove/urdf/flat_stove.urdf",
mjcf_path="roboverse_data/assets/libero/COMMON/articulated_objects/flat_stove/mjcf/flat_stove.xml",
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"libero_90.kitchen_scene3_turn_on_the_stove",
"kitchen_scene3_turn_on_the_stove",
)
class LiberoKitchenScene3TurnOnStoveTask(Libero90BaseTask):
class LiberoKitchenScene3TurnOnTheStoveTask(Libero90BaseTask):
"""Configuration for the Libero kitchen scene3 turn on the stove task.

This task is transferred from:
Expand All @@ -43,24 +43,24 @@ class LiberoKitchenScene3TurnOnStoveTask(Libero90BaseTask):
# Movable objects
RigidObjCfg(
name="moka_pot",
# usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/moka_pot/usd/moka_pot.usd",
# urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/moka_pot/urdf/moka_pot.urdf",
usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/moka_pot/usd/moka_pot.usd",
urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/moka_pot/urdf/moka_pot.urdf",
mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/moka_pot/mjcf/moka_pot.xml",
physics=PhysicStateType.RIGIDBODY,
),
RigidObjCfg(
name="chefmate_8_frypan",
# usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/chefmate_8_frypan/usd/chefmate_8_frypan.usd",
# urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/chefmate_8_frypan/urdf/chefmate_8_frypan.urdf",
usd_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/chefmate_8_frypan/usd/chefmate_8_frypan.usd",
urdf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/chefmate_8_frypan/urdf/chefmate_8_frypan.urdf",
mjcf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/chefmate_8_frypan/mjcf/chefmate_8_frypan.xml",
physics=PhysicStateType.RIGIDBODY,
),
# Fixed fixtures
ArticulationObjCfg(
name="flat_stove",
fix_base_link=True,
# usd_path="roboverse_data/assets/libero/COMMON/articulated_objects/flat_stove/usd/flat_stove.usd",
# urdf_path="roboverse_data/assets/libero/COMMON/articulated_objects/flat_stove/urdf/flat_stove.urdf",
usd_path="roboverse_data/assets/libero/COMMON/articulated_objects/flat_stove/usd/flat_stove.usd",
urdf_path="roboverse_data/assets/libero/COMMON/articulated_objects/flat_stove/urdf/flat_stove.urdf",
mjcf_path="roboverse_data/assets/libero/COMMON/articulated_objects/flat_stove/mjcf/flat_stove.xml",
),
],
Expand All @@ -82,11 +82,9 @@ class LiberoKitchenScene3TurnOnStoveTask(Libero90BaseTask):

def _terminated(self, states: TensorState) -> torch.Tensor:
"""Task success checker."""
# 假设 stove 的开关状态可以通过 states.objects["flat_stove"].joint_state 获取
# 这里 joint_state[:, knob_index] > threshold 代表已打开
# knob_index 和 threshold 需根据实际模型调
knob_index = 0 # 示例:第一个关节为旋钮
threshold = 0.5 # 示例:大于 0.5 视为打开
# knob_index and threshold need to be aligned with the actual stove model used
knob_index = 0
threshold = 0.5
stove_joint_state = states.objects["flat_stove"].joint_pos[:, 0] # (N,)
is_on = (stove_joint_state > threshold).all(dim=-1) # (N,)
return is_on
Expand Down
Loading