Skip to main content
Visitor II
September 2, 2019
Question

How can I get the quaternion matrix Q directly from LSM6DSO?

  • September 2, 2019
  • 1 reply
  • 2062 views

I download the document from your website, it shows how to rotate the coordinate, while the function it uses directly get the quaternion matrix Q which I cannot read from the board, can some one told me how to get this Q data?

Attached is the document downloaded from st web.

    This topic has been closed for replies.

    1 reply

    ST Employee
    September 24, 2019

    Hi @Sunny.Q​ , to get the quaternions using an accelerometer and a gyro you canfollow the indications described in the design tip DT0060. To have a reference source code you can refer to the X-CUBE-MEMS1 UM2225 (MotionEC real-time E-Compass), the MotionEC_Manager.c file. Regards

    Sunny.QAuthor
    Visitor II
    September 24, 2019

    Thank you for your reply. Right now, I am applying the kalman filter algorithm to remove the drift,this is the process I must do in my project, there is a matrix R,which is the variance of the measurement. I read the paper says it should provided by the company. Do you have idea what that is?

    And another thing surprise me is, why your device even have no drift?After I run the device about 5 mins, the gyroscope is still very accurate? Does this device already have some inner functions to remove drift?

    ST Employee
    September 25, 2019

    ​Hi @Sunny.Q​ , I was wrong suggesting you the use of MotionEC compass library, which of course uses the axl+mag data. The right FW package is MotionFX one, in 6-axis mode. However, it's not directly possible to get the Matrix Q from that source code, too deep inside the algorithm. Sorry for the lack of help :crying_face: Regards