diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-04-30 08:13:42 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-04-30 08:26:08 +0200 |
commit | 48a9ba39afec8443ad4cb7d34f42e0cfc37d4e1e (patch) | |
tree | e8bd4e8731801889b3f2628c569c644d496b4f4e | |
parent | ec50f73cbe4c88a57f92f888d764a678f6796dd2 (diff) | |
download | px4-firmware-48a9ba39afec8443ad4cb7d34f42e0cfc37d4e1e.tar.gz px4-firmware-48a9ba39afec8443ad4cb7d34f42e0cfc37d4e1e.tar.bz2 px4-firmware-48a9ba39afec8443ad4cb7d34f42e0cfc37d4e1e.zip |
Fixed typos in declination table lookup
-rw-r--r-- | src/lib/geo/geo_mag_declination.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/geo/geo_mag_declination.c b/src/lib/geo/geo_mag_declination.c index b96f87721..cfee6b423 100644 --- a/src/lib/geo/geo_mag_declination.c +++ b/src/lib/geo/geo_mag_declination.c @@ -115,8 +115,8 @@ __EXPORT float get_mag_declination(float lat, float lon) } /* find index of nearest low sampling point */ - unsigned min_lat_index = (90 + min_lat) / SAMPLING_RES; - unsigned min_lon_index = (180 + min_lat) / SAMPLING_RES; + unsigned min_lat_index = (-(SAMPLING_MIN_LAT) + min_lat) / SAMPLING_RES; + unsigned min_lon_index = (-(SAMPLING_MIN_LON) + min_lon) / SAMPLING_RES; float declination_sw = get_lookup_table_val(min_lat_index, min_lon_index); float declination_se = get_lookup_table_val(min_lat_index, min_lon_index + 1); |