From 28d10ef0894dd0f974886f5c03b9ada9646162dd Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 5 Jul 2021 08:14:39 +0200 Subject: [PATCH] Bug fixes for wrapped OpenAi environments --- alr_envs/__init__.py | 6 +++--- alr_envs/open_ai/continuous_mountain_car/mp_wrapper.py | 2 +- alr_envs/open_ai/fetch/positional_wrapper.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/alr_envs/__init__.py b/alr_envs/__init__.py index 181b627..2611701 100644 --- a/alr_envs/__init__.py +++ b/alr_envs/__init__.py @@ -571,7 +571,7 @@ register( "mp_kwargs": { "num_dof": 1, "num_basis": 4, - "duration": 100, + "duration": 2, "post_traj_time": 0, "width": 0.02, "policy_type": "motor", @@ -613,7 +613,7 @@ register( "mp_kwargs": { "num_dof": 4, "num_basis": 5, - "duration": 1, + "duration": 2, "post_traj_time": 0, "width": 0.02, "policy_type": "position" @@ -630,7 +630,7 @@ register( "mp_kwargs": { "num_dof": 4, "num_basis": 5, - "duration": 1, + "duration": 2, "post_traj_time": 0, "width": 0.02, "policy_type": "position" diff --git a/alr_envs/open_ai/continuous_mountain_car/mp_wrapper.py b/alr_envs/open_ai/continuous_mountain_car/mp_wrapper.py index 960fc0c..886b1e1 100644 --- a/alr_envs/open_ai/continuous_mountain_car/mp_wrapper.py +++ b/alr_envs/open_ai/continuous_mountain_car/mp_wrapper.py @@ -14,4 +14,4 @@ class MPWrapper(MPEnvWrapper): @property def dt(self) -> Union[float, int]: - return 1. \ No newline at end of file + return 0.02 \ No newline at end of file diff --git a/alr_envs/open_ai/fetch/positional_wrapper.py b/alr_envs/open_ai/fetch/positional_wrapper.py index c113db6..9c6dcf2 100644 --- a/alr_envs/open_ai/fetch/positional_wrapper.py +++ b/alr_envs/open_ai/fetch/positional_wrapper.py @@ -6,8 +6,8 @@ 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._get_obs()["observation"][-5:-1] + return self.unwrapped._get_obs()["observation"][-5:-1] @property def current_pos(self) -> Union[float, int, np.ndarray]: - return self._get_obs()["observation"][:4] \ No newline at end of file + return self.unwrapped._get_obs()["observation"][:4] \ No newline at end of file