Skip to content

Commit

Permalink
Removing extra classes (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
reginald-mclean authored Apr 3, 2024
1 parent a5b32cc commit 3fa2c78
Show file tree
Hide file tree
Showing 52 changed files with 19 additions and 1,133 deletions.
8 changes: 8 additions & 0 deletions metaworld/envs/mujoco/sawyer_xyz/sawyer_xyz_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,14 @@ def _get_state_rand_vec(self):
if self._freeze_rand_vec:
assert self._last_rand_vec is not None
return self._last_rand_vec
elif self.seeded_rand_vec:
rand_vec = self.np_random.uniform(
self._random_reset_space.low,
self._random_reset_space.high,
size=self._random_reset_space.low.size,
)
self._last_rand_vec = rand_vec
return rand_vec
else:
rand_vec = np.random.uniform(
self._random_reset_space.low,
Expand Down
144 changes: 11 additions & 133 deletions metaworld/envs/mujoco/sawyer_xyz/v2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,252 +1,130 @@
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_assembly_peg_v2 import (
SawyerNutAssemblyEnvV2,
TestAssemblyv2,
TrainAssemblyv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_basketball_v2 import (
SawyerBasketballEnvV2,
TestBasketballv2,
TrainBasketballv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_bin_picking_v2 import (
SawyerBinPickingEnvV2,
TestBinPickingv2,
TrainBinPickingv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_box_close_v2 import (
SawyerBoxCloseEnvV2,
TestBoxClosev2,
TrainBoxClosev2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_box_close_v2 import SawyerBoxCloseEnvV2
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_button_press_topdown_v2 import (
SawyerButtonPressTopdownEnvV2,
TestButtonPressTopdownv2,
TrainButtonPressTopdownv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_button_press_topdown_wall_v2 import (
SawyerButtonPressTopdownWallEnvV2,
TestButtonPressTopdownWallv2,
TrainButtonPressTopdownWallv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_button_press_v2 import (
SawyerButtonPressEnvV2,
TestButtonPressv2,
TrainButtonPressv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_button_press_wall_v2 import (
SawyerButtonPressWallEnvV2,
TestButtonPressWallv2,
TrainButtonPressWallv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_coffee_button_v2 import (
SawyerCoffeeButtonEnvV2,
TestCoffeeButtonv2,
TrainCoffeeButtonv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_coffee_pull_v2 import (
SawyerCoffeePullEnvV2,
TestCoffeePullv2,
TrainCoffeePullv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_coffee_push_v2 import (
SawyerCoffeePushEnvV2,
TestCoffeePushv2,
TrainCoffeePushv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_dial_turn_v2 import (
SawyerDialTurnEnvV2,
TestDialTurnv2,
TrainDialTurnv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_dial_turn_v2 import SawyerDialTurnEnvV2
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_disassemble_peg_v2 import (
SawyerNutDisassembleEnvV2,
TestDisassemblev2,
TrainDisassemblev2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_door_close_v2 import (
SawyerDoorCloseEnvV2,
TestDoorClosev2,
TrainDoorClosev2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_door_lock_v2 import (
SawyerDoorLockEnvV2,
TestDoorLockv2,
TrainDoorLockv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_door_lock_v2 import SawyerDoorLockEnvV2
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_door_unlock_v2 import (
SawyerDoorUnlockEnvV2,
TestDoorUnlockv2,
TrainDoorUnlockv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_door_v2 import (
SawyerDoorEnvV2,
TestDoorOpenv2,
TrainDoorOpenv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_door_v2 import SawyerDoorEnvV2
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_drawer_close_v2 import (
SawyerDrawerCloseEnvV2,
TestDrawerClosev2,
TrainDrawerClosev2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_drawer_open_v2 import (
SawyerDrawerOpenEnvV2,
TestDrawerOpenv2,
TrainDrawerOpenv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_faucet_close_v2 import (
SawyerFaucetCloseEnvV2,
TestFaucetClosev2,
TrainFaucetClosev2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_faucet_open_v2 import (
SawyerFaucetOpenEnvV2,
TestFaucetOpenv2,
TrainFaucetOpenv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_hammer_v2 import (
SawyerHammerEnvV2,
TestHammerv2,
TrainHammerv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_hammer_v2 import SawyerHammerEnvV2
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_hand_insert_v2 import (
SawyerHandInsertEnvV2,
TestHandInsertv2,
TrainHandInsertv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_handle_press_side_v2 import (
SawyerHandlePressSideEnvV2,
TestHandlePressSidev2,
TrainHandlePressSidev2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_handle_press_v2 import (
SawyerHandlePressEnvV2,
TestHandlePressv2,
TrainHandlePressv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_handle_pull_side_v2 import (
SawyerHandlePullSideEnvV2,
TestHandlePullSidev2,
TrainHandlePullSidev2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_handle_pull_v2 import (
SawyerHandlePullEnvV2,
TestHandlePullv2,
TrainHandlePullv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_lever_pull_v2 import (
SawyerLeverPullEnvV2,
TestLeverPullv2,
TrainLeverPullv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_peg_insertion_side_v2 import (
SawyerPegInsertionSideEnvV2,
TestPegInsertionSidev2,
TrainPegInsertionSidev2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_peg_unplug_side_v2 import (
SawyerPegUnplugSideEnvV2,
TestPegUnplugSidev2,
TrainPegUnplugSidev2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_pick_out_of_hole_v2 import (
SawyerPickOutOfHoleEnvV2,
TestPickOutOfHolev2,
TrainPickOutOfHolev2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_pick_place_v2 import (
SawyerPickPlaceEnvV2,
TestPickPlacev2,
TrainPickPlacev2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_pick_place_wall_v2 import (
SawyerPickPlaceWallEnvV2,
TestPickPlaceWallv2,
TrainPickPlaceWallv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_plate_slide_back_side_v2 import (
SawyerPlateSlideBackSideEnvV2,
TestPlateSlideBackSidev2,
TrainPlateSlideBackSidev2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_plate_slide_back_v2 import (
SawyerPlateSlideBackEnvV2,
TestPlateSlideBackv2,
TrainPlateSlideBackv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_plate_slide_side_v2 import (
SawyerPlateSlideSideEnvV2,
TestPlateSlideSidev2,
TrainPlateSlideSidev2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_plate_slide_v2 import (
SawyerPlateSlideEnvV2,
TestPlateSlidev2,
TrainPlateSlidev2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_push_back_v2 import (
SawyerPushBackEnvV2,
TestPushBackv2,
TrainPushBackv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_push_v2 import (
SawyerPushEnvV2,
TestPushv2,
TrainPushv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_push_wall_v2 import (
SawyerPushWallEnvV2,
TestPushWallv2,
TrainPushWallv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_reach_v2 import (
SawyerReachEnvV2,
TestReachv2,
TrainReachv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_push_back_v2 import SawyerPushBackEnvV2
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_push_v2 import SawyerPushEnvV2
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_push_wall_v2 import SawyerPushWallEnvV2
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_reach_v2 import SawyerReachEnvV2
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_reach_wall_v2 import (
SawyerReachWallEnvV2,
TestReachWallv2,
TrainReachWallv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_shelf_place_v2 import (
SawyerShelfPlaceEnvV2,
TestShelfPlacev2,
TrainShelfPlacev2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_soccer_v2 import (
SawyerSoccerEnvV2,
TestSoccerv2,
TrainSoccerv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_soccer_v2 import SawyerSoccerEnvV2
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_stick_pull_v2 import (
SawyerStickPullEnvV2,
TestStickPullv2,
TrainStickPullv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_stick_push_v2 import (
SawyerStickPushEnvV2,
TestStickPushv2,
TrainStickPushv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_sweep_into_goal_v2 import (
SawyerSweepIntoGoalEnvV2,
TestSweepIntoGoalv2,
TrainSweepIntoGoalv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_sweep_v2 import (
SawyerSweepEnvV2,
TestSweepv2,
TrainSweepv2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_sweep_v2 import SawyerSweepEnvV2
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_window_close_v2 import (
SawyerWindowCloseEnvV2,
TestWindowClosev2,
TrainWindowClosev2,
)
from metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_window_open_v2 import (
SawyerWindowOpenEnvV2,
TestWindowOpenv2,
TrainWindowOpenv2,
)

__all__ = [
Expand Down
20 changes: 0 additions & 20 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_assembly_peg_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,23 +194,3 @@ def compute_reward(self, actions, obs):
reward_in_place,
success,
)


class TrainAssemblyv2(SawyerNutAssemblyEnvV2):
tasks = None

def __init__(self):
SawyerNutAssemblyEnvV2.__init__(self, self.tasks)

def reset(self, seed=None, options=None):
return super().reset(seed=seed, options=options)


class TestAssemblyv2(SawyerNutAssemblyEnvV2):
tasks = None

def __init__(self):
SawyerNutAssemblyEnvV2.__init__(self, self.tasks)

def reset(self, seed=None, options=None):
return super().reset(seed=seed, options=options)
20 changes: 0 additions & 20 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_basketball_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,23 +155,3 @@ def compute_reward(self, action, obs):
if target_to_obj < self.TARGET_RADIUS:
reward = 10.0
return (reward, tcp_to_obj, tcp_opened, target_to_obj, object_grasped, in_place)


class TrainBasketballv2(SawyerBasketballEnvV2):
tasks = None

def __init__(self):
SawyerBasketballEnvV2.__init__(self, self.tasks)

def reset(self, seed=None, options=None):
return super().reset(seed=seed, options=options)


class TestBasketballv2(SawyerBasketballEnvV2):
tasks = None

def __init__(self):
SawyerBasketballEnvV2.__init__(self, self.tasks)

def reset(self, seed=None, options=None):
return super().reset(seed=seed, options=options)
20 changes: 0 additions & 20 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_bin_picking_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,23 +197,3 @@ def compute_reward(self, action, obs):
object_grasped,
in_place,
)


class TrainBinPickingv2(SawyerBinPickingEnvV2):
tasks = None

def __init__(self):
SawyerBinPickingEnvV2.__init__(self, self.tasks)

def reset(self, seed=None, options=None):
return super().reset(seed=seed, options=options)


class TestBinPickingv2(SawyerBinPickingEnvV2):
tasks = None

def __init__(self):
SawyerBinPickingEnvV2.__init__(self, self.tasks)

def reset(self, seed=None, options=None):
return super().reset(seed=seed, options=options)
20 changes: 0 additions & 20 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_box_close_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,23 +196,3 @@ def compute_reward(self, actions, obs):
*reward_steps,
success,
)


class TrainBoxClosev2(SawyerBoxCloseEnvV2):
tasks = None

def __init__(self):
SawyerBoxCloseEnvV2.__init__(self, self.tasks)

def reset(self, seed=None, options=None):
return super().reset(seed=seed, options=options)


class TestBoxClosev2(SawyerBoxCloseEnvV2):
tasks = None

def __init__(self):
SawyerBoxCloseEnvV2.__init__(self, self.tasks)

def reset(self, seed=None, options=None):
return super().reset(seed=seed, options=options)
Original file line number Diff line number Diff line change
Expand Up @@ -132,23 +132,3 @@ def compute_reward(self, action, obs):
reward += 5 * button_pressed

return (reward, tcp_to_obj, obs[3], obj_to_target, near_button, button_pressed)


class TrainButtonPressTopdownv2(SawyerButtonPressTopdownEnvV2):
tasks = None

def __init__(self):
SawyerButtonPressTopdownEnvV2.__init__(self, self.tasks)

def reset(self, seed=None, options=None):
return super().reset(seed=seed, options=options)


class TestButtonPressTopdownv2(SawyerButtonPressTopdownEnvV2):
tasks = None

def __init__(self):
SawyerButtonPressTopdownEnvV2.__init__(self, self.tasks)

def reset(self, seed=None, options=None):
return super().reset(seed=seed, options=options)
Loading

0 comments on commit 3fa2c78

Please sign in to comment.