0.3.0
Loading...
Searching...
No Matches
BaroSimulator.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 <cstdint>
20#include <Eigen/src/Core/Matrix.h>
21
22namespace NAV
23{
25class BaroSimulator : public Node
26{
27 public:
31 ~BaroSimulator() override;
33 BaroSimulator(const BaroSimulator&) = delete;
40
42 [[nodiscard]] static std::string typeStatic();
43
45 [[nodiscard]] std::string type() const override;
46
48 [[nodiscard]] static std::string category();
49
52 void guiConfig() override;
53
55 [[nodiscard]] json save() const override;
56
59 void restore(const json& j) override;
60
61 private:
62 constexpr static size_t OUTPUT_PORT_INDEX_BAROPRESSURE = 0;
63 constexpr static size_t INPUT_PORT_INDEX_POS = 0;
64
66 bool initialize() override;
67
69 void deinitialize() override;
70
74 void receiveObs(InputPin::NodeDataQueue& queue, size_t pinIdx);
75
77 double _temp0 = 288.15;
79 double _pressure0 = 1013.25;
81 double _lapserate = 0.00976;
83 double _geoidhgt = 0.0;
87 double _pressurenoise = 0.0;
88
91
94
96 Eigen::Vector3d _initPos{ 48.780509, 9.171712, 300.0 };
97
99 enum class GravityInput : uint8_t
100 {
104 };
105
108
112 friend constexpr const char* to_string(GravityInput value);
113};
114
118constexpr const char* to_string(NAV::BaroSimulator::GravityInput value)
119{
120 switch (value)
121 {
123 return "Manual";
125 return "Position";
127 return "";
128 }
129 return "";
130}
131
132} // namespace NAV
Holds all Constants.
nlohmann::json json
json namespace
Definition FlowManager.hpp:21
Node Class.
Random Number Generator.
static constexpr size_t OUTPUT_PORT_INDEX_BAROPRESSURE
Flow.
Definition BaroSimulator.hpp:62
double _pressurenoise
pressure noise in hPa
Definition BaroSimulator.hpp:87
BaroSimulator(const BaroSimulator &)=delete
Copy constructor.
json save() const override
Saves the node into a json object.
static constexpr size_t INPUT_PORT_INDEX_POS
Flow.
Definition BaroSimulator.hpp:63
double _gravity
Gravity in m / s²
Definition BaroSimulator.hpp:85
void receiveObs(InputPin::NodeDataQueue &queue, size_t pinIdx)
Converts the RtklibPosObs into PosVel.
BaroSimulator(BaroSimulator &&)=delete
Move constructor.
static std::string typeStatic()
String representation of the Class Type.
~BaroSimulator() override
Destructor.
double _pressure0
Pressure at Sea level in hPa.
Definition BaroSimulator.hpp:79
RandomNumberGenerator _pressureRng
Random number generator for the pressure noise.
Definition BaroSimulator.hpp:90
double _temp0
Temperature at Sea level in deg K.
Definition BaroSimulator.hpp:77
void guiConfig() override
ImGui config window which is shown on double click.
BaroSimulator()
Default constructor.
Eigen::Vector3d _initPos
Initial position in LLA [deg, deg, m] for the calculation of the local gravity through EGM96.
Definition BaroSimulator.hpp:96
void deinitialize() override
Deinitialize the node.
double _lapserate
Temperature lapse rate in K / m.
Definition BaroSimulator.hpp:81
static std::string category()
String representation of the Class Category.
bool initialize() override
Initialize the node.
GravityInput _gravityInput
Default gravity input type.
Definition BaroSimulator.hpp:107
GravityInput
Available options for gravity input.
Definition BaroSimulator.hpp:100
@ COUNT
Number of items in the enum.
Definition BaroSimulator.hpp:103
@ Position
Entry of the position, gravity is then deducted from EGM96.
Definition BaroSimulator.hpp:102
@ Manual
Manual entry of the gravity's magnitude.
Definition BaroSimulator.hpp:101
double _geoidhgt
Geoid undulation in m.
Definition BaroSimulator.hpp:83
void restore(const json &j) override
Restores the node from a json object.
BaroSimulator & operator=(const BaroSimulator &)=delete
Copy assignment operator.
double _exponent
save computations, by storing g * M / R0 / L;
Definition BaroSimulator.hpp:93
std::string type() const override
String representation of the Class Type.
friend constexpr const char * to_string(GravityInput value)
Converts the enum to a string.
Definition BaroSimulator.hpp:118
BaroSimulator & operator=(BaroSimulator &&)=delete
Move assignment operator.
TsDeque< std::shared_ptr< const NAV::NodeData > > NodeDataQueue
Node data queue type.
Definition Pin.hpp:707
static constexpr double Rg
Universal gas constant in [J/K/mol].
Definition Constants.hpp:230
static constexpr double dMtr
Molar mass of dry air in [kg/mol].
Definition Constants.hpp:233
static constexpr double G_NORM
Standard gravity in [m / s^2].
Definition Constants.hpp:40
Node(std::string name)
Constructor.
Manages a thread which calls a specified function at a specified interval.
Definition RandomNumberGenerator.hpp:29