Unverified Commit 2e6946af authored by renaudponcelet's avatar renaudponcelet Committed by GitHub

Fixes moving to cpu if needed in camera.py (#2176)

# Description

<!--
Thank you for your interest in sending a pull request. Please make sure
to check the contribution guidelines.

Link:
https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html
-->
I just add moving to cpu before casting to numpy. If it's already on cpu
then the change is armless.

Fixes #2175 

<!-- As a practice, it is recommended to open an issue to have
discussions on the proposed pull request.
This makes it easier for the community to keep track of what is being
developed or added, and if a given feature
is demanded by more than one party. -->

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- Bug fix (non-breaking change which fixes an issue)

---------
Signed-off-by: 's avatarrenaudponcelet <renaud.poncelet@gmail.com>
Signed-off-by: 's avatarKelly Guo <kellyg@nvidia.com>
Co-authored-by: 's avatarKelly Guo <kellyg@nvidia.com>
parent f3c54041
...@@ -92,6 +92,7 @@ Guidelines for modifications: ...@@ -92,6 +92,7 @@ Guidelines for modifications:
* Qian Wan * Qian Wan
* Qinxi Yu * Qinxi Yu
* Rafael Wiltz * Rafael Wiltz
* Renaud Poncelet
* René Zurbrügg * René Zurbrügg
* Ritvik Singh * Ritvik Singh
* Rosario Scalise * Rosario Scalise
......
...@@ -124,7 +124,7 @@ class Camera(SensorBase): ...@@ -124,7 +124,7 @@ class Camera(SensorBase):
rot_offset = convert_camera_frame_orientation_convention( rot_offset = convert_camera_frame_orientation_convention(
rot, origin=self.cfg.offset.convention, target="opengl" rot, origin=self.cfg.offset.convention, target="opengl"
) )
rot_offset = rot_offset.squeeze(0).numpy() rot_offset = rot_offset.squeeze(0).cpu().numpy()
# ensure vertical aperture is set, otherwise replace with default for squared pixels # ensure vertical aperture is set, otherwise replace with default for squared pixels
if self.cfg.spawn.vertical_aperture is None: if self.cfg.spawn.vertical_aperture is None:
self.cfg.spawn.vertical_aperture = self.cfg.spawn.horizontal_aperture * self.cfg.height / self.cfg.width self.cfg.spawn.vertical_aperture = self.cfg.spawn.horizontal_aperture * self.cfg.height / self.cfg.width
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment