mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 15:43:34 +08:00
EKF: Allow mag field estimates to stabilise before use
This commit is contained in:
@@ -437,6 +437,8 @@ bool Ekf::realignYawGPS()
|
||||
P[index][index] = sq(_params.mag_noise);
|
||||
}
|
||||
|
||||
// record the start time for the magnetic field alignment
|
||||
_flt_mag_align_start_time = _imu_sample_delayed.time_us;
|
||||
// calculate the amount that the quaternion has changed by
|
||||
_state_reset_status.quat_change = quat_before_reset.inversed() * _state.quat_nominal;
|
||||
|
||||
@@ -637,6 +639,9 @@ bool Ekf::resetMagHeading(Vector3f &mag_init)
|
||||
P[index][index] = sq(_params.mag_noise);
|
||||
}
|
||||
|
||||
// record the start time for the magnetic field alignment
|
||||
_flt_mag_align_start_time = _imu_sample_delayed.time_us;
|
||||
|
||||
// calculate the amount that the quaternion has changed by
|
||||
_state_reset_status.quat_change = quat_before_reset.inversed() * _state.quat_nominal;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user