From a9460f15fd7737eb7649e5f6710a78d3cc63c4ec Mon Sep 17 00:00:00 2001 From: Onur Date: Fri, 22 Apr 2022 15:36:19 +0200 Subject: [PATCH] fix small reacher issues for optimal control --- alr_envs/alr/mujoco/reacher/alr_reacher.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/alr_envs/alr/mujoco/reacher/alr_reacher.py b/alr_envs/alr/mujoco/reacher/alr_reacher.py index 42fe5a7..74cff4d 100644 --- a/alr_envs/alr/mujoco/reacher/alr_reacher.py +++ b/alr_envs/alr/mujoco/reacher/alr_reacher.py @@ -89,12 +89,14 @@ class ALRReacherEnv(MujocoEnv, utils.EzPickle): class ALRReacherOptCtrlEnv(ALRReacherEnv): def __init__(self, steps_before_reward=200, n_links=5, balance=False): - super(ALRReacherOptCtrlEnv, self).__init__(steps_before_reward, n_links, balance) self.goal = np.array([0.1, 0.1]) + super(ALRReacherOptCtrlEnv, self).__init__(steps_before_reward, n_links, balance) def _get_obs(self): theta = self.sim.data.qpos.flat[:self.n_links] + tip_pos = self.get_body_com("fingertip") return np.concatenate([ + tip_pos[:2], theta, self.sim.data.qvel.flat[:self.n_links], # this is angular velocity ])