Skip to main content
MGama.2
Associate
January 24, 2023
Question

I am using lsm6dsm, I read accelerometer data x, y and z, and gyroscope data x, y and z. I need to calculate the roll, pitch and yaw angles?

  • January 24, 2023
  • 1 reply
  • 1015 views

..

    This topic has been closed for replies.

    1 reply

    Eleon BORLINI
    ST Employee
    January 24, 2023

    Hi @MGama.2​ ,

    the gyroscope output is in terms of angular rate, so in degree per second. For the angle calculation, i.e. to get the degrees, you need to integrate the output data in time. The integration has do be performed carefully (knowing the time 0 position, calibrating the device before the calculation, etc), since the risk is to sum up the noise and to get wrong results.

    As example, see the MotionDI dynamic inclinometer library in X-CUBE-MEMS1 expansion for STM32Cube.

    -Eleon