0.2.0
Loading...
Searching...
No Matches
ImuObsSimulated.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 "ImuObsWDelta.hpp"
17
18namespace NAV
19{
21class ImuObsSimulated final : public ImuObsWDelta
22{
23 public:
26 explicit ImuObsSimulated(const ImuPos& imuPos)
28
31 [[nodiscard]] static std::string type()
32 {
33 return "ImuObsSimulated";
34 }
35
38 [[nodiscard]] static std::vector<std::string> parentTypes()
39 {
40 auto parent = ImuObsWDelta::parentTypes();
41 parent.push_back(ImuObsWDelta::type());
42 return parent;
43 }
44
46 [[nodiscard]] static std::vector<std::string> GetStaticDataDescriptors()
47 {
49 desc.emplace_back("AccelDynamicsN [m/s^2]");
50 desc.emplace_back("AccelDynamicsE [m/s^2]");
51 desc.emplace_back("AccelDynamicsD [m/s^2]");
52 desc.emplace_back("AngularRateN (ω_nb_n) [rad/s]");
53 desc.emplace_back("AngularRateE (ω_nb_n) [rad/s]");
54 desc.emplace_back("AngularRateD (ω_nb_n) [rad/s]");
55 desc.emplace_back("AccelDynamicsX ECEF [m/s^2]");
56 desc.emplace_back("AccelDynamicsY ECEF [m/s^2]");
57 desc.emplace_back("AccelDynamicsZ ECEF [m/s^2]");
58 desc.emplace_back("AngularRateX ECEF (ω_nb_e) [rad/s]");
59 desc.emplace_back("AngularRateY ECEF (ω_nb_e) [rad/s]");
60 desc.emplace_back("AngularRateZ ECEF (ω_nb_e) [rad/s]");
61 return desc;
62 }
63
65 [[nodiscard]] static constexpr size_t GetStaticDescriptorCount() { return 30; }
66
68 [[nodiscard]] std::vector<std::string> staticDataDescriptors() const override { return GetStaticDataDescriptors(); }
69
71 [[nodiscard]] size_t staticDescriptorCount() const override { return GetStaticDescriptorCount(); }
72
76 [[nodiscard]] std::optional<double> getValueAt(size_t idx) const override
77 {
79 switch (idx)
80 {
81 case 0: // Time since startup [ns]
82 case 1: // Accel X [m/s^2]
83 case 2: // Accel Y [m/s^2]
84 case 3: // Accel Z [m/s^2]
85 case 4: // Gyro X [rad/s]
86 case 5: // Gyro Y [rad/s]
87 case 6: // Gyro Z [rad/s]
88 case 7: // Mag X [Gauss]
89 case 8: // Mag Y [Gauss]
90 case 9: // Mag Z [Gauss]
91 case 10: // Temperature [°C]
92 case 11: // dTime [s]
93 case 12: // dTheta X [deg]
94 case 13: // dTheta Y [deg]
95 case 14: // dTheta Z [deg]
96 case 15: // dVelocity X [m/s]
97 case 16: // dVelocity Y [m/s]
98 case 17: // dVelocity Z [m/s]
99 return ImuObsWDelta::getValueAt(idx);
100 case 18: // AccelDynamicsN [m/s^2]
101 return n_accelDynamics.x();
102 case 19: // AccelDynamicsE [m/s^2]
103 return n_accelDynamics.y();
104 case 20: // AccelDynamicsD [m/s^2]
105 return n_accelDynamics.z();
106 case 21: // AngularRateN (ω_nb_n) [rad/s]
107 return n_angularRateDynamics.x();
108 case 22: // AngularRateE (ω_nb_n) [rad/s]
109 return n_angularRateDynamics.y();
110 case 23: // AngularRateD (ω_nb_n) [rad/s]
111 return n_angularRateDynamics.z();
112 case 24: // AccelDynamicsX ECEF [m/s^2]
113 return e_accelDynamics.x();
114 case 25: // AccelDynamicsY ECEF [m/s^2]
115 return e_accelDynamics.y();
116 case 26: // AccelDynamicsZ ECEF [m/s^2]
117 return e_accelDynamics.z();
118 case 27: // AngularRateX ECEF (ω_nb_e) [rad/s]
119 return e_angularRateDynamics.x();
120 case 28: // AngularRateY ECEF (ω_nb_e) [rad/s]
121 return e_angularRateDynamics.y();
122 case 29: // AngularRateZ ECEF (ω_nb_e) [rad/s]
123 return e_angularRateDynamics.z();
124 default:
125 return std::nullopt;
126 }
127 }
128
130 Eigen::Vector3d n_accelDynamics;
132 Eigen::Vector3d n_angularRateDynamics;
133
135 Eigen::Vector3d e_accelDynamics;
137 Eigen::Vector3d e_angularRateDynamics;
138};
139
140} // namespace NAV
#define INS_ASSERT(_EXPR)
Assert function wrapper.
Definition Assert.h:19
Data storage class for one VectorNavImu observation.
VectorNav Observation storage Class.
Definition ImuObsSimulated.hpp:22
Eigen::Vector3d e_accelDynamics
The acceleration derived from the trajectory in [m/s^2], given in the ECEF frame.
Definition ImuObsSimulated.hpp:135
static std::vector< std::string > GetStaticDataDescriptors()
Returns a vector of data descriptors.
Definition ImuObsSimulated.hpp:46
static constexpr size_t GetStaticDescriptorCount()
Get the amount of descriptors.
Definition ImuObsSimulated.hpp:65
Eigen::Vector3d e_angularRateDynamics
The angular rate ω_nb_e derived from the trajectory in [rad/s], given in the ECEF frame.
Definition ImuObsSimulated.hpp:137
std::vector< std::string > staticDataDescriptors() const override
Returns a vector of data descriptors.
Definition ImuObsSimulated.hpp:68
Eigen::Vector3d n_angularRateDynamics
The angular rate ω_nb_n derived from the trajectory in [rad/s], given in the NED frame.
Definition ImuObsSimulated.hpp:132
static std::string type()
Returns the type of the data class.
Definition ImuObsSimulated.hpp:31
std::optional< double > getValueAt(size_t idx) const override
Get the value at the index.
Definition ImuObsSimulated.hpp:76
static std::vector< std::string > parentTypes()
Returns the parent types of the data class.
Definition ImuObsSimulated.hpp:38
size_t staticDescriptorCount() const override
Get the amount of descriptors.
Definition ImuObsSimulated.hpp:71
Eigen::Vector3d n_accelDynamics
The acceleration derived from the trajectory in [m/s^2], given in the NED frame.
Definition ImuObsSimulated.hpp:130
ImuObsSimulated(const ImuPos &imuPos)
Constructor.
Definition ImuObsSimulated.hpp:26
VectorNav Observation storage Class.
Definition ImuObsWDelta.hpp:22
static std::string type()
Returns the type of the data class.
Definition ImuObsWDelta.hpp:31
static std::vector< std::string > GetStaticDataDescriptors()
Returns a vector of data descriptors.
Definition ImuObsWDelta.hpp:44
std::optional< double > getValueAt(size_t idx) const override
Get the value at the index.
Definition ImuObsWDelta.hpp:69
static std::vector< std::string > parentTypes()
Returns the parent types of the data class.
Definition ImuObsWDelta.hpp:38
const ImuPos & imuPos
Position and rotation information for conversion from platform to body frame.
Definition ImuObs.hpp:115
IMU Position.
Definition ImuPos.hpp:26