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

I’m trying to get the camera’s position in the camera’s frame. Specifically the ROS standard (Z UP, X Forward show HERE). 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!

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 and pos_tracking/init_odom_with_first_valid_pose to false.

@orrblue this thread can help you: