Coordinate System during recording

Hello everyone,

I am wondering if anyone can perhaps give me some more insights into an issue that I have encountered lately with ZED2i camera.

So, I have been playing around with sensor fusion, where I’m projecting LiDAR data onto images obtained from ZED camera. I’ve found out if works fairly well if the two sensors point forward. However, when I rotated and flipped the camera, I’ve noticed that the fusion breaks even when you account for the additional rotation.

My question how does the ZED camera initialize the coordinate system? Right now, I am lead to believe that regardless of the way I position my camera (horizontally or vertically in my case), after I run zed_wrapper to record some data, the IMAGE_COORDINATE system is initialized in the same way for both cases (Coordinate Frames - Stereolabs). Basically, I am lead to believe that at the startup, the two coordinate systems are set identically and not in a way that one is the rotated version of another? Does the ZED camera have some “default position”, such as laying horizontally, so that I know where is “down” or “right” or “forward” from the camera point of view?

I hope that I made myself as easy to understand as possible, since I’ve had some difficulties understanding what might be cause of the problems for my project.

Thank you :slight_smile:

Hi @erminkev1,

First of all, welcome to the Stereolabs community!

That is correct, by default, the SDK will use the IMU accelerometer data to initialize the WORLD reference frame with the Y axis going down towards gravity, and the Z axis going towards “forward” (in COORDINATE_SYSTEM_IMAGE). This is useful for having consistent coordinate systems each time you run the SDK, and have your camera’s initial pitch and roll in the WORLD reference frame.

In your case, I believe you would want to disable this feature, and you can do so by setting PositionalTrackingParameters.set_gravity_as_origin to false. This will make the zed’s WORLD reference frame initialize with the Y axis looking “down” with respect to the camera.

(If you are using ROS this parameter is exposed in the common.yaml file as well)

Thank you for your response @mattrouss,

I just want to make sure that I get this correctly. If the initialization if set so that Y-axis is going down towards gravity, then for a vertical mount of the camera, the coordinate orientation will be as I show in the drawing:

The orientation of my mount is that camera is flipped and rotated, basically :slight_smile:

@erminkev1 if the parameter set_gravity_as_origin is true, then the image that you published is correct.

1 Like