fixed OpenAI fetch tasks; added nicer imports

This commit is contained in:
ottofabian
2021-07-30 11:59:02 +02:00
parent f5fcbf7f54
commit a11965827d
41 changed files with 316 additions and 159 deletions
@@ -0,0 +1 @@
from .mp_wrapper import MPWrapper
@@ -0,0 +1,22 @@
from typing import Union
import numpy as np
from mp_env_api import MPEnvWrapper
class MPWrapper(MPEnvWrapper):
@property
def current_vel(self) -> Union[float, int, np.ndarray]:
return np.array([self.state[1]])
@property
def current_pos(self) -> Union[float, int, np.ndarray]:
return np.array([self.state[0]])
@property
def goal_pos(self):
raise ValueError("Goal position is not available and has to be learnt based on the environment.")
@property
def dt(self) -> Union[float, int]:
return 0.02