From 8e224a03e8107351ceedaa2770e3891b8e0f2443 Mon Sep 17 00:00:00 2001 From: Jacr Date: Mon, 15 Apr 2024 19:02:20 +0200 Subject: [PATCH] fixes Box low's precision warning --- .../mujoco/sawyer_xyz/v1/sawyer_assembly_peg.py | 5 ++++- .../envs/mujoco/sawyer_xyz/v1/sawyer_box_close.py | 5 ++++- .../mujoco/sawyer_xyz/v1/sawyer_button_press.py | 9 ++++++--- .../sawyer_xyz/v1/sawyer_button_press_topdown.py | 9 ++++++--- .../v1/sawyer_button_press_topdown_wall.py | 9 ++++++--- .../sawyer_xyz/v1/sawyer_button_press_wall.py | 9 ++++++--- .../mujoco/sawyer_xyz/v1/sawyer_coffee_button.py | 15 +++++++++------ .../mujoco/sawyer_xyz/v1/sawyer_coffee_pull.py | 11 +++++++---- .../mujoco/sawyer_xyz/v1/sawyer_coffee_push.py | 11 +++++++---- .../envs/mujoco/sawyer_xyz/v1/sawyer_dial_turn.py | 9 ++++++--- .../sawyer_xyz/v1/sawyer_disassemble_peg.py | 5 ++++- .../envs/mujoco/sawyer_xyz/v1/sawyer_door.py | 9 ++++++--- .../envs/mujoco/sawyer_xyz/v1/sawyer_door_lock.py | 9 ++++++--- .../mujoco/sawyer_xyz/v1/sawyer_door_unlock.py | 9 ++++++--- .../mujoco/sawyer_xyz/v1/sawyer_drawer_close.py | 15 +++++++++------ .../mujoco/sawyer_xyz/v1/sawyer_drawer_open.py | 15 +++++++++------ .../mujoco/sawyer_xyz/v1/sawyer_faucet_close.py | 15 +++++++++------ .../mujoco/sawyer_xyz/v1/sawyer_faucet_open.py | 15 +++++++++------ .../envs/mujoco/sawyer_xyz/v1/sawyer_hammer.py | 5 ++++- .../mujoco/sawyer_xyz/v1/sawyer_hand_insert.py | 5 ++++- .../mujoco/sawyer_xyz/v1/sawyer_handle_press.py | 9 ++++++--- .../sawyer_xyz/v1/sawyer_handle_press_side.py | 9 ++++++--- .../mujoco/sawyer_xyz/v1/sawyer_handle_pull.py | 9 ++++++--- .../sawyer_xyz/v1/sawyer_handle_pull_side.py | 9 ++++++--- .../mujoco/sawyer_xyz/v1/sawyer_lever_pull.py | 9 ++++++--- .../sawyer_xyz/v1/sawyer_peg_insertion_side.py | 8 +++++--- .../sawyer_xyz/v1/sawyer_peg_unplug_side.py | 9 ++++++--- .../sawyer_xyz/v1/sawyer_pick_out_of_hole.py | 5 ++++- .../mujoco/sawyer_xyz/v1/sawyer_plate_slide.py | 5 ++++- .../sawyer_xyz/v1/sawyer_plate_slide_back.py | 5 ++++- .../sawyer_xyz/v1/sawyer_plate_slide_back_side.py | 5 ++++- .../sawyer_xyz/v1/sawyer_plate_slide_side.py | 5 ++++- .../envs/mujoco/sawyer_xyz/v1/sawyer_push_back.py | 5 ++++- .../sawyer_xyz/v1/sawyer_reach_push_pick_place.py | 8 +++++--- .../v1/sawyer_reach_push_pick_place_wall.py | 8 +++++--- .../envs/mujoco/sawyer_xyz/v1/sawyer_soccer.py | 11 +++++++---- .../mujoco/sawyer_xyz/v1/sawyer_stick_pull.py | 5 ++++- .../mujoco/sawyer_xyz/v1/sawyer_stick_push.py | 5 ++++- .../envs/mujoco/sawyer_xyz/v1/sawyer_sweep.py | 9 ++++++--- .../sawyer_xyz/v1/sawyer_sweep_into_goal.py | 5 ++++- .../mujoco/sawyer_xyz/v1/sawyer_window_close.py | 15 +++++++++------ .../mujoco/sawyer_xyz/v1/sawyer_window_open.py | 15 +++++++++------ .../sawyer_xyz/v2/sawyer_assembly_peg_v2.py | 5 ++++- .../mujoco/sawyer_xyz/v2/sawyer_box_close_v2.py | 5 ++++- .../v2/sawyer_button_press_topdown_v2.py | 9 ++++++--- .../v2/sawyer_button_press_topdown_wall_v2.py | 9 ++++++--- .../sawyer_xyz/v2/sawyer_button_press_v2.py | 9 ++++++--- .../sawyer_xyz/v2/sawyer_button_press_wall_v2.py | 9 ++++++--- .../sawyer_xyz/v2/sawyer_coffee_button_v2.py | 9 ++++++--- .../mujoco/sawyer_xyz/v2/sawyer_coffee_pull_v2.py | 5 ++++- .../mujoco/sawyer_xyz/v2/sawyer_coffee_push_v2.py | 5 ++++- .../mujoco/sawyer_xyz/v2/sawyer_dial_turn_v2.py | 9 ++++++--- .../mujoco/sawyer_xyz/v2/sawyer_door_close_v2.py | 9 ++++++--- .../mujoco/sawyer_xyz/v2/sawyer_door_lock_v2.py | 9 ++++++--- .../mujoco/sawyer_xyz/v2/sawyer_door_unlock_v2.py | 9 ++++++--- .../envs/mujoco/sawyer_xyz/v2/sawyer_door_v2.py | 9 ++++++--- .../sawyer_xyz/v2/sawyer_drawer_close_v2.py | 9 ++++++--- .../mujoco/sawyer_xyz/v2/sawyer_drawer_open_v2.py | 9 ++++++--- .../sawyer_xyz/v2/sawyer_faucet_close_v2.py | 9 ++++++--- .../mujoco/sawyer_xyz/v2/sawyer_faucet_open_v2.py | 9 ++++++--- .../envs/mujoco/sawyer_xyz/v2/sawyer_hammer_v2.py | 5 ++++- .../mujoco/sawyer_xyz/v2/sawyer_hand_insert_v2.py | 5 ++++- .../sawyer_xyz/v2/sawyer_handle_press_side_v2.py | 9 ++++++--- .../sawyer_xyz/v2/sawyer_handle_press_v2.py | 9 ++++++--- .../sawyer_xyz/v2/sawyer_handle_pull_side_v2.py | 9 ++++++--- .../mujoco/sawyer_xyz/v2/sawyer_handle_pull_v2.py | 9 ++++++--- .../mujoco/sawyer_xyz/v2/sawyer_lever_pull_v2.py | 9 ++++++--- .../sawyer_xyz/v2/sawyer_peg_unplug_side_v2.py | 9 ++++++--- .../sawyer_xyz/v2/sawyer_pick_out_of_hole_v2.py | 5 ++++- .../mujoco/sawyer_xyz/v2/sawyer_pick_place_v2.py | 5 ++++- .../sawyer_xyz/v2/sawyer_pick_place_wall_v2.py | 5 ++++- .../v2/sawyer_plate_slide_back_side_v2.py | 5 ++++- .../sawyer_xyz/v2/sawyer_plate_slide_back_v2.py | 5 ++++- .../sawyer_xyz/v2/sawyer_plate_slide_side_v2.py | 5 ++++- .../mujoco/sawyer_xyz/v2/sawyer_plate_slide_v2.py | 5 ++++- .../mujoco/sawyer_xyz/v2/sawyer_push_back_v2.py | 5 ++++- .../envs/mujoco/sawyer_xyz/v2/sawyer_push_v2.py | 5 ++++- .../mujoco/sawyer_xyz/v2/sawyer_push_wall_v2.py | 5 ++++- .../envs/mujoco/sawyer_xyz/v2/sawyer_reach_v2.py | 5 ++++- .../mujoco/sawyer_xyz/v2/sawyer_reach_wall_v2.py | 5 ++++- .../mujoco/sawyer_xyz/v2/sawyer_shelf_place_v2.py | 5 ++++- .../envs/mujoco/sawyer_xyz/v2/sawyer_soccer_v2.py | 5 ++++- .../mujoco/sawyer_xyz/v2/sawyer_stick_pull_v2.py | 5 ++++- .../mujoco/sawyer_xyz/v2/sawyer_stick_push_v2.py | 5 ++++- .../sawyer_xyz/v2/sawyer_sweep_into_goal_v2.py | 5 ++++- .../envs/mujoco/sawyer_xyz/v2/sawyer_sweep_v2.py | 9 ++++++--- .../sawyer_xyz/v2/sawyer_window_close_v2.py | 9 ++++++--- .../mujoco/sawyer_xyz/v2/sawyer_window_open_v2.py | 9 ++++++--- 88 files changed, 475 insertions(+), 214 deletions(-) diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_assembly_peg.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_assembly_peg.py index 070045073..d608e2411 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_assembly_peg.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_assembly_peg.py @@ -42,7 +42,10 @@ def __init__(self): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_box_close.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_box_close.py index 4c47c40b6..67b64312f 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_box_close.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_box_close.py @@ -40,7 +40,10 @@ def __init__(self): np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_button_press.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_button_press.py index 5c1561894..c402d99c4 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_button_press.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_button_press.py @@ -32,10 +32,13 @@ def __init__(self): self.hand_init_pos = self.init_config["hand_init_pos"] self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_button_press_topdown.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_button_press_topdown.py index bab9f7820..7fe40e148 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_button_press_topdown.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_button_press_topdown.py @@ -33,10 +33,13 @@ def __init__(self): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_button_press_topdown_wall.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_button_press_topdown_wall.py index c6465db14..e7b425d09 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_button_press_topdown_wall.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_button_press_topdown_wall.py @@ -33,10 +33,13 @@ def __init__(self): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_button_press_wall.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_button_press_wall.py index 04a26d55e..db32fade3 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_button_press_wall.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_button_press_wall.py @@ -33,11 +33,14 @@ def __init__(self): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_coffee_button.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_coffee_button.py index fe555f817..eec9646d8 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_coffee_button.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_coffee_button.py @@ -36,10 +36,13 @@ def __init__(self): self.hand_init_pos = self.init_config["hand_init_pos"] self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): @@ -81,9 +84,9 @@ def reset_model(self): obj_pos = goal_pos + np.array([0, -0.1, -0.28]) self._target_pos = button_pos - self.sim.model.body_pos[ - self.model.body_name2id("coffee_machine") - ] = self.obj_init_pos + self.sim.model.body_pos[self.model.body_name2id("coffee_machine")] = ( + self.obj_init_pos + ) self.sim.model.body_pos[self.model.body_name2id("button")] = self._target_pos self._set_obj_xyz(obj_pos) self._target_pos = self._get_site_pos("coffee_goal") diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_coffee_pull.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_coffee_pull.py index b7223aa97..34d042f24 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_coffee_pull.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_coffee_pull.py @@ -37,7 +37,10 @@ def __init__(self): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): @@ -93,9 +96,9 @@ def reset_model(self): self.obj_init_pos = np.concatenate((goal_pos[:2], [self.obj_init_pos[-1]])) machine_pos = goal_pos[:3] - np.array([0, -0.15, -0.27]) button_pos = machine_pos + np.array([0.0, -0.12, 0.05]) - self.sim.model.body_pos[ - self.model.body_name2id("coffee_machine") - ] = machine_pos + self.sim.model.body_pos[self.model.body_name2id("coffee_machine")] = ( + machine_pos + ) self.sim.model.body_pos[self.model.body_name2id("button")] = button_pos self._set_obj_xyz(self.obj_init_pos) diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_coffee_push.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_coffee_push.py index 30e130441..945f5e745 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_coffee_push.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_coffee_push.py @@ -37,7 +37,10 @@ def __init__(self): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): @@ -92,9 +95,9 @@ def reset_model(self): self.obj_init_pos = np.concatenate((goal_pos[:2], [self.obj_init_pos[-1]])) machine_pos = self._target_pos - np.array([0, -0.1, -0.27]) button_pos = machine_pos + np.array([0.0, -0.12, 0.05]) - self.sim.model.body_pos[ - self.model.body_name2id("coffee_machine") - ] = machine_pos + self.sim.model.body_pos[self.model.body_name2id("coffee_machine")] = ( + machine_pos + ) self.sim.model.body_pos[self.model.body_name2id("button")] = button_pos self._set_obj_xyz(self.obj_init_pos) diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_dial_turn.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_dial_turn.py index 40efe8897..ea924d229 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_dial_turn.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_dial_turn.py @@ -32,10 +32,13 @@ def __init__(self): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_disassemble_peg.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_disassemble_peg.py index f98dddc3d..ad03543e3 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_disassemble_peg.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_disassemble_peg.py @@ -40,7 +40,10 @@ def __init__(self): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_door.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_door.py index 73f146539..17a43b4ae 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_door.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_door.py @@ -42,10 +42,13 @@ def __init__(self): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) self.door_angle_idx = self.model.get_joint_qpos_addr("doorjoint") diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_door_lock.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_door_lock.py index d019dc601..f0c0af36e 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_door_lock.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_door_lock.py @@ -33,10 +33,13 @@ def __init__(self): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_door_unlock.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_door_unlock.py index 568aeaea8..c9304ebc8 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_door_unlock.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_door_unlock.py @@ -32,10 +32,13 @@ def __init__(self): self.hand_init_pos = self.init_config["hand_init_pos"] self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_drawer_close.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_drawer_close.py index 7095b8a02..30fddd137 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_drawer_close.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_drawer_close.py @@ -38,10 +38,13 @@ def __init__(self): self.hand_init_pos = self.init_config["hand_init_pos"] self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): @@ -85,9 +88,9 @@ def reset_model(self): drawer_cover_pos = self.obj_init_pos.copy() drawer_cover_pos[2] -= 0.02 self.sim.model.body_pos[self.model.body_name2id("drawer")] = self.obj_init_pos - self.sim.model.body_pos[ - self.model.body_name2id("drawer_cover") - ] = drawer_cover_pos + self.sim.model.body_pos[self.model.body_name2id("drawer_cover")] = ( + drawer_cover_pos + ) self.sim.model.site_pos[self.model.site_name2id("goal")] = self._target_pos self._set_obj_xyz(-0.2) self.maxDist = np.abs( diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_drawer_open.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_drawer_open.py index b9142b5b6..575e1db65 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_drawer_open.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_drawer_open.py @@ -38,10 +38,13 @@ def __init__(self): self.hand_init_pos = self.init_config["hand_init_pos"] self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): @@ -87,9 +90,9 @@ def reset_model(self): drawer_cover_pos = self.obj_init_pos.copy() drawer_cover_pos[2] -= 0.02 self.sim.model.body_pos[self.model.body_name2id("drawer")] = self.obj_init_pos - self.sim.model.body_pos[ - self.model.body_name2id("drawer_cover") - ] = drawer_cover_pos + self.sim.model.body_pos[self.model.body_name2id("drawer_cover")] = ( + drawer_cover_pos + ) self.sim.model.site_pos[self.model.site_name2id("goal")] = self._target_pos self.maxPullDist = 0.2 self.target_reward = 1000 * self.maxPullDist + 1000 * 2 diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_faucet_close.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_faucet_close.py index d736057e8..2c73cf4be 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_faucet_close.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_faucet_close.py @@ -33,10 +33,13 @@ def __init__(self): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): @@ -79,9 +82,9 @@ def reset_model(self): self._target_pos = final_pos self.sim.model.body_pos[self.model.body_name2id("faucet")] = self.obj_init_pos - self.sim.model.body_pos[ - self.model.body_name2id("faucetBase") - ] = self.obj_init_pos + self.sim.model.body_pos[self.model.body_name2id("faucetBase")] = ( + self.obj_init_pos + ) self.maxPullDist = np.linalg.norm(self._target_pos - self.obj_init_pos) return self._get_obs() diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_faucet_open.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_faucet_open.py index e5cd2926a..dc41d7e64 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_faucet_open.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_faucet_open.py @@ -32,10 +32,13 @@ def __init__(self): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): @@ -80,9 +83,9 @@ def reset_model(self): self._target_pos = final_pos self.sim.model.body_pos[self.model.body_name2id("faucet")] = self.obj_init_pos - self.sim.model.body_pos[ - self.model.body_name2id("faucetBase") - ] = self.obj_init_pos + self.sim.model.body_pos[self.model.body_name2id("faucetBase")] = ( + self.obj_init_pos + ) self.maxPullDist = np.linalg.norm(self._target_pos - self.obj_init_pos) return self._get_obs() diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_hammer.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_hammer.py index cfd1df68b..bb1e7e977 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_hammer.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_hammer.py @@ -35,7 +35,10 @@ def __init__(self): self.liftThresh = liftThresh self._random_reset_space = Box(np.array(obj_low), np.array(obj_high)) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_hand_insert.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_hand_insert.py index fbeadb798..2572420a0 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_hand_insert.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_hand_insert.py @@ -37,7 +37,10 @@ def __init__(self): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_press.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_press.py index b8fe329ae..5a6f6ac24 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_press.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_press.py @@ -34,10 +34,13 @@ def __init__(self): self.hand_init_pos = self.init_config["hand_init_pos"] self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_press_side.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_press_side.py index 126ce4850..da0e967ad 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_press_side.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_press_side.py @@ -35,10 +35,13 @@ def __init__(self): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_pull.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_pull.py index 6ccf11311..b1f399ce0 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_pull.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_pull.py @@ -35,10 +35,13 @@ def __init__(self): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_pull_side.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_pull_side.py index b4d0f068d..db560361b 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_pull_side.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_pull_side.py @@ -35,10 +35,13 @@ def __init__(self): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_lever_pull.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_lever_pull.py index 520cd6535..30051e7ce 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_lever_pull.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_lever_pull.py @@ -33,10 +33,13 @@ def __init__(self): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_peg_insertion_side.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_peg_insertion_side.py index 0e01770a1..865359c5a 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_peg_insertion_side.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_peg_insertion_side.py @@ -45,7 +45,10 @@ def __init__(self): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): @@ -184,8 +187,7 @@ def placeReward(): if cond: if placingDistHead <= 0.05: placeRew = 1000 * (self.maxPlacingDist - placingDist) + c1 * ( - np.exp(-(placingDist**2) / c2) - + np.exp(-(placingDist**2) / c3) + np.exp(-(placingDist**2) / c2) + np.exp(-(placingDist**2) / c3) ) else: placeRew = 1000 * (self.maxPlacingDist - placingDistHead) + c1 * ( diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_peg_unplug_side.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_peg_unplug_side.py index bbf3ce824..f0ba6676d 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_peg_unplug_side.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_peg_unplug_side.py @@ -35,10 +35,13 @@ def __init__(self): self.liftThresh = liftThresh self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_pick_out_of_hole.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_pick_out_of_hole.py index a9f822e21..33004a71c 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_pick_out_of_hole.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_pick_out_of_hole.py @@ -40,7 +40,10 @@ def __init__(self): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_plate_slide.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_plate_slide.py index b612471ce..2947faef6 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_plate_slide.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_plate_slide.py @@ -37,7 +37,10 @@ def __init__(self): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_plate_slide_back.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_plate_slide_back.py index b474ad4ab..53296f203 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_plate_slide_back.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_plate_slide_back.py @@ -37,7 +37,10 @@ def __init__(self): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_plate_slide_back_side.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_plate_slide_back_side.py index f72fa61b0..57809e83c 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_plate_slide_back_side.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_plate_slide_back_side.py @@ -37,7 +37,10 @@ def __init__(self): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_plate_slide_side.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_plate_slide_side.py index a25a9d881..c8bba39d3 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_plate_slide_side.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_plate_slide_side.py @@ -37,7 +37,10 @@ def __init__(self): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_push_back.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_push_back.py index ec018dc53..a0642580d 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_push_back.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_push_back.py @@ -37,7 +37,10 @@ def __init__(self): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_reach_push_pick_place.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_reach_push_pick_place.py index 4d6eca798..f47e281f3 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_reach_push_pick_place.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_reach_push_pick_place.py @@ -43,7 +43,10 @@ def __init__(self): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) self.num_resets = 0 @@ -292,8 +295,7 @@ def placeReward(): cond = self.pickCompleted and (reachDist < 0.1) and not (objDropped()) if cond: placeRew = 1000 * (self.maxPlacingDist - placingDist) + c1 * ( - np.exp(-(placingDist**2) / c2) - + np.exp(-(placingDist**2) / c3) + np.exp(-(placingDist**2) / c2) + np.exp(-(placingDist**2) / c3) ) placeRew = max(placeRew, 0) return [placeRew, placingDist] diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_reach_push_pick_place_wall.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_reach_push_pick_place_wall.py index 88bbf802f..588496755 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_reach_push_pick_place_wall.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_reach_push_pick_place_wall.py @@ -43,7 +43,10 @@ def __init__(self): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) self.num_resets = 0 @@ -287,8 +290,7 @@ def placeReward(): cond = self.pickCompleted and (reachDist < 0.1) and not (objDropped()) if cond: placeRew = 1000 * (self.maxPlacingDist - placingDist) + c1 * ( - np.exp(-(placingDist**2) / c2) - + np.exp(-(placingDist**2) / c3) + np.exp(-(placingDist**2) / c2) + np.exp(-(placingDist**2) / c3) ) placeRew = max(placeRew, 0) return [placeRew, placingDist] diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_soccer.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_soccer.py index f5d879071..62638417a 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_soccer.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_soccer.py @@ -37,7 +37,10 @@ def __init__(self): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): @@ -84,9 +87,9 @@ def reset_model(self): goal_pos = self._get_state_rand_vec() self._target_pos = goal_pos[3:] self.obj_init_pos = np.concatenate((goal_pos[:2], [self.obj_init_pos[-1]])) - self.sim.model.body_pos[ - self.model.body_name2id("goal_whole") - ] = self._target_pos + self.sim.model.body_pos[self.model.body_name2id("goal_whole")] = ( + self._target_pos + ) self._set_obj_xyz(self.obj_init_pos) self.maxPushDist = np.linalg.norm( diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_stick_pull.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_stick_pull.py index cdbe37df1..4bc7e6817 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_stick_pull.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_stick_pull.py @@ -38,7 +38,10 @@ def __init__(self): self.obj_init_pos = np.array([0.2, 0.69, 0.04]) self.obj_init_qpos = np.array([0.0, 0.09]) self.obj_space = Box(np.array(obj_low), np.array(obj_high)) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) self._random_reset_space = Box( np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_stick_push.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_stick_push.py index 309cc7a92..543b4a818 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_stick_push.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_stick_push.py @@ -36,7 +36,10 @@ def __init__(self): self.obj_init_pos = np.array([0.2, 0.6, 0.04]) self.obj_init_qpos = np.array([0.0, 0.0]) self.obj_space = Box(np.array(obj_low), np.array(obj_high)) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) self._random_reset_space = Box( np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_sweep.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_sweep.py index a54f5dc49..47d19252e 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_sweep.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_sweep.py @@ -37,10 +37,13 @@ def __init__(self): self.init_puck_z = init_puck_z self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_sweep_into_goal.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_sweep_into_goal.py index cd1da5af4..896d1a2b3 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_sweep_into_goal.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_sweep_into_goal.py @@ -37,7 +37,10 @@ def __init__(self): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_window_close.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_window_close.py index fce7bed9d..fc689483e 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_window_close.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_window_close.py @@ -38,10 +38,13 @@ def __init__(self): self.liftThresh = liftThresh self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): @@ -81,9 +84,9 @@ def reset_model(self): wall_pos = self.obj_init_pos.copy() - np.array([0.1, 0, 0.12]) window_another_pos = self.obj_init_pos.copy() + np.array([0, 0.03, 0]) self.sim.model.body_pos[self.model.body_name2id("window")] = self.obj_init_pos - self.sim.model.body_pos[ - self.model.body_name2id("window_another") - ] = window_another_pos + self.sim.model.body_pos[self.model.body_name2id("window_another")] = ( + window_another_pos + ) self.sim.model.body_pos[self.model.body_name2id("wall")] = wall_pos self.sim.model.site_pos[self.model.site_name2id("goal")] = self._target_pos self.maxPullDist = 0.2 diff --git a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_window_open.py b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_window_open.py index 484d5fe89..7263f8a16 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_window_open.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_window_open.py @@ -43,10 +43,13 @@ def __init__(self): self.liftThresh = liftThresh self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): @@ -86,9 +89,9 @@ def reset_model(self): wall_pos = self.obj_init_pos.copy() - np.array([-0.1, 0, 0.12]) window_another_pos = self.obj_init_pos.copy() + np.array([0.2, 0.03, 0]) self.sim.model.body_pos[self.model.body_name2id("window")] = self.obj_init_pos - self.sim.model.body_pos[ - self.model.body_name2id("window_another") - ] = window_another_pos + self.sim.model.body_pos[self.model.body_name2id("window_another")] = ( + window_another_pos + ) self.sim.model.body_pos[self.model.body_name2id("wall")] = wall_pos self.sim.model.site_pos[self.model.site_name2id("goal")] = self._target_pos self.maxPullDist = 0.2 diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_assembly_peg_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_assembly_peg_v2.py index 3a5c2ce29..984235b0d 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_assembly_peg_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_assembly_peg_v2.py @@ -45,7 +45,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_box_close_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_box_close_v2.py index 3d653bd65..49f33dbc0 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_box_close_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_box_close_v2.py @@ -40,7 +40,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): self._target_to_obj_init = None - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) self._random_reset_space = Box( np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_topdown_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_topdown_v2.py index 5bf16c140..434cf16d5 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_topdown_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_topdown_v2.py @@ -38,10 +38,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_topdown_wall_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_topdown_wall_v2.py index 4cba6632d..bacc94cdf 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_topdown_wall_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_topdown_wall_v2.py @@ -38,10 +38,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_v2.py index b64278cde..cfff0fbd2 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_v2.py @@ -37,10 +37,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_wall_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_wall_v2.py index 1c9a05bb5..72e600483 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_wall_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_wall_v2.py @@ -38,11 +38,14 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_coffee_button_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_coffee_button_v2.py index 2c98b147b..cf89ef82a 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_coffee_button_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_coffee_button_v2.py @@ -43,10 +43,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): self.hand_init_pos = self.init_config["hand_init_pos"] self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_coffee_pull_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_coffee_pull_v2.py index 8586fccf1..259c854f4 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_coffee_pull_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_coffee_pull_v2.py @@ -43,7 +43,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_coffee_push_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_coffee_push_v2.py index 6bd0c40c0..e8edc10c5 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_coffee_push_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_coffee_push_v2.py @@ -43,7 +43,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_dial_turn_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_dial_turn_v2.py index 5dfa86d37..8ea123cdc 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_dial_turn_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_dial_turn_v2.py @@ -39,10 +39,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): self.hand_init_pos = self.init_config["hand_init_pos"] self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_close_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_close_v2.py index 656329d73..ee092ab53 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_close_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_close_v2.py @@ -41,11 +41,14 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): self.door_qpos_adr = self.model.joint("doorjoint").qposadr.item() self.door_qvel_adr = self.model.joint("doorjoint").dofadr.item() - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), ) @property diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_lock_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_lock_v2.py index 34a1b4c5f..1ca8f3917 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_lock_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_lock_v2.py @@ -40,10 +40,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): self._lock_length = 0.1 self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_unlock_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_unlock_v2.py index ed18e6bfb..9f55f995a 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_unlock_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_unlock_v2.py @@ -38,10 +38,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): self._lock_length = 0.1 self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_v2.py index 5901361f0..77962d96a 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_v2.py @@ -43,10 +43,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): self.door_qvel_adr = self.model.joint("doorjoint").dofadr.item() self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_drawer_close_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_drawer_close_v2.py index 6fdd3ee3c..0347c3112 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_drawer_close_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_drawer_close_v2.py @@ -46,10 +46,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) self.maxDist = 0.15 self.target_reward = 1000 * self.maxDist + 1000 * 2 diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_drawer_open_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_drawer_open_v2.py index 67daebd50..9c63c12dc 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_drawer_open_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_drawer_open_v2.py @@ -44,10 +44,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) self.maxDist = 0.2 self.target_reward = 1000 * self.maxDist + 1000 * 2 diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_faucet_close_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_faucet_close_v2.py index 6a14b03e2..5047cfbc2 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_faucet_close_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_faucet_close_v2.py @@ -39,10 +39,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_faucet_open_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_faucet_open_v2.py index 400e0270a..5f0bb3813 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_faucet_open_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_faucet_open_v2.py @@ -39,10 +39,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_hammer_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_hammer_v2.py index 620d66175..d2caff1be 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_hammer_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_hammer_v2.py @@ -41,7 +41,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): self.nail_init_pos = None self._random_reset_space = Box(np.array(obj_low), np.array(obj_high)) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_hand_insert_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_hand_insert_v2.py index 1a64fee97..947630d3d 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_hand_insert_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_hand_insert_v2.py @@ -43,7 +43,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_handle_press_side_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_handle_press_side_v2.py index 2d689a333..46924fb17 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_handle_press_side_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_handle_press_side_v2.py @@ -55,10 +55,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_handle_press_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_handle_press_v2.py index cd8004b53..6bcd0d15f 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_handle_press_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_handle_press_v2.py @@ -41,10 +41,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): self.hand_init_pos = self.init_config["hand_init_pos"] self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_handle_pull_side_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_handle_pull_side_v2.py index ab663dff4..b92352889 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_handle_pull_side_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_handle_pull_side_v2.py @@ -40,10 +40,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_handle_pull_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_handle_pull_v2.py index 622eba505..49fcbc908 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_handle_pull_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_handle_pull_v2.py @@ -39,10 +39,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): self.hand_init_pos = self.init_config["hand_init_pos"] self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_lever_pull_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_lever_pull_v2.py index b4c385e81..f582e8211 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_lever_pull_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_lever_pull_v2.py @@ -55,10 +55,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_peg_unplug_side_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_peg_unplug_side_v2.py index 23cea6a83..bda5ef56c 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_peg_unplug_side_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_peg_unplug_side_v2.py @@ -37,10 +37,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): self.hand_init_pos = self.init_config["hand_init_pos"] self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_pick_out_of_hole_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_pick_out_of_hole_v2.py index 209c9e77b..157e6884a 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_pick_out_of_hole_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_pick_out_of_hole_v2.py @@ -43,7 +43,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_pick_place_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_pick_place_v2.py index 304082791..ab72e1749 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_pick_place_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_pick_place_v2.py @@ -58,7 +58,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) self.num_resets = 0 self.obj_init_pos = None diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_pick_place_wall_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_pick_place_wall_v2.py index 654fee547..e4d7381d2 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_pick_place_wall_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_pick_place_wall_v2.py @@ -59,7 +59,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) self.num_resets = 0 diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_back_side_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_back_side_v2.py index 0d83a526c..ea6108c3e 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_back_side_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_back_side_v2.py @@ -58,7 +58,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_back_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_back_v2.py index b0e493f88..bbf6dc21f 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_back_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_back_v2.py @@ -42,7 +42,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_side_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_side_v2.py index 8ddffcebd..eff96b74d 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_side_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_side_v2.py @@ -42,7 +42,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_v2.py index 72f15822d..b1ce7c56e 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_v2.py @@ -44,7 +44,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_push_back_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_push_back_v2.py index 12635247e..35987105f 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_push_back_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_push_back_v2.py @@ -45,7 +45,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_push_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_push_v2.py index 0e08b1243..a7452f2e0 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_push_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_push_v2.py @@ -65,7 +65,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) self.num_resets = 0 @property diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_push_wall_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_push_wall_v2.py index 99b26856e..9c02a2bff 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_push_wall_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_push_wall_v2.py @@ -63,7 +63,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) self.num_resets = 0 diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_reach_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_reach_v2.py index 3882a77c8..85e16cfcd 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_reach_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_reach_v2.py @@ -59,7 +59,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_reach_wall_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_reach_wall_v2.py index d4638b21b..29a20d30f 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_reach_wall_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_reach_wall_v2.py @@ -58,7 +58,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) self.num_resets = 0 diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_shelf_place_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_shelf_place_v2.py index 19c8ae681..be57e8c6d 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_shelf_place_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_shelf_place_v2.py @@ -45,7 +45,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_soccer_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_soccer_v2.py index 51ec9babb..1a79c91b4 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_soccer_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_soccer_v2.py @@ -46,7 +46,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_stick_pull_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_stick_pull_v2.py index 3b899a072..ebbe47e85 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_stick_pull_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_stick_pull_v2.py @@ -40,7 +40,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): self.obj_init_pos = np.array([0.2, 0.69, 0.0]) self.obj_init_qpos = np.array([0.0, 0.09]) self.obj_space = Box(np.array(obj_low), np.array(obj_high)) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) self._random_reset_space = Box( np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_stick_push_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_stick_push_v2.py index 47d39b044..28a983ddd 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_stick_push_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_stick_push_v2.py @@ -40,7 +40,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): self.obj_init_pos = np.array([0.2, 0.6, 0.0]) self.obj_init_qpos = np.array([0.0, 0.0]) self.obj_space = Box(np.array(obj_low), np.array(obj_high)) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) self._random_reset_space = Box( np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_sweep_into_goal_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_sweep_into_goal_v2.py index 10f275c2c..dcc0faf81 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_sweep_into_goal_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_sweep_into_goal_v2.py @@ -44,7 +44,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): np.hstack((obj_low, goal_low)), np.hstack((obj_high, goal_high)), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), + ) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_sweep_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_sweep_v2.py index 8d44d1ceb..349fc7c8b 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_sweep_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_sweep_v2.py @@ -43,10 +43,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): self.init_puck_z = init_puck_z self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) @property def model_name(self): diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_window_close_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_window_close_v2.py index 41308be65..af695b6c8 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_window_close_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_window_close_v2.py @@ -56,10 +56,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): self.liftThresh = liftThresh self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) self.maxPullDist = 0.2 self.target_reward = 1000 * self.maxPullDist + 1000 * 2 diff --git a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_window_open_v2.py b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_window_open_v2.py index 1d84ef514..ff0c52f95 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_window_open_v2.py +++ b/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_window_open_v2.py @@ -57,10 +57,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None): goal_high = self.hand_high self._random_reset_space = Box( - np.array(obj_low), - np.array(obj_high), + np.array(obj_low, dtype=np.float32), + np.array(obj_high, dtype=np.float32), + ) + self.goal_space = Box( + np.array(goal_low, dtype=np.float32), + np.array(goal_high, dtype=np.float32), ) - self.goal_space = Box(np.array(goal_low), np.array(goal_high)) self.maxPullDist = 0.2 self.target_reward = 1000 * self.maxPullDist + 1000 * 2