Skip to content

Commit

Permalink
updating for np.float64
Browse files Browse the repository at this point in the history
  • Loading branch information
reginald-mclean committed Apr 23, 2024
1 parent 8e224a0 commit 9ea37a4
Show file tree
Hide file tree
Showing 48 changed files with 185 additions and 185 deletions.
10 changes: 5 additions & 5 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_assembly_peg_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):

self.init_config = {
"obj_init_angle": 0.3,
"obj_init_pos": np.array([0, 0.6, 0.02], dtype=np.float32),
"hand_init_pos": np.array((0, 0.6, 0.2), dtype=np.float32),
"obj_init_pos": np.array([0, 0.6, 0.02], dtype=np.float64),
"hand_init_pos": np.array((0, 0.6, 0.2), dtype=np.float64),
}

self.goal = np.array([0.1, 0.8, 0.1], dtype=np.float32)
self.goal = np.array([0.1, 0.8, 0.1], dtype=np.float64)
self.obj_init_pos = self.init_config["obj_init_pos"]
self.obj_init_angle = self.init_config["obj_init_angle"]
self.hand_init_pos = self.init_config["hand_init_pos"]
Expand All @@ -46,8 +46,8 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):
np.hstack((obj_high, goal_high)),
)
self.goal_space = Box(
np.array(goal_low, dtype=np.float32),
np.array(goal_high, dtype=np.float32),
np.array(goal_low, dtype=np.float64),
np.array(goal_high, dtype=np.float64),
)

@property
Expand Down
4 changes: 2 additions & 2 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_basketball_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):

self.init_config = {
"obj_init_angle": 0.3,
"obj_init_pos": np.array([0, 0.6, 0.03], dtype=np.float32),
"hand_init_pos": np.array((0, 0.6, 0.2), dtype=np.float32),
"obj_init_pos": np.array([0, 0.6, 0.03], dtype=np.float64),
"hand_init_pos": np.array((0, 0.6, 0.2), dtype=np.float64),
}
self.goal = np.array([0, 0.9, 0])
self.obj_init_pos = self.init_config["obj_init_pos"]
Expand Down
8 changes: 4 additions & 4 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_box_close_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):

self.init_config = {
"obj_init_angle": 0.3,
"obj_init_pos": np.array([0, 0.55, 0.02], dtype=np.float32),
"hand_init_pos": np.array((0, 0.6, 0.2), dtype=np.float32),
"obj_init_pos": np.array([0, 0.55, 0.02], dtype=np.float64),
"hand_init_pos": np.array((0, 0.6, 0.2), dtype=np.float64),
}
self.goal = np.array([0.0, 0.75, 0.133])
self.obj_init_pos = self.init_config["obj_init_pos"]
Expand All @@ -41,8 +41,8 @@ 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, dtype=np.float32),
np.array(goal_high, dtype=np.float32),
np.array(goal_low, dtype=np.float64),
np.array(goal_high, dtype=np.float64),
)
self._random_reset_space = Box(
np.hstack((obj_low, goal_low)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):
)

self.init_config = {
"obj_init_pos": np.array([0, 0.8, 0.115], dtype=np.float32),
"hand_init_pos": np.array([0, 0.4, 0.2], dtype=np.float32),
"obj_init_pos": np.array([0, 0.8, 0.115], dtype=np.float64),
"hand_init_pos": np.array([0, 0.4, 0.2], dtype=np.float64),
}
self.goal = np.array([0, 0.88, 0.1])
self.obj_init_pos = self.init_config["obj_init_pos"]
Expand All @@ -38,12 +38,12 @@ 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, dtype=np.float32),
np.array(obj_high, dtype=np.float32),
np.array(obj_low, dtype=np.float64),
np.array(obj_high, dtype=np.float64),
)
self.goal_space = Box(
np.array(goal_low, dtype=np.float32),
np.array(goal_high, dtype=np.float32),
np.array(goal_low, dtype=np.float64),
np.array(goal_high, dtype=np.float64),
)

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):
)

self.init_config = {
"obj_init_pos": np.array([0, 0.8, 0.115], dtype=np.float32),
"hand_init_pos": np.array([0, 0.4, 0.2], dtype=np.float32),
"obj_init_pos": np.array([0, 0.8, 0.115], dtype=np.float64),
"hand_init_pos": np.array([0, 0.4, 0.2], dtype=np.float64),
}
self.goal = np.array([0, 0.88, 0.1])
self.obj_init_pos = self.init_config["obj_init_pos"]
Expand All @@ -38,12 +38,12 @@ 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, dtype=np.float32),
np.array(obj_high, dtype=np.float32),
np.array(obj_low, dtype=np.float64),
np.array(obj_high, dtype=np.float64),
)
self.goal_space = Box(
np.array(goal_low, dtype=np.float32),
np.array(goal_high, dtype=np.float32),
np.array(goal_low, dtype=np.float64),
np.array(goal_high, dtype=np.float64),
)

@property
Expand Down
12 changes: 6 additions & 6 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_button_press_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):
)

self.init_config = {
"obj_init_pos": np.array([0.0, 0.9, 0.115], dtype=np.float32),
"hand_init_pos": np.array([0, 0.4, 0.2], dtype=np.float32),
"obj_init_pos": np.array([0.0, 0.9, 0.115], dtype=np.float64),
"hand_init_pos": np.array([0, 0.4, 0.2], dtype=np.float64),
}
self.goal = np.array([0, 0.78, 0.12])
self.obj_init_pos = self.init_config["obj_init_pos"]
Expand All @@ -37,12 +37,12 @@ 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, dtype=np.float32),
np.array(obj_high, dtype=np.float32),
np.array(obj_low, dtype=np.float64),
np.array(obj_high, dtype=np.float64),
)
self.goal_space = Box(
np.array(goal_low, dtype=np.float32),
np.array(goal_high, dtype=np.float32),
np.array(goal_low, dtype=np.float64),
np.array(goal_high, dtype=np.float64),
)

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):
)

self.init_config = {
"obj_init_pos": np.array([0.0, 0.9, 0.115], dtype=np.float32),
"hand_init_pos": np.array([0, 0.4, 0.2], dtype=np.float32),
"obj_init_pos": np.array([0.0, 0.9, 0.115], dtype=np.float64),
"hand_init_pos": np.array([0, 0.4, 0.2], dtype=np.float64),
}
self.goal = np.array([0, 0.84, 0.12])
self.obj_init_pos = self.init_config["obj_init_pos"]
Expand All @@ -38,13 +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, dtype=np.float32),
np.array(obj_high, dtype=np.float32),
np.array(obj_low, dtype=np.float64),
np.array(obj_high, dtype=np.float64),
)

self.goal_space = Box(
np.array(goal_low, dtype=np.float32),
np.array(goal_high, dtype=np.float32),
np.array(goal_low, dtype=np.float64),
np.array(goal_high, dtype=np.float64),
)

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ 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, dtype=np.float32),
np.array(obj_high, dtype=np.float32),
np.array(obj_low, dtype=np.float64),
np.array(obj_high, dtype=np.float64),
)
self.goal_space = Box(
np.array(goal_low, dtype=np.float32),
np.array(goal_high, dtype=np.float32),
np.array(goal_low, dtype=np.float64),
np.array(goal_high, dtype=np.float64),
)

@property
Expand Down
4 changes: 2 additions & 2 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_coffee_pull_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):
np.hstack((obj_high, goal_high)),
)
self.goal_space = Box(
np.array(goal_low, dtype=np.float32),
np.array(goal_high, dtype=np.float32),
np.array(goal_low, dtype=np.float64),
np.array(goal_high, dtype=np.float64),
)

@property
Expand Down
4 changes: 2 additions & 2 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_coffee_push_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):
np.hstack((obj_high, goal_high)),
)
self.goal_space = Box(
np.array(goal_low, dtype=np.float32),
np.array(goal_high, dtype=np.float32),
np.array(goal_low, dtype=np.float64),
np.array(goal_high, dtype=np.float64),
)

@property
Expand Down
10 changes: 5 additions & 5 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_dial_turn_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):

self.init_config = {
"obj_init_pos": np.array([0, 0.7, 0.0]),
"hand_init_pos": np.array([0, 0.6, 0.2], dtype=np.float32),
"hand_init_pos": np.array([0, 0.6, 0.2], dtype=np.float64),
}
self.goal = np.array([0.0, 0.73, 0.08])
self.obj_init_pos = self.init_config["obj_init_pos"]
self.hand_init_pos = self.init_config["hand_init_pos"]

self._random_reset_space = Box(
np.array(obj_low, dtype=np.float32),
np.array(obj_high, dtype=np.float32),
np.array(obj_low, dtype=np.float64),
np.array(obj_high, dtype=np.float64),
)
self.goal_space = Box(
np.array(goal_low, dtype=np.float32),
np.array(goal_high, dtype=np.float32),
np.array(goal_low, dtype=np.float64),
np.array(goal_high, dtype=np.float64),
)

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):
self.init_config = {
"obj_init_angle": 0.3,
"obj_init_pos": np.array([0, 0.7, 0.025]),
"hand_init_pos": np.array((0, 0.4, 0.2), dtype=np.float32),
"hand_init_pos": np.array((0, 0.4, 0.2), dtype=np.float64),
}
self.goal = np.array([0, 0.8, 0.17])
self.obj_init_pos = self.init_config["obj_init_pos"]
Expand Down
12 changes: 6 additions & 6 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_close_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):

self.init_config = {
"obj_init_angle": 0.3,
"obj_init_pos": np.array([0.1, 0.95, 0.15], dtype=np.float32),
"hand_init_pos": np.array([-0.5, 0.6, 0.2], dtype=np.float32),
"obj_init_pos": np.array([0.1, 0.95, 0.15], dtype=np.float64),
"hand_init_pos": np.array([-0.5, 0.6, 0.2], dtype=np.float64),
}
self.goal = np.array([0.2, 0.8, 0.15])
self.obj_init_pos = self.init_config["obj_init_pos"]
Expand All @@ -42,13 +42,13 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):
self.door_qvel_adr = self.model.joint("doorjoint").dofadr.item()

self.goal_space = Box(
np.array(goal_low, dtype=np.float32),
np.array(goal_high, dtype=np.float32),
np.array(goal_low, dtype=np.float64),
np.array(goal_high, dtype=np.float64),
)

self._random_reset_space = Box(
np.array(obj_low, dtype=np.float32),
np.array(obj_high, dtype=np.float32),
np.array(obj_low, dtype=np.float64),
np.array(obj_high, dtype=np.float64),
)

@property
Expand Down
12 changes: 6 additions & 6 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_lock_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):
)

self.init_config = {
"obj_init_pos": np.array([0, 0.85, 0.15], dtype=np.float32),
"hand_init_pos": np.array([0, 0.6, 0.2], dtype=np.float32),
"obj_init_pos": np.array([0, 0.85, 0.15], dtype=np.float64),
"hand_init_pos": np.array([0, 0.6, 0.2], dtype=np.float64),
}
self.goal = np.array([0, 0.85, 0.1])
self.obj_init_pos = self.init_config["obj_init_pos"]
Expand All @@ -40,12 +40,12 @@ 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, dtype=np.float32),
np.array(obj_high, dtype=np.float32),
np.array(obj_low, dtype=np.float64),
np.array(obj_high, dtype=np.float64),
)
self.goal_space = Box(
np.array(goal_low, dtype=np.float32),
np.array(goal_high, dtype=np.float32),
np.array(goal_low, dtype=np.float64),
np.array(goal_high, dtype=np.float64),
)

@property
Expand Down
10 changes: 5 additions & 5 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_unlock_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):

self.init_config = {
"obj_init_pos": np.array([0, 0.85, 0.15]),
"hand_init_pos": np.array([0, 0.6, 0.2], dtype=np.float32),
"hand_init_pos": np.array([0, 0.6, 0.2], dtype=np.float64),
}
self.goal = np.array([0, 0.85, 0.1])
self.obj_init_pos = self.init_config["obj_init_pos"]
Expand All @@ -38,12 +38,12 @@ 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, dtype=np.float32),
np.array(obj_high, dtype=np.float32),
np.array(obj_low, dtype=np.float64),
np.array(obj_high, dtype=np.float64),
)
self.goal_space = Box(
np.array(goal_low, dtype=np.float32),
np.array(goal_high, dtype=np.float32),
np.array(goal_low, dtype=np.float64),
np.array(goal_high, dtype=np.float64),
)

@property
Expand Down
8 changes: 4 additions & 4 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_door_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ 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, dtype=np.float32),
np.array(obj_high, dtype=np.float32),
np.array(obj_low, dtype=np.float64),
np.array(obj_high, dtype=np.float64),
)
self.goal_space = Box(
np.array(goal_low, dtype=np.float32),
np.array(goal_high, dtype=np.float32),
np.array(goal_low, dtype=np.float64),
np.array(goal_high, dtype=np.float64),
)

@property
Expand Down
14 changes: 7 additions & 7 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_drawer_close_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ def __init__(self, render_mode=None, camera_name=None, camera_id=None):
[
0.3,
],
dtype=np.float32,
dtype=np.float64,
),
"obj_init_pos": np.array([0.0, 0.9, 0.0], dtype=np.float32),
"hand_init_pos": np.array([0, 0.6, 0.2], dtype=np.float32),
"obj_init_pos": np.array([0.0, 0.9, 0.0], dtype=np.float64),
"hand_init_pos": np.array([0, 0.6, 0.2], dtype=np.float64),
}
self.obj_init_pos = self.init_config["obj_init_pos"]
self.obj_init_angle = self.init_config["obj_init_angle"]
Expand All @@ -46,12 +46,12 @@ 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, dtype=np.float32),
np.array(obj_high, dtype=np.float32),
np.array(obj_low, dtype=np.float64),
np.array(obj_high, dtype=np.float64),
)
self.goal_space = Box(
np.array(goal_low, dtype=np.float32),
np.array(goal_high, dtype=np.float32),
np.array(goal_low, dtype=np.float64),
np.array(goal_high, dtype=np.float64),
)

self.maxDist = 0.15
Expand Down
Loading

0 comments on commit 9ea37a4

Please sign in to comment.