Line | Branch | Exec | Source |
---|---|---|---|
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 | |||
9 | /// @file WiFiPositioningSolution.hpp | ||
10 | /// @brief WiFi Positioning Algorithm output | ||
11 | /// @author R. Lintz (r-lintz@gmx.de) (master thesis) | ||
12 | /// @author T. Topp (topp@ins.uni-stuttgart.de) | ||
13 | /// @date 2024-03-12 | ||
14 | |||
15 | #pragma once | ||
16 | |||
17 | #include "NodeData/State/PosVel.hpp" | ||
18 | #include <Eigen/Dense> | ||
19 | |||
20 | namespace NAV | ||
21 | { | ||
22 | |||
23 | /// WiFi Positioning Algorithm Solution | ||
24 | class WiFiPositioningSolution : public PosVel | ||
25 | { | ||
26 | public: | ||
27 | /// @brief Returns the type of the data class | ||
28 | /// @return The data type | ||
29 | 493 | [[nodiscard]] static std::string type() | |
30 | { | ||
31 |
1/2✓ Branch 1 taken 493 times.
✗ Branch 2 not taken.
|
986 | return "WiFiPositioningSolution"; |
32 | } | ||
33 | |||
34 | /// @brief Returns the type of the data class | ||
35 | /// @return The data type | ||
36 | ✗ | [[nodiscard]] std::string getType() const override { return type(); } | |
37 | |||
38 | /// @brief Returns the parent types of the data class | ||
39 | /// @return The parent data types | ||
40 | 112 | [[nodiscard]] static std::vector<std::string> parentTypes() | |
41 | { | ||
42 | 112 | auto parent = PosVel::parentTypes(); | |
43 |
2/4✓ Branch 1 taken 112 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 112 times.
✗ Branch 5 not taken.
|
112 | parent.push_back(PosVel::type()); |
44 | 112 | return parent; | |
45 | ✗ | } | |
46 | |||
47 | /// @brief Returns a vector of data descriptors | ||
48 | ✗ | [[nodiscard]] static std::vector<std::string> GetStaticDataDescriptors() | |
49 | { | ||
50 | ✗ | auto desc = PosVel::GetStaticDataDescriptors(); | |
51 | ✗ | desc.reserve(GetStaticDescriptorCount()); | |
52 | ✗ | desc.emplace_back("Bias [m]"); | |
53 | ✗ | desc.emplace_back("Bias StDev [m]"); | |
54 | ✗ | return desc; | |
55 | ✗ | } | |
56 | |||
57 | /// @brief Get the amount of descriptors | ||
58 | ✗ | [[nodiscard]] static constexpr size_t GetStaticDescriptorCount() { return PosVel::GetStaticDescriptorCount() + 2; } | |
59 | |||
60 | /// @brief Returns a vector of data descriptors | ||
61 | ✗ | [[nodiscard]] std::vector<std::string> staticDataDescriptors() const override { return GetStaticDataDescriptors(); } | |
62 | |||
63 | /// @brief Get the amount of descriptors | ||
64 | ✗ | [[nodiscard]] size_t staticDescriptorCount() const override { return GetStaticDescriptorCount(); } | |
65 | |||
66 | /// @brief Get the value at the index | ||
67 | /// @param idx Index corresponding to data descriptor order | ||
68 | /// @return Value if in the observation | ||
69 | ✗ | [[nodiscard]] std::optional<double> getValueAt(size_t idx) const override | |
70 | { | ||
71 | ✗ | INS_ASSERT(idx < GetStaticDescriptorCount()); | |
72 | ✗ | if (idx < PosVel::GetStaticDescriptorCount()) { return PosVel::getValueAt(idx); } | |
73 | ✗ | switch (idx) | |
74 | { | ||
75 | ✗ | case PosVel::GetStaticDescriptorCount() + 0: // Bias [m] | |
76 | ✗ | return bias; | |
77 | break; | ||
78 | ✗ | case PosVel::GetStaticDescriptorCount() + 1: // Bias StDev [m] | |
79 | ✗ | return biasStdev; | |
80 | break; | ||
81 | ✗ | default: | |
82 | ✗ | return std::nullopt; | |
83 | } | ||
84 | return std::nullopt; | ||
85 | } | ||
86 | |||
87 | //--------------------------------------------------------- Public Members ------------------------------------------------------------ | ||
88 | |||
89 | /// Bias [m] | ||
90 | double bias = std::nan(""); | ||
91 | /// Standard deviation of Bias [m] | ||
92 | double biasStdev = std::nan(""); | ||
93 | }; | ||
94 | |||
95 | } // namespace NAV | ||
96 |