# How to retrieve ZED2 pose in camera frame instead of map frame (ROS)

**URL:** <https://community.stereolabs.com/t/how-to-retrieve-zed2-pose-in-camera-frame-instead-of-map-frame-ros/187>\
**Category:** ROS1\
**Created:** [April 9, 2021, 8:03pm UTC](https://community.stereolabs.com/t/how-to-retrieve-zed2-pose-in-camera-frame-instead-of-map-frame-ros/187 "2021-04-09T20:03:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![orrblue](https://community.stereolabs.com/user_avatar/community.stereolabs.com/orrblue/32/13_2.png) [@orrblue](https://community.stereolabs.com/u/orrblue)\
**Post date:** [April 9, 2021, 8:03pm UTC](https://community.stereolabs.com/t/how-to-retrieve-zed2-pose-in-camera-frame-instead-of-map-frame-ros/187/1 "2021-04-09T20:03:30Z")

</div>

Hi,  
I’m trying to get the camera’s position in the camera’s frame. Specifically the ROS standard (Z UP, X Forward show [HERE](https://www.stereolabs.com/docs/api/group __Core__ group.html#ga1114207cbac18c1c0e4f77a6b36a8cb2)). Currently, the /zed2/zed\_node/pose topic shows the ZED2’s pose in relation to the map frame by default. The map frame seems to always be aligned to gravity. So regardless of the camera’s starting pose, anytime I move the camera upward (against gravity), the pose topic shows an increase in +Z for position. I’m trying to get the Z value to increase in the direction that is Z-UP based on the starting orientation of the camera, rather than based on gravity – I believe the terminology for that is the camera frame, rather than the current world frame.

I’ve tried changing the “pos\_tracking/map\_frame” parameter to base\_link but that didn’t fix it. When I place the camera on its side such that the camera’s frame Z-axis points to the right, and then turn it ON, and move it up against gravity, Z values are still increasing. I expect Y values to primarily change instead. Is there a different frame I should choose for the parameter I mentioned? Or is there something else going on?

Thank you!

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [April 12, 2021, 12:04pm UTC](https://community.stereolabs.com/t/how-to-retrieve-zed2-pose-in-camera-frame-instead-of-map-frame-ros/187/2 "2021-04-12T12:04:06Z")

</div>

The ZED ROS Wrapper has been designed to work in “world frame”.  
What you are searching is the movements in “body frame”.  
You can try to reach your goal setting [`pos_tracking/imu_fusion`](https://github.com/stereolabs/zed-ros-wrapper/blob/master/zed_wrapper/params/zed2.yaml#L13) and [`pos_tracking/init_odom_with_first_valid_pose`](https://github.com/stereolabs/zed-ros-wrapper/blob/master/zed_wrapper/params/common.yaml#L55) to false.

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [April 14, 2021, 3:45pm UTC](https://community.stereolabs.com/t/how-to-retrieve-zed2-pose-in-camera-frame-instead-of-map-frame-ros/187/3 "2021-04-14T15:45:06Z")

</div>

@orrblue this thread can help you:

> [@ZED world coordinate to camera coordinates](https://community.stereolabs.com/t/zed-world-coordinate-to-camera-coordinates/192):
>
> Hi, I am working on a solution to visualize 3D position coordinates of objects that I detected and saved in an earlier run. Specifically, after a run/recording, I save the .area map file and also the detections and I would like to visualize them when I visit the same area later with the camera. However, the saved positions are with respect to the world coordinate frame. How could I transform these coordinates to be able to visualize the bounding boxes on my current image, i.e. have the 3d po…
