From 95d5bdfe96d832096f42719c23fc81a8f3dfe9f8 Mon Sep 17 00:00:00 2001 From: blyu413 Date: Sun, 21 Dec 2025 21:35:41 +0800 Subject: [PATCH] add new libero90 tasks --- ...e10_close_the_top_drawer_of_the_cabinet.py | 2 +- ...net_and_put_the_black_bowl_on_top_of_it.py | 2 +- ...k_bowl_in_the_top_drawer_of_the_cabinet.py | 2 +- ..._top_drawer_of_the_cabinet_and_close_it.py | 2 +- ..._top_drawer_of_the_cabinet_and_close_it.py | 2 +- ..._top_drawer_of_the_cabinet_and_close_it.py | 2 +- ...ibero_kitchen_scene1_open_bottom_drawer.py | 4 +- ...ero_kitchen_scene1_open_drawer_put_bowl.py | 1 + ..._scene1_put_the_black_bowl_on_the_plate.py | 2 +- ...ut_the_black_bowl_on_top_of_the_cabinet.py | 2 +- ...ene2_open_the_top_drawer_of_the_cabinet.py | 2 +- ...the_black_bowl_at_the_back_on_the_plate.py | 2 +- ...he_black_bowl_at_the_front_on_the_plate.py | 2 +- ...e_black_bowl_in_the_middle_on_the_plate.py | 2 +- ...middle_black_bowl_on_top_of_the_cabinet.py | 2 +- ...e_front_on_the_black_bowl_in_the_middle.py | 2 +- ...iddle_black_bowl_on_the_back_black_bowl.py | 2 +- ..._scene3_put_the_frying_pan_on_the_stove.py | 23 ++-- ...en_scene3_put_the_moka_pot_on_the_stove.py | 14 +-- ...libero_kitchen_scene3_turn_on_the_stove.py | 22 ++-- ..._the_stove_and_put_the_frying_pan_on_it.py | 16 +-- ...owl_in_the_bottom_drawer_of_the_cabinet.py | 2 +- ...ut_the_black_bowl_on_top_of_the_cabinet.py | 2 +- ...tle_in_the_bottom_drawer_of_the_cabinet.py | 2 +- ...e4_put_the_wine_bottle_on_the_wine_rack.py | 2 +- ...k_bowl_in_the_top_drawer_of_the_cabinet.py | 2 +- ..._scene5_put_the_black_bowl_on_the_plate.py | 2 +- ...ut_the_black_bowl_on_top_of_the_cabinet.py | 2 +- ...etchup_in_the_top_drawer_of_the_cabinet.py | 2 +- ...white_mug_to_the_front_of_the_white_mug.py | 2 +- ...ibero_kitchen_scene8_turn_off_the_stove.py | 2 +- ...libero_kitchen_scene9_turn_on_the_stove.py | 2 +- ..._the_stove_and_put_the_frying_pan_on_it.py | 2 +- ..._alphabet_soup_and_put_it_in_the_basket.py | 2 +- ...eam_cheese_box_and_put_it_in_the_basket.py | 2 +- ...up_the_ketchup_and_put_it_in_the_basket.py | 2 +- ...e_tomato_sauce_and_put_it_in_the_basket.py | 2 +- ..._alphabet_soup_and_put_it_in_the_basket.py | 2 +- ..._up_the_butter_and_put_it_in_the_basket.py | 2 +- ...ck_up_the_milk_and_put_it_in_the_basket.py | 2 +- ...e_orange_juice_and_put_it_in_the_basket.py | 2 +- ...e_tomato_sauce_and_put_it_in_the_basket.py | 2 +- ...he_alphabet_soup_and_put_it_in_the_tray.py | 2 +- ...ck_up_the_butter_and_put_it_in_the_tray.py | 2 +- ...the_cream_cheese_and_put_it_in_the_tray.py | 2 +- ...k_up_the_ketchup_and_put_it_in_the_tray.py | 2 +- ...the_tomato_sauce_and_put_it_in_the_tray.py | 2 +- ...bowl_on_the_left_and_put_it_in_the_tray.py | 2 +- ...hocolate_pudding_and_put_it_in_the_tray.py | 2 +- ...e_salad_dressing_and_put_it_in_the_tray.py | 2 +- ...e_right_bowl_and_place_them_in_the_tray.py | 2 +- ...he_left_bowl_and_place_them_in_the_tray.py | 2 +- ...cene5_put_the_red_mug_on_the_left_plate.py | 111 +++++++++++++++++ ...ene5_put_the_red_mug_on_the_right_plate.py | 104 ++++++++++++++++ ...ne5_put_the_white_mug_on_the_left_plate.py | 104 ++++++++++++++++ ...yellow_and_white_mug_on_the_right_plate.py | 102 +++++++++++++++ ...colate_pudding_to_the_left_of_the_plate.py | 96 ++++++++++++++ ...olate_pudding_to_the_right_of_the_plate.py | 95 ++++++++++++++ ...oom_scene6_put_the_red_mug_on_the_plate.py | 93 ++++++++++++++ ...m_scene6_put_the_white_mug_on_the_plate.py | 93 ++++++++++++++ ...t_in_the_front_compartment_of_the_caddy.py | 92 ++++++++++++++ ...it_in_the_left_compartment_of_the_caddy.py | 91 ++++++++++++++ ...t_in_the_right_compartment_of_the_caddy.py | 91 ++++++++++++++ ..._and_place_it_to_the_right_of_the_caddy.py | 96 ++++++++++++++ ...it_in_the_back_compartment_of_the_caddy.py | 91 ++++++++++++++ ...t_in_the_front_compartment_of_the_caddy.py | 91 ++++++++++++++ ...it_in_the_left_compartment_of_the_caddy.py | 91 ++++++++++++++ ...t_in_the_right_compartment_of_the_caddy.py | 91 ++++++++++++++ ...t_in_the_front_compartment_of_the_caddy.py | 99 +++++++++++++++ ...it_in_the_left_compartment_of_the_caddy.py | 99 +++++++++++++++ ...t_in_the_right_compartment_of_the_caddy.py | 99 +++++++++++++++ ..._and_place_it_to_the_right_of_the_caddy.py | 103 +++++++++++++++ ..._and_place_it_to_the_right_of_the_caddy.py | 103 +++++++++++++++ ...iddle_and_place_it_on_the_cabinet_shelf.py | 114 +++++++++++++++++ ...e_left_and_place_it_on_top_of_the_shelf.py | 115 +++++++++++++++++ ...right_and_place_it_on_the_cabinet_shelf.py | 115 +++++++++++++++++ ...ht_and_place_it_under_the_cabinet_shelf.py | 117 ++++++++++++++++++ 77 files changed, 2583 insertions(+), 85 deletions(-) create mode 100644 roboverse_pack/tasks/libero_90/living_room_scene5_put_the_red_mug_on_the_left_plate.py create mode 100644 roboverse_pack/tasks/libero_90/living_room_scene5_put_the_red_mug_on_the_right_plate.py create mode 100644 roboverse_pack/tasks/libero_90/living_room_scene5_put_the_white_mug_on_the_left_plate.py create mode 100644 roboverse_pack/tasks/libero_90/living_room_scene5_put_the_yellow_and_white_mug_on_the_right_plate.py create mode 100644 roboverse_pack/tasks/libero_90/living_room_scene6_put_the_chocolate_pudding_to_the_left_of_the_plate.py create mode 100644 roboverse_pack/tasks/libero_90/living_room_scene6_put_the_chocolate_pudding_to_the_right_of_the_plate.py create mode 100644 roboverse_pack/tasks/libero_90/living_room_scene6_put_the_red_mug_on_the_plate.py create mode 100644 roboverse_pack/tasks/libero_90/living_room_scene6_put_the_white_mug_on_the_plate.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene1_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene1_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene1_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene1_pick_up_the_yellow_and_white_mug_and_place_it_to_the_right_of_the_caddy.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene2_pick_up_the_book_and_place_it_in_the_back_compartment_of_the_caddy.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene2_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene2_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene2_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_red_mug_and_place_it_to_the_right_of_the_caddy.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_white_mug_and_place_it_to_the_right_of_the_caddy.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene4_pick_up_the_book_in_the_middle_and_place_it_on_the_cabinet_shelf.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene4_pick_up_the_book_on_the_left_and_place_it_on_top_of_the_shelf.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene4_pick_up_the_book_on_the_right_and_place_it_on_the_cabinet_shelf.py create mode 100644 roboverse_pack/tasks/libero_90/study_scene4_pick_up_the_book_on_the_right_and_place_it_under_the_cabinet_shelf.py diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_close_the_top_drawer_of_the_cabinet.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_close_the_top_drawer_of_the_cabinet.py index 00ab05f95..dd20edd58 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_close_the_top_drawer_of_the_cabinet.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_close_the_top_drawer_of_the_cabinet.py @@ -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: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_close_the_top_drawer_of_the_cabinet_and_put_the_black_bowl_on_top_of_it.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_close_the_top_drawer_of_the_cabinet_and_put_the_black_bowl_on_top_of_it.py index 63fdd8c63..23e878a2e 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_close_the_top_drawer_of_the_cabinet_and_put_the_black_bowl_on_top_of_it.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_close_the_top_drawer_of_the_cabinet_and_put_the_black_bowl_on_top_of_it.py @@ -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: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_put_the_black_bowl_in_the_top_drawer_of_the_cabinet.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_put_the_black_bowl_in_the_top_drawer_of_the_cabinet.py index baa5e800c..5e2e3330d 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_put_the_black_bowl_in_the_top_drawer_of_the_cabinet.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_put_the_black_bowl_in_the_top_drawer_of_the_cabinet.py @@ -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: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_put_the_butter_at_the_back_in_the_top_drawer_of_the_cabinet_and_close_it.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_put_the_butter_at_the_back_in_the_top_drawer_of_the_cabinet_and_close_it.py index 117b0a14e..6b5837d11 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_put_the_butter_at_the_back_in_the_top_drawer_of_the_cabinet_and_close_it.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_put_the_butter_at_the_back_in_the_top_drawer_of_the_cabinet_and_close_it.py @@ -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: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_put_the_butter_at_the_front_in_the_top_drawer_of_the_cabinet_and_close_it.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_put_the_butter_at_the_front_in_the_top_drawer_of_the_cabinet_and_close_it.py index d189435d7..71fd74749 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_put_the_butter_at_the_front_in_the_top_drawer_of_the_cabinet_and_close_it.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_put_the_butter_at_the_front_in_the_top_drawer_of_the_cabinet_and_close_it.py @@ -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: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_put_the_chocolate_pudding_in_the_top_drawer_of_the_cabinet_and_close_it.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_put_the_chocolate_pudding_in_the_top_drawer_of_the_cabinet_and_close_it.py index a49cebd45..d29c1e6ed 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_put_the_chocolate_pudding_in_the_top_drawer_of_the_cabinet_and_close_it.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene10_put_the_chocolate_pudding_in_the_top_drawer_of_the_cabinet_and_close_it.py @@ -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: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene1_open_bottom_drawer.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene1_open_bottom_drawer.py index 561ccf394..ae66229cc 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene1_open_bottom_drawer.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene1_open_bottom_drawer.py @@ -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", ), @@ -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]) diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene1_open_drawer_put_bowl.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene1_open_drawer_put_bowl.py index 2b272bb5a..22284b784 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene1_open_drawer_put_bowl.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene1_open_drawer_put_bowl.py @@ -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") diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene1_put_the_black_bowl_on_the_plate.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene1_put_the_black_bowl_on_the_plate.py index 5157798d1..f1f667e6e 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene1_put_the_black_bowl_on_the_plate.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene1_put_the_black_bowl_on_the_plate.py @@ -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: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene1_put_the_black_bowl_on_top_of_the_cabinet.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene1_put_the_black_bowl_on_top_of_the_cabinet.py index 09920e93d..ce325f1a1 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene1_put_the_black_bowl_on_top_of_the_cabinet.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene1_put_the_black_bowl_on_top_of_the_cabinet.py @@ -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: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_open_the_top_drawer_of_the_cabinet.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_open_the_top_drawer_of_the_cabinet.py index 32a832897..69e5d6e1d 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_open_the_top_drawer_of_the_cabinet.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_open_the_top_drawer_of_the_cabinet.py @@ -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: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_put_the_black_bowl_at_the_back_on_the_plate.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_put_the_black_bowl_at_the_back_on_the_plate.py index 0f8757e80..bb29881a6 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_put_the_black_bowl_at_the_back_on_the_plate.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_put_the_black_bowl_at_the_back_on_the_plate.py @@ -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: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_put_the_black_bowl_at_the_front_on_the_plate.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_put_the_black_bowl_at_the_front_on_the_plate.py index 77398d369..51aadc4f9 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_put_the_black_bowl_at_the_front_on_the_plate.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_put_the_black_bowl_at_the_front_on_the_plate.py @@ -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: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_put_the_black_bowl_in_the_middle_on_the_plate.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_put_the_black_bowl_in_the_middle_on_the_plate.py index 967ceab77..89bab335e 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_put_the_black_bowl_in_the_middle_on_the_plate.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_put_the_black_bowl_in_the_middle_on_the_plate.py @@ -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: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_put_the_middle_black_bowl_on_top_of_the_cabinet.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_put_the_middle_black_bowl_on_top_of_the_cabinet.py index fbd0b279b..a02117102 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_put_the_middle_black_bowl_on_top_of_the_cabinet.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_put_the_middle_black_bowl_on_top_of_the_cabinet.py @@ -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: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_stack_the_black_bowl_at_the_front_on_the_black_bowl_in_the_middle.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_stack_the_black_bowl_at_the_front_on_the_black_bowl_in_the_middle.py index 7de3eba11..528aa8658 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_stack_the_black_bowl_at_the_front_on_the_black_bowl_in_the_middle.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_stack_the_black_bowl_at_the_front_on_the_black_bowl_in_the_middle.py @@ -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: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_stack_the_middle_black_bowl_on_the_back_black_bowl.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_stack_the_middle_black_bowl_on_the_back_black_bowl.py index e24d0fbab..d58e7a36c 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_stack_the_middle_black_bowl_on_the_back_black_bowl.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene2_stack_the_middle_black_bowl_on_the_back_black_bowl.py @@ -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: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene3_put_the_frying_pan_on_the_stove.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene3_put_the_frying_pan_on_the_stove.py index 5bd0b1efa..145885150 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene3_put_the_frying_pan_on_the_stove.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene3_put_the_frying_pan_on_the_stove.py @@ -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: @@ -43,15 +43,15 @@ 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, ), @@ -59,8 +59,8 @@ class LiberoKitchenScene3PutFryingPanOnStoveTask(Libero90BaseTask): 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", ), ], @@ -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 @@ -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,) diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene3_put_the_moka_pot_on_the_stove.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene3_put_the_moka_pot_on_the_stove.py index 84e62b7c7..159cb114b 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene3_put_the_moka_pot_on_the_stove.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene3_put_the_moka_pot_on_the_stove.py @@ -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: @@ -43,15 +43,15 @@ 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, ), @@ -59,8 +59,8 @@ class LiberoKitchenScene3PutMokaPotOnStoveTask(Libero90BaseTask): 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", ), ], diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene3_turn_on_the_stove.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene3_turn_on_the_stove.py index 24335c134..2ebcb18b1 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene3_turn_on_the_stove.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene3_turn_on_the_stove.py @@ -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: @@ -43,15 +43,15 @@ 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, ), @@ -59,8 +59,8 @@ class LiberoKitchenScene3TurnOnStoveTask(Libero90BaseTask): 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", ), ], @@ -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 diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene3_turn_on_the_stove_and_put_the_frying_pan_on_it.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene3_turn_on_the_stove_and_put_the_frying_pan_on_it.py index 88f85c63c..507b144ae 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene3_turn_on_the_stove_and_put_the_frying_pan_on_it.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene3_turn_on_the_stove_and_put_the_frying_pan_on_it.py @@ -17,7 +17,7 @@ "libero_90.kitchen_scene3_turn_on_the_stove_and_put_the_frying_pan_on_it", "kitchen_scene3_turn_on_the_stove_and_put_the_frying_pan_on_it", ) -class LiberoKitchenScene3TurnOnStoveAndPutFryingPanTask(Libero90BaseTask): +class LiberoKitchenScene3TurnOnTheStoveAndPutTheFryingPanOnItTask(Libero90BaseTask): """Configuration for the Libero kitchen scene3 turn on the stove and put the frying pan on it task. This task is transferred from: @@ -45,15 +45,15 @@ class LiberoKitchenScene3TurnOnStoveAndPutFryingPanTask(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, ), @@ -61,8 +61,8 @@ class LiberoKitchenScene3TurnOnStoveAndPutFryingPanTask(Libero90BaseTask): 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", ), ], @@ -91,7 +91,7 @@ def _terminated(self, states: TensorState) -> torch.Tensor: # 2. check if the frying pan is on the stove frypan_pos = states.objects["chefmate_8_frypan"].root_state[:, :3] # (N,3) - stove_center_single = self.handler.physics.named.data.site_xpos["flat_stove/burner"] # (3,) + stove_center_single = self.handler.physics.named.data.site_xpos["flat_stove/cook_region"] # (3,) N = frypan_pos.shape[0] stove_center_pos = ( torch.tensor(stove_center_single, device=frypan_pos.device).reshape(1, 3).repeat(N, 1) diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene4_put_the_black_bowl_in_the_bottom_drawer_of_the_cabinet.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene4_put_the_black_bowl_in_the_bottom_drawer_of_the_cabinet.py index 39b14c6bc..fae930efc 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene4_put_the_black_bowl_in_the_bottom_drawer_of_the_cabinet.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene4_put_the_black_bowl_in_the_bottom_drawer_of_the_cabinet.py @@ -33,7 +33,7 @@ def pose_to_mat(pos: torch.Tensor, quat: torch.Tensor | None = None) -> torch.Te "libero_90.kitchen_scene4_put_the_black_bowl_in_the_bottom_drawer_of_the_cabinet", "kitchen_scene4_put_the_black_bowl_in_the_bottom_drawer_of_the_cabinet", ) -class LiberoKitchenScene4PutBlackBowlInBottomDrawerTask(Libero90BaseTask): +class LiberoKitchenScene4PutTheBlackBowlInTheBottomDrawerOfTheCabinetTask(Libero90BaseTask): """Configuration for the Libero kitchen scene4 put the black bowl in the bottom drawer of the cabinet task. This task is transferred from: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene4_put_the_black_bowl_on_top_of_the_cabinet.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene4_put_the_black_bowl_on_top_of_the_cabinet.py index 3b3604436..ccc8cb338 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene4_put_the_black_bowl_on_top_of_the_cabinet.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene4_put_the_black_bowl_on_top_of_the_cabinet.py @@ -18,7 +18,7 @@ "libero_90.kitchen_scene4_put_the_black_bowl_on_top_of_the_cabinet", "kitchen_scene4_put_the_black_bowl_on_top_of_the_cabinet", ) -class LiberoKitchenScene4PutBlackBowlOnTopOfCabinetTask(Libero90BaseTask): +class LiberoKitchenScene4PutBlackBowlOnTopOfTheCabinetTask(Libero90BaseTask): """Configuration for the Libero kitchen scene4 put the black bowl on top of the cabinet task. This task is transferred from: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene4_put_the_wine_bottle_in_the_bottom_drawer_of_the_cabinet.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene4_put_the_wine_bottle_in_the_bottom_drawer_of_the_cabinet.py index 46aad547f..76d638e48 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene4_put_the_wine_bottle_in_the_bottom_drawer_of_the_cabinet.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene4_put_the_wine_bottle_in_the_bottom_drawer_of_the_cabinet.py @@ -33,7 +33,7 @@ def pose_to_mat(pos: torch.Tensor, quat: torch.Tensor | None = None) -> torch.Te "libero_90.kitchen_scene4_put_the_wine_bottle_in_the_bottom_drawer_of_the_cabinet", "kitchen_scene4_put_the_wine_bottle_in_the_bottom_drawer_of_the_cabinet", ) -class LiberoKitchenScene4PutWineBottleInBottomDrawerTask(Libero90BaseTask): +class LiberoKitchenScene4PutTheWineBottleInTheBottomDrawerOfTheCabinetTask(Libero90BaseTask): """Configuration for the Libero kitchen scene4 put the wine bottle in the bottom drawer of the cabinet task. This task is transferred from: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene4_put_the_wine_bottle_on_the_wine_rack.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene4_put_the_wine_bottle_on_the_wine_rack.py index 7bb37988b..531cb8f31 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene4_put_the_wine_bottle_on_the_wine_rack.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene4_put_the_wine_bottle_on_the_wine_rack.py @@ -17,7 +17,7 @@ "libero_90.kitchen_scene4_put_the_wine_bottle_on_the_wine_rack", "kitchen_scene4_put_the_wine_bottle_on_the_wine_rack", ) -class LiberoKitchenScene4PutWineBottleOnWineRackTask(Libero90BaseTask): +class LiberoKitchenScene4PutTheWineBottleOnTheWineRackTask(Libero90BaseTask): """Configuration for the Libero kitchen scene4 put the wine bottle on the wine rack task. This task is transferred from: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene5_put_the_black_bowl_in_the_top_drawer_of_the_cabinet.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene5_put_the_black_bowl_in_the_top_drawer_of_the_cabinet.py index 82027973e..895a63273 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene5_put_the_black_bowl_in_the_top_drawer_of_the_cabinet.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene5_put_the_black_bowl_in_the_top_drawer_of_the_cabinet.py @@ -33,7 +33,7 @@ def pose_to_mat(pos: torch.Tensor, quat: torch.Tensor | None = None) -> torch.Te "libero_90.kitchen_scene5_put_the_black_bowl_in_the_top_drawer_of_the_cabinet", "kitchen_scene5_put_the_black_bowl_in_the_top_drawer_of_the_cabinet", ) -class LiberoKitchenScene5PutBlackBowlInTopDrawerTask(Libero90BaseTask): +class LiberoKitchenScene5PutTheBlackBowlInTheTopDrawerOfTheCabinetTask(Libero90BaseTask): """Configuration for the Libero kitchen scene5 put the black bowl in the top drawer of the cabinet task.""" scenario = ScenarioCfg( diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene5_put_the_black_bowl_on_the_plate.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene5_put_the_black_bowl_on_the_plate.py index 88263a43c..9258b6156 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene5_put_the_black_bowl_on_the_plate.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene5_put_the_black_bowl_on_the_plate.py @@ -17,7 +17,7 @@ "libero_90.kitchen_scene5_put_the_black_bowl_on_the_plate", "kitchen_scene5_put_the_black_bowl_on_the_plate", ) -class LiberoKitchenScene5PutBowlOnPlateTask(Libero90BaseTask): +class LiberoKitchenScene5PutTheBlackBowlOnThePlateTask(Libero90BaseTask): """Configuration for the Libero kitchen scene5 put the black bowl on the plate task.""" scenario = ScenarioCfg( diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene5_put_the_black_bowl_on_top_of_the_cabinet.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene5_put_the_black_bowl_on_top_of_the_cabinet.py index 50dec3d10..43e5ce1b5 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene5_put_the_black_bowl_on_top_of_the_cabinet.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene5_put_the_black_bowl_on_top_of_the_cabinet.py @@ -33,7 +33,7 @@ def pose_to_mat(pos: torch.Tensor, quat: torch.Tensor | None = None) -> torch.Te "libero_90.kitchen_scene5_put_the_black_bowl_on_top_of_the_cabinet", "kitchen_scene5_put_the_black_bowl_on_top_of_the_cabinet", ) -class LiberoKitchenScene5PutBowlOnCabinetTask(Libero90BaseTask): +class LiberoKitchenScene5PutTheBlackBowlOnTopOfTheCabinetTask(Libero90BaseTask): """Configuration for the Libero kitchen scene5 put the black bowl on top of the cabinet task.""" scenario = ScenarioCfg( diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene5_put_the_ketchup_in_the_top_drawer_of_the_cabinet.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene5_put_the_ketchup_in_the_top_drawer_of_the_cabinet.py index aa8d0cfde..7c9e9020f 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene5_put_the_ketchup_in_the_top_drawer_of_the_cabinet.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene5_put_the_ketchup_in_the_top_drawer_of_the_cabinet.py @@ -33,7 +33,7 @@ def pose_to_mat(pos: torch.Tensor, quat: torch.Tensor | None = None) -> torch.Te "libero_90.kitchen_scene5_put_the_ketchup_in_the_top_drawer_of_the_cabinet", "kitchen_scene5_put_the_ketchup_in_the_top_drawer_of_the_cabinet", ) -class LiberoKitchenScene5PutKetchupInTopDrawerTask(Libero90BaseTask): +class LiberoKitchenScene5PutTheKetchupInTheTopDrawerOfTheCabinetTask(Libero90BaseTask): """Configuration for the Libero kitchen scene5 put the ketchup in the top drawer of the cabinet task.""" scenario = ScenarioCfg( diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene6_put_the_yellow_and_white_mug_to_the_front_of_the_white_mug.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene6_put_the_yellow_and_white_mug_to_the_front_of_the_white_mug.py index 4e3120d3f..425895b74 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene6_put_the_yellow_and_white_mug_to_the_front_of_the_white_mug.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene6_put_the_yellow_and_white_mug_to_the_front_of_the_white_mug.py @@ -17,7 +17,7 @@ "libero_90.kitchen_scene6_put_the_yellow_and_white_mug_to_the_front_of_the_white_mug", "kitchen_scene6_put_the_yellow_and_white_mug_to_the_front_of_the_white_mug", ) -class LiberoKitchenScene6PutYellowWhiteMugFrontWhiteMugTask(Libero90BaseTask): +class LiberoKitchenScene6PutTheYellowAndWhiteMugToTheFrontOfTheWhiteMugTask(Libero90BaseTask): """Configuration for the Libero kitchen scene6 put the yellow and white mug to the front of the white mug task.""" scenario = ScenarioCfg( diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene8_turn_off_the_stove.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene8_turn_off_the_stove.py index a3b423dd4..f94ec58cc 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene8_turn_off_the_stove.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene8_turn_off_the_stove.py @@ -17,7 +17,7 @@ "libero_90.kitchen_scene8_turn_off_the_stove", "kitchen_scene8_turn_off_the_stove", ) -class LiberoKitchenScene8TurnOffStoveTask(Libero90BaseTask): +class LiberoKitchenScene8TurnOffTheStoveTask(Libero90BaseTask): """Configuration for the Libero kitchen scene8 turn off the stove task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene9_turn_on_the_stove.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene9_turn_on_the_stove.py index 8b709655c..d8b370f5c 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene9_turn_on_the_stove.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene9_turn_on_the_stove.py @@ -17,7 +17,7 @@ "libero_90.kitchen_scene9_turn_on_the_stove", "kitchen_scene9_turn_on_the_stove", ) -class LiberoKitchenScene9TurnOnStoveTask(Libero90BaseTask): +class LiberoKitchenScene9TurnOnTheStoveTask(Libero90BaseTask): """Configuration for the Libero kitchen scene9 turn on the stove task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/libero_kitchen_scene9_turn_on_the_stove_and_put_the_frying_pan_on_it.py b/roboverse_pack/tasks/libero_90/libero_kitchen_scene9_turn_on_the_stove_and_put_the_frying_pan_on_it.py index 6382aa4ab..7c4fe1b54 100644 --- a/roboverse_pack/tasks/libero_90/libero_kitchen_scene9_turn_on_the_stove_and_put_the_frying_pan_on_it.py +++ b/roboverse_pack/tasks/libero_90/libero_kitchen_scene9_turn_on_the_stove_and_put_the_frying_pan_on_it.py @@ -17,7 +17,7 @@ "libero_90.kitchen_scene9_turn_on_the_stove_and_put_the_frying_pan_on_it", "kitchen_scene9_turn_on_the_stove_and_put_the_frying_pan_on_it", ) -class LiberoKitchenScene9TurnOnStoveAndPutFryingPanTask(Libero90BaseTask): +class LiberoKitchenScene9TurnOnTheStoveAndPutTheFryingPanTask(Libero90BaseTask): """Configuration for the Libero kitchen scene9 turn on the stove and put the frying pan on it task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene1_pick_up_the_alphabet_soup_and_put_it_in_the_basket.py b/roboverse_pack/tasks/libero_90/living_room_scene1_pick_up_the_alphabet_soup_and_put_it_in_the_basket.py index d325ec1e2..3956c1445 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene1_pick_up_the_alphabet_soup_and_put_it_in_the_basket.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene1_pick_up_the_alphabet_soup_and_put_it_in_the_basket.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene1_pick_up_the_alphabet_soup_and_put_it_in_the_basket", "living_room_scene1_pick_up_the_alphabet_soup_and_put_it_in_the_basket", ) -class LiberoLivingRoomScene1PickUpAlphabetSoupAndPutItInTheBasketTask(Libero90BaseTask): +class LiberoLivingRoomScene1PickUpTheAlphabetSoupAndPutItInTheBasketTask(Libero90BaseTask): """Configuration for the Libero living room scene1 pick up the alphabet soup and put it in the basket task.""" scenario = ScenarioCfg( diff --git a/roboverse_pack/tasks/libero_90/living_room_scene1_pick_up_the_cream_cheese_box_and_put_it_in_the_basket.py b/roboverse_pack/tasks/libero_90/living_room_scene1_pick_up_the_cream_cheese_box_and_put_it_in_the_basket.py index 2765cd9ea..ec4ddd716 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene1_pick_up_the_cream_cheese_box_and_put_it_in_the_basket.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene1_pick_up_the_cream_cheese_box_and_put_it_in_the_basket.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene1_pick_up_the_cream_cheese_box_and_put_it_in_the_basket", "living_room_scene1_pick_up_the_cream_cheese_box_and_put_it_in_the_basket", ) -class LiberoLivingRoomScene1PickUpCreamCheeseAndPutItInTheBasketTask(Libero90BaseTask): +class LiberoLivingRoomScene1PickUpTheCreamCheeseBoxAndPutItInTheBasketTask(Libero90BaseTask): """Configuration for the Libero living room scene1 pick up the cream cheese box and put it in the basket task.""" scenario = ScenarioCfg( diff --git a/roboverse_pack/tasks/libero_90/living_room_scene1_pick_up_the_ketchup_and_put_it_in_the_basket.py b/roboverse_pack/tasks/libero_90/living_room_scene1_pick_up_the_ketchup_and_put_it_in_the_basket.py index 7cb9cf717..cdae6632e 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene1_pick_up_the_ketchup_and_put_it_in_the_basket.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene1_pick_up_the_ketchup_and_put_it_in_the_basket.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene1_pick_up_the_ketchup_and_put_it_in_the_basket", "living_room_scene1_pick_up_the_ketchup_and_put_it_in_the_basket", ) -class LiberoLivingRoomScene1PickUpKetchupAndPutItInTheBasketTask(Libero90BaseTask): +class LiberoLivingRoomScene1PickUpTheKetchupAndPutItInTheBasketTask(Libero90BaseTask): """Configuration for the Libero living room scene1 pick up the ketchup and put it in the basket task.""" scenario = ScenarioCfg( diff --git a/roboverse_pack/tasks/libero_90/living_room_scene1_pick_up_the_tomato_sauce_and_put_it_in_the_basket.py b/roboverse_pack/tasks/libero_90/living_room_scene1_pick_up_the_tomato_sauce_and_put_it_in_the_basket.py index 836d7b404..952f0c956 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene1_pick_up_the_tomato_sauce_and_put_it_in_the_basket.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene1_pick_up_the_tomato_sauce_and_put_it_in_the_basket.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene1_pick_up_the_tomato_sauce_and_put_it_in_the_basket", "living_room_scene1_pick_up_the_tomato_sauce_and_put_it_in_the_basket", ) -class LiberoLivingRoomScene1PickUpTomatoSauceAndPutItInTheBasketTask(Libero90BaseTask): +class LiberoLivingRoomScene1PickUpTheTomatoSauceAndPutItInTheBasketTask(Libero90BaseTask): """Configuration for the Libero living room scene1 pick up the tomato sauce and put it in the basket task. Objects: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_alphabet_soup_and_put_it_in_the_basket.py b/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_alphabet_soup_and_put_it_in_the_basket.py index c09751eae..2df9aa9a3 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_alphabet_soup_and_put_it_in_the_basket.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_alphabet_soup_and_put_it_in_the_basket.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene2_pick_up_the_alphabet_soup_and_put_it_in_the_basket", "living_room_scene2_pick_up_the_alphabet_soup_and_put_it_in_the_basket", ) -class LiberoLivingRoomScene2PickUpAlphabetSoupTask(Libero90BaseTask): +class LiberoLivingRoomScene2PickUpTheAlphabetSoupAndPutItInTheBasketTask(Libero90BaseTask): """Configuration for the Libero kitchen scene10 put the chocolate pudding in the top drawer of the cabinet and close it task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_butter_and_put_it_in_the_basket.py b/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_butter_and_put_it_in_the_basket.py index f0bbaa51e..6f90e2607 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_butter_and_put_it_in_the_basket.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_butter_and_put_it_in_the_basket.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene2_pick_up_the_butter_and_put_it_in_the_basket", "living_room_scene2_pick_up_the_butter_and_put_it_in_the_basket", ) -class LiberoLivingRoomScene2PickUpButterTask(Libero90BaseTask): +class LiberoLivingRoomScene2PickUpTheButterAndPutItInTheBasketTask(Libero90BaseTask): """Configuration for the Libero kitchen scene10 put the chocolate pudding in the top drawer of the cabinet and close it task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_milk_and_put_it_in_the_basket.py b/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_milk_and_put_it_in_the_basket.py index 3d8b0b838..09dc752a8 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_milk_and_put_it_in_the_basket.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_milk_and_put_it_in_the_basket.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene2_pick_up_the_milk_and_put_it_in_the_basket", "living_room_scene2_pick_up_the_milk_and_put_it_in_the_basket", ) -class LiberoLivingRoomScene2PickUpMilkTask(Libero90BaseTask): +class LiberoLivingRoomScene2PickUpTheMilkAndPutItInTheBasketTask(Libero90BaseTask): """Configuration for the Libero kitchen scene10 put the chocolate pudding in the top drawer of the cabinet and close it task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_orange_juice_and_put_it_in_the_basket.py b/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_orange_juice_and_put_it_in_the_basket.py index 4a304ee60..00e02467f 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_orange_juice_and_put_it_in_the_basket.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_orange_juice_and_put_it_in_the_basket.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene2_pick_up_the_orange_juice_and_put_it_in_the_basket", "living_room_scene2_pick_up_the_orange_juice_and_put_it_in_the_basket", ) -class LiberoLivingRoomScene2PickUpOrangeJuiceTask(Libero90BaseTask): +class LiberoLivingRoomScene2PickUpTheOrangeJuiceAndPutItInTheBasketTask(Libero90BaseTask): """Configuration for the Libero kitchen scene10 put the chocolate pudding in the top drawer of the cabinet and close it task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_tomato_sauce_and_put_it_in_the_basket.py b/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_tomato_sauce_and_put_it_in_the_basket.py index a65c466a8..054570533 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_tomato_sauce_and_put_it_in_the_basket.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene2_pick_up_the_tomato_sauce_and_put_it_in_the_basket.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene2_pick_up_the_tomato_sauce_and_put_it_in_the_basket", "living_room_scene2_pick_up_the_tomato_sauce_and_put_it_in_the_basket", ) -class LiberoLivingRoomScene2PickUpTomatoSauceTask(Libero90BaseTask): +class LiberoLivingRoomScene2PickUpTheTomatoSauceAndPutItInTheBasketTask(Libero90BaseTask): """Configuration for the Libero kitchen scene10 put the chocolate pudding in the top drawer of the cabinet and close it task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_alphabet_soup_and_put_it_in_the_tray.py b/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_alphabet_soup_and_put_it_in_the_tray.py index 5be10a189..ffd01966d 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_alphabet_soup_and_put_it_in_the_tray.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_alphabet_soup_and_put_it_in_the_tray.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene3_pick_up_the_alphabet_soup_and_put_it_in_the_tray", "living_room_scene3_pick_up_the_alphabet_soup_and_put_it_in_the_tray", ) -class LiberoLivingRoomScene3PickUpAlphabetSoupTask(Libero90BaseTask): +class LiberoLivingRoomScene3PickUpTheAlphabetSoupAndPutItInTheTrayTask(Libero90BaseTask): """Configuration for the Libero kitchen scene10 put the chocolate pudding in the top drawer of the cabinet and close it task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_butter_and_put_it_in_the_tray.py b/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_butter_and_put_it_in_the_tray.py index 724090bb8..037483b97 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_butter_and_put_it_in_the_tray.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_butter_and_put_it_in_the_tray.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene3_pick_up_the_butter_and_put_it_in_the_tray", "living_room_scene3_pick_up_the_butter_and_put_it_in_the_tray", ) -class LiberoLivingRoomScene3PickUpButterTask(Libero90BaseTask): +class LiberoLivingRoomScene3PickUpTheButterAndPutItInTheTrayTask(Libero90BaseTask): """Configuration for the Libero kitchen scene10 put the chocolate pudding in the top drawer of the cabinet and close it task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_cream_cheese_and_put_it_in_the_tray.py b/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_cream_cheese_and_put_it_in_the_tray.py index ed743134b..a23e2b286 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_cream_cheese_and_put_it_in_the_tray.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_cream_cheese_and_put_it_in_the_tray.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene3_pick_up_the_cream_cheese_and_put_it_in_the_tray", "living_room_scene3_pick_up_the_cream_cheese_and_put_it_in_the_tray", ) -class LiberoLivingRoomScene3PickUpCreamCheeseTask(Libero90BaseTask): +class LiberoLivingRoomScene3PickUpTheCreamCheeseAndPutItInTheTrayTask(Libero90BaseTask): """Configuration for the Libero kitchen scene10 put the chocolate pudding in the top drawer of the cabinet and close it task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_ketchup_and_put_it_in_the_tray.py b/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_ketchup_and_put_it_in_the_tray.py index a7aeebc52..b828140fe 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_ketchup_and_put_it_in_the_tray.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_ketchup_and_put_it_in_the_tray.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene3_pick_up_the_ketchup_and_put_it_in_the_tray", "living_room_scene3_pick_up_the_ketchup_and_put_it_in_the_tray", ) -class LiberoLivingRoomScene3PickUpKetchupTask(Libero90BaseTask): +class LiberoLivingRoomScene3PickUpTheKetchupAndPutItInTheTrayTask(Libero90BaseTask): """Configuration for the Libero kitchen scene10 put the chocolate pudding in the top drawer of the cabinet and close it task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_tomato_sauce_and_put_it_in_the_tray.py b/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_tomato_sauce_and_put_it_in_the_tray.py index aefca7244..7093f98c0 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_tomato_sauce_and_put_it_in_the_tray.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene3_pick_up_the_tomato_sauce_and_put_it_in_the_tray.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene3_pick_up_the_tomato_sauce_and_put_it_in_the_tray", "living_room_scene3_pick_up_the_tomato_sauce_and_put_it_in_the_tray", ) -class LiberoLivingRoomScene3PickUpTomatoSauceTask(Libero90BaseTask): +class LiberoLivingRoomScene3PickUpTheTomatoSauceAndPutItInTheTrayTask(Libero90BaseTask): """Configuration for the Libero kitchen scene10 put the chocolate pudding in the top drawer of the cabinet and close it task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene4_pick_up_the_black_bowl_on_the_left_and_put_it_in_the_tray.py b/roboverse_pack/tasks/libero_90/living_room_scene4_pick_up_the_black_bowl_on_the_left_and_put_it_in_the_tray.py index b6b130783..98b83df09 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene4_pick_up_the_black_bowl_on_the_left_and_put_it_in_the_tray.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene4_pick_up_the_black_bowl_on_the_left_and_put_it_in_the_tray.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene4_pick_up_the_black_bowl_on_the_left_and_put_it_in_the_tray", "living_room_scene4_pick_up_the_black_bowl_on_the_left_and_put_it_in_the_tray", ) -class LiberoLivingRoomScene4PickUpLeftBlackBowlTask(Libero90BaseTask): +class LiberoLivingRoomScene4PickUpTheBlackBowlOnTheLeftAndPutItInTheTrayTask(Libero90BaseTask): """Configuration for the Libero living room scene4 pick up the black bowl on the left and put it in the tray task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene4_pick_up_the_chocolate_pudding_and_put_it_in_the_tray.py b/roboverse_pack/tasks/libero_90/living_room_scene4_pick_up_the_chocolate_pudding_and_put_it_in_the_tray.py index a2f3b5bcf..7caa02886 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene4_pick_up_the_chocolate_pudding_and_put_it_in_the_tray.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene4_pick_up_the_chocolate_pudding_and_put_it_in_the_tray.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene4_pick_up_the_chocolate_pudding_and_put_it_in_the_tray", "living_room_scene4_pick_up_the_chocolate_pudding_and_put_it_in_the_tray", ) -class LiberoLivingRoomScene4PickUpChocolatePuddingTask(Libero90BaseTask): +class LiberoLivingRoomScene4PickUpTheChocolatePuddingAndPutItInTheTrayTask(Libero90BaseTask): """Configuration for the Libero living room scene4 pick up the chocolate pudding and put it in the tray task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene4_pick_up_the_salad_dressing_and_put_it_in_the_tray.py b/roboverse_pack/tasks/libero_90/living_room_scene4_pick_up_the_salad_dressing_and_put_it_in_the_tray.py index dd36a8b4c..6389a9d14 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene4_pick_up_the_salad_dressing_and_put_it_in_the_tray.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene4_pick_up_the_salad_dressing_and_put_it_in_the_tray.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene4_pick_up_the_salad_dressing_and_put_it_in_the_tray", "living_room_scene4_pick_up_the_salad_dressing_and_put_it_in_the_tray", ) -class LiberoLivingRoomScene4PickUpSaladDressingTask(Libero90BaseTask): +class LiberoLivingRoomScene4PickUpTheSaladDressingAndPutItInTheTrayTask(Libero90BaseTask): """Configuration for the Libero living room scene4 pick up the salad dressing and put it in the tray task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene4_stack_the_left_bowl_on_the_right_bowl_and_place_them_in_the_tray.py b/roboverse_pack/tasks/libero_90/living_room_scene4_stack_the_left_bowl_on_the_right_bowl_and_place_them_in_the_tray.py index 081c5247b..605497139 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene4_stack_the_left_bowl_on_the_right_bowl_and_place_them_in_the_tray.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene4_stack_the_left_bowl_on_the_right_bowl_and_place_them_in_the_tray.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene4_stack_the_left_bowl_on_the_right_bowl_and_place_them_in_the_tray", "living_room_scene4_stack_the_left_bowl_on_the_right_bowl_and_place_them_in_the_tray", ) -class LiberoLivingRoomScene4StackLeftBowlOnRightBowlTask(Libero90BaseTask): +class LiberoLivingRoomScene4StackTheLeftBowlOnTheRightBowlAndPlaceThemInTheTrayTask(Libero90BaseTask): """Configuration for the Libero living room scene4 stack the left bowl on the right bowl and place them in the tray task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene4_stack_the_right_bowl_on_the_left_bowl_and_place_them_in_the_tray.py b/roboverse_pack/tasks/libero_90/living_room_scene4_stack_the_right_bowl_on_the_left_bowl_and_place_them_in_the_tray.py index 5ff73a68b..66c6d2644 100644 --- a/roboverse_pack/tasks/libero_90/living_room_scene4_stack_the_right_bowl_on_the_left_bowl_and_place_them_in_the_tray.py +++ b/roboverse_pack/tasks/libero_90/living_room_scene4_stack_the_right_bowl_on_the_left_bowl_and_place_them_in_the_tray.py @@ -17,7 +17,7 @@ "libero_90.living_room_scene4_stack_the_right_bowl_on_the_left_bowl_and_place_them_in_the_tray", "living_room_scene4_stack_the_right_bowl_on_the_left_bowl_and_place_them_in_the_tray", ) -class LiberoLivingRoomScene4StackRightBowlOnLeftBowlTask(Libero90BaseTask): +class LiberoLivingRoomScene4StackTheRightBowlOnTheLeftBowlAndPlaceThemInTheTrayTask(Libero90BaseTask): """Configuration for the Libero living room scene4 stack the right bowl on the left bowl and place them in the tray task. Task Description: diff --git a/roboverse_pack/tasks/libero_90/living_room_scene5_put_the_red_mug_on_the_left_plate.py b/roboverse_pack/tasks/libero_90/living_room_scene5_put_the_red_mug_on_the_left_plate.py new file mode 100644 index 000000000..df86ced0c --- /dev/null +++ b/roboverse_pack/tasks/libero_90/living_room_scene5_put_the_red_mug_on_the_left_plate.py @@ -0,0 +1,111 @@ +"""Configuration for the Libero living room scene5 put the red mug on the left plate task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.living_room_scene5_put_the_red_mug_on_the_left_plate", + "living_room_scene5_put_the_red_mug_on_the_left_plate", +) +class LiberoLivingRoomScene5PutTheRedMugOnTheLeftPlateTask(Libero90BaseTask): + """Configuration for the Libero living room scene5 put the red mug on the left plate task. + + Task Description: + - Put the red mug on the left plate + + Objects: + - red_coffee_mug + - porcelain_mug + - white_yellow_mug + - plate_1 + - plate_2 + + Goal: red_coffee_mug is on plate_1. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="porcelain_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/usd/porcelain_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/urdf/porcelain_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/mjcf/porcelain_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="white_yellow_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/usd/white_yellow_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/urdf/white_yellow_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/mjcf/white_yellow_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="plate_1", + usd_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/usd/plate.usd", + urdf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/urdf/plate.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/mjcf/plate.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="plate_2", + usd_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/usd/plate.usd", + urdf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/urdf/plate.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/mjcf/plate.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 200 + task_desc = "Put the red mug on the left plate (living_room_scene5)" + + workspace_name = ("living_room_table",) + workspace_offset = ((0.0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = ( + "roboverse_data/trajs/libero90/libero_90_living_room_scene5_put_the_red_mug_on_the_left_plate_traj_v2.pkl" + ) + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker.""" + red_mug_pos = states.objects["red_coffee_mug"].root_state[:, :3] # (N,3) + plate_pos = states.objects["plate_1"].root_state[:, :3] # (N,3) + # Check if red mug is within a small region above the plate + range_threshold = 0.06 # Radius of the range in xy plane + height_threshold = 0.03 # Height threshold above the plate + + # Calculate xy distance between red mug and plate + xy_distance = torch.norm(red_mug_pos[:, :2] - plate_pos[:, :2], dim=-1) # (N,) + # Calculate height difference (red mug z - plate z) + height_diff = red_mug_pos[:, 2] - plate_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,) + + is_on_plate = xy_close & height_valid # (N,) + return is_on_plate + + # rewrite checker + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/living_room_scene5_put_the_red_mug_on_the_right_plate.py b/roboverse_pack/tasks/libero_90/living_room_scene5_put_the_red_mug_on_the_right_plate.py new file mode 100644 index 000000000..69f07cbd3 --- /dev/null +++ b/roboverse_pack/tasks/libero_90/living_room_scene5_put_the_red_mug_on_the_right_plate.py @@ -0,0 +1,104 @@ +"""Configuration for the Libero living room scene5 put the red mug on the right plate task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.living_room_scene5_put_the_red_mug_on_the_right_plate", + "living_room_scene5_put_the_red_mug_on_the_right_plate", +) +class LiberoLivingRoomScene5PutTheRedMugOnTheRightPlateTask(Libero90BaseTask): + """Configuration for the Libero living room scene5 put the red mug on the right plate task. + + Task Description: + - Put the red mug on the right plate + + Objects: + - red_coffee_mug + - porcelain_mug + - white_yellow_mug + - plate_1 + - plate_2 + + Goal: red_coffee_mug is on plate_2. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="porcelain_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/usd/porcelain_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/urdf/porcelain_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/mjcf/porcelain_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="white_yellow_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/usd/white_yellow_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/urdf/white_yellow_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/mjcf/white_yellow_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="plate_1", + usd_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/usd/plate.usd", + urdf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/urdf/plate.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/mjcf/plate.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="plate_2", + usd_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/usd/plate.usd", + urdf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/urdf/plate.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/mjcf/plate.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 200 + task_desc = "Put the red mug on the right plate (living_room_scene5)" + + workspace_name = ("living_room_table",) + workspace_offset = ((0.0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = ( + "roboverse_data/trajs/libero90/libero_90_living_room_scene5_put_the_red_mug_on_the_right_plate_traj_v2.pkl" + ) + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker.""" + red_mug_pos = states.objects["red_coffee_mug"].root_state[:, :3] # (N,3) + plate_pos = states.objects["plate_2"].root_state[:, :3] # (N,3) + range_threshold = 0.06 + height_threshold = 0.03 + xy_distance = torch.norm(red_mug_pos[:, :2] - plate_pos[:, :2], dim=-1) + height_diff = red_mug_pos[:, 2] - plate_pos[:, 2] + xy_close = xy_distance < range_threshold + height_valid = (height_diff > 0) & (height_diff < height_threshold) + is_on_plate = xy_close & height_valid + return is_on_plate + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/living_room_scene5_put_the_white_mug_on_the_left_plate.py b/roboverse_pack/tasks/libero_90/living_room_scene5_put_the_white_mug_on_the_left_plate.py new file mode 100644 index 000000000..f96e070a1 --- /dev/null +++ b/roboverse_pack/tasks/libero_90/living_room_scene5_put_the_white_mug_on_the_left_plate.py @@ -0,0 +1,104 @@ +"""Configuration for the Libero living room scene5 put the white mug on the left plate task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.living_room_scene5_put_the_white_mug_on_the_left_plate", + "living_room_scene5_put_the_white_mug_on_the_left_plate", +) +class LiberoLivingRoomScene5PutTheWhiteMugOnTheLeftPlateTask(Libero90BaseTask): + """Configuration for the Libero living room scene5 put the white mug on the left plate task. + + Task Description: + - Put the white mug on the left plate + + Objects: + - white_mug + - porcelain_mug + - red_coffee_mug + - plate_1 + - plate_2 + + Goal: white_mug is on plate_1. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="porcelain_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/usd/porcelain_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/urdf/porcelain_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/mjcf/porcelain_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="white_yellow_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/usd/white_yellow_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/urdf/white_yellow_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/mjcf/white_yellow_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="plate_1", + usd_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/usd/plate.usd", + urdf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/urdf/plate.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/mjcf/plate.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="plate_2", + usd_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/usd/plate.usd", + urdf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/urdf/plate.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/mjcf/plate.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 200 + task_desc = "Put the white mug on the left plate (living_room_scene5)" + + workspace_name = ("living_room_table",) + workspace_offset = ((0.0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = ( + "roboverse_data/trajs/libero90/libero_90_living_room_scene5_put_the_white_mug_on_the_left_plate_traj_v2.pkl" + ) + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker.""" + white_mug_pos = states.objects["porcelain_mug"].root_state[:, :3] # (N,3) + plate_pos = states.objects["plate_1"].root_state[:, :3] # (N,3) + range_threshold = 0.06 + height_threshold = 0.03 + xy_distance = torch.norm(white_mug_pos[:, :2] - plate_pos[:, :2], dim=-1) + height_diff = white_mug_pos[:, 2] - plate_pos[:, 2] + xy_close = xy_distance < range_threshold + height_valid = (height_diff > 0) & (height_diff < height_threshold) + is_on_plate = xy_close & height_valid + return is_on_plate + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/living_room_scene5_put_the_yellow_and_white_mug_on_the_right_plate.py b/roboverse_pack/tasks/libero_90/living_room_scene5_put_the_yellow_and_white_mug_on_the_right_plate.py new file mode 100644 index 000000000..f5a2f93f4 --- /dev/null +++ b/roboverse_pack/tasks/libero_90/living_room_scene5_put_the_yellow_and_white_mug_on_the_right_plate.py @@ -0,0 +1,102 @@ +"""Configuration for the Libero living room scene5 put the yellow and white mug on the right plate task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.living_room_scene5_put_the_yellow_and_white_mug_on_the_right_plate", + "living_room_scene5_put_the_yellow_and_white_mug_on_the_right_plate", +) +class LiberoLivingRoomScene5PutTheYellowAndWhiteMugOnTheRightPlateTask(Libero90BaseTask): + """Configuration for the Libero living room scene5 put the yellow and white mug on the right plate task. + + Task Description: + - Put the yellow and white mug on the right plate + + Objects: + - white_yellow_mug + - porcelain_mug + - red_coffee_mug + - plate_1 + - plate_2 + + Goal: white_yellow_mug is on plate_2. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="porcelain_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/usd/porcelain_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/urdf/porcelain_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/mjcf/porcelain_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="white_yellow_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/usd/white_yellow_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/urdf/white_yellow_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/mjcf/white_yellow_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="plate_1", + usd_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/usd/plate.usd", + urdf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/urdf/plate.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/mjcf/plate.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="plate_2", + usd_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/usd/plate.usd", + urdf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/urdf/plate.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/mjcf/plate.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 200 + task_desc = "Put the yellow and white mug on the right plate (living_room_scene5)" + + workspace_name = ("living_room_table",) + workspace_offset = ((0.0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_living_room_scene5_put_the_yellow_and_white_mug_on_the_right_plate_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker.""" + mug_pos = states.objects["white_yellow_mug"].root_state[:, :3] # (N,3) + plate_pos = states.objects["plate_2"].root_state[:, :3] # (N,3) + range_threshold = 0.06 + height_threshold = 0.03 + xy_distance = torch.norm(mug_pos[:, :2] - plate_pos[:, :2], dim=-1) + height_diff = mug_pos[:, 2] - plate_pos[:, 2] + xy_close = xy_distance < range_threshold + height_valid = (height_diff > 0) & (height_diff < height_threshold) + is_on_plate = xy_close & height_valid + return is_on_plate + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/living_room_scene6_put_the_chocolate_pudding_to_the_left_of_the_plate.py b/roboverse_pack/tasks/libero_90/living_room_scene6_put_the_chocolate_pudding_to_the_left_of_the_plate.py new file mode 100644 index 000000000..a2f5f6031 --- /dev/null +++ b/roboverse_pack/tasks/libero_90/living_room_scene6_put_the_chocolate_pudding_to_the_left_of_the_plate.py @@ -0,0 +1,96 @@ +"""Configuration for the Libero living room scene6 put the chocolate pudding to the left of the plate task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.living_room_scene6_put_the_chocolate_pudding_to_the_left_of_the_plate", + "living_room_scene6_put_the_chocolate_pudding_to_the_left_of_the_plate", +) +class LiberoLivingRoomScene6PutTheChocolatePuddingToTheLeftOfPlateTask(Libero90BaseTask): + """Task: Put the chocolate_pudding to the left of the plate in living_room_scene6. + + Objects: + - porcelain_mug + - red_coffee_mug + - plate (reference) + - chocolate_pudding (target) + + Goal: Place chocolate_pudding to the left of the plate. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="porcelain_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/usd/porcelain_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/urdf/porcelain_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/mjcf/porcelain_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="plate", + usd_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/usd/plate.usd", + urdf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/urdf/plate.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/mjcf/plate.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="chocolate_pudding", + usd_path="roboverse_data/assets/libero/COMMON/stable_hope_objects/chocolate_pudding/usd/chocolate_pudding.usd", + urdf_path="roboverse_data/assets/libero/COMMON/stable_hope_objects/chocolate_pudding/urdf/chocolate_pudding.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/stable_hope_objects/chocolate_pudding/mjcf/chocolate_pudding.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 250 + task_desc = "Put the chocolate_pudding to the left of the plate (living_room_scene6)" + + workspace_name = ("living_room_table",) + workspace_offset = ((0.0, 0, 0.42),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_living_room_scene6_put_the_chocolate_pudding_to_the_left_of_the_plate_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success: chocolate_pudding is to the left of the plate (x < plate.x - threshold).""" + chocolate_pos = states.objects["chocolate_pudding"].root_state[:, :3] + plate_pos = states.objects["plate"].root_state[:, :3] + + # Calculate relative position: chocolate relative to plate + relative_pos = chocolate_pos - plate_pos + x_diff = relative_pos[:, 0] # x direction + y_diff = relative_pos[:, 1] # y direction + + # Check if chocolate pudding is in the target region relative to plate, range determined by checking trajectory data + # x: -0.05 to 0.05, y: 0.0 to 0.2 + x_in_range = (x_diff > -0.05) & (x_diff < 0.05) + y_in_range = (y_diff > 0) & (y_diff < 0.2) + + success = x_in_range & y_in_range + return success + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/living_room_scene6_put_the_chocolate_pudding_to_the_right_of_the_plate.py b/roboverse_pack/tasks/libero_90/living_room_scene6_put_the_chocolate_pudding_to_the_right_of_the_plate.py new file mode 100644 index 000000000..cd64e9bf4 --- /dev/null +++ b/roboverse_pack/tasks/libero_90/living_room_scene6_put_the_chocolate_pudding_to_the_right_of_the_plate.py @@ -0,0 +1,95 @@ +"""Configuration for the Libero living room scene6 put the chocolate pudding to the right of the plate task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.living_room_scene6_put_the_chocolate_pudding_to_the_right_of_the_plate", + "living_room_scene6_put_the_chocolate_pudding_to_the_right_of_the_plate", +) +class LiberoLivingRoomScene6PutTheChocolatePuddingToTheRightOfPlateTask(Libero90BaseTask): + """Task: Put the chocolate_pudding to the right of the plate in living_room_scene6. + + Objects: + - porcelain_mug + - red_coffee_mug + - plate + - chocolate_pudding + + Goal: Place chocolate_pudding to the right of the plate. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="porcelain_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/usd/porcelain_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/urdf/porcelain_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/mjcf/porcelain_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="plate", + usd_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/usd/plate.usd", + urdf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/urdf/plate.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/mjcf/plate.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="chocolate_pudding", + usd_path="roboverse_data/assets/libero/COMMON/stable_hope_objects/chocolate_pudding/usd/chocolate_pudding.usd", + urdf_path="roboverse_data/assets/libero/COMMON/stable_hope_objects/chocolate_pudding/urdf/chocolate_pudding.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/stable_hope_objects/chocolate_pudding/mjcf/chocolate_pudding.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 250 + task_desc = "Put the chocolate_pudding to the right of the plate (living_room_scene6)" + + workspace_name = ("living_room_table",) + workspace_offset = ((0.0, 0, 0.42),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_living_room_scene6_put_the_chocolate_pudding_to_the_right_of_the_plate_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success: chocolate_pudding is to the right of the plate (x > plate.x + threshold).""" + chocolate_pos = states.objects["chocolate_pudding"].root_state[:, :3] + plate_pos = states.objects["plate"].root_state[:, :3] + # Calculate relative position: chocolate relative to plate + relative_pos = chocolate_pos - plate_pos + x_diff = relative_pos[:, 0] # x direction + y_diff = relative_pos[:, 1] # y direction + + # Check if chocolate pudding is in the target region relative to plate, range determined by checking trajectory data + # x: -0.05 to 0.05, y: 0.0 to 0.2 + x_in_range = (x_diff > -0.05) & (x_diff < 0.05) + y_in_range = (y_diff > -0.2) & (y_diff < 0) + + success = x_in_range & y_in_range + return success + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/living_room_scene6_put_the_red_mug_on_the_plate.py b/roboverse_pack/tasks/libero_90/living_room_scene6_put_the_red_mug_on_the_plate.py new file mode 100644 index 000000000..04fce9c54 --- /dev/null +++ b/roboverse_pack/tasks/libero_90/living_room_scene6_put_the_red_mug_on_the_plate.py @@ -0,0 +1,93 @@ +"""Configuration for the Libero living room scene6 put the red mug on the plate task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.living_room_scene6_put_the_red_mug_on_the_plate", + "living_room_scene6_put_the_red_mug_on_the_plate", +) +class LiberoLivingRoomScene6PutRedMugOnThePlateTask(Libero90BaseTask): + """Task: Put the red_coffee_mug on the plate in living_room_scene6. + + Objects: + - porcelain_mug + - red_coffee_mug + - plate + - chocolate_pudding + + Goal: Place red_coffee_mug on the plate. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="porcelain_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/usd/porcelain_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/urdf/porcelain_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/mjcf/porcelain_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="plate", + usd_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/usd/plate.usd", + urdf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/urdf/plate.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/mjcf/plate.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="chocolate_pudding", + usd_path="roboverse_data/assets/libero/COMMON/stable_hope_objects/chocolate_pudding/usd/chocolate_pudding.usd", + urdf_path="roboverse_data/assets/libero/COMMON/stable_hope_objects/chocolate_pudding/urdf/chocolate_pudding.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/stable_hope_objects/chocolate_pudding/mjcf/chocolate_pudding.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 250 + task_desc = "Put the red_coffee_mug on the plate (living_room_scene6)" + + workspace_name = ("living_room_table",) + workspace_offset = ((0.0, 0, 0.42),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = ( + "roboverse_data/trajs/libero90/libero_90_living_room_scene6_put_the_red_mug_on_the_plate_traj_v2.pkl" + ) + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker.""" + red_mug_pos = states.objects["red_coffee_mug"].root_state[:, :3] # (N,3) + plate_pos = states.objects["plate"].root_state[:, :3] # (N,3) + range_threshold = 0.06 + height_threshold = 0.03 + xy_distance = torch.norm(red_mug_pos[:, :2] - plate_pos[:, :2], dim=-1) + height_diff = red_mug_pos[:, 2] - plate_pos[:, 2] + xy_close = xy_distance < range_threshold + height_valid = (height_diff > 0) & (height_diff < height_threshold) + is_on_plate = xy_close & height_valid + return is_on_plate + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/living_room_scene6_put_the_white_mug_on_the_plate.py b/roboverse_pack/tasks/libero_90/living_room_scene6_put_the_white_mug_on_the_plate.py new file mode 100644 index 000000000..c81880077 --- /dev/null +++ b/roboverse_pack/tasks/libero_90/living_room_scene6_put_the_white_mug_on_the_plate.py @@ -0,0 +1,93 @@ +"""Configuration for the Libero living room scene6 put the white mug on the plate task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.living_room_scene6_put_the_white_mug_on_the_plate", + "living_room_scene6_put_the_white_mug_on_the_plate", +) +class LiberoLivingRoomScene6PutWhiteMugOnThePlateTask(Libero90BaseTask): + """Task: Put the porcelain_mug on the plate in living_room_scene6. + + Objects: + - porcelain_mug (target) + - red_coffee_mug + - plate (goal) + - chocolate_pudding + + Goal: Place porcelain_mug on the plate. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="porcelain_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/usd/porcelain_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/urdf/porcelain_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/mjcf/porcelain_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="plate", + usd_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/usd/plate.usd", + urdf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/urdf/plate.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/stable_scanned_objects/plate/mjcf/plate.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="chocolate_pudding", + usd_path="roboverse_data/assets/libero/COMMON/stable_hope_objects/chocolate_pudding/usd/chocolate_pudding.usd", + urdf_path="roboverse_data/assets/libero/COMMON/stable_hope_objects/chocolate_pudding/urdf/chocolate_pudding.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/stable_hope_objects/chocolate_pudding/mjcf/chocolate_pudding.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 250 + task_desc = "Put the porcelain_mug on the plate (living_room_scene6)" + + workspace_name = ("living_room_table",) + workspace_offset = ((0.0, 0, 0.42),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = ( + "roboverse_data/trajs/libero90/libero_90_living_room_scene6_put_the_white_mug_on_the_plate_traj_v2.pkl" + ) + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker.""" + white_mug_pos = states.objects["porcelain_mug"].root_state[:, :3] # (N,3) + plate_pos = states.objects["plate"].root_state[:, :3] # (N,3) + range_threshold = 0.06 + height_threshold = 0.03 + xy_distance = torch.norm(white_mug_pos[:, :2] - plate_pos[:, :2], dim=-1) + height_diff = white_mug_pos[:, 2] - plate_pos[:, 2] + xy_close = xy_distance < range_threshold + height_valid = (height_diff > 0) & (height_diff < height_threshold) + is_on_plate = xy_close & height_valid + return is_on_plate + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene1_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy.py b/roboverse_pack/tasks/libero_90/study_scene1_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy.py new file mode 100644 index 000000000..6b4ed4999 --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene1_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy.py @@ -0,0 +1,92 @@ +"""Configuration for the Libero study scene1 pick up the book and place it in the front compartment of the caddy task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene1_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy", + "study_scene1_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy", +) +class LiberoStudyScene1PickUpTheBookAndPlaceInTheFrontCompartmentOfTheCaddyTask(Libero90BaseTask): + """Configuration for the Libero study scene1 pick up the book and place it in the front compartment of the caddy task. + + Task Description: + - Pick up the black_book from the table + - Place the black_book inside the desk_caddy/front_contain_region + + This is a manipulation task that requires: + 1. Picking up the black_book from the table + 2. Placing the black_book inside the desk_caddy/front_contain_region + + Objects: + - black_book (target) + - white_yellow_mug + - desk_caddy (goal container) + + Goal: Place black_book inside desk_caddy/front_contain_region. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="white_yellow_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/usd/white_yellow_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/urdf/white_yellow_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/mjcf/white_yellow_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="desk_caddy", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/usd/desk_caddy.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/urdf/desk_caddy.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/mjcf/desk_caddy.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 250 + task_desc = "Pick up the black_book and place it in the front containment region of the desk_caddy (study_scene1)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene1_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: black_book is inside desk_caddy/front_compartment bounding box.""" + book_pos = states.objects["black_book"].root_state[:, :3] + N = book_pos.shape[0] + region_mat = self.handler.physics.named.data.site_xmat["desk_caddy/front_contain_region"] + region_pos = self.handler.physics.named.data.site_xpos["desk_caddy/front_contain_region"] + region_R = torch.from_numpy(region_mat).float().reshape(3, 3).unsqueeze(0).expand(N, 3, 3).to(book_pos.device) + region_t = torch.from_numpy(region_pos).float().unsqueeze(0).expand(N, 3).to(book_pos.device) + # The half_size should be set according to the actual compartment size; placeholder values below + half_size = torch.tensor([0.02775, 0.03595, 0.06216], device=book_pos.device) + book_local = torch.matmul(region_R.transpose(1, 2), (book_pos - region_t).unsqueeze(-1)).squeeze(-1) + inside = (book_local.abs() <= (half_size + 1e-6)).all(dim=-1) + return inside + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene1_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy.py b/roboverse_pack/tasks/libero_90/study_scene1_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy.py new file mode 100644 index 000000000..c2eddeae5 --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene1_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy.py @@ -0,0 +1,91 @@ +"""Configuration for the Libero study scene1 pick up the book and place it in the left compartment of the caddy task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene1_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy", + "study_scene1_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy", +) +class LiberoStudyScene1PickUpTheBookAndPlaceInTheLeftCompartmentOfTheCaddyTask(Libero90BaseTask): + """Configuration for the Libero study scene1 pick up the book and place it in the left compartment of the caddy task. + + Task Description: + - Pick up the black_book from the table + - Place the black_book inside the desk_caddy/left_contain_region + + This is a manipulation task that requires: + 1. Picking up the black_book from the table + 2. Placing the black_book inside the desk_caddy/left_contain_region + + Objects: + - black_book (target) + - white_yellow_mug + - desk_caddy (goal container) + + Goal: Place black_book inside desk_caddy/left_contain_region. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="white_yellow_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/usd/white_yellow_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/urdf/white_yellow_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/mjcf/white_yellow_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="desk_caddy", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/usd/desk_caddy.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/urdf/desk_caddy.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/mjcf/desk_caddy.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 200 + task_desc = "Pick up the black_book and place it in the left compartment of the desk_caddy (study_scene1)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene1_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: black_book is inside desk_caddy/left_contain_region bounding box.""" + book_pos = states.objects["black_book"].root_state[:, :3] + N = book_pos.shape[0] + region_mat = self.handler.physics.named.data.site_xmat["desk_caddy/left_contain_region"] + region_pos = self.handler.physics.named.data.site_xpos["desk_caddy/left_contain_region"] + region_R = torch.from_numpy(region_mat).float().reshape(3, 3).unsqueeze(0).expand(N, 3, 3).to(book_pos.device) + region_t = torch.from_numpy(region_pos).float().unsqueeze(0).expand(N, 3).to(book_pos.device) + half_size = torch.tensor([0.06196, 0.06216, 0.06046], device=book_pos.device) + book_local = torch.matmul(region_R.transpose(1, 2), (book_pos - region_t).unsqueeze(-1)).squeeze(-1) + inside = (book_local.abs() <= (half_size + 1e-6)).all(dim=-1) + return inside + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene1_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy.py b/roboverse_pack/tasks/libero_90/study_scene1_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy.py new file mode 100644 index 000000000..38fd7c79a --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene1_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy.py @@ -0,0 +1,91 @@ +"""Configuration for the Libero study scene1 pick up the book and place it in the right compartment of the caddy task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene1_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy", + "study_scene1_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy", +) +class LiberoStudyScene1PickUpTheBookAndPlaceInTheRightCompartmentOfTheCaddyTask(Libero90BaseTask): + """Configuration for the Libero study scene1 pick up the book and place it in the right compartment of the caddy task. + + Task Description: + - Pick up the black_book from the table + - Place the black_book inside the desk_caddy/right_contain_region + + This is a manipulation task that requires: + 1. Picking up the black_book from the table + 2. Placing the black_book inside the desk_caddy/right_contain_region + + Objects: + - black_book (target) + - white_yellow_mug + - desk_caddy (goal container) + + Goal: Place black_book inside desk_caddy/right_contain_region. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="white_yellow_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/usd/white_yellow_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/urdf/white_yellow_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/mjcf/white_yellow_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="desk_caddy", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/usd/desk_caddy.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/urdf/desk_caddy.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/mjcf/desk_caddy.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 200 + task_desc = "Pick up the black_book and place it in the right compartment of the desk_caddy (study_scene1)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene1_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: black_book is inside desk_caddy/right_contain_region bounding box.""" + book_pos = states.objects["black_book"].root_state[:, :3] + N = book_pos.shape[0] + region_mat = self.handler.physics.named.data.site_xmat["desk_caddy/right_contain_region"] + region_pos = self.handler.physics.named.data.site_xpos["desk_caddy/right_contain_region"] + region_R = torch.from_numpy(region_mat).float().reshape(3, 3).unsqueeze(0).expand(N, 3, 3).to(book_pos.device) + region_t = torch.from_numpy(region_pos).float().unsqueeze(0).expand(N, 3).to(book_pos.device) + half_size = torch.tensor([0.06196, 0.06216, 0.06046], device=book_pos.device) + book_local = torch.matmul(region_R.transpose(1, 2), (book_pos - region_t).unsqueeze(-1)).squeeze(-1) + inside = (book_local.abs() <= (half_size + 1e-6)).all(dim=-1) + return inside + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene1_pick_up_the_yellow_and_white_mug_and_place_it_to_the_right_of_the_caddy.py b/roboverse_pack/tasks/libero_90/study_scene1_pick_up_the_yellow_and_white_mug_and_place_it_to_the_right_of_the_caddy.py new file mode 100644 index 000000000..faf99c49c --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene1_pick_up_the_yellow_and_white_mug_and_place_it_to_the_right_of_the_caddy.py @@ -0,0 +1,96 @@ +"""Configuration for the Libero study scene1 pick up the yellow and white mug and place it to the right of the caddy task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene1_pick_up_the_yellow_and_white_mug_and_place_it_to_the_right_of_the_caddy", + "study_scene1_pick_up_the_yellow_and_white_mug_and_place_it_to_the_right_of_the_caddy", +) +class LiberoStudyScene1PickUpTheYellowAndWhiteMugAndPlaceRightOfCaddyTask(Libero90BaseTask): + """Configuration for the Libero study scene1 pick up the yellow and white mug and place it in the right compartment of the caddy task. + + Task Description: + - Pick up the black_book from the table + - Place the black_book inside the desk_caddy/right_contain_region + + This is a manipulation task that requires: + 1. Picking up the black_book from the table + 2. Placing the black_book inside the desk_caddy/right_contain_region + + Objects: + - black_book + - white_yellow_mug (target) + - desk_caddy (goal container) + + Goal: Place black_book inside desk_caddy/right_contain_region. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="white_yellow_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/usd/white_yellow_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/urdf/white_yellow_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/white_yellow_mug/mjcf/white_yellow_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="desk_caddy", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/usd/desk_caddy.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/urdf/desk_caddy.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/mjcf/desk_caddy.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 200 + task_desc = "Pick up the white_yellow_mug and place it to the right of the desk_caddy (study_scene1)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene1_pick_up_the_yellow_and_white_mug_and_place_it_to_the_right_of_the_caddy_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: white_yellow_mug is to the right of desk_caddy (x > caddy.x + threshold, y/z close).""" + mug_pos = states.objects["white_yellow_mug"].root_state[:, :3] + caddy_pos = states.objects["desk_caddy"].root_state[:, :3] + + # Calculate relative position: chocolate relative to plate + relative_pos = mug_pos - caddy_pos + x_diff = relative_pos[:, 0] # x direction + y_diff = relative_pos[:, 1] # y direction + + # Check if chocolate pudding is in the target region relative to plate, range determined by checking trajectory data + # x: -0.05 to 0.05, y: 0.0 to 0.2, z: 0.0 to 0.05 + x_in_range = (x_diff > -0.15) & (x_diff < 0.15) + y_in_range = (y_diff > 0.2) & (y_diff < 0.4) + z_in_range = (relative_pos[:, 2] > 0.0) & (relative_pos[:, 2] < 0.05) + success = x_in_range & y_in_range & z_in_range + return success + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene2_pick_up_the_book_and_place_it_in_the_back_compartment_of_the_caddy.py b/roboverse_pack/tasks/libero_90/study_scene2_pick_up_the_book_and_place_it_in_the_back_compartment_of_the_caddy.py new file mode 100644 index 000000000..7150776bb --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene2_pick_up_the_book_and_place_it_in_the_back_compartment_of_the_caddy.py @@ -0,0 +1,91 @@ +"""Configuration for the Libero study scene2 pick up the book and place it in the back compartment of the caddy task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene2_pick_up_the_book_and_place_it_in_the_back_compartment_of_the_caddy", + "study_scene2_pick_up_the_book_and_place_it_in_the_back_compartment_of_the_caddy", +) +class LiberoStudyScene2PickUpTheBookAndPlaceInTheBackCompartmentOfTheCaddyTask(Libero90BaseTask): + """Configuration for the Libero study scene2 pick up the book and place it in the back compartment of the caddy task. + + Task Description: + - Pick up the black_book from the table + - Place the black_book inside the desk_caddy/back_contain_region + + This is a manipulation task that requires: + 1. Picking up the black_book from the table + 2. Placing the black_book inside the desk_caddy/back_contain_region + + Objects: + - black_book (target) + - red_coffee_mug + - desk_caddy (goal container) + + Goal: Place black_book inside desk_caddy/back_contain_region. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="desk_caddy", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/usd/desk_caddy.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/urdf/desk_caddy.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/mjcf/desk_caddy.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 250 + task_desc = "Pick up the black_book and place it in the back compartment of the desk_caddy (study_scene2)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene2_pick_up_the_book_and_place_it_in_the_back_compartment_of_the_caddy_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: black_book is inside desk_caddy/back_contain_region bounding box.""" + book_pos = states.objects["black_book"].root_state[:, :3] + N = book_pos.shape[0] + region_mat = self.handler.physics.named.data.site_xmat["desk_caddy/back_contain_region"] + region_pos = self.handler.physics.named.data.site_xpos["desk_caddy/back_contain_region"] + region_R = torch.from_numpy(region_mat).float().reshape(3, 3).unsqueeze(0).expand(N, 3, 3).to(book_pos.device) + region_t = torch.from_numpy(region_pos).float().unsqueeze(0).expand(N, 3).to(book_pos.device) + half_size = torch.tensor([0.02775, 0.06216, 0.06046], device=book_pos.device) + book_local = torch.matmul(region_R.transpose(1, 2), (book_pos - region_t).unsqueeze(-1)).squeeze(-1) + inside = (book_local.abs() <= (half_size + 1e-6)).all(dim=-1) + return inside + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene2_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy.py b/roboverse_pack/tasks/libero_90/study_scene2_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy.py new file mode 100644 index 000000000..65ed431b1 --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene2_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy.py @@ -0,0 +1,91 @@ +"""Configuration for the Libero study scene2 pick up the book and place it in the front compartment of the caddy task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene2_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy", + "study_scene2_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy", +) +class LiberoStudyScene2PickUpTheBookAndPlaceItInTheFrontCompartmentOfTheCaddyTask(Libero90BaseTask): + """Configuration for the Libero study scene2 pick up the book and place it in the front compartment of the caddy task. + + Task Description: + - Pick up the black_book from the table + - Place the black_book inside the desk_caddy/front_contain_region + + This is a manipulation task that requires: + 1. Picking up the black_book from the table + 2. Placing the black_book inside the desk_caddy/front_contain_region + + Objects: + - black_book (target) + - red_coffee_mug + - desk_caddy (goal container) + + Goal: Place black_book inside desk_caddy/front_contain_region. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="desk_caddy", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/usd/desk_caddy.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/urdf/desk_caddy.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/mjcf/desk_caddy.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 250 + task_desc = "Pick up the black_book and place it in the front compartment of the desk_caddy (study_scene2)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene2_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: black_book is inside desk_caddy/front_contain_region bounding box.""" + book_pos = states.objects["black_book"].root_state[:, :3] + N = book_pos.shape[0] + region_mat = self.handler.physics.named.data.site_xmat["desk_caddy/front_contain_region"] + region_pos = self.handler.physics.named.data.site_xpos["desk_caddy/front_contain_region"] + region_R = torch.from_numpy(region_mat).float().reshape(3, 3).unsqueeze(0).expand(N, 3, 3).to(book_pos.device) + region_t = torch.from_numpy(region_pos).float().unsqueeze(0).expand(N, 3).to(book_pos.device) + half_size = torch.tensor([0.02775, 0.03595, 0.06216], device=book_pos.device) + book_local = torch.matmul(region_R.transpose(1, 2), (book_pos - region_t).unsqueeze(-1)).squeeze(-1) + inside = (book_local.abs() <= (half_size + 1e-6)).all(dim=-1) + return inside + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene2_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy.py b/roboverse_pack/tasks/libero_90/study_scene2_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy.py new file mode 100644 index 000000000..1c7df985f --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene2_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy.py @@ -0,0 +1,91 @@ +"""Configuration for the Libero study scene2 pick up the book and place it in the left compartment of the caddy task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene2_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy", + "study_scene2_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy", +) +class LiberoStudyScene2PickUpTheBookAndPlaceInLeftCompartmentOfTheCaddyTask(Libero90BaseTask): + """Configuration for the Libero study scene2 pick up the book and place it in the left compartment of the caddy task. + + Task Description: + - Pick up the black_book from the table + - Place the black_book inside the desk_caddy/left_contain_region + + This is a manipulation task that requires: + 1. Picking up the black_book from the table + 2. Placing the black_book inside the desk_caddy/left_contain_region + + Objects: + - black_book (target) + - red_coffee_mug + - desk_caddy (goal container) + + Goal: Place black_book inside desk_caddy/left_contain_region. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="desk_caddy", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/usd/desk_caddy.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/urdf/desk_caddy.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/mjcf/desk_caddy.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 250 + task_desc = "Pick up the black_book and place it in the left compartment of the desk_caddy (study_scene2)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene2_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: black_book is inside desk_caddy/left_contain_region bounding box.""" + book_pos = states.objects["black_book"].root_state[:, :3] + N = book_pos.shape[0] + region_mat = self.handler.physics.named.data.site_xmat["desk_caddy/left_contain_region"] + region_pos = self.handler.physics.named.data.site_xpos["desk_caddy/left_contain_region"] + region_R = torch.from_numpy(region_mat).float().reshape(3, 3).unsqueeze(0).expand(N, 3, 3).to(book_pos.device) + region_t = torch.from_numpy(region_pos).float().unsqueeze(0).expand(N, 3).to(book_pos.device) + half_size = torch.tensor([0.06196, 0.06216, 0.06046], device=book_pos.device) + book_local = torch.matmul(region_R.transpose(1, 2), (book_pos - region_t).unsqueeze(-1)).squeeze(-1) + inside = (book_local.abs() <= (half_size + 1e-6)).all(dim=-1) + return inside + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene2_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy.py b/roboverse_pack/tasks/libero_90/study_scene2_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy.py new file mode 100644 index 000000000..b94b099fd --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene2_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy.py @@ -0,0 +1,91 @@ +"""Configuration for the Libero study scene2 pick up the book and place it in the right compartment of the caddy task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene2_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy", + "study_scene2_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy", +) +class LiberoStudyScene2PickUpTheBookAndPlaceInRightCompartmentOfTheCaddyTask(Libero90BaseTask): + """Configuration for the Libero study scene2 pick up the book and place it in the right compartment of the caddy task. + + Task Description: + - Pick up the black_book from the table + - Place the black_book inside the desk_caddy/right_contain_region + + This is a manipulation task that requires: + 1. Picking up the black_book from the table + 2. Placing the black_book inside the desk_caddy/right_contain_region + + Objects: + - black_book (target) + - red_coffee_mug + - desk_caddy (goal container) + + Goal: Place black_book inside desk_caddy/right_contain_region. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="desk_caddy", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/usd/desk_caddy.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/urdf/desk_caddy.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/mjcf/desk_caddy.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 250 + task_desc = "Pick up the black_book and place it in the right compartment of the desk_caddy (study_scene2)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene2_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: black_book is inside desk_caddy/right_contain_region bounding box.""" + book_pos = states.objects["black_book"].root_state[:, :3] + N = book_pos.shape[0] + region_mat = self.handler.physics.named.data.site_xmat["desk_caddy/right_contain_region"] + region_pos = self.handler.physics.named.data.site_xpos["desk_caddy/right_contain_region"] + region_R = torch.from_numpy(region_mat).float().reshape(3, 3).unsqueeze(0).expand(N, 3, 3).to(book_pos.device) + region_t = torch.from_numpy(region_pos).float().unsqueeze(0).expand(N, 3).to(book_pos.device) + half_size = torch.tensor([0.06196, 0.06216, 0.06046], device=book_pos.device) + book_local = torch.matmul(region_R.transpose(1, 2), (book_pos - region_t).unsqueeze(-1)).squeeze(-1) + inside = (book_local.abs() <= (half_size + 1e-6)).all(dim=-1) + return inside + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy.py b/roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy.py new file mode 100644 index 000000000..d5d1f4a41 --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy.py @@ -0,0 +1,99 @@ +"""Configuration for the Libero study scene3 pick up the book and place it in the front compartment of the caddy task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene3_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy", + "study_scene3_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy", +) +class LiberoStudyScene3PickUpTheBookAndPlaceInTheFrontCompartmentOfTheCaddyTask(Libero90BaseTask): + """Configuration for the Libero study scene3 pick up the book and place it in the front compartment of the caddy task. + + Task Description: + - Pick up the black_book from the table + - Place the black_book inside the desk_caddy/front_contain_region + + This is a manipulation task that requires: + 1. Picking up the black_book from the table + 2. Placing the black_book inside the desk_caddy/front_contain_region + + Objects: + - black_book (target) + - red_coffee_mug + - desk_caddy (goal container) + - porcelain_mug + + Goal: Place black_book inside desk_caddy/front_contain_region. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="desk_caddy", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/usd/desk_caddy.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/urdf/desk_caddy.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/mjcf/desk_caddy.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="porcelain_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/usd/porcelain_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/urdf/porcelain_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/mjcf/porcelain_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 250 + task_desc = "Pick up the black_book and place it in the front compartment of the desk_caddy (study_scene3)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene3_pick_up_the_book_and_place_it_in_the_front_compartment_of_the_caddy_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: black_book is inside desk_caddy/front_contain_region bounding box.""" + book_pos = states.objects["black_book"].root_state[:, :3] + N = book_pos.shape[0] + region_mat = self.handler.physics.named.data.site_xmat["desk_caddy/front_contain_region"] + region_pos = self.handler.physics.named.data.site_xpos["desk_caddy/front_contain_region"] + region_R = torch.from_numpy(region_mat).float().reshape(3, 3).unsqueeze(0).expand(N, 3, 3).to(book_pos.device) + region_t = torch.from_numpy(region_pos).float().unsqueeze(0).expand(N, 3).to(book_pos.device) + half_size = torch.tensor([0.02775, 0.03595, 0.06216], device=book_pos.device) + book_local = torch.matmul(region_R.transpose(1, 2), (book_pos - region_t).unsqueeze(-1)).squeeze(-1) + inside = (book_local.abs() <= (half_size + 1e-6)).all(dim=-1) + return inside + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy.py b/roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy.py new file mode 100644 index 000000000..a54ee140d --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy.py @@ -0,0 +1,99 @@ +"""Configuration for the Libero study scene3 pick up the book and place it in the left compartment of the caddy task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene3_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy", + "study_scene3_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy", +) +class LiberoStudyScene3PickUpTheBookAndPlaceInTheLeftCompartmentOfTheCaddyTask(Libero90BaseTask): + """Configuration for the Libero study scene3 pick up the book and place it in the left compartment of the caddy task. + + Task Description: + - Pick up the black_book from the table + - Place the black_book inside the desk_caddy/left_contain_region + + This is a manipulation task that requires: + 1. Picking up the black_book from the table + 2. Placing the black_book inside the desk_caddy/left_contain_region + + Objects: + - black_book (target) + - red_coffee_mug + - desk_caddy (goal container) + - porcelain_mug + + Goal: Place black_book inside desk_caddy/left_contain_region. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="desk_caddy", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/usd/desk_caddy.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/urdf/desk_caddy.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/mjcf/desk_caddy.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="porcelain_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/usd/porcelain_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/urdf/porcelain_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/mjcf/porcelain_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 250 + task_desc = "Pick up the black_book and place it in the left compartment of the desk_caddy (study_scene3)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene3_pick_up_the_book_and_place_it_in_the_left_compartment_of_the_caddy_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: black_book is inside desk_caddy/left_contain_region bounding box.""" + book_pos = states.objects["black_book"].root_state[:, :3] + N = book_pos.shape[0] + region_mat = self.handler.physics.named.data.site_xmat["desk_caddy/left_contain_region"] + region_pos = self.handler.physics.named.data.site_xpos["desk_caddy/left_contain_region"] + region_R = torch.from_numpy(region_mat).float().reshape(3, 3).unsqueeze(0).expand(N, 3, 3).to(book_pos.device) + region_t = torch.from_numpy(region_pos).float().unsqueeze(0).expand(N, 3).to(book_pos.device) + half_size = torch.tensor([0.06196, 0.06216, 0.06046], device=book_pos.device) + book_local = torch.matmul(region_R.transpose(1, 2), (book_pos - region_t).unsqueeze(-1)).squeeze(-1) + inside = (book_local.abs() <= (half_size + 1e-6)).all(dim=-1) + return inside + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy.py b/roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy.py new file mode 100644 index 000000000..745d5e947 --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy.py @@ -0,0 +1,99 @@ +"""Configuration for the Libero study scene3 pick up the book and place it in the right compartment of the caddy task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene3_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy", + "study_scene3_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy", +) +class LiberoStudyScene3PickUpTheBookAndPlaceInTheRightCompartmentOfTheCaddyTask(Libero90BaseTask): + """Configuration for the Libero study scene3 pick up the book and place it in the right compartment of the caddy task. + + Task Description: + - Pick up the black_book from the table + - Place the black_book inside the desk_caddy/right_contain_region + + This is a manipulation task that requires: + 1. Picking up the black_book from the table + 2. Placing the black_book inside the desk_caddy/right_contain_region + + Objects: + - black_book (target) + - red_coffee_mug + - porcelain_mug + - desk_caddy (goal container) + + Goal: Place black_book inside desk_caddy/right_contain_region. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="desk_caddy", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/usd/desk_caddy.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/urdf/desk_caddy.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/mjcf/desk_caddy.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="porcelain_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/usd/porcelain_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/urdf/porcelain_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/mjcf/porcelain_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 250 + task_desc = "Pick up the black_book and place it in the right compartment of the desk_caddy (study_scene3)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene3_pick_up_the_book_and_place_it_in_the_right_compartment_of_the_caddy_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: black_book is inside desk_caddy/right_contain_region bounding box.""" + book_pos = states.objects["black_book"].root_state[:, :3] + N = book_pos.shape[0] + region_mat = self.handler.physics.named.data.site_xmat["desk_caddy/right_contain_region"] + region_pos = self.handler.physics.named.data.site_xpos["desk_caddy/right_contain_region"] + region_R = torch.from_numpy(region_mat).float().reshape(3, 3).unsqueeze(0).expand(N, 3, 3).to(book_pos.device) + region_t = torch.from_numpy(region_pos).float().unsqueeze(0).expand(N, 3).to(book_pos.device) + half_size = torch.tensor([0.06196, 0.06216, 0.06046], device=book_pos.device) + book_local = torch.matmul(region_R.transpose(1, 2), (book_pos - region_t).unsqueeze(-1)).squeeze(-1) + inside = (book_local.abs() <= (half_size + 1e-6)).all(dim=-1) + return inside + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_red_mug_and_place_it_to_the_right_of_the_caddy.py b/roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_red_mug_and_place_it_to_the_right_of_the_caddy.py new file mode 100644 index 000000000..ab3c3c3ae --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_red_mug_and_place_it_to_the_right_of_the_caddy.py @@ -0,0 +1,103 @@ +"""Configuration for the Libero study scene3 pick up the red mug and place it to the right of the caddy task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene3_pick_up_the_red_mug_and_place_it_to_the_right_of_the_caddy", + "study_scene3_pick_up_the_red_mug_and_place_it_to_the_right_of_the_caddy", +) +class LiberoStudyScene3PickUpTheRedMugAndPlaceItToTheRightOfCaddyTask(Libero90BaseTask): + """Configuration for the Libero study scene3 pick up the red mug and place it to the right of the caddy task. + + Task Description: + - Pick up the red_coffee_mug from the table + - Place the red_coffee_mug inside the desk_caddy/right_contain_region + + This is a manipulation task that requires: + 1. Picking up the red_coffee_mug from the table + 2. Placing the red_coffee_mug inside the desk_caddy/right_contain_region + + Objects: + - black_book + - red_coffee_mug (target) + - porcelain_mug + - desk_caddy (goal container) + + Goal: Place red_coffee_mug inside desk_caddy/right_contain_region. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="desk_caddy", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/usd/desk_caddy.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/urdf/desk_caddy.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/mjcf/desk_caddy.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="porcelain_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/usd/porcelain_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/urdf/porcelain_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/mjcf/porcelain_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 200 + task_desc = "Pick up the red_coffee_mug and place it to the right of the desk_caddy (study_scene3)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene3_pick_up_the_red_mug_and_place_it_to_the_right_of_the_caddy_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: red_coffee_mug is to the right of desk_caddy (x > caddy.x + threshold, y/z close).""" + mug_pos = states.objects["red_coffee_mug"].root_state[:, :3] + caddy_pos = states.objects["desk_caddy"].root_state[:, :3] + # Calculate relative position: chocolate relative to plate + relative_pos = mug_pos - caddy_pos + x_diff = relative_pos[:, 0] # x direction + y_diff = relative_pos[:, 1] # y direction + + # Check if chocolate pudding is in the target region relative to plate, range determined by checking trajectory data + # x: -0.05 to 0.05, y: 0.0 to 0.2, z: 0.0 to 0.05 + x_in_range = (x_diff > -0.15) & (x_diff < 0.15) + y_in_range = (y_diff > 0.2) & (y_diff < 0.4) + z_in_range = (relative_pos[:, 2] > 0.0) & (relative_pos[:, 2] < 0.05) + success = x_in_range & y_in_range & z_in_range + return success + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_white_mug_and_place_it_to_the_right_of_the_caddy.py b/roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_white_mug_and_place_it_to_the_right_of_the_caddy.py new file mode 100644 index 000000000..9f6c36f29 --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene3_pick_up_the_white_mug_and_place_it_to_the_right_of_the_caddy.py @@ -0,0 +1,103 @@ +"""Configuration for the Libero study scene3 pick up the white mug and place it to the right of the caddy task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene3_pick_up_the_white_mug_and_place_it_to_the_right_of_the_caddy", + "study_scene3_pick_up_the_white_mug_and_place_it_to_the_right_of_the_caddy", +) +class LiberoStudyScene3PickUpTheWhiteMugAndPlaceItToTheRightOfTheCaddyTask(Libero90BaseTask): + """Configuration for the Libero study scene3 pick up the white mug and place it to the right of the caddy task. + + Task Description: + - Pick up the porcelain_mug from the table + - Place the porcelain_mug inside the desk_caddy/right_contain_region + + This is a manipulation task that requires: + 1. Picking up the porcelain_mug from the table + 2. Placing the porcelain_mug inside the desk_caddy/right_contain_region + + Objects: + - black_book + - red_coffee_mug + - porcelain_mug (target) + - desk_caddy (goal container) + + Goal: Place porcelain_mug inside desk_caddy/right_contain_region. + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="red_coffee_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/usd/red_coffee_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/urdf/red_coffee_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/red_coffee_mug/mjcf/red_coffee_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="desk_caddy", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/usd/desk_caddy.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/urdf/desk_caddy.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/desk_caddy/mjcf/desk_caddy.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="porcelain_mug", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/usd/porcelain_mug.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/urdf/porcelain_mug.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/porcelain_mug/mjcf/porcelain_mug.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 200 + task_desc = "Pick up the porcelain_mug and place it to the right of the desk_caddy (study_scene3)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene3_pick_up_the_white_mug_and_place_it_to_the_right_of_the_caddy_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: porcelain_mug is to the right of desk_caddy (x > caddy.x + threshold, y/z close).""" + mug_pos = states.objects["porcelain_mug"].root_state[:, :3] + caddy_pos = states.objects["desk_caddy"].root_state[:, :3] + # Calculate relative position: chocolate relative to plate + relative_pos = mug_pos - caddy_pos + x_diff = relative_pos[:, 0] # x direction + y_diff = relative_pos[:, 1] # y direction + + # Check if chocolate pudding is in the target region relative to plate, range determined by checking trajectory data + # x: -0.05 to 0.05, y: 0.0 to 0.2, z: 0.0 to 0.05 + x_in_range = (x_diff > -0.15) & (x_diff < 0.15) + y_in_range = (y_diff > 0.2) & (y_diff < 0.4) + z_in_range = (relative_pos[:, 2] > 0.0) & (relative_pos[:, 2] < 0.05) + success = x_in_range & y_in_range & z_in_range + return success + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene4_pick_up_the_book_in_the_middle_and_place_it_on_the_cabinet_shelf.py b/roboverse_pack/tasks/libero_90/study_scene4_pick_up_the_book_in_the_middle_and_place_it_on_the_cabinet_shelf.py new file mode 100644 index 000000000..838bf7f4d --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene4_pick_up_the_book_in_the_middle_and_place_it_on_the_cabinet_shelf.py @@ -0,0 +1,114 @@ +"""Configuration for the Libero study scene4 pick up the book in the middle and place it on the cabinet shelf task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene4_pick_up_the_book_in_the_middle_and_place_it_on_the_cabinet_shelf", + "study_scene4_pick_up_the_book_in_the_middle_and_place_it_on_the_cabinet_shelf", +) +class LiberoStudyScene4PickUpTheBookInTheMiddleAndPlaceItOnTheCabinetShelfTask(Libero90BaseTask): + """Configuration for the Libero study scene4 pick up the book in the middle and place it on the cabinet shelf task. + + Task Description: + - Pick up the black_book (middle) + - Place it on the wooden_two_layer_shelf (cabinet shelf) + + Objects: + - black_book (target) + - yellow_book_1 + - yellow_book_2 + - wooden_two_layer_shelf (goal shelf) + + Goal: Place black_book on wooden_two_layer_shelf (cabinet shelf). + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="yellow_book_1", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/usd/yellow_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/urdf/yellow_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/mjcf/yellow_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="yellow_book_2", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/usd/yellow_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/urdf/yellow_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/mjcf/yellow_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="wooden_two_layer_shelf", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/wooden_two_layer_shelf/usd/wooden_two_layer_shelf.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/wooden_two_layer_shelf/urdf/wooden_two_layer_shelf.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/wooden_two_layer_shelf/mjcf/wooden_two_layer_shelf.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 250 + task_desc = "Pick up the black_book in the middle and place it on the wooden_two_layer_shelf (study_scene4)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene4_pick_up_the_book_in_the_middle_and_place_it_on_the_cabinet_shelf_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: frying pan is in the bottom region of the cabinet shelf. + + Success condition (similar to wine_rack in kitchen4): + - Frying pan is within the bounding box region defined by the bottom_region site + - Uses the site's position and orientation from physics data + """ + book_pos = states.objects["black_book"].root_state[:, :3] # (N,3) + N = book_pos.shape[0] + + # Get shelf top_side site pose and expand to N environments + shelf_top_mat = self.handler.physics.named.data.site_xmat["wooden_two_layer_shelf/top_side"] # (9,) + shelf_top_pos = self.handler.physics.named.data.site_xpos["wooden_two_layer_shelf/top_side"] # (3,) + + shelf_top_R = ( + torch.from_numpy(shelf_top_mat).float().reshape(3, 3).unsqueeze(0).expand(N, 3, 3).to(book_pos.device) + ) # (N,3,3) + shelf_top_t = torch.from_numpy(shelf_top_pos).float().unsqueeze(0).expand(N, 3).to(book_pos.device) # (N,3) + + # top_side site half-size from wooden_two_layer_shelf.xml: size="0.03272 0.05000 0.11027" + bbox_lower = torch.tensor([-0.03272, -0.05000, -0.11027], device=book_pos.device) + bbox_upper = torch.tensor([0.03272, 0.05000, 0.11027], device=book_pos.device) + + # Transform book position to shelf top_side local frame + book_local = torch.matmul(shelf_top_R.transpose(1, 2), (book_pos - shelf_top_t).unsqueeze(-1)).squeeze( + -1 + ) # (N,3) + ge_lower = book_local >= bbox_lower # (N,3) + le_upper = book_local <= bbox_upper # (N,3) + inside = (ge_lower & le_upper).all(dim=-1) + return inside + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene4_pick_up_the_book_on_the_left_and_place_it_on_top_of_the_shelf.py b/roboverse_pack/tasks/libero_90/study_scene4_pick_up_the_book_on_the_left_and_place_it_on_top_of_the_shelf.py new file mode 100644 index 000000000..70e5c1a53 --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene4_pick_up_the_book_on_the_left_and_place_it_on_top_of_the_shelf.py @@ -0,0 +1,115 @@ +"""Configuration for the Libero study scene4 pick up the book on the left and place it on top of the shelf task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene4_pick_up_the_book_on_the_left_and_place_it_on_top_of_the_shelf", + "study_scene4_pick_up_the_book_on_the_left_and_place_it_on_top_of_the_shelf", +) +class LiberoStudyScene4PickUpTheBookOnTheLeftAndPlaceItOnTopOfTheShelfTask(Libero90BaseTask): + """Configuration for the Libero study scene4 pick up the book on the left and place it on top of the shelf task. + + Task Description: + - Pick up the yellow_book_2 (left) + - Place it on the wooden_two_layer_shelf (top side) + + Objects: + - black_book + - yellow_book_1 + - yellow_book_2 (target) + - wooden_two_layer_shelf (goal shelf) + + Goal: Place yellow_book_2 on wooden_two_layer_shelf (top side). + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="yellow_book_1", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/usd/yellow_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/urdf/yellow_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/mjcf/yellow_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="yellow_book_2", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/usd/yellow_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/urdf/yellow_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/mjcf/yellow_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="wooden_two_layer_shelf", + fix_base_link=True, + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/wooden_two_layer_shelf/usd/wooden_two_layer_shelf.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/wooden_two_layer_shelf/urdf/wooden_two_layer_shelf.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/wooden_two_layer_shelf/mjcf/wooden_two_layer_shelf.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 250 + task_desc = "Pick up the yellow_book_2 on the left and place it on top of the wooden_two_layer_shelf (study_scene4)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene4_pick_up_the_book_on_the_left_and_place_it_on_top_of_the_shelf_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: yellow_book_2 is on the top side of the wooden_two_layer_shelf. + + Success condition: + - yellow_book_2 is within the bounding box region defined by the top_side site + - Uses the site's position and orientation from physics data + """ + book_pos = states.objects["yellow_book_2"].root_state[:, :3] # (N,3) + N = book_pos.shape[0] + + # Get shelf top_side site pose and expand to N environments + shelf_top_mat = self.handler.physics.named.data.site_xmat["wooden_two_layer_shelf/top_side"] # (9,) + shelf_top_pos = self.handler.physics.named.data.site_xpos["wooden_two_layer_shelf/top_side"] # (3,) + + shelf_top_R = ( + torch.from_numpy(shelf_top_mat).float().reshape(3, 3).unsqueeze(0).expand(N, 3, 3).to(book_pos.device) + ) # (N,3,3) + shelf_top_t = torch.from_numpy(shelf_top_pos).float().unsqueeze(0).expand(N, 3).to(book_pos.device) # (N,3) + + # top_side site half-size from wooden_two_layer_shelf.xml: size="0.03272 0.05000 0.11027" + bbox_lower = torch.tensor([-0.03272, -0.05000, -0.11027], device=book_pos.device) + bbox_upper = torch.tensor([0.03272, 0.05000, 0.11027], device=book_pos.device) + + # Transform book position to shelf top_side local frame + book_local = torch.matmul(shelf_top_R.transpose(1, 2), (book_pos - shelf_top_t).unsqueeze(-1)).squeeze( + -1 + ) # (N,3) + ge_lower = book_local >= bbox_lower # (N,3) + le_upper = book_local <= bbox_upper # (N,3) + inside = (ge_lower & le_upper).all(dim=-1) + return inside + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene4_pick_up_the_book_on_the_right_and_place_it_on_the_cabinet_shelf.py b/roboverse_pack/tasks/libero_90/study_scene4_pick_up_the_book_on_the_right_and_place_it_on_the_cabinet_shelf.py new file mode 100644 index 000000000..97b2ffaf1 --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene4_pick_up_the_book_on_the_right_and_place_it_on_the_cabinet_shelf.py @@ -0,0 +1,115 @@ +"""Configuration for the Libero study scene4 pick up the book on the right and place it on the cabinet shelf task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene4_pick_up_the_book_on_the_right_and_place_it_on_the_cabinet_shelf", + "study_scene4_pick_up_the_book_on_the_right_and_place_it_on_the_cabinet_shelf", +) +class LiberoStudyScene4PickUpTheBookOnTheRightAndPlaceItOnTheCabinetShelfTask(Libero90BaseTask): + """Configuration for the Libero study scene4 pick up the book on the right and place it on the cabinet shelf task. + + Task Description: + - Pick up the yellow_book_1 (right) + - Place it on the wooden_two_layer_shelf (top region) + + Objects: + - black_book + - yellow_book_1 (target) + - yellow_book_2 + - wooden_two_layer_shelf (goal shelf) + + Goal: Place yellow_book_1 on wooden_two_layer_shelf (top region). + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="yellow_book_1", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/usd/yellow_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/urdf/yellow_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/mjcf/yellow_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="yellow_book_2", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/usd/yellow_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/urdf/yellow_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/mjcf/yellow_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="wooden_two_layer_shelf", + fix_base_link=True, + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/wooden_two_layer_shelf/usd/wooden_two_layer_shelf.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/wooden_two_layer_shelf/urdf/wooden_two_layer_shelf.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/wooden_two_layer_shelf/mjcf/wooden_two_layer_shelf.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 250 + task_desc = "Pick up the yellow_book_1 on the right and place it on the top region of the wooden_two_layer_shelf (study_scene4)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene4_pick_up_the_book_on_the_right_and_place_it_on_the_cabinet_shelf_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: yellow_book_1 is in the top region of the wooden_two_layer_shelf. + + Success condition: + - yellow_book_1 is within the bounding box region defined by the top_region site + - Uses the site's position and orientation from physics data + """ + book_pos = states.objects["yellow_book_1"].root_state[:, :3] # (N,3) + N = book_pos.shape[0] + + # Get shelf top_region site pose and expand to N environments + shelf_top_mat = self.handler.physics.named.data.site_xmat["wooden_two_layer_shelf/top_region"] # (9,) + shelf_top_pos = self.handler.physics.named.data.site_xpos["wooden_two_layer_shelf/top_region"] # (3,) + + shelf_top_R = ( + torch.from_numpy(shelf_top_mat).float().reshape(3, 3).unsqueeze(0).expand(N, 3, 3).to(book_pos.device) + ) # (N,3,3) + shelf_top_t = torch.from_numpy(shelf_top_pos).float().unsqueeze(0).expand(N, 3).to(book_pos.device) # (N,3) + + # top_region site half-size from wooden_shelf.xml: size="0.03272 0.05000 0.11027" + bbox_lower = torch.tensor([-0.03272, -0.05000, -0.11027], device=book_pos.device) + bbox_upper = torch.tensor([0.03272, 0.05000, 0.11027], device=book_pos.device) + + # Transform book position to shelf top_region local frame + book_local = torch.matmul(shelf_top_R.transpose(1, 2), (book_pos - shelf_top_t).unsqueeze(-1)).squeeze( + -1 + ) # (N,3) + ge_lower = book_local >= bbox_lower # (N,3) + le_upper = book_local <= bbox_upper # (N,3) + inside = (ge_lower & le_upper).all(dim=-1) + return inside + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states diff --git a/roboverse_pack/tasks/libero_90/study_scene4_pick_up_the_book_on_the_right_and_place_it_under_the_cabinet_shelf.py b/roboverse_pack/tasks/libero_90/study_scene4_pick_up_the_book_on_the_right_and_place_it_under_the_cabinet_shelf.py new file mode 100644 index 000000000..2c61642ac --- /dev/null +++ b/roboverse_pack/tasks/libero_90/study_scene4_pick_up_the_book_on_the_right_and_place_it_under_the_cabinet_shelf.py @@ -0,0 +1,117 @@ +"""Configuration for the Libero study scene4 pick up the book on the right and place it under the cabinet shelf task.""" + +from __future__ import annotations + +import torch + +from metasim.constants import PhysicStateType +from metasim.scenario.objects import RigidObjCfg +from metasim.scenario.scenario import ScenarioCfg +from metasim.task.registry import register_task +from metasim.types import TensorState + +from .libero_90_base import Libero90BaseTask + + +@register_task( + "libero_90.study_scene4_pick_up_the_book_on_the_right_and_place_it_under_the_cabinet_shelf", + "study_scene4_pick_up_the_book_on_the_right_and_place_it_under_the_cabinet_shelf", +) +class LiberoStudyScene4PickUpTheBookOnTheRightAndPlaceItUnderTheCabinetShelfTask(Libero90BaseTask): + """Configuration for the Libero study scene4 pick up the book on the right and place it under the cabinet shelf task. + + Task Description: + - Pick up the yellow_book_1 (right) + - Place it under the wooden_two_layer_shelf (bottom region) + + Objects: + - black_book + - yellow_book_1 (target) + - yellow_book_2 + - wooden_two_layer_shelf (goal shelf) + + Goal: Place yellow_book_1 under wooden_two_layer_shelf (bottom region). + """ + + scenario = ScenarioCfg( + objects=[ + RigidObjCfg( + name="black_book", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/usd/black_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/urdf/black_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/black_book/mjcf/black_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="yellow_book_1", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/usd/yellow_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/urdf/yellow_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/mjcf/yellow_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="yellow_book_2", + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/usd/yellow_book.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/urdf/yellow_book.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/yellow_book/mjcf/yellow_book.xml", + physics=PhysicStateType.RIGIDBODY, + ), + RigidObjCfg( + name="wooden_two_layer_shelf", + fix_base_link=True, + usd_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/wooden_two_layer_shelf/usd/wooden_two_layer_shelf.usd", + urdf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/wooden_two_layer_shelf/urdf/wooden_two_layer_shelf.urdf", + mjcf_path="roboverse_data/assets/libero/COMMON/turbosquid_objects/wooden_two_layer_shelf/mjcf/wooden_two_layer_shelf.xml", + physics=PhysicStateType.RIGIDBODY, + ), + ], + robots=["franka"], + ) + + max_episode_steps = 250 + task_desc = "Pick up the yellow_book_1 on the right and place it under the wooden_two_layer_shelf (bottom region) (study_scene4)" + + workspace_name = ("study_table",) + workspace_offset = ((0, 0, 0),) + workspace_size = ((1.0, 1.2, 0.1),) + + traj_filepath = "roboverse_data/trajs/libero90/libero_90_study_scene4_pick_up_the_book_on_the_right_and_place_it_under_the_cabinet_shelf_traj_v2.pkl" + + def _terminated(self, states: TensorState) -> torch.Tensor: + """Task success checker: yellow_book_1 is in the bottom region of the wooden_two_layer_shelf. + + Success condition: + - yellow_book_1 is within the bounding box region defined by the bottom_region site + - Uses the site's position and orientation from physics data + """ + book_pos = states.objects["yellow_book_1"].root_state[:, :3] # (N,3) + N = book_pos.shape[0] + + # Get shelf bottom_region site pose and expand to N environments + shelf_bottom_mat = self.handler.physics.named.data.site_xmat["wooden_two_layer_shelf/bottom_region"] # (9,) + shelf_bottom_pos = self.handler.physics.named.data.site_xpos["wooden_two_layer_shelf/bottom_region"] # (3,) + + shelf_bottom_R = ( + torch.from_numpy(shelf_bottom_mat).float().reshape(3, 3).unsqueeze(0).expand(N, 3, 3).to(book_pos.device) + ) # (N,3,3) + shelf_bottom_t = ( + torch.from_numpy(shelf_bottom_pos).float().unsqueeze(0).expand(N, 3).to(book_pos.device) + ) # (N,3) + + # bottom_region site half-size from wooden_shelf.xml: size="0.03272 0.05000 0.11027" + bbox_lower = torch.tensor([-0.03272, -0.05000, -0.11027], device=book_pos.device) + bbox_upper = torch.tensor([0.03272, 0.05000, 0.11027], device=book_pos.device) + + # Transform book position to shelf bottom_region local frame + book_local = torch.matmul(shelf_bottom_R.transpose(1, 2), (book_pos - shelf_bottom_t).unsqueeze(-1)).squeeze( + -1 + ) # (N,3) + ge_lower = book_local >= bbox_lower # (N,3) + le_upper = book_local <= bbox_upper # (N,3) + inside = (ge_lower & le_upper).all(dim=-1) + return inside + + def reset(self, states=None, env_ids=None): + """Skip checker reset.""" + states = super(Libero90BaseTask, self).reset(states, env_ids) + return states