mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-09 22:49:53 +08:00
WMM updated for 2020-2025 period (#2485)
This commit is contained in:
@@ -59,7 +59,7 @@ nps.srcs += \
|
||||
$(NPSDIR)/nps_main_common.c
|
||||
|
||||
# for geo mag calculation
|
||||
nps.srcs += math/pprz_geodetic_wmm2015.c
|
||||
nps.srcs += math/pprz_geodetic_wmm2020.c
|
||||
|
||||
BARO_PERIODIC_FREQUENCY ?= 50
|
||||
BARO_BOARD_CFLAGS += -DBARO_PERIODIC_FREQUENCY=$(BARO_PERIODIC_FREQUENCY)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<event fun="geo_mag_event()"/>
|
||||
<makefile target="ap|nps">
|
||||
<file name="geo_mag.c"/>
|
||||
<file name="pprz_geodetic_wmm2015.c" dir="math"/>
|
||||
<file name="pprz_geodetic_wmm2020.c" dir="math"/>
|
||||
</makefile>
|
||||
<makefile target="nps">
|
||||
<define name="NPS_CALC_GEO_MAG"/>
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<file name="nps_radio_control_joystick.c" dir="nps"/>
|
||||
<file name="nps_radio_control_spektrum.c" dir="nps"/>
|
||||
<file name="nps_main_common.c" dir="nps"/>
|
||||
<file name="math/pprz_geodetic_wmm2015.c" dir="math"/>
|
||||
<file name="math/pprz_geodetic_wmm2020.c" dir="math"/>
|
||||
</makefile>
|
||||
|
||||
<makefile target="nps">
|
||||
|
||||
+31
-31
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Sergey Krukowski <softsr@yahoo.de>
|
||||
* Copyright (C) 2015 OpenUAS info@openuas.org>
|
||||
* Copyright (C) 2020 OpenUAS info@openuas.org>
|
||||
*
|
||||
* This file is part of paparazzi.
|
||||
*
|
||||
@@ -20,45 +20,45 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file pprz_geodetic_wmm2015.c
|
||||
* @brief WMM2015 Geomagnetic field model.
|
||||
* @file pprz_geodetic_wmm2020.c
|
||||
* @brief WMM2020 Geomagnetic field model.
|
||||
*
|
||||
* Based on the WMM2015 model (http://www.ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml)
|
||||
* Based on the WMM2020 model (http://www.ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml)
|
||||
*/
|
||||
|
||||
#include "std.h"
|
||||
#include "math/pprz_geodetic_wmm2015.h"
|
||||
#include "math/pprz_geodetic_wmm2020.h"
|
||||
|
||||
const double gh1[MAXCOEFF] = {
|
||||
//WMM 2015 data
|
||||
0.0, -29438.5, -1501.1, 4796.2,
|
||||
-2445.3, 3012.5, -2845.6, 1676.6, -642.0,
|
||||
1351.1, -2352.3, -115.3, 1225.6, 245.0, 581.9, -538.3,
|
||||
907.2, 813.7, 283.4, 120.3, -188.6, -335.0, 180.9, 70.3, -329.5,
|
||||
-232.6, 360.1, 47.4, 192.4, 196.9, -141.0, -119.4, -157.4, 16.1, 4.3, 100.1,
|
||||
69.5, 67.4, -20.7, 72.8, 33.2, -129.8, 58.8, -29.0, -66.5, 13.2, 7.3, -70.9, 62.5,
|
||||
81.6, -76.1, -54.1, -6.8, -19.4, 51.9, 5.6, 15.0, 24.4, 9.3, 3.3, -2.8, -27.5, 6.7, -2.3,
|
||||
24.0, 8.6, 10.2, -16.9, -18.1, -3.2, 13.2, -20.6, -14.6, 13.3, 16.2, 11.7, 5.7, -16.0, -9.1, -2.0, 2.2,
|
||||
5.4, 8.8, -21.6, 3.1, 10.8, -3.1, 11.7, 0.6, -6.8, -13.3, -6.9, -0.1, 7.8, 8.7, 1.0, -9.1, -3.9, -10.5, 8.5,
|
||||
-1.9, -6.5, 3.3, 0.2, -0.3, 0.6, 4.6, -0.6, 4.4, 1.7, -7.9, -0.7, -0.6, 2.1, -4.1, 2.3, -2.8, -1.8, -1.1, -3.6, -8.7,
|
||||
3.1, -1.5, -0.1, -2.3, 2.1, 2.1, -0.7, -0.9, -1.1, 0.6, 0.7, -0.7, -0.2, 0.2, -2.1, 1.7, -1.5, -0.2, -2.5, 0.4, -2.0, 3.5, -2.3,
|
||||
-2.0, -0.3, -1.0, 0.4, 0.5, 1.3, 1.8, -0.9, -2.2, 0.9, 0.3, 0.1, 0.7, 0.5, -0.1, -0.4, 0.3, -0.4, 0.2, 0.2, -0.9, -0.9, -0.2, 0.0, 0.7
|
||||
//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
|
||||
};
|
||||
|
||||
const double gh2[MAXCOEFF] = {
|
||||
//WMM 2015 data
|
||||
0.0, 10.7, 17.9, -26.8,
|
||||
-8.6, 0.0, -3.3, -27.1, 2.4, -13.3,
|
||||
3.1, -6.2, 8.4, -0.4, -0.4, -10.4, 2.3,
|
||||
-0.4, 0.8, -0.6, -9.2, 5.3, 4.0, 3.0, -4.2, -5.3,
|
||||
-0.2, 0.1, 0.4, -1.4, 1.6, 0.0, -1.1, 1.3, 3.3, 3.8, 0.1,
|
||||
-0.5, -0.2, 0.0, -0.6, -2.2, 2.4, -0.7, -1.1, 0.1, 0.3, 1.0, 1.5, 1.3,
|
||||
0.2, -0.2, 0.7, -0.4, 0.5, 1.3, -0.2, 0.2, -0.1, -0.4, -0.7, -0.9, 0.1, 0.3, 0.1,
|
||||
0.0, 0.1, -0.3, -0.5, 0.3, 0.5, 0.3, -0.2, 0.6, 0.4, -0.1, 0.2, -0.2, -0.4, 0.3, 0.3, 0.0,
|
||||
0.0, -0.1, -0.2, -0.1, -0.1, 0.4, -0.2, -0.5, 0.1, -0.2, 0.1, 0.1, 0.0, 0.0, -0.2, -0.2, 0.4, -0.1, 0.3,
|
||||
0.0, 0.0, 0.1, -0.1, -0.1, 0.3, 0.0, -0.1, 0.0, -0.1, -0.2, -0.1, 0.1, 0.0, -0.1, -0.2, -0.2, -0.1, 0.1, -0.2, -0.1,
|
||||
0.0, 0.0, 0.0, -0.1, 0.1, 0.1, 0.0, 0.0, 0.1, 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.1, -0.1,
|
||||
0.1, 0.0, 0.0, 0.0, 0.0, 0.1, -0.1, -0.1, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
|
||||
//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
|
||||
};
|
||||
|
||||
int16_t extrapsh(double date, double dte1, int16_t nmax1, int16_t nmax2, double *gh)
|
||||
+11
-11
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Sergey Krukowski <softsr@yahoo.de>
|
||||
* Copyright (C) 2015 OpenUAS <info@openuas.org>
|
||||
* Copyright (C) 2020 OpenUAS <info@openuas.org>
|
||||
*
|
||||
* This file is part of paparazzi.
|
||||
*
|
||||
@@ -20,10 +20,10 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file pprz_geodetic_wmm2015.h
|
||||
* @brief WMM2015 Geomagnetic field model.
|
||||
* @file pprz_geodetic_wmm2020.h
|
||||
* @brief WMM2020 Geomagnetic field model.
|
||||
*
|
||||
* Based on the WMM2015 model (http://www.ngdc.noaa.gov/geomag/models.shtml)
|
||||
* Based on the WMM2020 model (http://www.ngdc.noaa.gov/geomag/models.shtml)
|
||||
*
|
||||
* @addtogroup math_geodetic
|
||||
* @{
|
||||
@@ -31,20 +31,20 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef WMM2015_H
|
||||
#define WMM2015_H
|
||||
#ifndef WMM2020_H
|
||||
#define WMM2020_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define WMM2015_FRAC 2
|
||||
#define WMM2020_FRAC 2
|
||||
#define N_MAX_OF_GH 12
|
||||
|
||||
// Geo mag current observation epoch begin
|
||||
#define GEO_EPOCH 2015.
|
||||
#define YR_MIN 2015.
|
||||
#define YR_MAX 2020.
|
||||
#define GEO_EPOCH 2020.
|
||||
#define YR_MIN 2020.
|
||||
#define YR_MAX 2025.
|
||||
#define NMAX_1 12
|
||||
#define NMAX_2 12
|
||||
|
||||
@@ -78,6 +78,6 @@ int16_t mag_calc(int16_t igdgc, double flat, double flon, double elev, int16_t n
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* WMM2015_H */
|
||||
#endif /* WMM2020_H */
|
||||
/** @}*/
|
||||
/** @}*/
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Sergey Krukowski <softsr@yahoo.de>
|
||||
* Copyright (C) 2015 OpenUAS <info@openuas.org>
|
||||
* Copyright (C) 2020 OpenUAS <info@openuas.org>
|
||||
*
|
||||
* This file is part of paparazzi.
|
||||
*
|
||||
@@ -23,11 +23,11 @@
|
||||
/**
|
||||
* @file modules/geo_mag/geo_mag.c
|
||||
* @brief Calculation of the Geomagnetic field vector from current location.
|
||||
* This module is based on the WMM2015 model (http://www.ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml).
|
||||
* This module is based on the world magnetic model from (http://www.ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml).
|
||||
*/
|
||||
|
||||
#include "modules/geo_mag/geo_mag.h"
|
||||
#include "math/pprz_geodetic_wmm2015.h"
|
||||
#include "math/pprz_geodetic_wmm2020.h"
|
||||
#include "math/pprz_algebra_double.h"
|
||||
#include "subsystems/gps.h"
|
||||
#include "subsystems/abi.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Sergey Krukowski <softsr@yahoo.de>
|
||||
* Copyright (C) 2015 OpenUAS <info@openuas.org>
|
||||
* Copyright (C) 2020 OpenUAS <info@openuas.org>
|
||||
*
|
||||
* This file is part of paparazzi.
|
||||
*
|
||||
@@ -23,7 +23,7 @@
|
||||
/**
|
||||
* @file modules/geo_mag/geo_mag.h
|
||||
* @brief Calculation of the Geomagnetic field vector from current location.
|
||||
* This module is based on the WMM2015 model (http://www.ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml).
|
||||
* This module is based on the world magnetic model from (http://www.ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml).
|
||||
*/
|
||||
|
||||
#ifndef GEO_MAG_H
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
#include "math/pprz_algebra.h"
|
||||
#include "math/pprz_algebra_float.h"
|
||||
|
||||
#include "math/pprz_geodetic_wmm2015.h"
|
||||
#include "math/pprz_geodetic_wmm2020.h"
|
||||
|
||||
#include "generated/airframe.h"
|
||||
#include "generated/flight_plan.h"
|
||||
|
||||
Reference in New Issue
Block a user