mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 18:08:53 +08:00
sensors: magnetometer preserve original mag cal offset for status message
This commit is contained in:
@@ -190,6 +190,7 @@ void VehicleMagnetometer::MagCalibrationUpdate()
|
||||
for (int i = 0; i < ORB_MULTI_MAX_INSTANCES; i++) {
|
||||
if ((_calibration[mag_index].device_id() != 0) && (_mag_cal[i].device_id == _calibration[mag_index].device_id())) {
|
||||
|
||||
const Vector3f mag_cal_orig{_calibration[mag_index].offset()};
|
||||
Vector3f mag_cal_offset{_calibration[mag_index].offset()};
|
||||
|
||||
// calculate weighting using ratio of variances and update stored bias values
|
||||
@@ -208,9 +209,7 @@ void VehicleMagnetometer::MagCalibrationUpdate()
|
||||
|
||||
PX4_INFO("%d (%d) EST:%d offset committed: [%.2f %.2f %.2f]->[%.2f %.2f %.2f] (full [%.2f %.2f %.2f])",
|
||||
mag_index, _calibration[mag_index].device_id(), i,
|
||||
(double)_calibration[mag_index].offset()(0),
|
||||
(double)_calibration[mag_index].offset()(1),
|
||||
(double)_calibration[mag_index].offset()(2),
|
||||
(double)mag_cal_orig(0), (double)mag_cal_orig(1), (double)mag_cal_orig(2),
|
||||
(double)mag_cal_offset(0), (double)mag_cal_offset(1), (double)mag_cal_offset(2),
|
||||
(double)_mag_cal[i].mag_offset(0), (double)_mag_cal[i].mag_offset(1), (double)_mag_cal[i].mag_offset(2));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user