This is a simple question I am having for some experts out there. I am getting a GIMBAL LOCK problem when I pitch my APM-1 board 90 degrees (downwards), the roll and yaw values becomes crazy.
My current implementation uses ahrs.pitch_sensor (euler angle) values.
Can anyone tell me how to prevent this problem using ahrs.get_dcm_matrix() or using the Quaternions (in this case I am not sure how to call update, as this class does not have one).
I am looking for a solution to this problem with logic and\or code. HELP is really appreciated!
Thanks in advance.
As I understand it, there is a fundamental problem with converting the dcm rotation matrix to roll, pitch, yaw. If you stay with with the DCM rotation matrix then you don't have this problem.
Thanks for your reply. But in my case I need the pitch and yaw angles to move the corresponding servo(s) of the camera gimbal. How do I achieve this with the DCM rotation matrix?
Could you please help me to deal with this. I will be too happy if I get this to work. Thank you!
In case anyone who read this thread is still interested, you and I figured out that you were running into a gimbal lock problem with Euler angles. There were a couple of possible solutions, including using direction cosines instead of Euler angles. However, you and I came up with a simple solution that allowed you to use Euler angles, which you posted here.