0.3.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]] std::string getType() const override { return type(); }
39
42 [[nodiscard]] static std::vector<std::string> parentTypes()
43 {
44 auto parent = ImuObsWDelta::parentTypes();
45 parent.push_back(ImuObsWDelta::type());
46 return parent;
47 }
48
50 [[nodiscard]] static std::vector<std::string> GetStaticDataDescriptors()
51 {
53 desc.emplace_back("AccelDynamicsN [m/s^2]");
54 desc.emplace_back("AccelDynamicsE [m/s^2]");
55 desc.emplace_back("AccelDynamicsD [m/s^2]");
56 desc.emplace_back("AngularRateN (ω_nb_n) [rad/s]");
57 desc.emplace_back("AngularRateE (ω_nb_n) [rad/s]");
58 desc.emplace_back("AngularRateD (ω_nb_n) [rad/s]");
59 desc.emplace_back("AccelDynamicsX ECEF [m/s^2]");
60 desc.emplace_back("AccelDynamicsY ECEF [m/s^2]");
61 desc.emplace_back("AccelDynamicsZ ECEF [m/s^2]");
62 desc.emplace_back("AngularRateX ECEF (ω_nb_e) [rad/s]");
63 desc.emplace_back("AngularRateY ECEF (ω_nb_e) [rad/s]");
64 desc.emplace_back("AngularRateZ ECEF (ω_nb_e) [rad/s]");
65 return desc;
66 }
67
69 [[nodiscard]] static constexpr size_t GetStaticDescriptorCount() { return ImuObsWDelta::GetStaticDescriptorCount() + 12; }
70
72 [[nodiscard]] std::vector<std::string> staticDataDescriptors() const override { return GetStaticDataDescriptors(); }
73
75 [[nodiscard]] size_t staticDescriptorCount() const override { return GetStaticDescriptorCount(); }
76
80 [[nodiscard]] std::optional<double> getValueAt(size_t idx) const override
81 {
84 switch (idx)
85 {
86 case ImuObsWDelta::GetStaticDescriptorCount() + 0: // AccelDynamicsN [m/s^2]
87 return n_accelDynamics.x();
88 case ImuObsWDelta::GetStaticDescriptorCount() + 1: // AccelDynamicsE [m/s^2]
89 return n_accelDynamics.y();
90 case ImuObsWDelta::GetStaticDescriptorCount() + 2: // AccelDynamicsD [m/s^2]
91 return n_accelDynamics.z();
92 case ImuObsWDelta::GetStaticDescriptorCount() + 3: // AngularRateN (ω_nb_n) [rad/s]
93 return n_angularRateDynamics.x();
94 case ImuObsWDelta::GetStaticDescriptorCount() + 4: // AngularRateE (ω_nb_n) [rad/s]
95 return n_angularRateDynamics.y();
96 case ImuObsWDelta::GetStaticDescriptorCount() + 5: // AngularRateD (ω_nb_n) [rad/s]
97 return n_angularRateDynamics.z();
98 case ImuObsWDelta::GetStaticDescriptorCount() + 6: // AccelDynamicsX ECEF [m/s^2]
99 return e_accelDynamics.x();
100 case ImuObsWDelta::GetStaticDescriptorCount() + 7: // AccelDynamicsY ECEF [m/s^2]
101 return e_accelDynamics.y();
102 case ImuObsWDelta::GetStaticDescriptorCount() + 8: // AccelDynamicsZ ECEF [m/s^2]
103 return e_accelDynamics.z();
104 case ImuObsWDelta::GetStaticDescriptorCount() + 9: // AngularRateX ECEF (ω_nb_e) [rad/s]
105 return e_angularRateDynamics.x();
106 case ImuObsWDelta::GetStaticDescriptorCount() + 10: // AngularRateY ECEF (ω_nb_e) [rad/s]
107 return e_angularRateDynamics.y();
108 case ImuObsWDelta::GetStaticDescriptorCount() + 11: // AngularRateZ ECEF (ω_nb_e) [rad/s]
109 return e_angularRateDynamics.z();
110 default:
111 return std::nullopt;
112 }
113 }
114
119 [[nodiscard]] bool setValueAt(size_t idx, double value) override
120 {
122 if (idx < ImuObsWDelta::GetStaticDescriptorCount()) { return ImuObsWDelta::setValueAt(idx, value); }
123 switch (idx)
124 {
125 case ImuObsWDelta::GetStaticDescriptorCount() + 0: // AccelDynamicsN [m/s^2]
126 n_accelDynamics.x() = value;
127 break;
128 case ImuObsWDelta::GetStaticDescriptorCount() + 1: // AccelDynamicsE [m/s^2]
129 n_accelDynamics.y() = value;
130 break;
131 case ImuObsWDelta::GetStaticDescriptorCount() + 2: // AccelDynamicsD [m/s^2]
132 n_accelDynamics.z() = value;
133 break;
134 case ImuObsWDelta::GetStaticDescriptorCount() + 3: // AngularRateN (ω_nb_n) [rad/s]
135 n_angularRateDynamics.x() = value;
136 break;
137 case ImuObsWDelta::GetStaticDescriptorCount() + 4: // AngularRateE (ω_nb_n) [rad/s]
138 n_angularRateDynamics.y() = value;
139 break;
140 case ImuObsWDelta::GetStaticDescriptorCount() + 5: // AngularRateD (ω_nb_n) [rad/s]
141 n_angularRateDynamics.z() = value;
142 break;
143 case ImuObsWDelta::GetStaticDescriptorCount() + 6: // AccelDynamicsX ECEF [m/s^2]
144 e_accelDynamics.x() = value;
145 break;
146 case ImuObsWDelta::GetStaticDescriptorCount() + 7: // AccelDynamicsY ECEF [m/s^2]
147 e_accelDynamics.y() = value;
148 break;
149 case ImuObsWDelta::GetStaticDescriptorCount() + 8: // AccelDynamicsZ ECEF [m/s^2]
150 e_accelDynamics.z() = value;
151 break;
152 case ImuObsWDelta::GetStaticDescriptorCount() + 9: // AngularRateX ECEF (ω_nb_e) [rad/s]
153 e_angularRateDynamics.x() = value;
154 break;
155 case ImuObsWDelta::GetStaticDescriptorCount() + 10: // AngularRateY ECEF (ω_nb_e) [rad/s]
156 e_angularRateDynamics.y() = value;
157 break;
158 case ImuObsWDelta::GetStaticDescriptorCount() + 11: // AngularRateZ ECEF (ω_nb_e) [rad/s]
159 e_angularRateDynamics.z() = value;
160 break;
161 default:
162 return false;
163 }
164
165 return true;
166 }
167
169 Eigen::Vector3d n_accelDynamics;
171 Eigen::Vector3d n_angularRateDynamics;
172
174 Eigen::Vector3d e_accelDynamics;
176 Eigen::Vector3d e_angularRateDynamics;
177};
178
179} // 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:174
static std::vector< std::string > GetStaticDataDescriptors()
Returns a vector of data descriptors.
Definition ImuObsSimulated.hpp:50
static constexpr size_t GetStaticDescriptorCount()
Get the amount of descriptors.
Definition ImuObsSimulated.hpp:69
Eigen::Vector3d e_angularRateDynamics
The angular rate ω_nb_e derived from the trajectory in [rad/s], given in the ECEF frame.
Definition ImuObsSimulated.hpp:176
std::vector< std::string > staticDataDescriptors() const override
Returns a vector of data descriptors.
Definition ImuObsSimulated.hpp:72
bool setValueAt(size_t idx, double value) override
Set the value at the index.
Definition ImuObsSimulated.hpp:119
Eigen::Vector3d n_angularRateDynamics
The angular rate ω_nb_n derived from the trajectory in [rad/s], given in the NED frame.
Definition ImuObsSimulated.hpp:171
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:80
static std::vector< std::string > parentTypes()
Returns the parent types of the data class.
Definition ImuObsSimulated.hpp:42
std::string getType() const override
Returns the type of the data class.
Definition ImuObsSimulated.hpp:38
size_t staticDescriptorCount() const override
Get the amount of descriptors.
Definition ImuObsSimulated.hpp:75
Eigen::Vector3d n_accelDynamics
The acceleration derived from the trajectory in [m/s^2], given in the NED frame.
Definition ImuObsSimulated.hpp:169
ImuObsSimulated(const ImuPos &imuPos)
Constructor.
Definition ImuObsSimulated.hpp:26
VectorNav Observation storage Class.
Definition ImuObsWDelta.hpp:23
bool setValueAt(size_t idx, double value) override
Set the value at the index.
Definition ImuObsWDelta.hpp:104
static constexpr size_t GetStaticDescriptorCount()
Get the amount of descriptors.
Definition ImuObsWDelta.hpp:63
static std::string type()
Returns the type of the data class.
Definition ImuObsWDelta.hpp:32
static std::vector< std::string > GetStaticDataDescriptors()
Returns a vector of data descriptors.
Definition ImuObsWDelta.hpp:49
std::optional< double > getValueAt(size_t idx) const override
Get the value at the index.
Definition ImuObsWDelta.hpp:74
static std::vector< std::string > parentTypes()
Returns the parent types of the data class.
Definition ImuObsWDelta.hpp:43
const ImuPos & imuPos
Position and rotation information for conversion from platform to body frame.
Definition ImuObs.hpp:184
IMU Position.
Definition ImuPos.hpp:26