Fix render issue in server render mode (e.g., docker)
px is an 1D array, and cause a runtime error when trying to strip the color channels into RGB. I fixed this by first reshape the px array into am image compatible format first.
This commit is contained in:
1 parent
c6a43e0a5b
commit
8f9ff5e674
1 file changed
+1
@@ -96,6 +96,7 @@ class MJCFBaseBulletEnv(gym.Env):
|
||||
renderer=pybullet.ER_BULLET_HARDWARE_OPENGL
|
||||
)
|
||||
rgb_array = np.array(px)
|
||||
rgb_array = np.reshape(np.array(px), (self._render_height, self._render_width, -1))
|
||||
rgb_array = rgb_array[:, :, :3]
|
||||
return rgb_array
|
||||
|
||||
|
||||
Reference in new issue
Block a user