Hi People,

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.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • T3

    Hi Shyam,

    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.

    Best regards,

    Bill Premerlani

  • 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.

This reply was deleted.

Activity