INSTINCT Code Coverage Report


Directory: src/
File: NodeData/State/InsGnssTCKFSolution.hpp
Date: 2025-02-07 16:54:41
Exec Total Coverage
Lines: 2 29 6.9%
Functions: 1 7 14.3%
Branches: 1 21 4.8%

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 InsGnssTCKFSolution.hpp
10 /// @brief Tightly-coupled Kalman Filter INS/GNSS errors
11 /// @author M. Maier (marcel.maier@ins.uni-stuttgart.de)
12 /// @date 2023-02-24
13
14 #pragma once
15
16 #include "InsGnssLCKFSolution.hpp"
17
18 namespace NAV
19 {
20 /// Tightly-coupled Kalman Filter INS/GNSS errors
21 class InsGnssTCKFSolution : public InsGnssLCKFSolution
22 {
23 public:
24 /// @brief Returns the type of the data class
25 /// @return The data type
26 581808 [[nodiscard]] static std::string type()
27 {
28
1/2
✓ Branch 1 taken 581808 times.
✗ Branch 2 not taken.
1163616 return "InsGnssTCKFSolution";
29 }
30
31 /// @brief Returns the type of the data class
32 /// @return The data type
33 [[nodiscard]] std::string getType() const override { return type(); }
34
35 /// @brief Returns the parent types of the data class
36 /// @return The parent data types
37 [[nodiscard]] static std::vector<std::string> parentTypes()
38 {
39 auto parent = InsGnssLCKFSolution::parentTypes();
40 parent.push_back(InsGnssLCKFSolution::type());
41 return parent;
42 }
43
44 /// @brief Returns a vector of data descriptors
45 [[nodiscard]] static std::vector<std::string> GetStaticDataDescriptors()
46 {
47 auto desc = InsGnssLCKFSolution::GetStaticDataDescriptors();
48 desc.reserve(GetStaticDescriptorCount());
49 desc.emplace_back("Receiver clock offset [m]");
50 desc.emplace_back("Receiver clock drift [m/s]");
51 desc.emplace_back("Receiver clock offset [s]");
52 desc.emplace_back("Receiver clock drift [s/s]");
53 return desc;
54 }
55
56 /// @brief Get the amount of descriptors
57 [[nodiscard]] static constexpr size_t GetStaticDescriptorCount() { return InsGnssLCKFSolution::GetStaticDescriptorCount() + 4; }
58
59 /// @brief Returns a vector of data descriptors
60 [[nodiscard]] std::vector<std::string> staticDataDescriptors() const override { return GetStaticDataDescriptors(); }
61
62 /// @brief Get the amount of descriptors
63 [[nodiscard]] size_t staticDescriptorCount() const override { return GetStaticDescriptorCount(); }
64
65 /// @brief Get the value at the index
66 /// @param idx Index corresponding to data descriptor order
67 /// @return Value if in the observation
68 [[nodiscard]] std::optional<double> getValueAt(size_t idx) const override
69 {
70 INS_ASSERT(idx < GetStaticDescriptorCount());
71 if (idx < InsGnssLCKFSolution::GetStaticDescriptorCount()) { return InsGnssLCKFSolution::getValueAt(idx); }
72 switch (idx)
73 {
74 case InsGnssLCKFSolution::GetStaticDescriptorCount() + 0: // Receiver clock offset [m]
75 return recvClkOffset;
76 case InsGnssLCKFSolution::GetStaticDescriptorCount() + 1: // Receiver clock drift [m/s]
77 return recvClkDrift;
78 case InsGnssLCKFSolution::GetStaticDescriptorCount() + 2: // Receiver clock offset [s]
79 return recvClkOffset / InsConst::C;
80 case InsGnssLCKFSolution::GetStaticDescriptorCount() + 3: // Receiver clock drift [s/s]
81 return recvClkDrift / InsConst::C;
82 default:
83 return std::nullopt;
84 }
85 }
86
87 /// δϱ The receiver clock offset in [m]
88 double recvClkOffset{};
89
90 /// δϱ_dot The receiver clock drift in [m/s]
91 double recvClkDrift{};
92 };
93
94 } // namespace NAV
95