0.3.0
Loading...
Searching...
No Matches
PressToHgt.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
19
20namespace NAV
21{
23class PressToHgt : public Node
24{
25 public:
29 ~PressToHgt() override;
31 PressToHgt(const PressToHgt&) = delete;
35 PressToHgt& operator=(const PressToHgt&) = delete;
38
40 [[nodiscard]] static std::string typeStatic();
41
43 [[nodiscard]] std::string type() const override;
44
46 [[nodiscard]] static std::string category();
47
50 void guiConfig() override;
51
53 [[nodiscard]] json save() const override;
54
57 void restore(const json& j) override;
58
59 private:
60 constexpr static size_t OUTPUT_PORT_INDEX_BAROHEIGHT = 0;
61 constexpr static size_t INPUT_PORT_INDEX_POS = 0;
62
64 bool initialize() override;
65
67 void deinitialize() override;
68
72 void receiveObs(InputPin::NodeDataQueue& queue, size_t pinIdx);
73
75 double _temp0 = 288.15;
77 double _pressure0 = 1013.25;
79 double _lapserate = 0.00976;
81 double _geoidhgt = 0.0;
84
87
89 Eigen::Vector3d _initPos{ 48.780509, 9.171712, 300.0 };
90
92 enum class GravityInput : uint8_t
93 {
97 };
98
101
105 friend constexpr const char* to_string(GravityInput value);
106};
107
111constexpr const char* to_string(NAV::PressToHgt::GravityInput value)
112{
113 switch (value)
114 {
116 return "Manual";
118 return "Position";
120 return "";
121 }
122 return "";
123};
124
125} // namespace NAV
Holds all Constants.
nlohmann::json json
json namespace
Definition FlowManager.hpp:21
Node Class.
Random Number Generator.
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.
void deinitialize() override
Deinitialize the node.
bool initialize() override
Initialize the node.
double _temp0
Temperature at Sea level in deg K.
Definition PressToHgt.hpp:75
double _geoidhgt
Geoid undulation in m.
Definition PressToHgt.hpp:81
void guiConfig() override
ImGui config window which is shown on double click.
double _lapserate
Temperature lapse rate in K / m.
Definition PressToHgt.hpp:79
std::string type() const override
String representation of the Class Type.
PressToHgt & operator=(PressToHgt &&)=delete
Move assignment operator.
PressToHgt(PressToHgt &&)=delete
Move constructor.
~PressToHgt() override
Destructor.
static std::string typeStatic()
String representation of the Class Type.
static constexpr size_t OUTPUT_PORT_INDEX_BAROHEIGHT
Flow.
Definition PressToHgt.hpp:60
GravityInput
Available options for gravity input.
Definition PressToHgt.hpp:93
@ COUNT
Number of items in the enum.
Definition PressToHgt.hpp:96
@ Position
Entry of the position, gravity is then deducted from EGM96.
Definition PressToHgt.hpp:95
@ Manual
Manual entry of the gravity's magnitude.
Definition PressToHgt.hpp:94
void restore(const json &j) override
Restores the node from a json object.
static constexpr size_t INPUT_PORT_INDEX_POS
Flow.
Definition PressToHgt.hpp:61
PressToHgt & operator=(const PressToHgt &)=delete
Copy assignment operator.
double _gravity
Gravity in m / s²
Definition PressToHgt.hpp:83
GravityInput _gravityInput
Default gravity input type.
Definition PressToHgt.hpp:100
double _exponent
save computations, by storing g * M / R0 / L;
Definition PressToHgt.hpp:86
PressToHgt()
Default constructor.
PressToHgt(const PressToHgt &)=delete
Copy constructor.
double _pressure0
Pressure at Sea level in hPa.
Definition PressToHgt.hpp:77
Eigen::Vector3d _initPos
Initial position in LLA [deg, deg, m] for the calculation of the local gravity through EGM96.
Definition PressToHgt.hpp:89
void receiveObs(InputPin::NodeDataQueue &queue, size_t pinIdx)
Converts the RtklibPosObs into PosVel.
json save() const override
Saves the node into a json object.
friend constexpr const char * to_string(GravityInput value)
Converts the enum to a string.
Definition PressToHgt.hpp:111
static std::string category()
String representation of the Class Category.