Skyward boardcore
Loading...
Searching...
No Matches
Constants.h
Go to the documentation of this file.
1/* Copyright (c) 2015-2023 Skyward Experimental Rocketry
2 * Authors: Alain Carlucci, Emilio Corigliano
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22
23#pragma once
24
25namespace Boardcore
26{
27
28namespace Constants
29{
30
31static constexpr float PI = 3.14159265f; // [rad]
32static constexpr float DEGREES_TO_RADIANS = PI / 180.0f;
33static constexpr float RADIANS_TO_DEGREES = 180.0f / PI;
34static constexpr float PSI_TO_PASCAL = 6894.76f; // [Pa / psi]
35
36static constexpr float g = 9.80665f; // [m^s^2]
37
38static constexpr float TROPOSPHERE_HEIGHT = 11000.f; // Troposphere height [m]
39static constexpr float a = 0.0065f; // Troposphere temperature gradient [deg/m]
40static constexpr float R = 287.05f; // Air gas constant [J/Kg/K]
41static constexpr float n = g / (R * a);
42static constexpr float nInv = (R * a) / g;
43
44static constexpr float CO = 340.3; // Sound speed at ground altitude [m/s]
45static constexpr float ALPHA = -3.871e-3; // Sound speed gradient [1/s]
46static constexpr float RHO_0 = 1.225; // Air density at sea level [kg/m^3]
47static constexpr float GAMMA_AIR = 1.4f; // Adiabatic constant for air [1]
48static constexpr float Hn = 10400.0; // Scale height [m]
49
50static constexpr float MSL_PRESSURE = 101325.0f; // [Pa]
51static constexpr float MSL_TEMPERATURE = 288.15f; // [Kelvin]
52
53static constexpr float gpsLatConst =
54 111132.95225;
55static constexpr float gpsLonConst =
56 111412.87733;
57
58static constexpr float B21_LATITUDE = 45.501141;
59static constexpr float B21_LONGITUDE = 9.156281;
60} // namespace Constants
61
62} // namespace Boardcore
This file includes all the types the logdecoder script will decode.