Describe the bug
When trying to set the camera pose using the Camera.set_world_pose_ros(), the obtained pose in the data is different from the one being set. On digging deeper, the main issue seems to be with using the Replicator API to create the camera in the Camera.spawn() method.
When replicator creates a camera using the rep.create.camera(), it creates an Xform prim and a Camera prim under it. The camera prim is rotated by (90, 0, -90) relative to the parent, to have the up-axis of the camera Z instead of Y. Now, when the camera pose is computed, the transformation of the Camera prim is used. However, when setting the pose, the pose is set to the Xform prim (also called the camera rig). So in a way, the camera prim pose ends up at the input pose with an orientation offset of (90, 0, -90).
Steps to reproduce
Modify the play_camera.py script with the following addition from L-140 onwards:
# set pose
# camera.set_world_pose_from_view(eye=[5.0, 5.0, 5.0], target=[0.0, 0.0, 0.0])
position = [5.0, 5.0, 5.0]
orientation = [-0.1759199, 0.33985114, 0.82047324, -0.4247082]
camera.set_world_pose_ros(position, orientation)
This gives the output:
Camera @ '/World/CameraSensor/Camera_Xform/Camera':
data types : ['rgb', 'distance_to_image_plane', 'normals', 'motion_vectors', 'trigger_outputs']
tick rate (s): 0
timestamp (s): 0.0
frame : 33
shape : (480, 640)
position : [5. 5. 5.]
orientation : [-0.27984815 0.88047624 -0.11591691 0.36470519]
Expected output orientation to match the input orientation.
System Info
Describe the characteristic of your environment:
- Commit: 88d4a34
- Isaac Sim Version: 2022.2.0
- OS: Ubuntu 20.04
- GPU: RTX 2080
- CUDA: 11.6
- GPU Driver: 510.108.03
Additional context
The camera methods currently print the warnings that they may not work.
2023-01-26 15:55:07 [14,045ms] [Warning] [omni.isaac.orbit.sensors.camera.camera] The function `set_world_pose_ros` is currently not implemented correctly.
Checklist
Describe the bug
When trying to set the camera pose using the
Camera.set_world_pose_ros(), the obtained pose in thedatais different from the one being set. On digging deeper, the main issue seems to be with using the Replicator API to create the camera in theCamera.spawn()method.When replicator creates a camera using the
rep.create.camera(), it creates an Xform prim and a Camera prim under it. The camera prim is rotated by (90, 0, -90) relative to the parent, to have the up-axis of the camera Z instead of Y. Now, when the camera pose is computed, the transformation of the Camera prim is used. However, when setting the pose, the pose is set to the Xform prim (also called the camera rig). So in a way, the camera prim pose ends up at the input pose with an orientation offset of (90, 0, -90).Steps to reproduce
Modify the
play_camera.pyscript with the following addition from L-140 onwards:This gives the output:
Expected output orientation to match the input orientation.
System Info
Describe the characteristic of your environment:
Additional context
The camera methods currently print the warnings that they may not work.
Checklist