removed dependency on mujoco-py

This commit is contained in:
philipp
2022-07-13 13:28:39 +02:00
parent 2fbf42167f
commit b04e7c1dcd
17 changed files with 134 additions and 80 deletions
+5 -5
View File
@@ -10,18 +10,18 @@ class MPWrapper(RawInterfaceWrapper):
@property
def context_mask(self):
return np.concatenate([[False] * self.env.n_links, # cos
[False] * self.env.n_links, # sin
return np.concatenate([[False] * self.n_links, # cos
[False] * self.n_links, # sin
[True] * 2, # goal position
[False] * self.env.n_links, # angular velocity
[False] * self.n_links, # angular velocity
[False] * 3, # goal distance
# [False], # step
])
@property
def current_pos(self) -> Union[float, int, np.ndarray, Tuple]:
return self.env.data.qpos.flat[:self.env.n_links]
return self.data.qpos.flat[:self.n_links]
@property
def current_vel(self) -> Union[float, int, np.ndarray, Tuple]:
return self.env.data.qvel.flat[:self.env.n_links]
return self.data.qvel.flat[:self.n_links]
+4 -1
View File
@@ -23,7 +23,10 @@ class ReacherEnv(MujocoEnv, utils.EzPickle):
file_name = f'reacher_{n_links}links.xml'
MujocoEnv.__init__(self, os.path.join(os.path.dirname(__file__), "assets", file_name), 2)
MujocoEnv.__init__(self,
model_path=os.path.join(os.path.dirname(__file__), "assets", file_name),
frame_skip=2,
mujoco_bindings="mujoco")
def step(self, action):
self._steps += 1