AHRS

Dependencies:   Eigen

Dependents:   IndNav_QK3_T265

Files at this revision

API Documentation at this revision

Comitter:
pmic
Date:
Mon Jan 27 10:54:13 2020 +0000
Parent:
29:cd963a6d31c5
Commit message:
Correct magnetometer.

Changed in this revision

BMX055.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/BMX055.cpp	Mon Jan 27 09:23:58 2020 +0000
+++ b/BMX055.cpp	Mon Jan 27 10:54:13 2020 +0000
@@ -92,8 +92,8 @@
     z = dt[5] << 8 | (dt[4] & 0xfe); // value has to be divided by 2
     
     // scaling factor 1/301.5815f if experimentally validated in comparision to pes board -> approx. same scaling of mag values, pmic 21.01.2020
-    magX = -(float)y / 8.0f / 301.5815f;       // MAGNETOMETER x-y are switched, see BMX055 datasheet page 161, also measurements show change in sign x!!!
-    magY = (float)x / 8.0f / 301.5815f;       // x-y is switched
+    magX = (float)y / 8.0f / 301.5815f;       // MAGNETOMETER x-y are switched, see BMX055 datasheet page 161, also measurements show change in sign x!!!
+    magY = -(float)x / 8.0f / 301.5815f;       // x-y is switched
     magZ = -(float)z / 2.0f / 301.5815f;       // z is -z
 }