# Orientation of Camera

**URL:** <https://forums.developer.nvidia.com/t/orientation-of-camera/260757>\
**Category:** Isaac Sim\
**Tags:** kb, python, camera\
**Created:** [July 23, 2023, 4:07pm UTC](https://forums.developer.nvidia.com/t/orientation-of-camera/260757 "2023-07-23T16:07:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![christof.schuetzenhoefer](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@christof.schuetzenhoefer](https://forums.developer.nvidia.com/u/christof.schuetzenhoefer)\
**Post date:** [July 23, 2023, 4:07pm UTC](https://forums.developer.nvidia.com/t/orientation-of-camera/260757/1 "2023-07-23T16:07:20Z")

</div>

Hello!

I want to attach a camera to custom objects and there are some problems regarding the orientation of the camera. The parent is a XForm prim that is there for proper orientation of the camera, but whatever I try, the orientation does not really change as I would expect. The XForm is also not changing the orientation as I am trying to do using `set_local_pose`. So, now the problem is that I cannot fix the orientation of the camera such that I can capture synthetic data.

It does not matter, if I try to change the orientation of the XForm or directly the camera, the result is somehow weird and not logical to me.

How is it supposed to work?

Best Regards,  
Christof

---

<div class="post-metadata">

**Author:** ![xuning.yang](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@xuning.yang](https://forums.developer.nvidia.com/u/xuning.yang)\
**Post date:** [July 25, 2023, 4:44pm UTC](https://forums.developer.nvidia.com/t/orientation-of-camera/260757/2 "2023-07-25T16:44:47Z")

</div>

Hey Christof,

This is a great question! There are three different frames that the Isaac Sim/Omniverse supports wrt to the camera:

1. `USD` frame: Defined as +Y up, -Z forward.
  - this is the frame data being displayed in the `Property` tab of the scene. This is the convention used by the computer graphics community.

2. `world` frame: Defined as +Z up, +X forward.
  - The `omni.isaac.sensor Camera` class sets/gets the pose of the cameras in the `world` frame via `set_world_pose()` and `get_world_pose()`

3. `ROS` camera frame: Defined as +Y up, +Z forward
  - This is the frame that ROS camera-related messages are published in via OmniGraph.

If you take the pose of the camera from the `Property` tab of the scene and put it into `omni.isaac.sensor Camera` object via get/set, then it would result in weird behaviors because the pose does not match.

To work around this, you can do one of two things:

1. If you know the pose of the camera that you like in the `world` frame, directly use `omni.isaac.sensor.Camera` . Example:

2. If you would like to set the pose of the camera using the `USD` pose, directly use the XForm and set pose using the data from `Property` panel.

We are actively looking to improve the camera interface for Isaac Sim and we have improvements coming in the next Isaac Sim release. The features that will help you with this issue are as follows:

1. The `omni.isaac.sensor` camera will allow you to get/set of the camera pose in all of the different frames
2. We will introduce a new GUI extension, Camera Inspector, which will display the camera pose in all of these frames, so that you can take them from the scene and put it into code with ease. This extension will also include some other functionalities, e.g., viewports to allow you to adjust the camera on the fly.
3. We will introduce a new set of camera tutorials to help you interact with the camera better via GUI and API.

---

<div class="post-metadata">

**Author:** ![voyager.yupeng](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@voyager.yupeng](https://forums.developer.nvidia.com/u/voyager.yupeng)\
**Post date:** [May 1, 2024, 10:39am UTC](https://forums.developer.nvidia.com/t/orientation-of-camera/260757/4 "2024-05-01T10:39:40Z")

</div>

Hi, I found the similar problem with you, and I wrote a pose of it, hope it can help you out.

> [@Isaac Sim camera orientation auto rotate in set\_world\_pose()](https://forums.developer.nvidia.com/t/isaac-sim-camera-orientation-auto-rotate-in-set-world-pose/291467):
>
> Issue The default coordinate system in Isaac Sim is Z-up, and the cameras in USD are always y-up. As many issues in Forums have mentioned, when you creating a camera and set its world pose to dafult using set\_world\_pose(), from omni.isaac.sensor import Camera camera = Camera( prim\_path="/World/camera", position=np.array([0, 0, 0]), orientation=np.array([1, 0, 0, 0]), ) camera.set\_world\_pose(np.array([0, 0, 0]), np.array([1, 0, 0, 0])) my\_world.step(render=True) the camera pose is …

# Solution

According to the discussion in the form, I think its a designed mechanism to automatically keep the same camera coordinate system(+Y up) across different USD files.

And if you want to cancel this “auto-rotation” effect, you can use `camera_axes="usd"` args in `set_world_pose()`.

```auto
from omni.isaac.sensor import Camera
camera = Camera(
    prim_path="/World/camera",
    position=np.array([0, 0, 0]),
    orientation=np.array([1, 0, 0, 0]),
)
camera.set_world_pose(np.array([0, 0, 0]), np.array([1, 0, 0, 0]), camera_axes="usd")
my_world.step(render=True)

```

This way, the default camera pose will aligned with the world frame.

 ![Pasted image 20240501181344](https://global.discourse-cdn.com/nvidia/original/4X/9/a/c/9acc6d23daf7ae4caff34516e01b6c37a7cee263.png) ![Pasted image 20240501181355](https://global.discourse-cdn.com/nvidia/original/4X/1/2/f/12f737806151f3d1f33d4d9aa2cb6f6decca5a31.png)

You can find more detailed information about `set_world_pose()` in [the API docs of it here](https://docs.omniverse.nvidia.com/py/isaacsim/source/extensions/omni.isaac.sensor/docs/index.html?highlight=camera#omni.isaac.sensor.scripts.camera.Camera.set_world_pose).
