Hummingbird Flight Software
Flight software for the Hummingbird FCU quadcopter flight controller. Designed to run on the Teensy 4.1. Developed with VSCode+PlatformIO.
constants.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // FLIGHT CONTROLLER GLOBAL CONSTANTS
3 //
4 // Code By: Michael Wrona | B.S. Aerospace Engineering
5 // Created:
6 // ----------------------------------------------------------------------------
15 #pragma once
16 
17 
18 #include "hummingbird_config.h"
19 
20 
21 // ----------------------------------------------------------------------------
22 // Trigonometric constants
23 // ----------------------------------------------------------------------------
24 constexpr float CONSTS_PIDIV4 = 0.7853981634f; // PI / 4
25 constexpr float CONSTS_PIDIV2 = 1.5707963268f; // PI / 2
26 constexpr float CONSTS_PI = 3.14159265359f; // PI
27 constexpr float CONSTS_2PI = 6.28318530718f; // 2 * PI
28 
29 
30 // ----------------------------------------------------------------------------
31 // WGS84 Standard (Earth) Ellipsoid Parameters
32 // Parameters obtained from: Principles of GNSS, Inertial, and Multisensor
33 // Integrated Navigation Systems by Paul D. Groves (2008).
34 // ----------------------------------------------------------------------------
35 constexpr float CONSTS_GRAV = 9.80665f; // WGS84 gravitational acceleration [m/s/s]
36 constexpr float CONSTS_WGS84_A = 6378137.0f; // WGS84 earth semi-major axis [m]
37 constexpr float CONSTS_WGS84_B = 6356752.3142f; // WGS84 earth semi-minor axis [m]
38 constexpr float CONSTS_WGS84_E = 0.0818191908425f; // WGS84 earth eccentricity
39 constexpr float CONSTS_WGS84_INVF = 298.257223563f; // Inverse of WGS84 flattening, 1/f
40 // constexpr float CONSTS_WGS84_GRAVPARAM = 3.986004418e+14F; // WGS84 gearth ravity parameter (mu) [m^3/s^2]
41 
42 
43 // ----------------------------------------------------------------------------
44 // Environment constants
45 // ----------------------------------------------------------------------------
46 constexpr float CONSTS_ENV_AIRDENS = 1.225f; // Standard sea-level atmospheric air density [kg/m^3]
47 constexpr float CONSTS_ENV_TLAPSERATE = 0.0065f; // Standard atmospheric temperature lapse rate [C/m]
48 constexpr float CONSTS_ENV_SLPRES = 101325.0f; // Standard atmospheric air pressure at sea-level [Pa]
49 constexpr float CONSTS_ENV_SLTEMP = 288.15f; // Standard atmospheric air temperature at sea-level [K]
50 constexpr float CONSTS_ENV_R = 287.26f; // Gas constant for air [J/kg.K]
51 
52 
53 // ----------------------------------------------------------------------------
54 // Geomagnetig constants
55 // ----------------------------------------------------------------------------
56 constexpr float CONSTS_ENV_MAGDECL = -0.000602662f; // Local magnetic field declination [rad] (in degrees: -0.03453deg)
57 constexpr float CONSTS_ENV_MAGINCL = 1.24428537f; // Local magnetic field inclnation [rad] (in degrees: 71.2923deg)
constexpr float CONSTS_PIDIV2
Definition: constants.h:25
constexpr float CONSTS_ENV_R
Definition: constants.h:50
constexpr float CONSTS_WGS84_INVF
Definition: constants.h:39
constexpr float CONSTS_WGS84_B
Definition: constants.h:37
constexpr float CONSTS_ENV_TLAPSERATE
Definition: constants.h:47
constexpr float CONSTS_PIDIV4
Global constants such as grav.
Definition: constants.h:24
constexpr float CONSTS_WGS84_E
Definition: constants.h:38
constexpr float CONSTS_2PI
Definition: constants.h:27
constexpr float CONSTS_PI
Definition: constants.h:26
constexpr float CONSTS_ENV_MAGDECL
Definition: constants.h:56
constexpr float CONSTS_ENV_AIRDENS
Definition: constants.h:46
constexpr float CONSTS_GRAV
Definition: constants.h:35
constexpr float CONSTS_ENV_SLTEMP
Definition: constants.h:49
constexpr float CONSTS_WGS84_A
Definition: constants.h:36
constexpr float CONSTS_ENV_SLPRES
Definition: constants.h:48
constexpr float CONSTS_ENV_MAGINCL
Definition: constants.h:57