From cbac002fb3997c2d3a4cf47ab0fe81c8020baaff Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 2 Jan 2014 19:18:19 +0100 Subject: [PATCH] Use the already compensated mag vector and initialize offsets to zero --- .../fw_att_pos_estimator/fw_att_pos_estimator_main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp b/src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp index b238422b63..49622dda38 100644 --- a/src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp +++ b/src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp @@ -528,14 +528,15 @@ FixedwingEstimator::task_main() if (_initialized) { + // XXX we compensate the offsets upfront - should be close to zero. magData.x = _mag.x; - magBias.x = -_mag_offsets.x_offset; + magBias.x = 0.0f; // _mag_offsets.x_offset magData.y = _mag.y; - magBias.y = -_mag_offsets.y_offset; + magBias.y = 0.0f; // _mag_offsets.y_offset magData.z = _mag.z; - magBias.z = -_mag_offsets.z_offset; + magBias.z = 0.0f; // _mag_offsets.y_offset fuseMagData = true; RecallStates(statesAtMagMeasTime, (IMUmsec - _parameters.mag_delay_ms));