unified API wrapper and updated examples
This commit is contained in:
@@ -59,9 +59,17 @@ class SimpleReacherEnv(gym.Env):
|
||||
def dt(self) -> Union[float, int]:
|
||||
return self._dt
|
||||
|
||||
# @property
|
||||
# def start_pos(self):
|
||||
# return self._start_pos
|
||||
|
||||
@property
|
||||
def start_pos(self):
|
||||
return self._start_pos
|
||||
def current_pos(self):
|
||||
return self._joint_angles
|
||||
|
||||
@property
|
||||
def current_vel(self):
|
||||
return self._angle_velocity
|
||||
|
||||
def step(self, action: np.ndarray):
|
||||
"""
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from typing import Union
|
||||
from typing import Tuple, Union
|
||||
|
||||
import numpy as np
|
||||
|
||||
from mp_env_api.env_wrappers.mp_env_wrapper import MPEnvWrapper
|
||||
from mp_env_api.interface_wrappers.mp_env_wrapper import MPEnvWrapper
|
||||
|
||||
|
||||
class SimpleReacherMPWrapper(MPEnvWrapper):
|
||||
@@ -17,11 +17,15 @@ class SimpleReacherMPWrapper(MPEnvWrapper):
|
||||
])
|
||||
|
||||
@property
|
||||
def start_pos(self):
|
||||
return self.env.start_pos
|
||||
def current_pos(self) -> Union[float, int, np.ndarray, Tuple]:
|
||||
return self.env.current_pos
|
||||
|
||||
@property
|
||||
def goal_pos(self):
|
||||
def current_vel(self) -> Union[float, int, np.ndarray, Tuple]:
|
||||
return self.env.current_vel
|
||||
|
||||
@property
|
||||
def goal_pos(self) -> Union[float, int, np.ndarray, Tuple]:
|
||||
raise ValueError("Goal position is not available and has to be learnt based on the environment.")
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user