diff --git a/conf/modules/geo_mag.xml b/conf/modules/geo_mag.xml index b8f6d39844..eb275e646f 100644 --- a/conf/modules/geo_mag.xml +++ b/conf/modules/geo_mag.xml @@ -11,7 +11,7 @@ Method uses is based on the the ngdc noaa DODWMM model and data (http://www.ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml). The WMM is based on earth magnetic field measuring at an high number of sites on the whole globe and on its mathematical representation through a series of characteristic values listed in a file (WMM.COF) which has a five-year validity. The autopilot used data derived from this file to make the complex calculation of declination. - Every 5 years (2015, 2020) an updated geomagnetic model is released and datatables in the code must be updated accordingly for more accurate flight. + Every 5 years (2015, 2020, 2025) an updated geomagnetic model is released and datatables in the code must be updated accordingly for more accurate flight. @@ -29,7 +29,7 @@ - + diff --git a/conf/modules/targets/nps_common.xml b/conf/modules/targets/nps_common.xml index fa9f776b96..caffa49c4b 100644 --- a/conf/modules/targets/nps_common.xml +++ b/conf/modules/targets/nps_common.xml @@ -62,7 +62,7 @@ VPATH += $(PAPARAZZI_HOME)/var/share - + diff --git a/sw/airborne/math/pprz_geodetic_wmm2020.c b/sw/airborne/math/pprz_geodetic_wmm2025.c similarity index 70% rename from sw/airborne/math/pprz_geodetic_wmm2020.c rename to sw/airborne/math/pprz_geodetic_wmm2025.c index cc9ee0b2af..303ea29c60 100644 --- a/sw/airborne/math/pprz_geodetic_wmm2020.c +++ b/sw/airborne/math/pprz_geodetic_wmm2025.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2012 Sergey Krukowski - * Copyright (C) 2020 OpenUAS info@openuas.org> + * Copyright (C) 2025 OpenUAS info@openuas.org> * * This file is part of paparazzi. * @@ -20,45 +20,45 @@ */ /** - * @file pprz_geodetic_wmm2020.c - * @brief WMM2020 Geomagnetic field model. + * @file pprz_geodetic_wmm2025.c + * @brief WMM2025 Geomagnetic field model. * - * Based on the WMM2020 model (http://www.ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml) + * Based on the WMM2025 model (http://www.ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml) */ #include "std.h" -#include "math/pprz_geodetic_wmm2020.h" +#include "math/pprz_geodetic_wmm2025.h" const double gh1[MAXCOEFF] = { - //WMM 2020 data - 0.0, -29404.5, -1450.7, 4652.9, - -2500.0, 2982.0, -2991.6, 1676.8, -734.8, - 1363.9, -2381.0, -82.2, 1236.2, 241.8, 525.7, -542.9, - 903.1, 809.4, 282.0, 86.2, -158.4, -309.4, 199.8, 47.9, -350.1, - -234.4, 363.1, 47.7, 187.8, 208.4, -140.7, -121.3, -151.2, 32.2, 13.7, 99.1, - 65.9, 65.6, -19.1, 73.0, 25.0, -121.5, 52.7, -36.2, -64.4, 13.5, 9.0, -64.7, 68.1, - 80.6, -76.8, -51.4, -8.3, -16.8, 56.5, 2.3, 15.8, 23.5, 6.4, -2.2, -7.2, -27.2, 9.8, -1.9, - 23.6, 9.8, 8.4, -17.5, -15.3, -0.4, 12.8, -21.1, -11.8, 15.3, 14.9, 13.7, 3.6, -16.5, -6.9, -0.3, 2.8, - 5.0, 8.2, -23.3, 2.9, 11.1, -1.4, 9.8, -1.1, -5.1, -13.3, -6.2, 1.1, 7.8, 8.9, 0.4, -9.3, -1.5, -11.9, 9.7, - -1.9, -6.2, 3.4, -0.1, -0.2, 1.7, 3.5, -0.9, 4.8, 0.6, -8.6, -0.9, -0.1, 1.9, -4.2, 1.4, -3.4, -2.4, -0.1, -3.9, -8.8, - 3.0, -1.4, 0.0, -2.5, 2.6, 2.4, -0.5, -0.9, -0.4, 0.3, 0.6, -0.7, -0.2, -0.1, -1.7, 1.4, -1.6, -0.6, -3.0, 0.2, -2.0, 3.1, -2.6, - -2.0, -0.1, -1.2, 0.5, 0.5, 1.3, 1.3, -1.2, -1.8, 0.7, 0.1, 0.3, 0.7, 0.5, -0.1, -0.2, 0.6, -0.5, 0.2, 0.1, -0.9, -1.1, 0.0, -0.3, 0.5 + //WMM 2025 data + 0.0, -29351.8, -1410.8, 4545.4, + -2556.6, 2951.1, -3133.6, 1649.3, -815.1, + 1361.0, -2404.1, -56.6, 1243.8, 237.5, 453.6, -549.5, + 895.0, 799.5, 278.6, 55.7, -133.9, -281.1, 212.0, 12.1, -375.6, + -233.2, 368.9, 45.4, 187.2, 220.2, -138.7, -122.9, -142.0, 43.0, 20.9, 106.1, + 64.4, 63.8, -18.4, 76.9, 16.8, -115.7, 48.8, -40.9, -59.8, 14.9, 10.9, -60.7, 72.7, + 79.5, -77.0, -48.9, -8.8, -14.4, 59.3, -1.0, 15.8, 23.4, 2.5, -7.4, -11.1, -25.1, 14.2, -2.3, + 23.2, 10.8, 7.1, -17.5 , -12.6, 2.0, 11.4, -21.7, -9.7, 16.9, 12.7, 15.0, 0.7, -16.8, -5.2, 0.9, 3.9, + 4.6, 7.8, -24.8, 3.0, 12.2, -0.2, 8.3, -2.5, -3.3, -13.1, -5.2, 2.4, 7.2, 8.6, -0.6, -8.7, 0.8, -12.9, 10.0, + -1.3, -6.4, 3.3, 0.2, 0.0, 2.0, 2.4, -1.0, 5.3, -0.6, -9.1, -0.9, 0.4, 1.5, -4.2, 0.9, -3.8, -2.7, 0.9, -3.9, -9.1, + 2.9, -1.5, 0.0, -2.5, 2.9, 2.4, -0.6, -0.6, 0.2, -0.1, 0.5, -0.6, -0.3, -0.1, -1.2, 1.1, -1.7, -1.0, -2.9, -0.2, -1.8, 2.6, -2.3, + -2.0, -0.2, -1.3, 0.3, 0.7, 1.2, 1.0, -1.3 , -1.4, 0.6, 0.0, 0.6, 0.6, 0.5, -0.1, -0.1, 0.8, -0.4, 0.1, -0.2, -1.0, -1.3, 0.1, -0.7, 0.2 }; const double gh2[MAXCOEFF] = { - //WMM 2020 data - 0.0, 6.7, 7.7, -25.1, - -11.5, -7.1, -30.2, -2.2, -23.9, - 2.8, -6.2, 5.7, 3.4, -1.0, -12.2, 1.1, - -1.1, -1.6, 0.2, -6.0, 6.9, 5.4, 3.7, -5.5, -5.6, - -0.3, 0.6, 0.1, -0.7, 2.5, 0.1, -0.9, 1.2, 3.0, 1.0, 0.5, - -0.6, -0.4, 0.1, 0.5, -1.8, 1.4, -1.4, -1.4, 0.9, 0.0, 0.1, 0.8, 1.0, - -0.1, -0.3, 0.5, -0.1, 0.6, 0.7, -0.7, 0.2, -0.2, -0.5, -1.2, -0.8, 0.2, 1.0, 0.3, - -0.1, 0.1, -0.3, -0.1, 0.7, 0.5, -0.2, -0.1, 0.5, 0.4, -0.3, 0.5, -0.5, 0.0, 0.4, 0.4, 0.1, - -0.1, -0.2, -0.3, 0.0, 0.2, 0.4, -0.4, -0.3, 0.4, 0.0, 0.1, 0.3, 0.0, 0.0, -0.2, 0.0, 0.5, -0.4, 0.2, - 0.0, 0.0, 0.0, 0.0, 0.1, 0.2, -0.3, -0.1, 0.1, -0.2, -0.2, 0.0, 0.1, -0.1, 0.0, -0.2, -0.1, -0.1, 0.2, 0.0, 0.0, - 0.0, -0.1, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.2, -0.1, 0.0, 0.0, 0.0, 0.0, 0.1, -0.1, 0.0, -0.1, -0.1, -0.1, 0.0, -0.1, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, -0.1 + //WMM 2025 data + 0.0, 12.0, 9.7, -21.5, + -11.6, -5.2, -27.7, -8.0, -12.1, + -1.3, -4.2, 4.0, 0.4, -0.3, -15.6, -4.1, + -1.6, -2.4, -1.1, -6.0, 4.1, 5.6, 1.6, -7.0, -4.4, + 0.6, 1.4, -0.5, 0.0, 2.2, 0.6, 0.4, 2.2, 1.7, 0.9, 1.9, + -0.2, -0.4, 0.3, 0.9, -1.6, 1.2, -0.4, -0.9, 0.9, 0.3, 0.7, 0.9, 0.9, + 0.0, -0.1, 0.6, -0.1, 0.5, 0.5, -0.8, -0.1, 0.0, -0.8, -1.0, -0.8, 0.6, 0.8, -0.2, + -0.1, 0.2, -0.2, 0.0, 0.5, 0.5, -0.4, -0.1, 0.4, 0.3, -0.5, 0.2, -0.6, 0.0, 0.3, 0.2, 0.2, + 0.0, -0.1, -0.3, 0.1, 0.3, 0.3, -0.3, -0.3, 0.3, 0.0, 0.2, 0.3, -0.1, -0.1, -0.2, 0.1, 0.4, -0.1, 0.1, + 0.1, 0.0, 0.0, 0.1, 0.0, 0.1, -0.2, 0.0, 0.1, -0.3, -0.1, 0.0, 0.1, -0.1, 0.0, -0.1, -0.1, 0.0, 0.2, 0.0, -0.0, + 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.1, -0.1, 0.0, 0.0, 0.0, 0.0, 0.1, -0.1, 0.0, -0.1, 0.0, -0.1, 0.0, -0.1, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.1, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, -0.1, -0.1 }; int16_t extrapsh(double date, double dte1, int16_t nmax1, int16_t nmax2, double *gh) diff --git a/sw/airborne/math/pprz_geodetic_wmm2020.h b/sw/airborne/math/pprz_geodetic_wmm2025.h similarity index 100% rename from sw/airborne/math/pprz_geodetic_wmm2020.h rename to sw/airborne/math/pprz_geodetic_wmm2025.h diff --git a/sw/airborne/modules/geo_mag/geo_mag.c b/sw/airborne/modules/geo_mag/geo_mag.c index 35a87b1901..eb606d1670 100644 --- a/sw/airborne/modules/geo_mag/geo_mag.c +++ b/sw/airborne/modules/geo_mag/geo_mag.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2012 Sergey Krukowski - * Copyright (C) 2020 OpenUAS + * Copyright (C) 2025 OpenUAS * * This file is part of paparazzi. * @@ -27,7 +27,7 @@ */ #include "modules/geo_mag/geo_mag.h" -#include "math/pprz_geodetic_wmm2020.h" +#include "math/pprz_geodetic_wmm2025.h" #include "math/pprz_algebra_double.h" #include "modules/gps/gps.h" #include "modules/core/abi.h" @@ -62,7 +62,7 @@ void geo_mag_event(void) double gha[MAXCOEFF]; // Geomag global variables int32_t nmax; - /* Current date in decimal year, for example 2015.68 */ + /* Current date in decimal year, for example 2025.68 */ double sdate = GPS_EPOCH_BEGIN + (double)gps.week / WEEKS_IN_YEAR + (double)gps.tow / 1000 / SECS_IN_YEAR;