custom metaworld controller

This commit is contained in:
ottofabian 2021-08-19 16:46:11 +02:00
parent 9b1ccb3235
commit cb603859d9

View File

@ -33,11 +33,12 @@ class MPWrapper(MPEnvWrapper):
@property @property
def current_pos(self) -> Union[float, int, np.ndarray]: def current_pos(self) -> Union[float, int, np.ndarray]:
return self.env.physics.named.data.qpos[:] r_close = self.env.data.get_joint_qpos("r_close")
return np.hstack([self.env.data.mocap_pos.flatten(), r_close])
@property @property
def current_vel(self) -> Union[float, int, np.ndarray, Tuple]: def current_vel(self) -> Union[float, int, np.ndarray, Tuple]:
return self.env.physics.named.data.qvel[:] raise NotImplementedError("Velocity cannot be retrieved.")
@property @property
def goal_pos(self) -> Union[float, int, np.ndarray, Tuple]: def goal_pos(self) -> Union[float, int, np.ndarray, Tuple]: