EKF: Publish the magnetic declination we wish to save for next startup

This commit is contained in:
Paul Riseborough
2016-02-14 22:01:53 +01:00
committed by Roman
parent 0308f2f796
commit 9017e077f8
+11
View File
@@ -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)
};