diff --git a/EKF/estimator_interface.h b/EKF/estimator_interface.h index d15daedb97..5e240178c5 100644 --- a/EKF/estimator_interface.h +++ b/EKF/estimator_interface.h @@ -157,6 +157,12 @@ public: *time_us = _time_last_imu; } + // Copy the magnetic declination that we wish to save to the EKF2_MAG_DECL parameter for the next startup + void copy_mag_decl_deg(float *val) + { + *val = _mag_declination_to_save_deg; + } + protected: parameters _params; // filter parameters @@ -224,4 +230,9 @@ protected: // free buffer memory void unallocate_buffers(); + + float _mag_declination_gps = + 0.0f; // magnetic declination returned by the geo library using the last valid GPS position (rad) + + float _mag_declination_to_save_deg = 0.0f; // magnetic declination to save to EKF2_MAG_DECL (deg) };