Skip to content

Commit

Permalink
bug fix (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
StoneT2000 authored Aug 22, 2024
1 parent 6f6f20a commit 407c346
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mani_skill/envs/sapien_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def capture_sensor_data(self):
sensor.capture()

def get_sensor_images(self) -> Dict[str, Dict[str, torch.Tensor]]:
"""Get image (RGB) visualizations of what sensors currently sense"""
"""Get image (RGB) visualizations of what sensors currently sense. This function calls self._get_obs_sensor_data() internally which automatically hides objects and updates the render"""
return self.scene.get_sensor_images(self._get_obs_sensor_data())

def get_sensor_params(self) -> Dict[str, Dict[str, torch.Tensor]]:
Expand Down Expand Up @@ -1189,12 +1189,10 @@ def render_all(self):
obj.show_visual()
self.scene.update_render()
render_images = self.scene.get_human_render_camera_images()
for obj in self._hidden_objects:
obj.hide_visual()
# note that get_sensor_images function will update the render and hide objects itself
sensor_images = self.get_sensor_images()
for image in render_images.values():
for img in image.values():
images.append(img)
images.append(image)
for image in sensor_images.values():
for img in image.values():
images.append(img)
Expand Down

0 comments on commit 407c346

Please sign in to comment.