Quats_to_rot_matrices not found

Hi, I’m trying to add a camera to simulation (taken from here except for the orientation calculation which gives the same error)

import omni.isaac.sensor as isaac_sensor
isaac_sensor.Camera(
                    prim_path="/World/camera",
                    position=np.array([0.0, 0.0, 25.0]),
                    frequency=20,
                    resolution=(256, 256)
                )

But I get the following errors:

File “/home/ahallak/.local/share/ov/pkg/isaac_sim-2022.2.1/exts/omni.isaac.sensor/omni/isaac/sensor/scripts/camera.py”, line 130, in init
self.set_world_pose(position=position, orientation=orientation)
File “/home/ahallak/.local/share/ov/pkg/isaac_sim-2022.2.1/exts/omni.isaac.sensor/omni/isaac/sensor/scripts/camera.py”, line 349, in set_world_pose
world_i_cam_i_R = self._backend_utils.quats_to_rot_matrices(orientation)
AttributeError: module ‘omni.isaac.core.utils.torch’ has no attribute ‘quats_to_rot_matrices’
Any ideas?

1 Like

Hi @ahallak - Does this forum question helpful to you? Orientation of Camera - #2 by xuning.yang

No, but I managed to get it to work eventually.
It was because I’m using pytorch backend, but for some reason two functions were not implemented in the pytorch utils so I had to add them manually: quats_to_rot_matrices & rot_matrices_to_quats.
I copied the two functions from ov/pkg/isaac_sim-2022.2.1/exts/omni.isaac.core/omni/isaac/core/utils/numpy/rotations.py to ov/pkg/isaac_sim-2022.2.1/exts/omni.isaac.core/omni/isaac/core/utils/torch/rotations.py, and casted the input to numpy and the output to tensor so it wont crash.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.