# The Singularity Problem and Solution?

Dear Team,

I would like to express my sincere appreciation for your exceptional product! Currently, I am delving into the functionality of the IMU and coordinate system within the ZED2i. I have conducted various experiments and would like to share the details with you:

## Settings:

• The ZED2i camera was positioned vertically.
• The default coordinate system was utilized, following a right-handed convention with the y-axis pointing downwards.
• Initially, I assumed that the XYZ directions aligned with the image attached.

To avoid confusion stemming from the coordinate system, I have opted to describe camera movements using alternative terms rather than referring to the traditional X, Y, and Z axes.

## Experiments:

• Tilting movements were performed in the forward/backward direction.
• The camera was moved forward/backward, with “forward” denoting the direction aligned with the camera lens.
• Horizontal movements were executed, involving displacements parallel to the ground, either closer or farther away from a desk.

## Results

I have obtained results in the form of SVO file and python code. These findings encompass translations and orientations.

Orientation : Upon analyzing the orientation chart, I noticed that the roll is -90 degrees, which is expected due to the camera’s rotation. When tilting the camera, I initially anticipated only a change in the yaw value. However, I observed that the pitch and yaw exhibited similar patterns initially.

Translation : Examining the translation chart, I made an intriguing observation: despite attempting to alter the camera’s movement away from the desk, the X value consistently decreased. Furthermore, as I did not perform any upward or downward motion, the chart does not reflect changes in the Y translation value. However, I presume that vertical movements might impact the Y translation value.

## Problems

I am currently facing a significant challenge in comprehending the coordinate system. The results I have obtained thus far highlight a clear discrepancy between my initial assumptions regarding the X and Y axes and the actual behavior demonstrated by the camera. Specifically, I am puzzled by the simultaneous movement of pitch and yaw when the XYZ coordinates do not align with my initial understanding. As a result, I am finding it difficult to grasp the underlying rationale behind interpreting the XYZ coordinates in this specific manner.

If you could offer any guidance regarding the coordinate system or any other relevant aspects, I would greatly appreciate it.

Thank you sincerely!

YJ

Hi @yongjin-shin
Welcome to the Stereolabs community.

The coordinate system used by the ZED SDK reflects the setting value that you use in `InitParameters::coordinate_system` when you call the `open` function.
In your case you used the `COORDINATE_SYSTEM::IMAGE` setting, so your picture is correct (see also this section of the documentation for other coordinate systems).

Have you tried your experiments using the ZED Sensor Viewer tool to have direct visual feedback on the camera orientation?

Note: after playing your SVO I can say that the scene that you are acquiring causes the strange behaviors that you are facing. The objects are indeed too close to the camera. I suggest you point the camera to a broader area.

Hi @Myzhar,

Thank you for your prompt response!

I recently conducted an experiment with the ZED2i camera in a larger area that contains numerous features. While using the Sensor Viewer, I obtained the same chart that I have attached.

Upon researching the issue, I discovered that it is a singularity problem related to Euler angles, also known as gimbal lock. Specifically, when I rolled the camera and reached -90 degrees, the other values, yaw and pitch, experienced significant changes. Furthermore, when the roll was -90 degrees, the yaw and pitch remained stable at 0, but as soon as I adjusted the pitch, both yaw and pitch diverged to -180 or 180 degrees.

I would appreciate any insights or suggestions you may have to resolve this singularity problem. Here are my specific questions:

1. What is the order in which the Euler rotations are performed to obtain positions?
2. Is it possible to change the order of the Euler rotations?

Thank you for your valuable assistance!

YJ

The ZED SDK internally uses the Quaternion representation, so the RPY singularities are not a problem.
Regarding Euler Angles, the ZED SDK uses the ZYX convention.
We are adding options to request Euler Angles also with other conventions.