0.2.0
Loading...
Searching...
No Matches
GnssCombination.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 <vector>
17#include <tuple>
18
19#include "NodeData/NodeData.hpp"
20#include "GnssObs.hpp"
22
23namespace NAV
24{
25
28{
29 public:
32 [[nodiscard]] static std::string type()
33 {
34 return "GnssCombination";
35 }
36
39 [[nodiscard]] static std::vector<std::string> parentTypes()
40 {
41 return { NodeData::type() };
42 }
43
46 {
55
56 std::string description;
57 std::optional<double> result;
58 std::vector<Term> terms;
59
60 std::optional<PolynomialCycleSlipDetectorResult> cycleSlipResult;
61 std::optional<double> cycleSlipPrediction;
62 std::optional<double> cycleSlipMeasMinPred;
63 std::vector<std::tuple<InsTime, Polynomial<double>, double>> cycleSlipPolynomials;
64 };
65
67 std::vector<Combination> combinations;
68
70 [[nodiscard]] std::vector<std::string> dynamicDataDescriptors() const override
71 {
72 std::vector<std::string> descriptors;
73 descriptors.reserve(combinations.size() * 4);
74
75 for (const auto& comb : combinations)
76 {
77 descriptors.push_back(comb.description);
78 descriptors.push_back(comb.description + " Cycle Slip");
79 descriptors.push_back(comb.description + " Prediction");
80 descriptors.push_back(comb.description + " Meas - Pred");
81 }
82
83 return descriptors;
84 }
85
88 [[nodiscard]] std::optional<double> getDynamicDataAt(const std::string& descriptor) const override
89 {
90 for (const auto& comb : combinations)
91 {
92 if (descriptor == comb.description) { return comb.result; }
93 if (descriptor == comb.description + " Cycle Slip" && comb.cycleSlipResult) { return static_cast<double>(*comb.cycleSlipResult); }
94 if (descriptor == comb.description + " Prediction") { return comb.cycleSlipPrediction; }
95 if (descriptor == comb.description + " Meas - Pred") { return comb.cycleSlipMeasMinPred; }
96 }
97 return std::nullopt;
98 }
99
101 [[nodiscard]] std::vector<std::pair<std::string, double>> getDynamicData() const override
102 {
103 std::vector<std::pair<std::string, double>> dynData;
104 dynData.reserve(combinations.size() * 4);
105 for (const auto& comb : combinations)
106 {
107 if (comb.result) { dynData.emplace_back(comb.description, *comb.result); }
108 if (comb.cycleSlipResult) { dynData.emplace_back(comb.description + " Cycle Slip", static_cast<double>(*comb.cycleSlipResult)); }
109 if (comb.cycleSlipPrediction) { dynData.emplace_back(comb.description + " Prediction", *comb.cycleSlipPrediction); }
110 if (comb.cycleSlipMeasMinPred) { dynData.emplace_back(comb.description + " Meas - Pred", *comb.cycleSlipMeasMinPred); }
111 }
112 return dynData;
113 }
114};
115
116} // namespace NAV
GNSS Observation messages.
Abstract NodeData Class.
Polynomial Cycle-slip detection algorithm.
@ None
None.
Definition Code.hpp:93
GNSS measurement combinations.
Definition GnssCombination.hpp:28
static std::string type()
Returns the type of the data class.
Definition GnssCombination.hpp:32
std::vector< std::pair< std::string, double > > getDynamicData() const override
Returns a vector of data descriptors and values for the dynamic data.
Definition GnssCombination.hpp:101
std::optional< double > getDynamicDataAt(const std::string &descriptor) const override
Get the value for the descriptor.
Definition GnssCombination.hpp:88
std::vector< std::string > dynamicDataDescriptors() const override
Returns a vector of data descriptors for the dynamic data.
Definition GnssCombination.hpp:70
static std::vector< std::string > parentTypes()
Returns the parent types of the data class.
Definition GnssCombination.hpp:39
std::vector< Combination > combinations
List of combinations.
Definition GnssCombination.hpp:67
ObservationType
Observation types.
Definition GnssObs.hpp:36
@ Carrier
Carrier-Phase.
Definition GnssObs.hpp:38
Parent class for all data transmitted over Flow pins.
Definition NodeData.hpp:27
static std::string type()
Returns the type of the data class.
Definition NodeData.hpp:44
Term of a combination equation.
Definition GnssCombination.hpp:49
int sign
+1 or -1
Definition GnssCombination.hpp:50
std::optional< double > value
Measurement (if present)
Definition GnssCombination.hpp:53
SatSigId satSigId
SignalId and satellite number.
Definition GnssCombination.hpp:51
GnssObs::ObservationType obsType
Observation Type.
Definition GnssCombination.hpp:52
Combination of GNSS measurements.
Definition GnssCombination.hpp:46
std::optional< double > cycleSlipMeasMinPred
Measurement minus predicted value from the cycle-slip detector.
Definition GnssCombination.hpp:62
std::optional< double > cycleSlipPrediction
Predicted value from the cycle-slip detector (polynomial fit)
Definition GnssCombination.hpp:61
std::optional< PolynomialCycleSlipDetectorResult > cycleSlipResult
Cycle-slip result.
Definition GnssCombination.hpp:60
std::vector< std::tuple< InsTime, Polynomial< double >, double > > cycleSlipPolynomials
Polynomial fits.
Definition GnssCombination.hpp:63
std::string description
String describing the combination.
Definition GnssCombination.hpp:56
std::optional< double > result
Calculated combination (only set if all terms where present)
Definition GnssCombination.hpp:57
std::vector< Term > terms
List of terms making up the combination.
Definition GnssCombination.hpp:58
Identifies a satellite signal (satellite frequency and number)
Definition SatelliteIdentifier.hpp:62