cancel
Showing results for 
Search instead for 
Did you mean: 

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?

MGama.2
Associate II
 
1 REPLY 1
Eleon BORLINI
ST Employee

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