Skip to content

Commit

Permalink
fix rgb_array rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
hnyu authored and stepjam committed Mar 7, 2022
1 parent 97f1268 commit 568f9d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rlbench/gym/rlbench_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def render(self, mode='human') -> Union[None, np.ndarray]:
'You passed in mode %s, but expected %s.' % (
mode, self._render_mode))
if mode == 'rgb_array':
return self._gym_cam.capture_rgb()
frame = self._gym_cam.capture_rgb()
frame = np.clip((frame * 255.).astype(np.uint8), 0, 255)
return frame

def reset(self) -> Dict[str, np.ndarray]:
descriptions, obs = self.task.reset()
Expand Down

0 comments on commit 568f9d9

Please sign in to comment.