0.3.0
Loading...
Searching...
No Matches
BaroHgt.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 "NodeData/NodeData.hpp"
17#include "util/Assert.h"
18#include <Eigen/src/Core/MatrixBase.h>
19
20namespace NAV
21{
23class BaroHgt : public NodeData
24{
25 public:
28 [[nodiscard]] static std::string type()
29 {
30 return "BaroHgt";
31 }
32
35 [[nodiscard]] std::string getType() const override { return type(); }
36
39 [[nodiscard]] static std::vector<std::string> parentTypes()
40 {
41 return { NodeData::type() };
42 }
43
45 [[nodiscard]] static std::vector<std::string> GetStaticDataDescriptors()
46 {
47 return {
48 "BaroHgt [m]",
49 "BaroHgt StDev [m]"
50 };
51 }
52
54 [[nodiscard]] static constexpr size_t GetStaticDescriptorCount() { return 2; }
55
57 [[nodiscard]] std::vector<std::string> staticDataDescriptors() const override { return GetStaticDataDescriptors(); }
58
60 [[nodiscard]] size_t staticDescriptorCount() const override { return GetStaticDescriptorCount(); }
61
65 [[nodiscard]] std::optional<double> getValueAt(size_t idx) const override
66 {
68 switch (idx)
69 {
70 case 0: // BaroHgt [m]
71 return baro_height;
72 case 1: // BaroHgt StDev [m]
73 return baro_heightStdev;
74 default:
75 return std::nullopt;
76 }
77 return std::nullopt;
78 }
79
84 [[nodiscard]] bool setValueAt(size_t idx, double value) override
85 {
87 switch (idx)
88 {
89 case 0: // BaroHgt [m]
90 baro_height = value;
91 break;
92 case 1: // BaroHgt StDev [m]
93 baro_heightStdev = value;
94 break;
95 default:
96 return false;
97 }
98
99 return true;
100 }
101
103 double baro_height{ std::nan("") };
104
106 std::optional<double> baro_heightStdev;
107};
108
109} // namespace NAV
Assertion helpers.
#define INS_ASSERT(_EXPR)
Assert function wrapper.
Definition Assert.h:19
Abstract NodeData Class.
Barometric height storage class.
Definition BaroHgt.hpp:24
double baro_height
Barometric height [m].
Definition BaroHgt.hpp:103
static std::string type()
Returns the type of the data class.
Definition BaroHgt.hpp:28
static std::vector< std::string > GetStaticDataDescriptors()
Returns a vector of data descriptors.
Definition BaroHgt.hpp:45
std::optional< double > getValueAt(size_t idx) const override
Get the value at the index.
Definition BaroHgt.hpp:65
static constexpr size_t GetStaticDescriptorCount()
Get the amount of descriptors.
Definition BaroHgt.hpp:54
std::vector< std::string > staticDataDescriptors() const override
Returns a vector of data descriptors.
Definition BaroHgt.hpp:57
bool setValueAt(size_t idx, double value) override
Set the value at the index.
Definition BaroHgt.hpp:84
size_t staticDescriptorCount() const override
Get the amount of descriptors.
Definition BaroHgt.hpp:60
std::optional< double > baro_heightStdev
Standard deviation of barometric height [m].
Definition BaroHgt.hpp:106
static std::vector< std::string > parentTypes()
Returns the parent types of the data class.
Definition BaroHgt.hpp:39
std::string getType() const override
Returns the type of the data class.
Definition BaroHgt.hpp:35
NodeData()=default
Default constructor.
static std::string type()
Returns the type of the data class.
Definition NodeData.hpp:45