geo_lookup: upgrade table size (2 bytes per element) and add testing

- updated table to 2 bytes (int16) per element and scaled the inclination/declination/strength tables to use most of the range without being too awkward
 - tables have been extended to include the full latitude range
 - expanded the API slightly to offer declination/inclination in both degrees/radians and the magnetic strength in Gauss and Tesla
 - generated some simple testing that verifies interpolation between points
This commit is contained in:
Daniel Agar
2020-07-19 18:53:47 -04:00
committed by GitHub
parent 3651ed37fb
commit 9aa7991654
10 changed files with 5626 additions and 361 deletions
+3 -3
View File
@@ -80,9 +80,9 @@ bool Ekf::collect_gps(const gps_message &gps)
_last_gps_origin_time_us = _time_last_imu;
// set the magnetic field data returned by the geo library using the current GPS position
_mag_declination_gps = math::radians(get_mag_declination(lat, lon));
_mag_inclination_gps = math::radians(get_mag_inclination(lat, lon));
_mag_strength_gps = 0.01f * get_mag_strength(lat, lon);
_mag_declination_gps = get_mag_declination_radians(lat, lon);
_mag_inclination_gps = get_mag_inclination_radians(lat, lon);
_mag_strength_gps = get_mag_strength_tesla(lat, lon);
// request a reset of the yaw using the new declination
if (_params.mag_fusion_type == MAG_FUSE_TYPE_NONE) {