I have another issue with Euler angles aside the gimbal lock: I was using Eigen to compute the difference between a desired angle (yaw) and an Euler angle extracted from a quaternion. Around the value 0, the conversion would flip from 0.0001 to -3.14, which broke my code. I thought it was a bug until I remembered there is no unique set of Euler angles that represents an orientation. So I converted to quaternions and it all worked. Cost me a lot of time :...)
I have another issue with Euler angles aside the gimbal lock: I was using Eigen to compute the difference between a desired angle (yaw) and an Euler angle extracted from a quaternion. Around the value 0, the conversion would flip from 0.0001 to -3.14, which broke my code. I thought it was a bug until I remembered there is no unique set of Euler angles that represents an orientation. So I converted to quaternions and it all worked. Cost me a lot of time :...)