From cb603859d9923130e117e500c1293c3f58b7fbae Mon Sep 17 00:00:00 2001 From: ottofabian Date: Thu, 19 Aug 2021 16:46:11 +0200 Subject: [PATCH] custom metaworld controller --- alr_envs/meta/button_press.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/alr_envs/meta/button_press.py b/alr_envs/meta/button_press.py index b552cc4..55c0731 100644 --- a/alr_envs/meta/button_press.py +++ b/alr_envs/meta/button_press.py @@ -33,11 +33,12 @@ class MPWrapper(MPEnvWrapper): @property 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 def current_vel(self) -> Union[float, int, np.ndarray, Tuple]: - return self.env.physics.named.data.qvel[:] + raise NotImplementedError("Velocity cannot be retrieved.") @property def goal_pos(self) -> Union[float, int, np.ndarray, Tuple]: