Skip to content

Commit ca4a2b9

Browse files
SeaOtocinclusmeta-codesync[bot]
authored andcommitted
{BugFix} Fix sign of the magnetometer rectification matrix
Summary: Fix sign -- Determinant of the matrix should remain positive (calibration convention that the codebase enforce here https://github.com/facebookresearch/projectaria_tools/blob/14ab31d2e476f401744e0de338392f9c885013e3/core/calibration/loader/SensorCalibrationJson.cpp#L118) A proper fix, would be to flip the sign only if the determinant is negative, I assume ... and will come later Differential Revision: D85268025 fbshipit-source-id: 5612de5ec68035dd9dc133afa1d0b1ef4fdc749b
1 parent 14ab31d commit ca4a2b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/calibration/loader/DeviceCalibrationJson.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ nlohmann::json magnetometerCalibrationToJson(
267267
// 3. `biasFromJson`: Gen1: muT -> T, Gen2: Gauss -> T.
268268
double biasScale = deviceVersion == DeviceVersion::Gen1 ? 1e-6 : 1e-4;
269269

270-
Eigen::Matrix3d magMatForJson = -magMat.inverse() * rectificationMatrixScale;
270+
Eigen::Matrix3d magMatForJson = magMat.inverse() * rectificationMatrixScale;
271271
Eigen::Vector3d biasForJson = biasInTesla / biasScale;
272272

273273
magJson["SerialNumber"] = "";

0 commit comments

Comments
 (0)