ZED X Downward-Facing Camera — IMU Gimbal Lock in RPY

Hi team,

I’m using a ZED X camera mounted facing straight down on a ground vehicle (ROS 2 Humble). I wanted to share an issue I ran into with IMU orientation data


When subscribing to /zed/zed_node/imu/data and converting the quaternion to roll/pitch/yaw using the standard ZYX formula, I was seeing:

Roll:  -31.2°   Pitch:  89.2°   Yaw:  -31.7°
Roll:  -36.1°   Pitch:  89.2°   Yaw:  -36.7°
Roll:  -25.4°   Pitch:  89.2°   Yaw:  -26.0°

Roll and Yaw were nearly identical and oscillating wildly between -25° and -39°, while Pitch was locked at ~89°..

angular_velocity:
x: -0.0037372470899413083
y: 0.0068473275281483535
z: -0.0007464583917411008
angular_velocity_covariance:

  • 5.105498603087797e-06

  • 0.0

  • 0.0

  • 0.0

  • 0.00010884288259745603

  • 0.0

  • 0.0

  • 0.0

  • 7.027000590363156e-06
    linear_acceleration:
    x: -9.861936569213867
    y: -0.05002943426370621
    z: 0.037796176970005035

    these are zed imu output and thye camera is facing downwards ..

    is there any way i can convert quaternion to rpy without the gimbal lock issue ??

    please help with the issue …