PX4 Firmware
PX4 Autopilot Software http://px4.io
|
Calculation / lookup table for Earth's magnetic field declination (deg), inclination (deg) and strength (mTesla). More...
Go to the source code of this file.
Functions | |
static unsigned | get_lookup_table_index (float *val, float min, float max) |
static float | get_table_data (float lat, float lon, const int8_t table[13][37]) |
float | get_mag_declination (float lat, float lon) |
float | get_mag_inclination (float lat, float lon) |
float | get_mag_strength (float lat, float lon) |
Variables | |
static constexpr float | SAMPLING_RES = 10.0f |
set this always to the sampling in degrees for the table below More... | |
static constexpr float | SAMPLING_MIN_LAT = -60.0f |
static constexpr float | SAMPLING_MAX_LAT = 60.0f |
static constexpr float | SAMPLING_MIN_LON = -180.0f |
static constexpr float | SAMPLING_MAX_LON = 180.0f |
static constexpr const int8_t | declination_table [13][37] |
static constexpr const int8_t | inclination_table [13][37] |
static constexpr const int8_t | strength_table [13][37] |
Calculation / lookup table for Earth's magnetic field declination (deg), inclination (deg) and strength (mTesla).
Data generated by https://www.ngdc.noaa.gov/geomag-web/#igrfgrid IGRF calculator on 22 Jan 2018
XXX Lookup table currently too coarse in resolution (only full degrees) and lat/lon res - needs extension medium term.
Definition in file geo_mag_declination.cpp.
|
static |
Definition at line 116 of file geo_mag_declination.cpp.
References math::constrain(), math::min(), and SAMPLING_RES.
Referenced by get_table_data().
float get_mag_declination | ( | float | lat, |
float | lon | ||
) |
Definition at line 165 of file geo_mag_declination.cpp.
References declination_table, and get_table_data().
Referenced by AutoDeclinationTest::autodeclination_check(), Ekf::collect_gps(), and AttitudeEstimatorQ::Run().
float get_mag_inclination | ( | float | lat, |
float | lon | ||
) |
Definition at line 170 of file geo_mag_declination.cpp.
References get_table_data(), and inclination_table.
Referenced by Ekf::collect_gps().
float get_mag_strength | ( | float | lat, |
float | lon | ||
) |
Definition at line 175 of file geo_mag_declination.cpp.
References get_table_data(), and strength_table.
Referenced by Ekf::collect_gps().
|
static |
Definition at line 130 of file geo_mag_declination.cpp.
References math::constrain(), f(), get_lookup_table_index(), SAMPLING_MAX_LAT, SAMPLING_MAX_LON, SAMPLING_MIN_LAT, SAMPLING_MIN_LON, and SAMPLING_RES.
Referenced by get_mag_declination(), get_mag_inclination(), and get_mag_strength().
|
static |
Definition at line 62 of file geo_mag_declination.cpp.
Referenced by get_mag_declination().
|
static |
Definition at line 80 of file geo_mag_declination.cpp.
Referenced by get_mag_inclination().
|
static |
Definition at line 57 of file geo_mag_declination.cpp.
Referenced by get_table_data().
|
static |
Definition at line 59 of file geo_mag_declination.cpp.
Referenced by get_table_data().
|
static |
Definition at line 56 of file geo_mag_declination.cpp.
Referenced by get_table_data().
|
static |
Definition at line 58 of file geo_mag_declination.cpp.
Referenced by get_table_data().
|
static |
set this always to the sampling in degrees for the table below
Definition at line 55 of file geo_mag_declination.cpp.
Referenced by get_lookup_table_index(), and get_table_data().
|
static |
Definition at line 98 of file geo_mag_declination.cpp.
Referenced by get_mag_strength().