44 return _enableLLICheck;
46 return _singleFrequencyDetector.isEnabled();
48 return _dualFrequencyDetector.isEnabled();
60 _enableLLICheck = enabled;
63 _singleFrequencyDetector.setEnabled(enabled);
66 _dualFrequencyDetector.setEnabled(enabled);
75 return detector ==
Detector::SingleFrequency ? _singleFrequencyDetector.getWindowSize() : _dualFrequencyDetector.getWindowSize();
83 else { _dualFrequencyDetector.setWindowSize(windowSize); }
98 else { _dualFrequencyThresholdPercentage = threshold; }
105 return detector ==
Detector::SingleFrequency ? _singleFrequencyDetector.getPolynomialDegree() : _dualFrequencyDetector.getPolynomialDegree();
113 else { _dualFrequencyDetector.setPolynomialDegree(polyDegree); }
123 return detector ==
Detector::SingleFrequency ? _singleFrequencyDetector.getFitStrategy() : _dualFrequencyDetector.getFitStrategy();
131 else { _dualFrequencyDetector.setFitStrategy(strategy); }
151 using Result = std::variant<CycleSlipLossOfLockIndicator, CycleSlipDualFrequency, CycleSlipSingleFrequency>;
173 [[nodiscard]] std::vector<Result>
checkForCycleSlip(
InsTime insTime,
const std::vector<SatelliteObservation>& satObs,
const std::string& nameId);
208 bool _enableLLICheck =
true;
210 double _singleFrequencyThresholdPercentage = 11.0;
211 double _dualFrequencyThresholdPercentage = 0.6;
256struct hash<NAV::CycleSlipDetector::DualFrequencyCombination>
262 auto hash1 = std::hash<NAV::SatId>{}(c.
satId);
263 auto hash2 = std::hash<NAV::Code>{}(c.
sig1);
264 auto hash3 = std::hash<NAV::Code>{}(c.
sig2);
266 return hash1 | (hash2 << 24) | (hash3 << 48);
271#ifndef DOXYGEN_IGNORE
275struct fmt::formatter<NAV::CycleSlipDetector::Result> : fmt::formatter<std::string>
281 template<
typename FormatContext>
284 return fmt::formatter<std::string>::format(
to_string(cycleSlip), ctx);
std::ostream & operator<<(std::ostream &os, const NAV::CycleSlipDetector::Result &obj)
Stream insertion operator overload.
bool CycleSlipDetectorGui(const char *label, CycleSlipDetector &cycleSlipDetector, float width=0.0F, bool dualFrequencyAvailable=true)
Shows a GUI for advanced configuration of the CycleSlipDetector.
nlohmann::json json
json namespace
Definition FlowManager.hpp:21
GNSS Observation messages.
Polynomial Cycle-slip detection algorithm.
Structs identifying a unique satellite.
Enumerate for GNSS Codes.
Definition Code.hpp:88
Cycle-slip detector.
Definition CycleSlipDetector.hpp:27
void reset()
Resets all data.
std::variant< CycleSlipLossOfLockIndicator, CycleSlipDualFrequency, CycleSlipSingleFrequency > Result
Result of the cycle-slip detection test.
Definition CycleSlipDetector.hpp:151
bool isEnabled(const Detector &detector) const
Is the cycle-slip detector enabled?
Definition CycleSlipDetector.hpp:39
friend bool CycleSlipDetectorGui(const char *label, CycleSlipDetector &cycleSlipDetector, float width, bool dualFrequencyAvailable)
Shows a GUI for advanced configuration of the CycleSlipDetector.
void setWindowSize(size_t windowSize, const Detector &detector)
Sets the amount of points used for the fit (sliding window)
Definition CycleSlipDetector.hpp:80
std::vector< Result > checkForCycleSlip(InsTime insTime, const std::vector< SatelliteObservation > &satObs, const std::string &nameId)
Checks for a cycle slip.
void setThreshold(double threshold, const Detector &detector)
Sets the threshold to categorize a measurement as cycle slip.
Definition CycleSlipDetector.hpp:95
void resetSignal(const SatSigId &satSigId)
Resets all data related to the provided signal.
Strategy getFitStrategy(const Detector &detector) const
Get the strategy used for fitting.
Definition CycleSlipDetector.hpp:121
friend void to_json(json &j, const CycleSlipDetector &data)
Write info to a json object.
void setEnabled(bool enabled, const Detector &detector)
Sets the enabled state.
Definition CycleSlipDetector.hpp:55
void setFitStrategy(Strategy strategy, const Detector &detector)
Sets the strategy used for fitting.
Definition CycleSlipDetector.hpp:128
size_t getWindowSize(const Detector &detector) const
Get the window size for the polynomial fit.
Definition CycleSlipDetector.hpp:73
double getThreshold(const Detector &detector) const
Get the threshold to categorize a measurement as cycle slip [% of smallest wavelength].
Definition CycleSlipDetector.hpp:88
Detector
Detectors in use.
Definition CycleSlipDetector.hpp:31
@ LLI
Loss-of-Lock Indicator check.
@ SingleFrequency
Single frequency detector.
@ DualFrequency
Dual frequency detector.
void setPolynomialDegree(size_t polyDegree, const Detector &detector)
Sets the degree of the polynomial which is used for fitting.
Definition CycleSlipDetector.hpp:110
friend void from_json(const json &j, CycleSlipDetector &data)
Read info from a json object.
size_t getPolynomialDegree(const Detector &detector) const
Get the degree of the polynomial which is used for fitting.
Definition CycleSlipDetector.hpp:103
The class is responsible for all time-related tasks.
Definition InsTime.hpp:667
Cycle-slip detection.
Definition PolynomialCycleSlipDetector.hpp:49
Strategy
Possible Fit strategies.
Definition PolynomialRegressor.hpp:43
Cycle-slip found in dual frequency combination.
Definition CycleSlipDetector.hpp:146
std::array< SatSigId, 2 > signals
Signal identifiers where the cycle-slip occurred.
Definition CycleSlipDetector.hpp:147
Cycle-slip because LLI was set.
Definition CycleSlipDetector.hpp:136
SatSigId signal
Signal identifier where the cycle-slip occurred.
Definition CycleSlipDetector.hpp:137
Cycle-slip found in single frequency carrier-phase observation.
Definition CycleSlipDetector.hpp:141
SatSigId signal
Signal identifier where the cycle-slip occurred.
Definition CycleSlipDetector.hpp:142
Dual frequency combination.
Definition CycleSlipDetector.hpp:184
SatId satId
Satellite Identifier.
Definition CycleSlipDetector.hpp:201
Code sig2
Signal code/frequency (f(sig2) < f(sig1), e.g. L2 if L1-L2)
Definition CycleSlipDetector.hpp:203
constexpr bool operator==(const DualFrequencyCombination &rhs) const
Equal comparison (needed for unordered_map)
Definition CycleSlipDetector.hpp:188
Code sig1
Signal code/frequency (f(sig1) > f(sig2), e.g. L1 if L1-L2)
Definition CycleSlipDetector.hpp:202
constexpr bool operator<(const DualFrequencyCombination &rhs) const
Less than comparison (needed for map)
Definition CycleSlipDetector.hpp:193
Signal for a code.
Definition CycleSlipDetector.hpp:158
GnssObs::ObservationData::CarrierPhase measurement
Carrier-phase measurement and LLI flag.
Definition CycleSlipDetector.hpp:160
Code code
Code.
Definition CycleSlipDetector.hpp:159
Satellite observations ordered per satellite.
Definition CycleSlipDetector.hpp:155
int8_t freqNum
Frequency number. Only used for GLONASS G1 and G2.
Definition CycleSlipDetector.hpp:165
SatId satId
Satellite identifier.
Definition CycleSlipDetector.hpp:163
std::vector< Signal > signals
List of signals.
Definition CycleSlipDetector.hpp:164
Carrier phase.
Definition GnssObs.hpp:71
Identifies a satellite (satellite system and number)
Definition SatelliteIdentifier.hpp:32
Identifies a satellite signal (satellite frequency and number)
Definition SatelliteIdentifier.hpp:62
std::size_t operator()(const NAV::CycleSlipDetector::DualFrequencyCombination &c) const
Hash function for SatId.
Definition CycleSlipDetector.hpp:260