Adopt new interface structure
This commit is contained in:
@@ -1,2 +1 @@
|
||||
from alr_envs.open_ai.fetch.positional_wrapper import PositionalWrapper
|
||||
from alr_envs.open_ai.fetch.mp_wrapper import MPWrapper
|
||||
@@ -1,13 +1,17 @@
|
||||
from typing import Union
|
||||
|
||||
from gym import spaces
|
||||
import numpy as np
|
||||
from mp_env_api.env_wrappers.mp_env_wrapper import MPEnvWrapper
|
||||
|
||||
|
||||
class MPWrapper(MPEnvWrapper):
|
||||
@property
|
||||
def start_pos(self):
|
||||
return self.initial_gripper_xpos
|
||||
def current_vel(self) -> Union[float, int, np.ndarray]:
|
||||
return self.unwrapped._get_obs()["observation"][-5:-1]
|
||||
|
||||
@property
|
||||
def current_pos(self) -> Union[float, int, np.ndarray]:
|
||||
return self.unwrapped._get_obs()["observation"][:4]
|
||||
|
||||
@property
|
||||
def goal_pos(self):
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
from typing import Union
|
||||
import numpy as np
|
||||
from mp_env_api.env_wrappers.positional_env_wrapper import PositionalEnvWrapper
|
||||
|
||||
|
||||
class PositionalWrapper(PositionalEnvWrapper):
|
||||
@property
|
||||
def current_vel(self) -> Union[float, int, np.ndarray]:
|
||||
return self.unwrapped._get_obs()["observation"][-5:-1]
|
||||
|
||||
@property
|
||||
def current_pos(self) -> Union[float, int, np.ndarray]:
|
||||
return self.unwrapped._get_obs()["observation"][:4]
|
||||
Reference in New Issue
Block a user