fix small reacher issues for optimal control

This commit is contained in:
Onur 2022-04-22 15:36:19 +02:00
parent c0502cf1d4
commit a9460f15fd

View File

@ -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
])