0.3.0
Loading...
Searching...
No Matches
Keys.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
13
14#pragma once
15
16#include <array>
17#include <cmath>
18#include <iostream>
19#include <fmt/format.h>
20
21namespace NAV::Keys
22{
23
52
54template<typename StateKeyType>
55constexpr std::array<StateKeyType, 3> AccelBias = { Keys::AccelBiasX, Keys::AccelBiasY, Keys::AccelBiasZ };
57template<typename StateKeyType>
58constexpr std::array<StateKeyType, 3> GyroBias = { Keys::GyroBiasX, Keys::GyroBiasY, Keys::GyroBiasZ };
59
61template<typename StateKeyType>
64template<typename StateKeyType>
66
68template<typename StateKeyType>
71template<typename StateKeyType>
73
74} // namespace NAV::Keys
75
80std::ostream& operator<<(std::ostream& os, const NAV::Keys::InertialNavigationKey& obj);
81
82#ifndef DOXYGEN_IGNORE
83
85template<>
86struct fmt::formatter<NAV::Keys::InertialNavigationKey> : fmt::formatter<const char*>
87{
92 template<typename FormatContext>
93 auto format(const NAV::Keys::InertialNavigationKey& state, FormatContext& ctx) const
94 {
95 using namespace NAV::Keys; // NOLINT(google-build-using-namespace)
96
97 switch (state)
98 {
99 case AccelBiasX:
100 return fmt::formatter<const char*>::format("AccelBiasX", ctx);
101 case AccelBiasY:
102 return fmt::formatter<const char*>::format("AccelBiasY", ctx);
103 case AccelBiasZ:
104 return fmt::formatter<const char*>::format("AccelBiasZ", ctx);
105 case GyroBiasX:
106 return fmt::formatter<const char*>::format("GyroBiasX", ctx);
107 case GyroBiasY:
108 return fmt::formatter<const char*>::format("GyroBiasY", ctx);
109 case GyroBiasZ:
110 return fmt::formatter<const char*>::format("GyroBiasZ", ctx);
112 return fmt::formatter<const char*>::format("AccelScaleFactorX", ctx);
114 return fmt::formatter<const char*>::format("AccelScaleFactorY", ctx);
116 return fmt::formatter<const char*>::format("AccelScaleFactorZ", ctx);
117 case GyroScaleFactorX:
118 return fmt::formatter<const char*>::format("GyroScaleFactorX", ctx);
119 case GyroScaleFactorY:
120 return fmt::formatter<const char*>::format("GyroScaleFactorY", ctx);
121 case GyroScaleFactorZ:
122 return fmt::formatter<const char*>::format("GyroScaleFactorZ", ctx);
124 return fmt::formatter<const char*>::format("AccelMisalignmentQ1", ctx);
126 return fmt::formatter<const char*>::format("AccelMisalignmentQ2", ctx);
128 return fmt::formatter<const char*>::format("AccelMisalignmentQ3", ctx);
130 return fmt::formatter<const char*>::format("AccelMisalignmentQ0", ctx);
132 return fmt::formatter<const char*>::format("GyroMisalignmentQ1", ctx);
134 return fmt::formatter<const char*>::format("GyroMisalignmentQ2", ctx);
136 return fmt::formatter<const char*>::format("GyroMisalignmentQ3", ctx);
138 return fmt::formatter<const char*>::format("GyroMisalignmentQ0", ctx);
140 return fmt::formatter<const char*>::format("InertialNavigationKey_COUNT", ctx);
141 }
142
143 return fmt::formatter<const char*>::format("ERROR", ctx);
144 }
145};
146
147#endif
std::ostream & operator<<(std::ostream &os, const NAV::SPP::Meas::Psr &obj)
Stream insertion operator overload.
constexpr std::array< StateKeyType, 3 > GyroBias
All gyroscope bias keys.
Definition Keys.hpp:58
constexpr std::array< StateKeyType, 3 > AccelScaleFactor
All accelerometer scale factor keys.
Definition Keys.hpp:62
constexpr std::array< StateKeyType, 4 > AccelMisalignment
All accelerometer misalignment quaternion keys.
Definition Keys.hpp:69
constexpr std::array< StateKeyType, 4 > GyroMisalignment
All gyroscope misalignment quaternion keys.
Definition Keys.hpp:72
constexpr std::array< StateKeyType, 3 > GyroScaleFactor
All gyroscope scale factor keys.
Definition Keys.hpp:65
constexpr std::array< StateKeyType, 3 > AccelBias
All accelerometer bias keys.
Definition Keys.hpp:55
InertialNavigationKey
Keys used in the model.
Definition Keys.hpp:26
@ AccelMisalignmentQ0
Accelerometer misalignment quaternion w: Real (scalar) part of the Quaternion.
Definition Keys.hpp:44
@ AccelScaleFactorY
Accelerometer scale factor Y [-].
Definition Keys.hpp:35
@ AccelBiasZ
Accelerometer bias Z [m/s^2].
Definition Keys.hpp:29
@ GyroScaleFactorX
Gyroscope scale factor X [-].
Definition Keys.hpp:37
@ AccelBiasY
Accelerometer bias Y [m/s^2].
Definition Keys.hpp:28
@ AccelMisalignmentQ3
Accelerometer misalignment quaternion z: Coefficient of k.
Definition Keys.hpp:43
@ AccelBiasX
Accelerometer bias X [m/s^2].
Definition Keys.hpp:27
@ GyroBiasX
Gyroscope bias X [rad/s].
Definition Keys.hpp:30
@ AccelScaleFactorX
Accelerometer scale factor X [-].
Definition Keys.hpp:34
@ GyroMisalignmentQ0
Gyroscope misalignment quaternion w: Real (scalar) part of the Quaternion.
Definition Keys.hpp:48
@ AccelScaleFactorZ
Accelerometer scale factor Z [-].
Definition Keys.hpp:36
@ GyroBiasZ
Gyroscope bias Z [rad/s].
Definition Keys.hpp:32
@ GyroMisalignmentQ2
Gyroscope misalignment quaternion y: Coefficient of j.
Definition Keys.hpp:46
@ GyroMisalignmentQ3
Gyroscope misalignment quaternion z: Coefficient of k.
Definition Keys.hpp:47
@ GyroScaleFactorY
Gyroscope scale factor Y [-].
Definition Keys.hpp:38
@ GyroScaleFactorZ
Gyroscope scale factor Z [-].
Definition Keys.hpp:39
@ InertialNavigationKey_COUNT
Count.
Definition Keys.hpp:50
@ GyroBiasY
Gyroscope bias Y [rad/s].
Definition Keys.hpp:31
@ AccelMisalignmentQ2
Accelerometer misalignment quaternion y: Coefficient of j.
Definition Keys.hpp:42
@ GyroMisalignmentQ1
Gyroscope misalignment quaternion x: Coefficient of i.
Definition Keys.hpp:45
@ AccelMisalignmentQ1
Accelerometer misalignment quaternion x: Coefficient of i.
Definition Keys.hpp:41