mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 04:03:33 +08:00
EKF: cleanup use of _mag_filt_state
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
This commit is contained in:
committed by
Paul Riseborough
parent
37339de57c
commit
56b6b7a778
+1
-4
@@ -256,13 +256,10 @@ bool Ekf::initialiseFilter()
|
||||
// update transformation matrix from body to world frame
|
||||
_R_to_earth = quat_to_invrotmat(_state.quat_nominal);
|
||||
|
||||
// calculate the averaged magnetometer reading
|
||||
Vector3f mag_init = _mag_filt_state;
|
||||
|
||||
// calculate the initial magnetic field and yaw alignment
|
||||
// Get the magnetic declination
|
||||
calcMagDeclination();
|
||||
_control_status.flags.yaw_align = resetMagHeading(mag_init);
|
||||
_control_status.flags.yaw_align = resetMagHeading(_mag_filt_state);
|
||||
|
||||
if (_control_status.flags.rng_hgt) {
|
||||
// if we are using the range finder as the primary source, then calculate the baro height at origin so we can use baro as a backup
|
||||
|
||||
Reference in New Issue
Block a user