jremington / LSM9DS1-AHRS

Mahony 3D fusion filter and tilt compensated compass, with sensor calibration code
44 stars 11 forks source link

applying sensor sensitivity #3

Closed coryjonsmith closed 2 years ago

coryjonsmith commented 2 years ago

Hi jremington,

Thank you for your code! I have a question regarding the application of sensor sensitivity. In the code you apply the gyro sensitivity of 8.75 mdps/LSB when converting from deg/s to rad/s. However, you do not apply the sensitivities to the accelerometer or magnetometer data. Does this imply that the readgyro() function in the library reads the raw gyro data while the readaccel() function reads the raw data AND converts to g's and the readmag() function reads the raw mag data AND converts to micro Teslas?

Thank you! coryjonsmith

jremington commented 2 years ago

In the orientation algorithm, only the vector direction of the accelerometer and magnetometer data are used, so the scale factors (or measurement units) are irrelevant. Both vectors are normalized to magnitude = 1.