Skip to content

Commit

Permalink
Use alternative magnetic calibration model
Browse files Browse the repository at this point in the history
  • Loading branch information
xioTechnologies authored Sep 24, 2023
1 parent c15d3e9 commit 15e463c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Fusion/FusionCalibration.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static inline FusionVector FusionCalibrationInertial(const FusionVector uncalibr
* @return Calibrated measurement.
*/
static inline FusionVector FusionCalibrationMagnetic(const FusionVector uncalibrated, const FusionMatrix softIronMatrix, const FusionVector hardIronOffset) {
return FusionVectorSubtract(FusionMatrixMultiplyVector(softIronMatrix, uncalibrated), hardIronOffset);
return FusionMatrixMultiplyVector(softIronMatrix, FusionVectorSubtract(uncalibrated, hardIronOffset));

This comment has been minimized.

Copy link
@Overff

Overff Jan 5, 2024

Thanks!

}

#endif
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ i<sub>c</sub> = Ms(i<sub>u</sub> - b)

The `FusionCalibrationMagnetic` function applies magnetometer calibration parameters using the calibration model:

m<sub>c</sub> = Sm<sub>u</sub> - h
m<sub>c</sub> = S(m<sub>u</sub> - h)

- m<sub>c</sub> is the calibrated magnetometer measurement and `return` value
- m<sub>u</sub> is the uncalibrated magnetometer measurement and `uncalibrated` argument
Expand Down

0 comments on commit 15e463c

Please sign in to comment.