0.4.1
Loading...
Searching...
No Matches
Constants.hpp
Go to the documentation of this file.
1// This file is part of INSTINCT, the INS Toolkit for Integrated
2// Navigation Concepts and Training by the Institute of Navigation of
3// the University of Stuttgart, Germany.
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9/// @file Constants.hpp
10/// @brief Holds all Constants
11/// @author T. Topp (topp@ins.uni-stuttgart.de)
12/// @date 2020-04-21
13
14#pragma once
15
16#include <cmath>
17#include "util/Eigen.hpp"
18#include <gcem.hpp>
19
20namespace NAV
21{
22
23/// @brief Constants
25{
26 public:
27 /// @brief Default Constructor
28 InsConst() = delete;
29
30 /// @brief Conversion factor between latitude and longitude in [rad] to [pseudometre]
31 static constexpr double pseudometre = 6370000;
32
33 /// Speed of light [m/s]
34 static constexpr double C = 299792458.0;
35
36 /// Speed of light in air: CGPM defined speed of light divided by approximate refractory index of dry air over sea level 1.0003 [m/s]
37 static constexpr double C_AIR = 299702547.0;
38
39 /// Standard gravity in [m / s^2]
40 static constexpr double G_NORM = 9.80665;
41
42 /// @brief World Geodetic System 1984
43 class WGS84
44 {
45 public:
46 /// @brief Default Constructor
47 WGS84() = delete;
48
49 /// Semi-major axis = equatorial radius
50 static constexpr double a = 6378137.0;
51 /// Flattening f = (a-b)/a
52 static constexpr double f = 1.0 / 298.257223563;
53 /// Semi-minor axis = polar radius
54 static constexpr double b = a - f * a;
55 /// Square of the first eccentricity of the ellipsoid
56 static constexpr double e_squared = 2 * f - f * f;
57 /// Gravitational constant (mass of Earth’s atmosphere included) [m³/s²]
58 static constexpr double MU = 3.986004418e14;
59 /// Dynamic form factor, derived [-]
60 static constexpr double J2 = 1.081874e-3;
61 /// Earth rotation rate in [rads/s]
62 static constexpr double omega_ie = 7.2921151467e-05;
63 };
64
65 /// @brief Geodetic Reference System 1980
66 class GRS80
67 {
68 public:
69 /// @brief Default Constructor
70 GRS80() = delete;
71
72 /// Semi-major axis = equatorial radius
73 static constexpr double a = 6378137;
74 /// Flattening f = (a-b)/a
75 static constexpr double f = 1.0 / 298.257222101;
76 /// Semi-minor axis = polar radius
77 static constexpr double b = a - f * a;
78 /// Square of the first eccentricity of the ellipsoid
79 static constexpr double e_squared = 2 * f - f * f;
80 };
81
82 /// @brief Parametry Zemli 1990 goda (see \cite PZ-90.11)
83 class PZ90
84 {
85 public:
86 /// @brief Default Constructor
87 PZ90() = delete;
88
89 /// Semi-major axis = equatorial radius
90 static constexpr double a = 6378136;
91 /// Flattening f = (a-b)/a
92 static constexpr double f = 1.0 / 298.25784;
93 /// Semi-minor axis = polar radius
94 static constexpr double b = a - f * a;
95 /// Square of the first eccentricity of the ellipsoid
96 static constexpr double e_squared = 2 * f - f * f;
97 /// Gravitational constant (mass of Earth’s atmosphere included) [m³/s²]
98 static constexpr double MU = 3.986004418e14;
99 /// Earth rotation rate in [rads/s]
100 static constexpr double omega_ie = 7.292115e-05;
101
102 /// Second degree zonal coefficient of normal potential [-]
103 static constexpr double J2 = 1.08262575e-3;
104 };
105
106 /// @brief GPS related constants
107 class GPS
108 {
109 public:
110 /// @brief Default Constructor
111 GPS() = delete;
112
113 /// Gravitational constant GPS [m³/s²]. See \cite IS-GPS-200M IS-GPS-200M p. 106
114 static constexpr double MU = 3.986005e+14;
115 /// Earth angular velocity GPS [rad/s]. See \cite IS-GPS-200M IS-GPS-200M p. 106
116 static constexpr double omega_ie = WGS84::omega_ie;
117 /// Relativistic constant F for GPS clock corrections [s/√m] (-2*√µ/c²)
118 static constexpr double F = -2.0 * gcem::sqrt(MU) / (C * C);
119 /// Earth Equatorial Radius [m]
120 static constexpr double R_E = WGS84::a;
121 /// Oblate Earth Gravity Coefficient [-]
122 static constexpr double J2 = 1.0826262e-3;
123 };
124
125 /// @brief GLONASS related constants (see \cite GLO-ICD-5.1 GLONASS ICD 5.1 Table 3.2)
126 class GLO
127 {
128 public:
129 /// @brief Default Constructor
130 GLO() = delete;
131
132 /// Semi-major axis = equatorial radius
133 static constexpr double a = PZ90::a;
134 /// Gravitational constant GLONASS [m³/s²]
135 static constexpr double MU = PZ90::MU;
136 /// Earth angular velocity GLONASS [rad/s]
137 static constexpr double omega_ie = 7.2921151467e-05;
138 /// Second degree zonal coefficient of normal potential [-]
139 static constexpr double J2 = PZ90::J2;
140 /// Normalized harmonic of the normal geopotential [-]
141 static constexpr double C20_bar = 1.0 / gcem::sqrt(5.0) * J2;
142 /// Second zonal coefficient of spherical harmonic expansion [-]
143 static constexpr double C20 = -J2;
144 };
145
146 /// @brief GALILEO related constants
147 class GAL
148 {
149 public:
150 /// @brief Default Constructor
151 GAL() = delete;
152
153 /// Earth angular velocity GALILEO [rad/s]
154 static constexpr double omega_ie = WGS84::omega_ie;
155 /// Earth gravitational constant GALILEO [m³/s²]
156 static constexpr double MU = 3.986004418e+14;
157 /// Relativistic constant F for clock corrections [s/√m] (-2*√µ/c²)
158 static constexpr double F = -2.0 * gcem::sqrt(MU) / (C * C);
159 };
160
161 /// @brief BeiDou related constants (China Geodetic Coordinate System 2000 (CGCS2000))
162 class BDS
163 {
164 public:
165 /// @brief Default Constructor
166 BDS() = delete;
167
168 /// Semi-major axis = equatorial radius
169 static constexpr double a = 6378137.0;
170 /// Flattening f = (a-b)/a
171 static constexpr double f = 1.0 / 298.257222101;
172 /// Semi-minor axis = polar radius
173 static constexpr double b = a - f * a;
174 /// Square of the first eccentricity of the ellipsoid
175 static constexpr double e_squared = 2 * f - f * f;
176 /// Earth angular velocity BeiDou (CGCS2000) [rad/s]
177 static constexpr double omega_ie = 7.2921150e-5;
178 /// Earth gravitational constant BeiDou (CGCS2000) [m³/s²]
179 static constexpr double MU = 3.986004418e+14;
180 /// Relativistic constant F for clock corrections [s/√m] (-2*√µ/c²)
181 static constexpr double F = -2.0 * gcem::sqrt(MU) / (C * C);
182 };
183
184 /// @brief QZSS related constants
185 class QZSS
186 {
187 public:
188 /// @brief Default Constructor
189 QZSS() = delete;
190
191 /// Earth angular velocity QZSS [rad/s]
192 static constexpr double omega_ie = WGS84::omega_ie;
193 /// Earth gravitational constant QZSS [m³/s²]
194 static constexpr double MU = 3.986005e+14;
195 /// Relativistic constant F for clock corrections [s/√m] (-2*√µ/c²)
196 static constexpr double F = -2.0 * gcem::sqrt(MU) / (C * C);
197 };
198
199 /// @brief IRNSS related constants
200 class IRNSS
201 {
202 public:
203 /// @brief Default Constructor
204 IRNSS() = delete;
205
206 /// Earth angular velocity IRNSS [rad/s]
207 static constexpr double omega_ie = WGS84::omega_ie;
208 /// Earth gravitational constant IRNSS [m³/s²]
209 static constexpr double MU = 3.986005e+14;
210 /// Relativistic constant F for clock corrections [s/√m] (-2*√µ/c²)
211 static constexpr double F = -2.0 * gcem::sqrt(MU) / (C * C);
212 };
213
214 /// @brief Nominal mean angular velocity of the Earth in [rad/s]
215 /// @note D. D. McCarthy, G. Petit (Hrsg.): IERS Conventions (2003) (IERS Technical Note No. 32), Kap. 1: General Definitions and Numerical Standards.
216 /// ftp://tai.bipm.org/iers/conv2003/chapter1/tn32_c1.pdf
217 static constexpr double omega_ie = WGS84::omega_ie;
218 /// @brief Nominal mean angular velocity of the Earth in [rad/s]. Value implemented by the Skydel GNSS simulator (for compatibility with Skydel's IMU plugin)
219 static constexpr double omega_ie_Skydel = 7.2921155e-5; // FIXME: Skydel (for compatibility with Skydel's IMU plugin)
220
221 /// ω_ie_e = ω_ie_i Nominal mean angular velocity of the Earth in [rad/s], in earth coordinates
222 const static inline Eigen::Vector3<double> e_omega_ie{ 0.0, 0.0, omega_ie };
223
224 /// Avogadro’s number. Number of units in one mole of any substance [1/mol].
225 /// Units may be electrons, atoms, ions, or molecules, depending on substance or reaction
226 static constexpr double N_A = 6.02214076e23;
227 /// Boltzmann constant [J/K]
228 static constexpr double k_B = 1.380649e-23;
229 /// Universal gas constant in [J/K/mol]
230 static constexpr double Rg = N_A * k_B;
231
232 /// Molar mass of dry air in [kg/mol]
233 static constexpr double dMtr = 28.965e-3;
234};
235
236} // namespace NAV
Vector space operations.
static constexpr double F
Relativistic constant F for clock corrections [s/√m] (-2*√µ/c²)
static constexpr double b
Semi-minor axis = polar radius.
BDS()=delete
Default Constructor.
static constexpr double omega_ie
Earth angular velocity BeiDou (CGCS2000) [rad/s].
static constexpr double f
Flattening f = (a-b)/a.
static constexpr double a
Semi-major axis = equatorial radius.
static constexpr double MU
Earth gravitational constant BeiDou (CGCS2000) [m³/s²].
static constexpr double e_squared
Square of the first eccentricity of the ellipsoid.
static constexpr double MU
Earth gravitational constant GALILEO [m³/s²].
static constexpr double omega_ie
Earth angular velocity GALILEO [rad/s].
static constexpr double F
Relativistic constant F for clock corrections [s/√m] (-2*√µ/c²)
GAL()=delete
Default Constructor.
static constexpr double C20_bar
Normalized harmonic of the normal geopotential [-].
GLO()=delete
Default Constructor.
static constexpr double J2
Second degree zonal coefficient of normal potential [-].
static constexpr double MU
Gravitational constant GLONASS [m³/s²].
static constexpr double C20
Second zonal coefficient of spherical harmonic expansion [-].
static constexpr double a
Semi-major axis = equatorial radius.
static constexpr double omega_ie
Earth angular velocity GLONASS [rad/s].
static constexpr double R_E
Earth Equatorial Radius [m].
GPS()=delete
Default Constructor.
static constexpr double J2
Oblate Earth Gravity Coefficient [-].
static constexpr double F
Relativistic constant F for GPS clock corrections [s/√m] (-2*√µ/c²)
static constexpr double MU
Gravitational constant GPS [m³/s²]. See is-gps-200m IS-GPS-200M p. 106.
static constexpr double omega_ie
Earth angular velocity GPS [rad/s]. See is-gps-200m IS-GPS-200M p. 106.
static constexpr double a
Semi-major axis = equatorial radius.
Definition Constants.hpp:73
static constexpr double f
Flattening f = (a-b)/a.
Definition Constants.hpp:75
static constexpr double b
Semi-minor axis = polar radius.
Definition Constants.hpp:77
static constexpr double e_squared
Square of the first eccentricity of the ellipsoid.
Definition Constants.hpp:79
GRS80()=delete
Default Constructor.
static constexpr double MU
Earth gravitational constant IRNSS [m³/s²].
IRNSS()=delete
Default Constructor.
static constexpr double F
Relativistic constant F for clock corrections [s/√m] (-2*√µ/c²)
static constexpr double omega_ie
Earth angular velocity IRNSS [rad/s].
static constexpr double omega_ie
Earth rotation rate in [rads/s].
static constexpr double J2
Second degree zonal coefficient of normal potential [-].
static constexpr double f
Flattening f = (a-b)/a.
Definition Constants.hpp:92
static constexpr double e_squared
Square of the first eccentricity of the ellipsoid.
Definition Constants.hpp:96
static constexpr double b
Semi-minor axis = polar radius.
Definition Constants.hpp:94
static constexpr double a
Semi-major axis = equatorial radius.
Definition Constants.hpp:90
static constexpr double MU
Gravitational constant (mass of Earth’s atmosphere included) [m³/s²].
Definition Constants.hpp:98
PZ90()=delete
Default Constructor.
QZSS()=delete
Default Constructor.
static constexpr double F
Relativistic constant F for clock corrections [s/√m] (-2*√µ/c²)
static constexpr double MU
Earth gravitational constant QZSS [m³/s²].
static constexpr double omega_ie
Earth angular velocity QZSS [rad/s].
static constexpr double f
Flattening f = (a-b)/a.
Definition Constants.hpp:52
static constexpr double J2
Dynamic form factor, derived [-].
Definition Constants.hpp:60
static constexpr double b
Semi-minor axis = polar radius.
Definition Constants.hpp:54
static constexpr double omega_ie
Earth rotation rate in [rads/s].
Definition Constants.hpp:62
static constexpr double MU
Gravitational constant (mass of Earth’s atmosphere included) [m³/s²].
Definition Constants.hpp:58
static constexpr double a
Semi-major axis = equatorial radius.
Definition Constants.hpp:50
WGS84()=delete
Default Constructor.
static constexpr double e_squared
Square of the first eccentricity of the ellipsoid.
Definition Constants.hpp:56
static constexpr double C
Speed of light [m/s].
Definition Constants.hpp:34
static constexpr double omega_ie
Nominal mean angular velocity of the Earth in [rad/s].
static constexpr double k_B
Boltzmann constant [J/K].
static constexpr double Rg
Universal gas constant in [J/K/mol].
static constexpr double N_A
static constexpr double dMtr
Molar mass of dry air in [kg/mol].
static constexpr double pseudometre
Conversion factor between latitude and longitude in [rad] to [pseudometre].
Definition Constants.hpp:31
static constexpr double C_AIR
Speed of light in air: CGPM defined speed of light divided by approximate refractory index of dry air...
Definition Constants.hpp:37
static constexpr double G_NORM
Standard gravity in [m / s^2].
Definition Constants.hpp:40
static constexpr double omega_ie_Skydel
Nominal mean angular velocity of the Earth in [rad/s]. Value implemented by the Skydel GNSS simulator...
InsConst()=delete
Default Constructor.
static const Eigen::Vector3< double > e_omega_ie
ω_ie_e = ω_ie_i Nominal mean angular velocity of the Earth in [rad/s], in earth coordinates