Skip to content

Commit

Permalink
update cartpole camera env
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyguo11 committed Aug 3, 2024
1 parent ca7825d commit 1aa79a3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ def _apply_action(self) -> None:
def _get_observations(self) -> dict:
data_type = "rgb" if "rgb" in self.cfg.tiled_camera.data_types else "depth"
if "rgb" in self.cfg.tiled_camera.data_types:
camera_data = 1 - self._tiled_camera.data.output[data_type]
camera_data = self._tiled_camera.data.output[data_type]
# normalize the camera data for better training results
mean_tensor = torch.mean(camera_data, dim=(1, 2), keepdim=True)
camera_data -= mean_tensor
elif "depth" in self.cfg.tiled_camera.data_types:
camera_data = self._tiled_camera.data.output[data_type]
camera_data[camera_data == float("inf")] = 0
Expand Down

0 comments on commit 1aa79a3

Please sign in to comment.