mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-22 06:37:35 +08:00
vehicle_magnetometer: fix standalone mag bias est factored into in flight mag cal
- preflight mag bias estimate is in the vehicle body frame and removed from the raw mag data after it's rotated, calibrated, etc - in flight mag bias (from ekf2) is in the vehicle body frame, but stored as a sensor frame offset immediately
This commit is contained in:
@@ -280,9 +280,8 @@ void VehicleMagnetometer::UpdateMagCalibration()
|
||||
|
||||
_mag_cal[i].device_id = estimator_sensor_bias.mag_device_id;
|
||||
|
||||
// readd estimated bias that was removed before publishing vehicle_magnetometer
|
||||
_mag_cal[i].offset = _calibration[mag_index].BiasCorrectedSensorOffset(bias) +
|
||||
_calibration_estimator_bias[mag_index];
|
||||
// readd estimated bias that was removed before publishing vehicle_magnetometer (_calibration_estimator_bias)
|
||||
_mag_cal[i].offset = _calibration[mag_index].BiasCorrectedSensorOffset(bias + _calibration_estimator_bias[mag_index]);
|
||||
|
||||
_mag_cal[i].variance = bias_variance;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user