fancy_gym/alr_envs/open_ai/reacher_v2/mp_wrapper.py

23 lines
512 B
Python
Raw Normal View History

2021-07-01 14:55:14 +02:00
from typing import Union
2021-07-05 09:16:36 +02:00
import numpy as np
2021-07-01 14:55:14 +02:00
from mp_env_api.env_wrappers.mp_env_wrapper import MPEnvWrapper
class MPWrapper(MPEnvWrapper):
@property
2021-07-05 09:16:36 +02:00
def current_vel(self) -> Union[float, int, np.ndarray]:
return self.sim.data.qvel[:2]
@property
def current_pos(self) -> Union[float, int, np.ndarray]:
return self.sim.data.qpos[:2]
2021-07-01 14:55:14 +02:00
@property
def goal_pos(self):
return self.goal
@property
def dt(self) -> Union[float, int]:
return self.env.dt