fix rendering ("rgb_array") for pendulums/pendula

This commit is contained in:
Erwin Coumans
2017-09-15 16:33:22 -07:00
parent 1881f6679a
commit f4b28dddce
2 changed files with 6 additions and 2 deletions

View File

@@ -67,7 +67,11 @@ class MJCFBaseBulletEnv(gym.Env):
self.isRender = True
if mode != "rgb_array":
return np.array([])
base_pos = self.robot.body_xyz
base_pos=[0,0,0]
if (hasattr(self,'robot')):
if (hasattr(self.robot,'body_xyz')):
base_pos = self.robot.body_xyz
view_matrix = p.computeViewMatrixFromYawPitchRoll(
cameraTargetPosition=base_pos,