0.2.0
Loading...
Searching...
No Matches
ObservationFilter.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 <cstddef>
17#include <unordered_map>
18#include <unordered_set>
19#include <utility>
20#include <array>
21#include <vector>
22
23#include <imgui.h>
25
32#include "Navigation/Transformations/Units.hpp"
33
36
38#include "util/Json.hpp"
39
40namespace NAV
41{
42
45{
46 public:
51 explicit ObservationFilter(size_t receiverCount,
52 const std::unordered_set<GnssObs::ObservationType>& availableObsTypes = { GnssObs::Pseudorange, GnssObs::Carrier, GnssObs::Doppler },
53 std::unordered_set<GnssObs::ObservationType> neededObsTypes = {})
54 : _snrMask(receiverCount), _availableObsTypes(availableObsTypes), _neededObsTypes(std::move(neededObsTypes)), _usedObsTypes(availableObsTypes) {}
55
57 ~ObservationFilter() = default;
59 ObservationFilter(const ObservationFilter& other) = default;
61 ObservationFilter(ObservationFilter&& other) noexcept = default;
64 {
65 if (this != &other) // not a self-assignment
66 {
67 _filterFreq = other._filterFreq;
68 _filterCode = other._filterCode;
69 _excludedSatellites = other._excludedSatellites;
70 _elevationMask = other._elevationMask;
71 _snrMask = other._snrMask;
72 _sameSnrMaskForAllReceivers = other._sameSnrMaskForAllReceivers;
73 _neededObsTypes = other._neededObsTypes;
74 _usedObsTypes = other._usedObsTypes;
75 std::vector<GnssObs::ObservationType> obsTypeToRemove;
76 for (const auto& obsType : _usedObsTypes)
77 {
78 if (!_availableObsTypes.contains(obsType)) { obsTypeToRemove.push_back(obsType); }
79 }
80 for (const auto& obsType : obsTypeToRemove)
81 {
82 _usedObsTypes.erase(obsType);
83 }
84 }
85 return *this;
86 }
89 {
90 if (this != &other) // not a self-assignment
91 {
92 _filterFreq = other._filterFreq;
93 _filterCode = other._filterCode;
94 _excludedSatellites = std::move(other._excludedSatellites);
95 _elevationMask = other._elevationMask;
96 _snrMask = std::move(other._snrMask);
97 _sameSnrMaskForAllReceivers = other._sameSnrMaskForAllReceivers;
98 _neededObsTypes = std::move(other._neededObsTypes);
99 _usedObsTypes = std::move(other._usedObsTypes);
100 std::vector<GnssObs::ObservationType> obsTypeToRemove;
101 for (const auto& obsType : _usedObsTypes)
102 {
103 if (!_availableObsTypes.contains(obsType)) { obsTypeToRemove.push_back(obsType); }
104 }
105 for (const auto& obsType : obsTypeToRemove)
106 {
107 _usedObsTypes.erase(obsType);
108 }
109 }
110 return *this;
111 }
112
114 void reset()
115 {
116 _temporarilyExcludedSignalsSatellites.clear();
117 }
118
125 template<typename ReceiverType>
126 [[nodiscard]] Observations selectObservationsForCalculation(const std::array<Receiver<ReceiverType>, ReceiverType::ReceiverType_COUNT>& receivers,
127 const std::vector<const GnssNavInfo*>& gnssNavInfos,
128 [[maybe_unused]] const std::string& nameId,
129 bool ignoreElevationMask = false)
130 {
131 Observations observations;
132 observations.signals.reserve(receivers.front().gnssObs->data.size());
133
134 std::array<std::unordered_set<SatId>, GnssObs::ObservationType_COUNT> nMeasUniqueSat;
135
136 for (const auto& obsData : receivers.front().gnssObs->data)
137 {
138 SatId satId = obsData.satSigId.toSatId();
139
140 if (!(obsData.satSigId.freq() & _filterFreq) // frequency is not selected in GUI
141 || !(obsData.satSigId.code & _filterCode) // code is not selected in GUI
142 || !obsData.pseudorange // has an invalid pseudorange
143 || _temporarilyExcludedSignalsSatellites.contains(obsData.satSigId)
144 || std::find(_excludedSatellites.begin(), _excludedSatellites.end(), satId) != _excludedSatellites.end()) // is excluded
145 {
146 if (_temporarilyExcludedSignalsSatellites.contains(obsData.satSigId))
147 {
148 _temporarilyExcludedSignalsSatellites.at(obsData.satSigId)--;
149 if (_temporarilyExcludedSignalsSatellites.at(obsData.satSigId) == 0) { _temporarilyExcludedSignalsSatellites.erase(obsData.satSigId); }
150 }
151 LOG_DATA("{}: [{}] Skipping obs due to GUI filter selections", nameId, obsData.satSigId);
152 continue;
153 }
154
155 LOG_DATA("{}: [{}] Searching if observation in all receivers", nameId, obsData.satSigId);
157 if (std::any_of(receivers.begin(), receivers.end(),
158 [&](const Receiver<ReceiverType>& recv) {
159 auto obsDataOther = std::find_if(recv.gnssObs->data.begin(), recv.gnssObs->data.end(),
160 [&obsData](const GnssObs::ObservationData& obsDataOther) {
161 return obsDataOther.satSigId == obsData.satSigId;
162 });
163
164 if (obsDataOther == recv.gnssObs->data.end())
165 {
166 LOG_DATA("{}: [{}] Receiver '{}' did not observe the signal.", nameId, obsData.satSigId, recv.type);
167 return true;
168 } // All receivers must have this observation
169
170 for (const auto& obsType : _usedObsTypes)
171 {
172 switch (obsType)
173 {
175 if (obsDataOther->pseudorange) { availableObservations[obsType]++; }
176 break;
177 case GnssObs::Carrier:
178 if (obsDataOther->carrierPhase) { availableObservations[obsType]++; }
179 break;
180 case GnssObs::Doppler:
181 if (obsDataOther->doppler) { availableObservations[obsType]++; }
182 break;
184 break;
185 }
186 }
187 if (!obsDataOther->pseudorange)
188 {
189 LOG_DATA("{}: [{}] Receiver '{}' did not have a pseudorange observation.", nameId, obsData.satSigId, recv.type);
190 }
191 return !obsDataOther->pseudorange; // Pseudorange must be available for all receivers
192 }))
193 {
194 continue;
195 }
196 LOG_DATA("{}: [{}] Observed psr {}x, carrier {}x, doppler {}x", nameId, obsData.satSigId,
197 availableObservations.contains(GnssObs::Pseudorange) ? availableObservations.at(GnssObs::Pseudorange) : 0,
198 availableObservations.contains(GnssObs::Carrier) ? availableObservations.at(GnssObs::Carrier) : 0,
199 availableObservations.contains(GnssObs::Doppler) ? availableObservations.at(GnssObs::Doppler) : 0);
200
201 std::shared_ptr<NAV::SatNavData> satNavData = nullptr;
202 for (const auto& gnssNavInfo : gnssNavInfos)
203 {
204 auto satNav = gnssNavInfo->searchNavigationData(satId, receivers.front().gnssObs->insTime);
205 if (satNav && satNav->isHealthy())
206 {
207 satNavData = satNav;
208 break;
209 }
210 }
211 if (satNavData == nullptr) { continue; } // can calculate satellite position
212
213 int8_t freqNum = -128;
214 if (satId.satSys == GLO)
215 {
216 if (auto gloSatNavData = std::dynamic_pointer_cast<GLONASSEphemeris>(satNavData))
217 {
218 freqNum = gloSatNavData->frequencyNumber;
219 }
220 }
221
222 Observations::SignalObservation sigObs(satNavData, freqNum);
223
224 bool skipObservation = false;
225 for (const auto& recv : receivers)
226 {
227 auto recvObsData = std::find_if(recv.gnssObs->data.begin(), recv.gnssObs->data.end(),
228 [&obsData](const GnssObs::ObservationData& recvObsData) {
229 return recvObsData.satSigId == obsData.satSigId;
230 });
231 auto satClk = satNavData->calcClockCorrections(recv.gnssObs->insTime,
232 recvObsData->pseudorange->value,
233 recvObsData->satSigId.freq());
234 auto satPosVel = satNavData->calcSatellitePosVel(satClk.transmitTime);
235
236 LOG_DATA("{}: Adding satellite [{}] for receiver {}", nameId, obsData.satSigId, recv.type);
237 sigObs.recvObs.emplace_back(recv.gnssObs, static_cast<size_t>(recvObsData - recv.gnssObs->data.begin()),
238 recv.e_posMarker, recv.lla_posMarker, recv.e_vel,
239 satPosVel.e_pos, satPosVel.e_vel, satClk);
240
241 if (!ignoreElevationMask)
242 {
243 const auto& satElevation = sigObs.recvObs.back().satElevation();
244 if (satElevation < _elevationMask)
245 {
246 LOG_DATA("{}: Signal {} is skipped because of elevation mask. ({} < {})", nameId, obsData.satSigId,
247 rad2deg(satElevation), rad2deg(_elevationMask));
248 skipObservation = true;
249 break;
250 }
251 if (recvObsData->CN0 // If no CN0 available, we use the signal
252 && !_snrMask
253 .at(_sameSnrMaskForAllReceivers ? static_cast<ReceiverType>(0) : recv.type)
254 .checkSNRMask(obsData.satSigId.freq(), satElevation, recvObsData->CN0.value()))
255 {
256 LOG_DEBUG("{}: [{}] SNR mask triggered for [{}] on receiver [{}] with CN0 {} dbHz",
257 nameId, receivers.front().gnssObs->insTime.toYMDHMS(GPST), obsData.satSigId, recv.type, recvObsData->CN0.value());
258 skipObservation = true;
259 break;
260 }
261 }
262 }
263 if (skipObservation) { continue; }
264
265 for (const auto& recv : receivers)
266 {
267 auto& recvObsData = sigObs.recvObs.at(recv.type);
268
269 for (const auto& obsType : _usedObsTypes)
270 {
271 if (availableObservations.contains(obsType) && availableObservations.at(obsType) == receivers.size())
272 {
273 observations.nObservables.at(obsType)++;
274 nMeasUniqueSat.at(obsType).insert(satId);
275 switch (obsType)
276 {
278 recvObsData.obs[obsType].measurement = recvObsData.gnssObsData().pseudorange->value;
279 LOG_DATA("{}: [{}] Taking {:11} observation into account on {:5} receiver ({:.3f} [m])", nameId, obsData.satSigId,
280 obsType, recv.type, recvObsData.obs[obsType].measurement);
281 break;
282 case GnssObs::Carrier:
283 recvObsData.obs[obsType].measurement = InsConst<>::C / obsData.satSigId.freq().getFrequency(freqNum)
284 * recvObsData.gnssObsData().carrierPhase->value;
285 LOG_DATA("{}: [{}] Taking {:11} observation into account on {:5} receiver ({:.3f} [m] = {:.3f} [cycles])", nameId, obsData.satSigId,
286 obsType, recv.type, recvObsData.obs[obsType].measurement, recvObsData.gnssObsData().carrierPhase->value);
287 break;
288 case GnssObs::Doppler:
289 recvObsData.obs[obsType].measurement = doppler2rangeRate(recvObsData.gnssObsData().doppler.value(),
290 obsData.satSigId.freq(),
291 freqNum);
292 LOG_DATA("{}: [{}] Taking {:11} observation into account on {:5} receiver ({:.3f} [m/s] = {:.3f} [Hz])", nameId, obsData.satSigId,
293 obsType, recv.type, recvObsData.obs[obsType].measurement, recvObsData.gnssObsData().doppler.value());
294 break;
296 break;
297 }
298 }
299 }
300 }
301
302 observations.systems.insert(satId.satSys);
303 observations.satellites.insert(satId);
304 observations.signals.insert(std::make_pair(obsData.satSigId, sigObs));
305 }
306
307 for (size_t obsType = 0; obsType < GnssObs::ObservationType_COUNT; obsType++)
308 {
309 observations.nObservablesUniqueSatellite.at(obsType) = nMeasUniqueSat.at(obsType).size();
310 }
311
312#if LOG_LEVEL <= LOG_LEVEL_DATA
313 LOG_DATA("{}: usedSatSystems = [{}]", nameId, joinToString(observations.systems));
314 size_t nMeasTotal = 0;
315 std::string nMeasStr;
316 for (size_t obsType = 0; obsType < GnssObs::ObservationType_COUNT; obsType++)
317 {
318 auto& nMeas = observations.nObservables.at(obsType);
319 nMeas /= receivers.size();
320 nMeasStr += fmt::format("{} {}, ", nMeas, static_cast<GnssObs::ObservationType>(obsType));
321 nMeasTotal += nMeas;
322 }
323 if (nMeasStr.ends_with(", ")) { nMeasStr = nMeasStr.erase(nMeasStr.length() - 2); }
324
325 LOG_DATA("{}: Using {} measurements ({}) from {} satellites", nameId, nMeasTotal, nMeasStr, observations.satellites.size());
326
329 for (const auto& obs : observations.signals)
330 {
331 satData[obs.first.toSatId()].first |= obs.first.freq();
332 satData[obs.first.toSatId()].second |= obs.first.code;
333 for (size_t obsType = 0; obsType < GnssObs::ObservationType_COUNT; obsType++)
334 {
335 if (std::all_of(obs.second.recvObs.begin(), obs.second.recvObs.end(), [&obsType](const Observations::SignalObservation::ReceiverSpecificData& recvObs) {
336 return recvObs.obs.contains(static_cast<GnssObs::ObservationType>(obsType));
337 }))
338 {
339 sigData[obs.first].insert(static_cast<GnssObs::ObservationType>(obsType));
340 }
341 }
342 }
343 for ([[maybe_unused]] const auto& [satId, freqCode] : satData)
344 {
345 LOG_DATA("{}: [{}] on frequencies [{}] with codes [{}]", nameId, satId, freqCode.first, freqCode.second);
346 for (const auto& [satSigId, obs] : sigData)
347 {
348 if (satSigId.toSatId() != satId) { continue; }
349 std::string str;
350 for (const auto& o : obs)
351 {
352 if (!str.empty()) { str += ", "; }
353 str += fmt::format("{}", o);
354 }
355 LOG_DATA("{}: [{}] has obs: {}", nameId, satSigId.code, str);
356 }
357 }
358#endif
359
360 return observations;
361 }
362
366 template<typename ReceiverType>
367 bool ShowGuiWidgets(const char* id, float itemWidth)
368 {
369 bool changed = false;
370
371 ImGui::SetNextItemWidth(itemWidth);
372 if (ShowFrequencySelector(fmt::format("Satellite Frequencies##{}", id).c_str(), _filterFreq))
373 {
374 changed = true;
375 }
376
377 ImGui::SetNextItemWidth(itemWidth);
378 if (ShowCodeSelector(fmt::format("Signal Codes##{}", id).c_str(), _filterCode, _filterFreq))
379 {
380 changed = true;
381 }
382
383 ImGui::SetNextItemWidth(itemWidth);
384 if (ShowSatelliteSelector(fmt::format("Excluded satellites##{}", id).c_str(), _excludedSatellites))
385 {
386 changed = true;
387 }
388
389 double elevationMaskDeg = rad2deg(_elevationMask);
390 ImGui::SetNextItemWidth(itemWidth);
391 if (ImGui::InputDoubleL(fmt::format("Elevation mask##{}", id).c_str(), &elevationMaskDeg, 0.0, 90.0, 5.0, 5.0, "%.1f°", ImGuiInputTextFlags_AllowTabInput))
392 {
393 _elevationMask = deg2rad(elevationMaskDeg);
394 LOG_DEBUG("{}: Elevation mask changed to {}°", id, elevationMaskDeg);
395 changed = true;
396 }
397
398 for (size_t i = 0; i < ReceiverType::ReceiverType_COUNT; ++i)
399 {
400 if (i != 0)
401 {
402 ImGui::SameLine();
403 if (_sameSnrMaskForAllReceivers) { ImGui::BeginDisabled(); }
404 }
405 if (_snrMask.at(i).ShowGuiWidgets(fmt::format("{} SNR Mask", static_cast<ReceiverType>(i)).c_str()))
406 {
407 changed = true;
408 }
409 if (i != 0 && _sameSnrMaskForAllReceivers) { ImGui::EndDisabled(); }
410 }
411 if (ReceiverType::ReceiverType_COUNT > 1)
412 {
413 ImGui::SameLine();
414 if (ImGui::Checkbox(fmt::format("Use same SNR for all receivers##{}", id).c_str(), &_sameSnrMaskForAllReceivers))
415 {
416 changed = true;
417 }
418 }
419
420 ImGui::BeginHorizontal(fmt::format("Observables##{}", id).c_str(),
421 ImVec2(itemWidth - ImGui::GetStyle().ItemSpacing.x + ImGui::GetStyle().ItemInnerSpacing.x, 0.0F));
422 for (size_t i = 0; i < GnssObs::ObservationType_COUNT; i++)
423 {
424 auto obsType = static_cast<GnssObs::ObservationType>(i);
425 if (!_availableObsTypes.contains(obsType)) { continue; }
426 if (_neededObsTypes.contains(obsType)) { ImGui::BeginDisabled(); }
427 bool enabled = _usedObsTypes.contains(obsType);
428 if (ImGui::Checkbox(fmt::format("{}##{}", obsType, id).c_str(), &enabled))
429 {
430 LOG_DEBUG("{}: Using {}: {}", id, obsType, enabled);
431 if (enabled) { _usedObsTypes.insert(obsType); }
432 else { _usedObsTypes.erase(obsType); }
433 changed = true;
434 }
435 if (_neededObsTypes.contains(obsType)) { ImGui::EndDisabled(); }
436 }
437 ImGui::EndHorizontal();
438
439 ImGui::SameLine();
440 ImGui::TextUnformatted("Used observables");
441
442 return changed;
443 }
444
447 [[nodiscard]] bool isSatelliteAllowed(const SatId& satId) const
448 {
449 return (satId.satSys & _filterFreq)
450 && std::find(_excludedSatellites.begin(), _excludedSatellites.end(), satId) == _excludedSatellites.end();
451 }
452
455 [[nodiscard]] bool isObsTypeUsed(GnssObs::ObservationType obsType) const
456 {
457 return _usedObsTypes.contains(obsType);
458 }
459
463 {
464 _usedObsTypes.insert(obsType);
465 }
466
470 void markObsTypeAsNeeded(GnssObs::ObservationType obsType, bool needed = true)
471 {
472 if (needed) { _neededObsTypes.insert(obsType); }
473 else if (_neededObsTypes.contains(obsType)) { _neededObsTypes.erase(obsType); }
474 }
475
479 void excludeSignalTemporarily(const SatSigId& satSigId, size_t count)
480 {
481 if (count == 0) { return; }
482 _temporarilyExcludedSignalsSatellites.emplace(satSigId, count);
483 }
484
486 [[nodiscard]] const Frequency& getFrequencyFilter() const
487 {
488 return _filterFreq;
489 }
491 [[nodiscard]] const Code& getCodeFilter() const
492 {
493 return _filterCode;
494 }
495
497 [[nodiscard]] SatelliteSystem getSystemFilter() const
498 {
499 return _filterFreq.getSatSys();
500 }
501
503 [[nodiscard]] const std::unordered_set<GnssObs::ObservationType>& getUsedObservationTypes() const
504 {
505 return _usedObsTypes;
506 }
507
508 private:
510 Frequency _filterFreq = G01 | G02 | G05
511 | E01 | E05 | E06 | E07 | E08;
513 Code _filterCode = Code_Default;
515 std::vector<SatId> _excludedSatellites;
517 double _elevationMask = static_cast<double>(10.0_deg);
519 std::vector<SNRMask> _snrMask;
521 bool _sameSnrMaskForAllReceivers = true;
523 const std::unordered_set<GnssObs::ObservationType> _availableObsTypes;
525 std::unordered_set<GnssObs::ObservationType> _neededObsTypes;
527 std::unordered_set<GnssObs::ObservationType> _usedObsTypes;
528
530 std::unordered_map<SatSigId, size_t> _temporarilyExcludedSignalsSatellites;
531
535 friend void to_json(json& j, const ObservationFilter& obj)
536 {
537 j = json{
538 { "frequencies", Frequency_(obj._filterFreq) },
539 { "codes", obj._filterCode },
540 { "excludedSatellites", obj._excludedSatellites },
541 { "elevationMask", rad2deg(obj._elevationMask) },
542 { "snrMask", obj._snrMask },
543 { "sameSnrMaskForAllReceivers", obj._sameSnrMaskForAllReceivers },
544 { "usedObsTypes", obj._usedObsTypes },
545 { "neededObsType", obj._neededObsTypes },
546 };
547 }
551 friend void from_json(const json& j, ObservationFilter& obj)
552 {
553 if (j.contains("frequencies"))
554 {
555 uint64_t value = 0;
556 j.at("frequencies").get_to(value);
557 obj._filterFreq = Frequency_(value);
558 }
559 if (j.contains("codes")) { j.at("codes").get_to(obj._filterCode); }
560 if (j.contains("excludedSatellites")) { j.at("excludedSatellites").get_to(obj._excludedSatellites); }
561 if (j.contains("elevationMask"))
562 {
563 j.at("elevationMask").get_to(obj._elevationMask);
564 obj._elevationMask = deg2rad(obj._elevationMask);
565 }
566 if (j.contains("snrMask")) { j.at("snrMask").get_to(obj._snrMask); }
567 if (j.contains("sameSnrMaskForAllReceivers")) { j.at("sameSnrMaskForAllReceivers").get_to(obj._sameSnrMaskForAllReceivers); }
568 if (j.contains("usedObsTypes")) { j.at("usedObsTypes").get_to(obj._usedObsTypes); }
569 if (j.contains("neededObsTypes")) { j.at("neededObsTypes").get_to(obj._neededObsTypes); }
570 }
571};
572
573} // namespace NAV
Code definitions.
bool ShowCodeSelector(const char *label, Code &code, const Frequency &filterFreq, bool singleSelect=false)
Shows a ComboBox to select signal codes.
const Code Code_Default
Default selection for codes.
Definition Code.hpp:654
nlohmann::json json
json namespace
Definition FlowManager.hpp:21
Frequency definition for different satellite systems.
Frequency_
Enumerate for GNSS frequencies.
Definition Frequency.hpp:26
@ E07
Galileo E5b (1207.14 MHz).
Definition Frequency.hpp:34
@ E06
Galileo E6 (1278.75 MHz).
Definition Frequency.hpp:33
@ E01
Galileo, "E1" (1575.42 MHz).
Definition Frequency.hpp:31
@ E05
Galileo E5a (1176.45 MHz).
Definition Frequency.hpp:32
@ G02
GPS L2 (1227.6 MHz).
Definition Frequency.hpp:29
@ G01
GPS L1 (1575.42 MHz).
Definition Frequency.hpp:28
@ E08
Galileo E5 (E5a + E5b) (1191.795MHz).
Definition Frequency.hpp:35
@ G05
GPS L5 (1176.45 MHz).
Definition Frequency.hpp:30
bool ShowFrequencySelector(const char *label, Frequency &frequency, bool singleSelect=false)
Shows a ComboBox to select GNSS frequencies.
double doppler2rangeRate(double doppler, Frequency freq, int8_t num)
Transforms a doppler-shift into a range-rate.
Navigation message information.
GNSS Observation messages.
Defines how to save certain datatypes to json.
#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
Observation data used for calculations.
Receiver information.
Signal to Noise Ratio Mask.
Algorithms concerning the STL containers.
Structs identifying a unique satellite.
bool ShowSatelliteSelector(const char *label, std::vector< SatId > &satellites, SatelliteSystem filterSys=SatSys_All, bool displayOnlyNumber=false)
Shows a ComboBox to select satellites.
@ GLO
Globalnaja nawigazionnaja sputnikowaja sistema (GLONASS)
Definition SatelliteSystem.hpp:34
@ GPST
GPS Time.
Definition TimeSystem.hpp:29
ankerl::unordered_dense::map< Key, T > unordered_map
Unordered map type.
Definition Unordered_map.hpp:34
Enumerate for GNSS Codes.
Definition Code.hpp:88
Frequency definition for different satellite systems.
Definition Frequency.hpp:59
ObservationType
Observation types.
Definition GnssObs.hpp:36
@ Doppler
Doppler (Pseudorange rate)
Definition GnssObs.hpp:39
@ ObservationType_COUNT
Count.
Definition GnssObs.hpp:40
@ Carrier
Carrier-Phase.
Definition GnssObs.hpp:38
@ Pseudorange
Pseudorange.
Definition GnssObs.hpp:37
Constants.
Definition Constants.hpp:26
Observation Filter.
Definition ObservationFilter.hpp:45
const std::unordered_set< GnssObs::ObservationType > & getUsedObservationTypes() const
Get the used observation types.
Definition ObservationFilter.hpp:503
Observations selectObservationsForCalculation(const std::array< Receiver< ReceiverType >, ReceiverType::ReceiverType_COUNT > &receivers, const std::vector< const GnssNavInfo * > &gnssNavInfos, const std::string &nameId, bool ignoreElevationMask=false)
Returns a list of satellites and observations filtered by GUI settings & NAV data available & ....
Definition ObservationFilter.hpp:126
ObservationFilter(ObservationFilter &&other) noexcept=default
Move constructor.
friend void to_json(json &j, const ObservationFilter &obj)
Converts the provided object into json.
Definition ObservationFilter.hpp:535
ObservationFilter & operator=(ObservationFilter &&other) noexcept
Move assignment operator.
Definition ObservationFilter.hpp:88
bool isSatelliteAllowed(const SatId &satId) const
Checks if the satellite is allowed. Does not check elevation or SNR mask.
Definition ObservationFilter.hpp:447
friend void from_json(const json &j, ObservationFilter &obj)
Converts the provided json object into a node object.
Definition ObservationFilter.hpp:551
const Code & getCodeFilter() const
Get the Code Filter.
Definition ObservationFilter.hpp:491
void useObsType(GnssObs::ObservationType obsType)
Set the observation type to use.
Definition ObservationFilter.hpp:462
~ObservationFilter()=default
Destructor.
bool isObsTypeUsed(GnssObs::ObservationType obsType) const
Checks if the Observation type is used by the GUI settings.
Definition ObservationFilter.hpp:455
void markObsTypeAsNeeded(GnssObs::ObservationType obsType, bool needed=true)
Set the observation type as needed (cannot be unchecked in the GUI) or unneeded.
Definition ObservationFilter.hpp:470
SatelliteSystem getSystemFilter() const
Get the Satellite System Filter.
Definition ObservationFilter.hpp:497
void reset()
Reset the temporary settings.
Definition ObservationFilter.hpp:114
bool ShowGuiWidgets(const char *id, float itemWidth)
Shows the GUI input to select the options.
Definition ObservationFilter.hpp:367
ObservationFilter(size_t receiverCount, const std::unordered_set< GnssObs::ObservationType > &availableObsTypes={ GnssObs::Pseudorange, GnssObs::Carrier, GnssObs::Doppler }, std::unordered_set< GnssObs::ObservationType > neededObsTypes={})
Constructor.
Definition ObservationFilter.hpp:51
const Frequency & getFrequencyFilter() const
Get the Frequency Filter.
Definition ObservationFilter.hpp:486
ObservationFilter(const ObservationFilter &other)=default
Copy constructor.
ObservationFilter & operator=(const ObservationFilter &other)
Copy assignment operator.
Definition ObservationFilter.hpp:63
void excludeSignalTemporarily(const SatSigId &satSigId, size_t count)
Temporarily excludes a signal.
Definition ObservationFilter.hpp:479
ImGui extensions.
Stores the satellites observations.
Definition GnssObs.hpp:45
std::optional< Pseudorange > pseudorange
Pseudorange measurement [m].
Definition GnssObs.hpp:120
std::optional< double > CN0
Carrier-to-Noise density [dBHz].
Definition GnssObs.hpp:123
SatSigId satSigId
SignalId and satellite number.
Definition GnssObs.hpp:119
Receiver specific observation of the signal.
Definition Observation.hpp:41
std::vector< ReceiverSpecificData > recvObs
Receiver specific data.
Definition Observation.hpp:136
Observation storage type.
Definition Observation.hpp:38
std::set< SatelliteSystem > systems
Satellite systems used.
Definition Observation.hpp:150
std::array< size_t, GnssObs::ObservationType_COUNT > nObservables
Number of observables.
Definition Observation.hpp:152
std::unordered_set< SatId > satellites
Satellites used.
Definition Observation.hpp:151
unordered_map< SatSigId, SignalObservation > signals
Observations and calculated data for each signal.
Definition Observation.hpp:148
Receiver information.
Definition Receiver.hpp:35
std::shared_ptr< const GnssObs > gnssObs
Latest GNSS observation.
Definition Receiver.hpp:53
ReceiverType type
Receiver Type.
Definition Receiver.hpp:41
Identifies a satellite (satellite system and number)
Definition SatelliteIdentifier.hpp:32
SatelliteSystem satSys
Satellite system (GPS, GLONASS, GALILEO, QZSS, BDS, IRNSS, SBAS)
Definition SatelliteIdentifier.hpp:42
Identifies a satellite signal (satellite frequency and number)
Definition SatelliteIdentifier.hpp:62
Frequency freq() const
Returns the frequency of the satellite signal.
Definition SatelliteIdentifier.hpp:103
Satellite System type.
Definition SatelliteSystem.hpp:43