Skip to content

Commit d0d3b04

Browse files
committed
changed depth type
1 parent 799a47a commit d0d3b04

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mujoco_viewer/mujoco_viewer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,12 @@ def read_pixels(self, camid=None,depth=False):
294294
# render
295295
mujoco.mjr_render(self.viewport, self.scn, self.ctx)
296296
shape = glfw.get_framebuffer_size(self.window)
297-
img = np.zeros((shape[1], shape[0], 3), dtype=np.uint8)
297+
img = np.zeros((shape[1], shape[0], 3), dtype=np.float64)
298298

299299
if depth:
300300
depth_img = np.zeros((shape[1], shape[0], 1), dtype=np.uint8)
301301
mujoco.mjr_readPixels(img, depth_img, self.viewport, self.ctx)
302-
return np.dstack((np.flipud(img),np.flipud(depth_img)))
302+
return np.dstack((np.flipud(img),np.flipud(depth_img)),dtype=np.float64)
303303
else:
304304
mujoco.mjr_readPixels(img, None, self.viewport, self.ctx)
305305
return np.flipud(img)

src/mujoco-python-viewer

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 799a47a35ce38b1e9043f15e5b1441a149d1ad67

0 commit comments

Comments
 (0)