0.5.0
Loading...
Searching...
No Matches
AmbiguityResolution.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
9/// @file AmbiguityResolution.hpp
10/// @brief Ambiguity resolution algorithms
11/// @author T. Topp (topp@ins.uni-stuttgart.de)
12/// @date 2023-09-20
13
14#pragma once
15
16#include <cstddef>
17#include <cstdint>
18#include <optional>
19#include "util/Eigen.hpp"
20#include "util/Logger.hpp"
21#include <fmt/format.h>
22#include <nlohmann/json.hpp>
23using json = nlohmann::json; ///< json namespace
24
26#include "internal/Search.hpp"
27#include "internal/Validate.hpp"
28
30
31namespace NAV
32{
33
34/// Ambiguity resolution strategies
35enum class AmbiguityResolutionStrategy : uint8_t
36{
37 Continuous, ///< Estimate ambiguities every epoch
38 FixAndHold, ///< Do not change the ambiguity once it is fixed
39 COUNT, ///< Amount of items in the enum
40};
41
42/// @brief Converts the enum to a string
43/// @param[in] ambiguityResolutionStrategy Enum value to convert into text
44/// @return String representation of the enum
45const char* to_string(AmbiguityResolutionStrategy ambiguityResolutionStrategy);
46
47/// @brief Ambiguity resolution algorithms and parameters
49{
50 /// @brief Decorrelation algorithms
51 enum class DecorrelationAlgorithm : uint8_t
52 {
53 None, ///< Do not decorrelate
54 Z_Transformation, ///< Z-Transformation
55 COUNT, ///< Amount of items in the enum
56 };
57
58 /// @brief Search algorithms
59 enum class SearchAlgorithm : uint8_t
60 {
61 None, ///< Disable the search
62 IntegerRounding, ///< Integer Rounding (IR)
63 IntegerBootstrapping, ///< Integer Bootstrapping (IB)
64 IntegerLeastSquaresSearch, ///< Integer least-squares (ILS) Search (LAMBDA)
65 IntegerLeastSquaresSearchAndShrink, ///< Integer least-squares (ILS) Search-and-Shrink (MLAMBDA)
66 COUNT, ///< Amount of items in the enum
67 };
68
69 /// @brief Validation algorithms
70 ///
71 /// Define the best fitting integer solution \f$ \mathbf{\check{a}} \f$ and second best integer solution as \f$ \mathbf{\check{a}}' \f$ (\cite SpringerHandbookGNSS2017 Springer Handbook GNSS, ch. 23.6.4, eq. 23.79)
72 /// \anchor eq-ambRes-val \f{equation}{ \label{eq:eq-ambRes-val}
73 /// \begin{aligned}
74 /// \mathbf{\check{a}} &= \text{arg} \min_{z \in \mathbb{Z}^n} ||\mathbf{\hat{a}} - \mathbf{z}||^2_{\mathbf{Q_{\mathbf{\hat{a}}\mathbf{\hat{a}}}}} \\
75 /// \mathbf{\check{a}}' &= \text{arg} \min_{z \in \mathbb{Z}^n, z \neq \mathbf{\check{a}}} ||\mathbf{\hat{a}} - \mathbf{z}||^2_{\mathbf{Q_{\mathbf{\hat{a}}\mathbf{\hat{a}}}}}
76 /// \end{aligned}
77 /// \f}
78 enum class ValidationAlgorithm : uint8_t
79 {
80 /// Do not validate the solution (always accept the integer solution, if one is found)
82 /// Accept if (see \cite Verhagen2006 Verhagen 2006, eq. 31, see NAV::Ambiguity::differenceTest)
83 /// \anchor eq-ambRes-diff \f{equation}{ \label{eq:eq-ambRes-diff}
84 /// ||\mathbf{\hat{a}} - \mathbf{\check{a}}'||^2_{\mathbf{Q_{\mathbf{\hat{a}}\mathbf{\hat{a}}}}}
85 /// - ||\mathbf{\hat{a}} - \mathbf{\check{a}} ||^2_{\mathbf{Q_{\mathbf{\hat{a}}\mathbf{\hat{a}}}}} \ge c
86 /// \f}
88 /// Accept if (see \cite SpringerHandbookGNSS2017 Springer Handbook GNSS, ch. 23.6.4, eq. 23.78 or \cite Verhagen2006 Verhagen 2006, eq. 28, 29, see NAV::Ambiguity::ratioTest)
89 /// \anchor eq-ambRes-ratio \f{equation}{ \label{eq:eq-ambRes-ratio}
90 /// \frac{||\mathbf{\hat{a}} - \mathbf{\check{a}} ||^2_{\mathbf{Q_{\mathbf{\hat{a}}\mathbf{\hat{a}}}}}}
91 /// {||\mathbf{\hat{a}} - \mathbf{\check{a}}'||^2_{\mathbf{Q_{\mathbf{\hat{a}}\mathbf{\hat{a}}}}}} \le \mu
92 /// ,\quad 0 < \mu \le 1, \text{given by the user}
93 /// \f}
95 /// Accept if \eqref{eq-ambRes-ratio}, but with \f$ \mu \f$ calculated from given failure rate \f$ P_F \f$ (see \cite Verhagen2013 Verhagen 2013, see NAV::Ambiguity::fixedFailureRateRatioTest)
97 /// Accept if (see \cite Verhagen2006 Verhagen 2006, eq. 35, see NAV::Ambiguity::projectorTest)
98 /// \anchor eq-ambRes-proj \f{equation}{ \label{eq:eq-ambRes-proj}
99 /// \left| \dfrac{(\mathbf{\check{a}}' - \mathbf{\check{a}})^T \mathbf{Q}_{\mathbf{\hat{a}}}^{-1} (\mathbf{\hat{a}} - \mathbf{\check{a}}) }
100 /// {|| \mathbf{\check{a}}' - \mathbf{\check{a}} ||_{\mathbf{Q}_{\mathbf{\hat{a}}}}} \right| \le \mu
101 /// \f}
102 /// It projects \f$ \mathbf{\hat{a}} - \mathbf{\check{a}} \f$ orthogonally on the direction of \f$ \mathbf{\check{a}}' - \mathbf{\check{a}} \f$, in the metric of \f$ \mathbf{Q}_{\mathbf{\hat{a}}} \f$
104 /// Amount of items in the enum
106 };
107
108 /// Decorrelation algorithm
110 /// Search algorithm
112 /// Validation with Bootstrapped success rate (Bootstrapped failure rate is an upper bound for the ILS failure rate)
114 /// Validation algorithm
116
117 /// @brief Critical value c for the the difference test
119 /// @brief Critical value µ for the the ratio and projector test (0, 1]
121 /// @brief Failure rate for the ratio test (used to calculate µ)
123 /// @brief Attempt partial fixing of ambiguities
124 bool partialFixing = false;
125
126 /// Possible failure rates for the look-up tables
127 static constexpr std::array<double, 2> allowedFailureRateValues = { { 0.001, 0.01 } };
128};
129
130/// @brief Converts the enum to a string
131/// @param[in] decorrelationAlgorithm Enum value to convert into text
132/// @return String representation of the enum
133const char* to_string(AmbiguityResolutionParameters::DecorrelationAlgorithm decorrelationAlgorithm);
134
135/// @brief Converts the enum to a string
136/// @param[in] searchAlgorithm Enum value to convert into text
137/// @return String representation of the enum
139
140/// @brief Converts the enum to a string
141/// @param[in] searchAlgorithm Enum value to convert into text
142/// @return String representation of the enum
144
145/// @brief Converts the enum to a string
146/// @param[in] validationAlgorithm Enum value to convert into text
147/// @return String representation of the enum
149
150/// @brief Shows a ComboBox to select the ambiguity resolution algorithms
151/// @param[in] id Unique id for ImGui.
152/// @param[in, out] params Reference to the ambiguity resolution parameter struct
153/// @param[in] width GUI item width
154bool GuiAmbiguityResolution(const char* id, AmbiguityResolutionParameters& params, float width = 310.0F);
155
156/// @brief Possible failures
157enum class AmbiguityResolutionFailure : uint8_t
158{
159 None, ///< No failure
160 NoSearchAlgorithm, ///< No Search algorithm selected
161 Decorrelation, ///< Decorrelation failed
162 NoCandidatesFound, ///< No candidates were found with the search
163 ValidationFailed, ///< Validation rejected the result
164};
165
166/// @brief Ambiguity resolution result
167template<typename Scalar, int nAmb, int nReal>
169{
170 /// @brief Fixed ambiguity and their squared norm
172 {
173 /// @brief Constructor
174 /// @param sqnorm Squared norm
175 /// @param a Fixed ambiguity vector [cycles]
176 template<typename Derived>
177 FixedAmbiguity(double sqnorm, const Eigen::MatrixBase<Derived>& a)
178 : sqnorm(sqnorm), a(a)
179 {}
180
181 double sqnorm; ///< Squared norm
182 Eigen::Vector<Scalar, nAmb> a; ///< Fixed ambiguity vector [cycles]
183 };
184
186 double ambiguityCriticalValueRatio{}; ///< Ambiguity Critical Value µ ∈ (0, 1] (R1/R2 ≤ µ)
187
188 size_t nFixed = 0; ///< Number of fixed ambiguities (differs from vector size in case of partial fixing)
189 std::vector<FixedAmbiguity> fixedAmb; ///< Sorted vector of fixed ambiguities and their norms
190 Eigen::Vector<Scalar, nReal> b; ///< Fixed non-integer float states (e.g. Pos, Vel, ...)
191 Eigen::Matrix<Scalar, nReal, nReal> Qb; ///< Fixed variance/covariance matrix of the non-integer float states
192};
193
194/// @brief Tries resolving the ambiguities
195/// @param a Float ambiguity vector [cycles]
196/// @param Qa Variance/covariance matrix of the ambiguities
197/// @param b Non-integer float states (e.g. Pos, Vel, ...)
198/// @param Qb Variance/covariance matrix of the non-integer float states
199/// @param Qab Upper right part of the variance/covariance matrix (correlation between ambiguities and other states)
200/// @param Qba Lower left part of the variance/covariance matrix (correlation between ambiguities and other states)
201/// @param params Ambiguity resolution algorithm and parameters
202/// @param nameId NameId for debugging
203/// @return The result struct if the ambiguities could be fixed and validated
204template<typename DerivedA, typename DerivedQa, typename DerivedB, typename DerivedQb, typename DerivedQab, typename DerivedQba>
206 ResolveAmbiguities(const Eigen::MatrixBase<DerivedA>& a, const Eigen::MatrixBase<DerivedQa>& Qa,
207 const Eigen::MatrixBase<DerivedB>& b, const Eigen::MatrixBase<DerivedQb>& Qb,
208 const Eigen::MatrixBase<DerivedQab>& Qab, const Eigen::MatrixBase<DerivedQba>& Qba,
209 const AmbiguityResolutionParameters& params,
210 [[maybe_unused]] const std::string& nameId)
211{
212 using DecorrelationAlgorithm = AmbiguityResolutionParameters::DecorrelationAlgorithm;
214 using ValidationAlgorithm = AmbiguityResolutionParameters::ValidationAlgorithm;
215
216 using Eigen::seq, Eigen::last;
217
219
220 if (params.searchAlgorithm == SearchAlgorithm::None) // If we do not search, do not do any work like decorrelation or validation
221 {
223 return result;
224 }
225
226 LOG_DATA("{}: Qa = \n{}", nameId, Eigen::MatrixXd(Qa));
227 LOG_DATA("{}: a = {}", nameId, a.transpose());
228 LOG_DATA("{}: Qb = \n{}", nameId, Eigen::MatrixXd(Qb));
229 LOG_DATA("{}: b = {}", nameId, b.transpose());
230 LOG_DATA("{}: Qab = \n{}", nameId, Eigen::MatrixXd(Qab));
231 LOG_DATA("{}: Qba = \n{}", nameId, Eigen::MatrixXd(Qba));
232
233 // Avoid integer overflows by reducing the ambiguities between -1.0 and +1.0
234 Eigen::VectorXd ambIntPart = a.template cast<int>().template cast<double>();
235 Eigen::VectorXd ambFracPart = a - ambIntPart;
236 LOG_DATA("{}: ambFracPart = {}", nameId, ambFracPart.transpose());
237
238 typename DerivedQa::PlainObject Qz; // Decorrelated ambiguity covariance matrix
239 typename DerivedQa::PlainObject Z; // Decorrelation transformation matrix
240 typename DerivedQa::PlainObject L; // Lower-triangular matrix from the L^T * D * L decomposition of Q
241 Eigen::VectorXd D; // Diagonal entries from the L^T * D * L decomposition of Q
242 Eigen::VectorXd z; // Decorrelated float ambiguity vector [cycles]
243
244 switch (params.decorrelationAlgorithm)
245 {
246 case DecorrelationAlgorithm::Z_Transformation:
247 if (auto decorrelated_ztrafo = Ambiguity::decorrelate_ztrafo(ambFracPart, Qa))
248 {
249 std::tie(Qz, Z, L, D, z) = *decorrelated_ztrafo;
250 }
251 else
252 {
253 LOG_DEBUG("{}: Decorrelation failed", nameId);
255 return result;
256 }
257 break;
258 case DecorrelationAlgorithm::None:
259 case DecorrelationAlgorithm::COUNT:
260 Qz = Qa;
261 z = a;
262 if (auto ltdl_decomp = math::LtDLdecomp_choleskyFact(Qa))
263 {
264 std::tie(L, D) = *ltdl_decomp;
265 }
266 else
267 {
268 LOG_DEBUG("{}: Decorrelation failed", nameId);
269 }
270 break;
271 }
272 LOG_DATA("{}: z = {}", nameId, z.transpose());
273 LOG_DATA("{}: Qz = \n{}", nameId, Eigen::MatrixXd(Qz));
274 LOG_DATA("{}: Z = \n{}", nameId, Z);
275 LOG_DATA("{}: L = \n{}", nameId, L);
276 LOG_DATA("{}: D = {}", nameId, D.transpose());
277
278 auto n = z.rows();
279 int k = 0;
280 // if (params.partialFixing) // Partial fixing is done by giving a subset to this function. So not relevant here
281 // {
282 // k = -1;
283 // double P0 = 0.995;
284 // double Ps = 0.0;
285 // do // Decorrelated ambiguities are sorted by standard deviation. Largest entry in D is first entry. So remove from top
286 // {
287 // k++;
288 // Ps = Ambiguity::successRateBootstrapping(D(seq(k, last)));
289 // LOG_DATA("{}: Ps(k = {}) = {}", nameId, k, Ps);
290 // } while (Ps < P0 && k < n - 1);
291 // if (Ps < P0) { return {}; }
292 // }
293 if (k != 0)
294 {
295 LOG_TRACE("{}: Doing partial ambiguity fixing for only {} of {} ambiguities", nameId, n - k, n);
296 LOG_DATA("{}: z = {}", nameId, z(seq(k, last)).transpose());
297 LOG_DATA("{}: Qz = \n{}", nameId, Eigen::MatrixXd(Qz(seq(k, last), seq(k, last))));
298 LOG_DATA("{}: L = \n{}", nameId, L(seq(k, last), seq(k, last)));
299 LOG_DATA("{}: D = {}", nameId, D(seq(k, last)).transpose());
300 }
301
302 Eigen::MatrixXd cands;
303 Eigen::VectorXd sqnorm;
304 int numCandidates = 2;
305
306 switch (params.searchAlgorithm)
307 {
308 case SearchAlgorithm::IntegerRounding:
309 cands = Ambiguity::integerSearchRounding(z(seq(k, last)));
310 sqnorm = Eigen::VectorXd::Constant(1, 1.0);
311 break;
312 case SearchAlgorithm::IntegerBootstrapping:
313 cands = Ambiguity::integerSearchBootstrapping(z(seq(k, last)), Qz(seq(k, last), seq(k, last)));
314 sqnorm = Eigen::VectorXd::Constant(1, 1.0);
315 break;
316 case SearchAlgorithm::IntegerLeastSquaresSearch:
317 std::tie(cands, sqnorm) = Ambiguity::integerLeastSquaresSearch(z(seq(k, last)), Qz(seq(k, last), seq(k, last)),
318 L(seq(k, last), seq(k, last)), D(seq(k, last)), numCandidates);
319 break;
320 case SearchAlgorithm::IntegerLeastSquaresSearchAndShrink:
321 std::tie(cands, sqnorm) = Ambiguity::integerLeastSquaresSearchAndShrink(z(seq(k, last)), L(seq(k, last), seq(k, last)), D(seq(k, last)), numCandidates);
322 break;
323 case SearchAlgorithm::None:
324 case SearchAlgorithm::COUNT:
325 break;
326 }
327
328#if LOG_LEVEL <= LOG_LEVEL_DATA
329 if (k != 0)
330 {
331 Eigen::MatrixXd print(cands.cols(), cands.rows() + 1);
332 for (Eigen::Index i = 0; i < cands.cols(); i++)
333 {
334 print(i, 0) = sqnorm(i);
335 print(i, Eigen::seq(1, Eigen::last)) = cands.col(i).transpose();
336 }
337 LOG_DATA("{}: sqnorm, cand (1 candidate each row)\n{}", nameId, print);
338 }
339#endif
340
341 if (cands.cols() == 0)
342 {
343 LOG_DATA("{}: No candidates found ", nameId);
345 return result;
346 }
347
348 // Partial fixing is done by giving a subset to this function. So not relevant here
349 // if (params.partialFixing) // Adjust first k-1 ambiguities based on correlation with the fixed ambiguities
350 // {
351 // LOG_DATA("{}: Adjusting first k-1 ambiguities based on correlation with the fixed ambiguities", nameId);
352 // Eigen::MatrixXd zfixed = Eigen::MatrixXd::Zero(n, numCandidates);
353 // Eigen::MatrixXd QP = Qz(seq(0, k - 1), seq(k, last)) * Qz(seq(k, last), seq(k, last)).inverse();
354 // for (int i = 0; i < numCandidates; i++)
355 // {
356 // zfixed(seq(0, k - 1), i) = z(seq(0, k - 1)) - QP * (z(seq(k, last)) - cands(Eigen::all, i));
357 // }
358 // zfixed(seq(k, last), Eigen::all) = cands;
359 // cands = zfixed;
360
361 // #if LOG_LEVEL <= LOG_LEVEL_DATA
362 // {
363 // Eigen::MatrixXd print(cands.cols(), cands.rows() + 1);
364 // for (Eigen::Index i = 0; i < cands.cols(); i++)
365 // {
366 // print(i, 0) = sqnorm(i);
367 // print(i, Eigen::seq(1, Eigen::last)) = cands.col(i).transpose();
368 // }
369 // LOG_DATA("{}: sqnorm, cand (1 candidate each row)\n{}", nameId, print);
370 // }
371 // #endif
372 // }
373
374 for (Eigen::Index i = 0; i < cands.cols(); i++)
375 {
376 if (params.decorrelationAlgorithm != DecorrelationAlgorithm::None)
377 {
378 // Back transformation
379 cands.col(i) = Z.transpose().inverse() * cands.col(i);
380
381 // Z is an integer preserving transformation
382 // If cands is only partially fixed, then the output wont have integers at all
383 }
384 // Reapply the integer part from before
385 cands.col(i) += ambIntPart;
386 }
387
388#if LOG_LEVEL <= LOG_LEVEL_DATA
389 {
390 Eigen::MatrixXd print(cands.cols(), cands.rows() + 1);
391 for (Eigen::Index i = 0; i < cands.cols(); i++)
392 {
393 print(i, 0) = sqnorm(i);
394 print(i, Eigen::seq(1, Eigen::last)) = cands.col(i).transpose();
395 }
396 LOG_DATA("{}: Back transformed results - sqnorm, cand (1 candidate each row){}\n{}", nameId,
397 k != 0 ? " (not integer, because only partial fix)" : "", print);
398 }
399#endif
400
401 if (cands.cols() > 1) // If we found only one candidate, the second one was very unlikely. Therefore we can accept this one without testing
402 {
403 result.ambiguityCriticalValueRatio = sqnorm(0) / sqnorm(1);
404 switch (params.validationAlgorithm)
405 {
406 case ValidationAlgorithm::DifferenceTest:
407 if (!Ambiguity::differenceTest(sqnorm(0), sqnorm(1), params.validationTestCriticalValueC))
408 {
410 return result;
411 }
412 break;
413 case ValidationAlgorithm::RatioTestCriticalValue:
414 if (!Ambiguity::ratioTest(sqnorm(0), sqnorm(1), params.validationTestCriticalValueMu))
415 {
417 return result;
418 }
419 break;
420 case ValidationAlgorithm::RatioTestFailureRate:
422 static_cast<size_t>(n - k), D, params.validationBootstrappedSuccessRate))
423 {
425 return result;
426 }
427 break;
428 case ValidationAlgorithm::ProjectorTest:
429 if (!Ambiguity::projectorTest(cands.col(0), cands.col(1), a(seq(k, last)), Qa(seq(k, last), seq(k, last)),
431 {
433 return result;
434 }
435 break;
436 case ValidationAlgorithm::None:
437 case ValidationAlgorithm::COUNT:
438 break;
439 }
440 }
441
442 result.b = b - Qba * Qa.inverse() * (a - cands.col(0));
443 result.Qb = Qb - Qba * Qa.inverse() * Qab;
444
445 for (Eigen::Index i = 0; i < cands.cols(); i++)
446 {
447 result.fixedAmb.emplace_back(sqnorm(i), cands.col(i));
448 }
449 result.nFixed = static_cast<size_t>(n - k);
450
451 return result;
452}
453
454/// @brief Converts the provided object into json
455/// @param[out] j Json object which gets filled with the info
456/// @param[in] obj Object to convert into json
457void to_json(json& j, const AmbiguityResolutionParameters& obj);
458/// @brief Converts the provided json object into a node object
459/// @param[in] j Json object with the needed values
460/// @param[out] obj Object to fill from the json
461void from_json(const json& j, AmbiguityResolutionParameters& obj);
462
463} // namespace NAV
Ambiguity decorrelation algorithms.
Vector space operations.
nlohmann::json json
json namespace
Utility class for logging to console and file.
#define LOG_DEBUG
Debug information. Should not be called on functions which receive observations (spamming)
Definition Logger.hpp:67
#define LOG_DATA
All output which occurs repeatedly every time observations are received.
Definition Logger.hpp:29
#define LOG_TRACE
Detailled info to trace the execution of the program. Should not be called on functions which receive...
Definition Logger.hpp:65
Simple Math functions.
Ambiguity Search algorithms.
Ambiguity resolution validation algorithms.
bool fixedFailureRateRatioTest(double Pf, const Eigen::MatrixBase< DerivedAFix1 > &aFix1, const Eigen::MatrixBase< DerivedAFix2 > &aFix2, const Eigen::MatrixBase< DerivedAFloat > &aFloat, const Eigen::MatrixBase< DerivedQ > &Qa, const Eigen::MatrixBase< DerivedD > &D_LTDL_Q)
Ratio test with a fixed-failure rate for ambiguity resolution, see NAV::AmbiguityResolutionParameters...
Definition Validate.hpp:123
bool differenceTest(double sqNormFix1, double sqNormFix2, double criticalValue)
Difference test for the ambiguity resolution see NAV::AmbiguityResolutionParameters::ValidationAlgori...
Definition Validate.cpp:98
std::pair< Eigen::MatrixXd, Eigen::VectorXd > integerLeastSquaresSearchAndShrink(const Eigen::MatrixBase< DerivedA > &zh, const Eigen::MatrixBase< DerivedL > &L_LTDL_Q, const Eigen::MatrixBase< DerivedD > &D_LTDL_Q, const Eigen::Index &numCandidates=2)
Performs an integer least-squares to search for integer candidates for the ambiguities using the sear...
Definition Search.hpp:243
Derived::PlainObject integerSearchRounding(const Eigen::MatrixBase< Derived > &a)
Searches for the integer ambiguities by integer rounding.
Definition Search.hpp:34
bool ratioTest(double sqNormFix1, double sqNormFix2, double mu)
Ratio test for the ambiguity resolution see NAV::AmbiguityResolutionParameters::ValidationAlgorithm::...
Definition Validate.cpp:103
std::pair< Eigen::MatrixXd, Eigen::VectorXd > integerLeastSquaresSearch(const Eigen::MatrixBase< DerivedA > &a, const Eigen::MatrixBase< DerivedQ > &Q, const Eigen::MatrixBase< DerivedL > &L_LTDL_Q, const Eigen::MatrixBase< DerivedD > &D_LTDL_Q, const Eigen::Index &numCandidates=2)
Performs an integer least-squares to search for integer candidates for the ambiguities.
Definition Search.hpp:79
DerivedA::PlainObject integerSearchBootstrapping(const Eigen::MatrixBase< DerivedA > &a, const Eigen::MatrixBase< DerivedQ > &Qa)
Searches for the integer ambiguities by integer bootstrapping.
Definition Search.hpp:48
bool projectorTest(const Eigen::MatrixBase< DerivedAFix1 > &aFix1, const Eigen::MatrixBase< DerivedAFix2 > &aFix2, const Eigen::MatrixBase< DerivedAFloat > &aFloat, const Eigen::MatrixBase< DerivedQ > &Qa, double mu)
Projector test for the ambiguity resolution see NAV::AmbiguityResolutionParameters::ValidationAlgorit...
Definition Validate.hpp:172
std::optional< std::tuple< typename DerivedQ::PlainObject, typename DerivedQ::PlainObject, typename DerivedQ::PlainObject, typename DerivedA::PlainObject, typename DerivedA::PlainObject > > decorrelate_ztrafo(const Eigen::MatrixBase< DerivedA > &a, const Eigen::MatrixBase< DerivedQ > &Q)
Decorrelates the ambiguities.
std::optional< std::pair< Eigen::Matrix< typename Derived::Scalar, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime >, Eigen::Vector< typename Derived::Scalar, Derived::RowsAtCompileTime > > > LtDLdecomp_choleskyFact(const Eigen::MatrixBase< Derived > &Q)
Find (L^T D L)-decomposition of Q-matrix via a backward Cholesky factorization in a bordering method ...
Definition Math.hpp:278
void to_json(json &j, const Node &node)
Converts the provided node into a json object.
Definition Node.cpp:990
AmbiguityResolutionStrategy
Ambiguity resolution strategies.
@ FixAndHold
Do not change the ambiguity once it is fixed.
@ Continuous
Estimate ambiguities every epoch.
const char * to_string_short(AmbiguityResolutionParameters::SearchAlgorithm searchAlgorithm)
Converts the enum to a string.
@ COUNT
Amount of items in the enum.
@ None
Ionosphere model turned off.
const char * to_string(gui::widgets::PositionWithFrame::ReferenceFrame refFrame)
Converts the enum to a string.
AmbiguityResolutionFailure
Possible failures.
@ ValidationFailed
Validation rejected the result.
@ NoCandidatesFound
No candidates were found with the search.
@ NoSearchAlgorithm
No Search algorithm selected.
void from_json(const json &j, Node &node)
Converts the provided json object into a node object.
Definition Node.cpp:1007
AmbiguityResolutionResult< typename DerivedA::Scalar, DerivedA::RowsAtCompileTime, DerivedB::RowsAtCompileTime > ResolveAmbiguities(const Eigen::MatrixBase< DerivedA > &a, const Eigen::MatrixBase< DerivedQa > &Qa, const Eigen::MatrixBase< DerivedB > &b, const Eigen::MatrixBase< DerivedQb > &Qb, const Eigen::MatrixBase< DerivedQab > &Qab, const Eigen::MatrixBase< DerivedQba > &Qba, const AmbiguityResolutionParameters &params, const std::string &nameId)
Tries resolving the ambiguities.
bool GuiAmbiguityResolution(const char *id, AmbiguityResolutionParameters &params, float width)
Shows a ComboBox to select the ambiguity resolution algorithms.
Ambiguity resolution algorithms and parameters.
bool validationBootstrappedSuccessRate
Validation with Bootstrapped success rate (Bootstrapped failure rate is an upper bound for the ILS fa...
@ RatioTestFailureRate
Accept if , but with calculated from given failure rate (see verhagen2013 Verhagen 2013,...
SearchAlgorithm searchAlgorithm
Search algorithm.
double validationTestCriticalValueC
Critical value c for the the difference test.
double validationTestCriticalValueMu
Critical value µ for the the ratio and projector test (0, 1].
double validationRatioTestFailureRate
Failure rate for the ratio test (used to calculate µ)
DecorrelationAlgorithm
Decorrelation algorithms.
static constexpr std::array< double, 2 > allowedFailureRateValues
Possible failure rates for the look-up tables.
DecorrelationAlgorithm decorrelationAlgorithm
Decorrelation algorithm.
ValidationAlgorithm validationAlgorithm
Validation algorithm.
bool partialFixing
Attempt partial fixing of ambiguities.
@ IntegerLeastSquaresSearchAndShrink
Integer least-squares (ILS) Search-and-Shrink (MLAMBDA)
@ IntegerLeastSquaresSearch
Integer least-squares (ILS) Search (LAMBDA)
Eigen::Vector< Scalar, nAmb > a
Fixed ambiguity vector [cycles].
FixedAmbiguity(double sqnorm, const Eigen::MatrixBase< Derived > &a)
Constructor.
Ambiguity resolution result.
double ambiguityCriticalValueRatio
Ambiguity Critical Value µ ∈ (0, 1] (R1/R2 ≤ µ)
AmbiguityResolutionFailure failure
Failure mode.
Eigen::Vector< Scalar, nReal > b
Fixed non-integer float states (e.g. Pos, Vel, ...)
size_t nFixed
Number of fixed ambiguities (differs from vector size in case of partial fixing)
Eigen::Matrix< Scalar, nReal, nReal > Qb
Fixed variance/covariance matrix of the non-integer float states.
std::vector< FixedAmbiguity > fixedAmb
Sorted vector of fixed ambiguities and their norms.