Macros | Functions | Variables
geo_mag_declination.cpp File Reference
#include <cstdint>
#include <cmath>
#include "rotors_gazebo_plugins/geo_mag_declination.h"
Include dependency graph for geo_mag_declination.cpp:

Go to the source code of this file.

Macros

#define SAMPLING_MAX_LAT   60.0f
 
#define SAMPLING_MAX_LON   180.0f
 
#define SAMPLING_MIN_LAT   -60.0f
 
#define SAMPLING_MIN_LON   -180.0f
 
#define SAMPLING_RES   10.0f
 

Functions

static float get_lookup_table_val (unsigned lat, unsigned lon)
 
float get_mag_declination (float lat_rad, float lon_rad)
 

Variables

static const int8_t declination_table [13][37]
 

Macro Definition Documentation

◆ SAMPLING_MAX_LAT

#define SAMPLING_MAX_LAT   60.0f

Definition at line 53 of file geo_mag_declination.cpp.

◆ SAMPLING_MAX_LON

#define SAMPLING_MAX_LON   180.0f

Definition at line 55 of file geo_mag_declination.cpp.

◆ SAMPLING_MIN_LAT

#define SAMPLING_MIN_LAT   -60.0f

Definition at line 52 of file geo_mag_declination.cpp.

◆ SAMPLING_MIN_LON

#define SAMPLING_MIN_LON   -180.0f

Definition at line 54 of file geo_mag_declination.cpp.

◆ SAMPLING_RES

#define SAMPLING_RES   10.0f

set this always to the sampling in degrees for the table below

Definition at line 51 of file geo_mag_declination.cpp.

Function Documentation

◆ get_lookup_table_val()

float get_lookup_table_val ( unsigned  lat,
unsigned  lon 
)
static

Definition at line 135 of file geo_mag_declination.cpp.

◆ get_mag_declination()

float get_mag_declination ( float  lat_rad,
float  lon_rad 
)

Definition at line 76 of file geo_mag_declination.cpp.

Variable Documentation

◆ declination_table

const int8_t declination_table[13][37]
static
Initial value:
=
{
{ 46, 45, 44, 42, 41, 40, 38, 36, 33, 28, 23, 16, 10, 4, -1, -5, -9, -14, -19, -26, -33, -40, -48, -55, -61, -66, -71, -74, -75, -72, -61, -25, 22, 40, 45, 47, 46 },
{ 30, 30, 30, 30, 29, 29, 29, 29, 27, 24, 18, 11, 3, -3, -9, -12, -15, -17, -21, -26, -32, -39, -45, -51, -55, -57, -56, -53, -44, -31, -14, 0, 13, 21, 26, 29, 30 },
{ 21, 22, 22, 22, 22, 22, 22, 22, 21, 18, 13, 5, -3, -11, -17, -20, -21, -22, -23, -25, -29, -35, -40, -44, -45, -44, -40, -32, -22, -12, -3, 3, 9, 14, 18, 20, 21 },
{ 16, 17, 17, 17, 17, 17, 16, 16, 16, 13, 8, 0, -9, -16, -21, -24, -25, -25, -23, -20, -21, -24, -28, -31, -31, -29, -24, -17, -9, -3, 0, 4, 7, 10, 13, 15, 16 },
{ 12, 13, 13, 13, 13, 13, 12, 12, 11, 9, 3, -4, -12, -19, -23, -24, -24, -22, -17, -12, -9, -10, -13, -17, -18, -16, -13, -8, -3, 0, 1, 3, 6, 8, 10, 12, 12 },
{ 10, 10, 10, 10, 10, 10, 10, 9, 9, 6, 0, -6, -14, -20, -22, -22, -19, -15, -10, -6, -2, -2, -4, -7, -8, -8, -7, -4, 0, 1, 1, 2, 4, 6, 8, 10, 10 },
{ 9, 9, 9, 9, 9, 9, 8, 8, 7, 4, -1, -8, -15, -19, -20, -18, -14, -9, -5, -2, 0, 1, 0, -2, -3, -4, -3, -2, 0, 0, 0, 1, 3, 5, 7, 8, 9 },
{ 8, 8, 8, 9, 9, 9, 8, 8, 6, 2, -3, -9, -15, -18, -17, -14, -10, -6, -2, 0, 1, 2, 2, 0, -1, -1, -2, -1, 0, 0, 0, 0, 1, 3, 5, 7, 8 },
{ 8, 9, 9, 10, 10, 10, 10, 8, 5, 0, -5, -11, -15, -16, -15, -12, -8, -4, -1, 0, 2, 3, 2, 1, 0, 0, 0, 0, 0, -1, -2, -2, -1, 0, 3, 6, 8 },
{ 6, 9, 10, 11, 12, 12, 11, 9, 5, 0, -7, -12, -15, -15, -13, -10, -7, -3, 0, 1, 2, 3, 3, 3, 2, 1, 0, 0, -1, -3, -4, -5, -5, -2, 0, 3, 6 },
{ 5, 8, 11, 13, 15, 15, 14, 11, 5, -1, -9, -14, -17, -16, -14, -11, -7, -3, 0, 1, 3, 4, 5, 5, 5, 4, 3, 1, -1, -4, -7, -8, -8, -6, -2, 1, 5 },
{ 4, 8, 12, 15, 17, 18, 16, 12, 5, -3, -12, -18, -20, -19, -16, -13, -8, -4, -1, 1, 4, 6, 8, 9, 9, 9, 7, 3, -1, -6, -10, -12, -11, -9, -5, 0, 4 },
{ 3, 9, 14, 17, 20, 21, 19, 14, 4, -8, -19, -25, -26, -25, -21, -17, -12, -7, -2, 1, 5, 9, 13, 15, 16, 16, 13, 7, 0, -7, -12, -15, -14, -11, -6, -1, 3 },
}

Definition at line 57 of file geo_mag_declination.cpp.



rotors_gazebo_plugins
Author(s): Fadri Furrer, Michael Burri, Mina Kamel, Janosch Nikolic, Markus Achtelik
autogenerated on Mon Feb 28 2022 23:39:04