mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-14 06:13:33 +08:00
EKF: Publish the magnetic declination we wish to save for next startup
This commit is contained in:
@@ -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)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user