0.5.0
Loading...
Searching...
No Matches
RealTimeKinematic.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 RealTimeKinematic.hpp
10/// @brief Real-Time Kinematic (RTK) carrier-phase DGNSS
11/// @author T. Topp (topp@ins.uni-stuttgart.de)
12/// @date 2023-04-13
13
14#pragma once
15
16#include <cstddef>
17#include <cstdint>
18#include <memory>
21
39
44
45#include "util/Eigen.hpp"
47
48namespace NAV
49{
50
51/// @brief Numerically integrates Imu data
52class RealTimeKinematic : public Node
53{
54 public:
55 /// @brief Receiver Types
56 enum ReceiverType : uint8_t
57 {
58 Rover, ///< Rover
59 Base, ///< Base
60 ReceiverType_COUNT, ///< Amount of receiver types
61 };
62
63 /// @brief Default constructor
65 /// @brief Destructor
66 ~RealTimeKinematic() override;
67 /// @brief Copy constructor
69 /// @brief Move constructor
71 /// @brief Copy assignment operator
73 /// @brief Move assignment operator
75
76 /// @brief String representation of the Class Type
77 [[nodiscard]] static std::string typeStatic();
78
79 /// @brief String representation of the Class Type
80 [[nodiscard]] std::string type() const override;
81
82 /// @brief String representation of the Class Category
83 [[nodiscard]] static std::string category();
84
85 /// @brief ImGui config window which is shown on double click
86 /// @attention Don't forget to set _hasConfig to true in the constructor of the node
87 void guiConfig() override;
88
89 /// @brief Saves the node into a json object
90 [[nodiscard]] json save() const override;
91
92 /// @brief Restores the node from a json object
93 /// @param[in] j Json object with the node state
94 void restore(const json& j) override;
95
96 private:
97 constexpr static size_t INPUT_PORT_INDEX_BASE_POS = 0; ///< @brief Pos
98 constexpr static size_t INPUT_PORT_INDEX_BASE_GNSS_OBS = 1; ///< @brief GnssObs
99 constexpr static size_t INPUT_PORT_INDEX_ROVER_GNSS_OBS = 2; ///< @brief GnssObs
100 constexpr static size_t INPUT_PORT_INDEX_GNSS_NAV_INFO = 3; ///< @brief GnssNavInfo
101
102 constexpr static size_t OUTPUT_PORT_INDEX_RTKSOL = 0; ///< @brief Flow (RtkSol)
103
104 // --------------------------------------------------------------- Gui -----------------------------------------------------------------
105
106 /// Possible Units for the Standard deviation of the ambiguities
107 enum class StdevAmbiguityUnits : uint8_t
108 {
109 Cycle, ///< [cycle]
110 };
111
112 /// @brief Initialize the node
113 bool initialize() override;
114
115 /// @brief Deinitialize the node
116 void deinitialize() override;
117
118 /// @brief Function to call to add a new pin
119 /// @param[in, out] node Pointer to this node
120 static void pinAddCallback(Node* node);
121 /// @brief Function to call to delete a pin
122 /// @param[in, out] node Pointer to this node
123 /// @param[in] pinIdx Input pin index to delete
124 static void pinDeleteCallback(Node* node, size_t pinIdx);
125
126 /// Observation Filter
128
129 /// Observation Estimator
131 /// Maximum amount of outliers to remove per epoch
133 /// Amount of epochs to remove an outlier after being found (1 = only current)
135 /// Minumum amount of satellites for doing a NIS check
136 size_t _outlierMinSat = 4;
137 /// Minumum amount of pseudorange observables to leave when doing a NIS check
139
140 /// Do not attempt to remove outlier if the position variance is above the threshold in the startup phase [m^2]
142
143 /// @brief Wether to output a SPP solution if no base observations are available
144 bool _calcSPPIfNoBase = false;
145 /// Maximum time between base and rover observations to calculate the RTK solution
147
148 /// Ambiguity resolution algorithms and parameters to use
150
151 /// Ambiguity resolution strategy
153
154 /// Minimum amount of satellites with carrier observations to try fixing the solution
156 /// Minimum amount of satellites with carrier observations for holding the ambiguities
158 /// Do not attempt to fix if the position variance is above the threshold
159 double _maxPosVar = 0.4;
160
161 /// Make an update with the fixed ambiguities when true.
162 /// Otherwise apply via $$a = a_fix$$ and $$b = b_float - Q_ba * Q_aa^-1 (a_fix - a_float)$$
164
165 /// Measurement noise standard deviation used when fixing ambiguities in [cycles] (GUI value)
167 /// Gui selection for the Unit of the input for the StDev of the ambiguities (while float solution)
169 /// Measurement noise variance used when fixing ambiguities in [cycles^2] (Value used for calculation)
171
172 bool _maxPosVarTriggered = false; ///< Trigger state of the check
173 bool _outlierMaxPosVarStartupTriggered = false; ///< Trigger state of the check
174 bool _nMinSatForAmbFixTriggered = false; ///< Trigger state of the check
175 bool _nMinSatForAmbHoldTriggered = false; ///< Trigger state of the check
176
177 // #####################################################################################
178
179 /// Possible Units for the Standard deviation of the acceleration due to user motion
180 enum class StdevAccelUnits : uint8_t
181 {
182 m_sqrts3, ///< [ m / √(s^3) ]
183 };
184 /// Gui selection for the Unit of the input stdev_accel parameter for the StDev due to acceleration due to user motion
186
187 /// @brief GUI selection for the Standard deviation of the acceleration 𝜎_a due to user motion in horizontal and vertical component
188 /// @note See Groves (2013) eq. (9.156)
189 std::array<double, 2> _gui_stdevAccel = { { 3.0, 1.5 } } /* [ m / √(s^3) ] */;
190
191 /// Gui selection for the Unit of the input for the StDev of the ambiguities (while float solution)
193 /// Process noise (standard deviation) for the ambiguities (while float solution) (Selection in GUI)
195 /// Process noise (variance) for the ambiguities (while float solution) in [cycles^2] (Value used for calculation)
197
198 /// Gui selection for the Unit of the input for the StDev of the ambiguities (while fix solution)
200 /// Process noise (standard deviation) for the ambiguities (while fix solution) (Selection in GUI)
202 /// Process noise (standard deviation) for the ambiguities (while fix solution) in [cycles^2] (Value used for calculation)
204
205 // ------------------------------------------------------------ Algorithm --------------------------------------------------------------
206
208
209 /// @brief SPP algorithm
211
212 /// @brief Receivers
213 std::array<Receiver, ReceiverType::ReceiverType_COUNT> _receiver = { { Receiver(Base, {}), Receiver(Rover, {}) } };
214
215 /// Flag, whether the observation was received this epoch
217
218 /// Solution type of last epoch
220
221 /// Differences (single or double)
223 {
224 double estimate = 0.0; ///< Estimate
225 double measurement = 0.0; ///< Measurement
226 };
227
228 /// @brief Difference storage type
231 Difference>>;
232
233 /// @brief Pivot satellite information
235 {
236 /// @brief Constructor
237 /// @param[in] satSigId Satellite Signal identifier
239
240 SatSigId satSigId; ///< Satellite Signal identifier
241 };
242
243 /// Pivot satellites for each constellation
245
246 /// Last update time
248 /// Data interval [s]
249 double _dataInterval = 1;
250
251 /// Kalman Filter representation
253
254 /// Cycle-slip detector
255 std::array<CycleSlipDetector, ReceiverType_COUNT> _cycleSlipDetector;
256
257 /// List of event texts (pivot changes, cycle-slips)
258 std::vector<std::pair<InsTime, std::vector<std::string>>> _events;
259
260 /// Regex for filtering events
261 std::string _eventFilterRegex;
262
263 /// Whether to output state change events
264 bool _outputStateEvents = false;
265
266 /// Ambiguities which are fixed and hold. Values in [cycles]
267 std::unordered_map<SatSigId, double> _ambiguitiesHold;
268
269 /// Percentage of fix solutions
270 size_t nFixSolutions = 0;
271 /// Percentage of float solutions
272 size_t nFloatSolutions = 0;
273 /// Percentage of float solutions
275
276 size_t _nPivotChange = 0; ///< Amount of pivot changes performed
277 size_t _nCycleSlipsLLI = 0; ///< Cycle-slip detection count (LLI)
278 size_t _nCycleSlipsSingle = 0; ///< Cycle-slip detection count (Single)
279 size_t _nCycleSlipsDual = 0; ///< Cycle-slip detection count (Dual)
280 size_t _nMeasExcludedNIS = 0; ///< Measurement excluded due to NIS test count
281
282 /// @brief Dynamic input pins
283 /// @attention This should always be the last variable in the header, because it accesses others through the function callbacks
285
286 /// @brief Adds the event to the GUI list
287 /// @param[in, out] rtkSol RtkSolution to update
288 /// @param[in] text Text to display
289 void addEventToGui(const std::shared_ptr<RtkSolution>& rtkSol, const std::string& text);
290
291 /// @brief Prints the observations for logging
292 /// @param[in] observations List of GNSS observation data used for the calculation of this epoch
293 void printObservations(const Observations& observations);
294
295 /// @brief Receive Function for the Base Position
296 /// @param[in] queue Queue with all the received data messages
297 /// @param[in] pinIdx Index of the pin the data is received on
298 void recvBasePos(InputPin::NodeDataQueue& queue, size_t pinIdx);
299
300 /// @brief Receive Function for the Base GNSS Observations
301 /// @param[in] queue Queue with all the received data messages
302 /// @param[in] pinIdx Index of the pin the data is received on
303 void recvBaseGnssObs(InputPin::NodeDataQueue& queue, size_t pinIdx);
304
305 /// @brief Receive Function for the RoverGNSS Observations
306 /// @param[in] queue Queue with all the received data messages
307 /// @param[in] pinIdx Index of the pin the data is received on
308 void recvRoverGnssObs(InputPin::NodeDataQueue& queue, size_t pinIdx);
309
310 /// @brief Assign the SPP solution to the RTK filter
311 /// @param sppSol SPP solution
312 void assignSolutionToFilter(const std::shared_ptr<NAV::SppSolution>& sppSol);
313
314 /// @brief Calculates the RTK solution
316
317 /// @brief Calculates a SPP solution as fallback in case no base data is available
318 std::shared_ptr<RtkSolution> calcFallbackSppSolution();
319
320 /// @brief Does the Kalman Filter prediction
322
323 /// @brief Checks for cycle-slips
324 /// @param[in] observations List of GNSS observation data used for the calculation of this epoch
325 /// @param[in, out] rtkSol RtkSolution to update
326 void checkForCycleSlip(Observations& observations, const std::shared_ptr<RtkSolution>& rtkSol);
327
328 /// @brief Removes observations which do not have a second one to do double differences
329 /// @param[in] observations List of GNSS observation data used for the calculation of this epoch
330 /// @param[in] filtered Filtered observations
331 /// @param[in, out] rtkSol RtkSolution to update
332 void removeSingleObservations(Observations& observations, ObservationFilter::Filtered* filtered, const std::shared_ptr<RtkSolution>& rtkSol);
333
334 /// @brief Update the specified pivot satellite and also does a pivot change in the Kalman filter state if necessary
335 /// @param code Code for the pivot
336 /// @param obsType Observation type of the pivot
337 /// @param observations List of GNSS observation data used for the calculation of this epoch
338 /// @param rtkSol RtkSolution to update
339 /// @param reason Reason for changing the pivot
340 /// @return The final pivot change result after the update. Empty if no pivot was selected
341 std::optional<RtkSolution::PivotChange> updatePivotSatellite(Code code, GnssObs::ObservationType obsType,
342 Observations& observations, const std::shared_ptr<RtkSolution>& rtkSol,
344
345 /// Prints all pivot satellites
347
348 /// @brief Update the pivot satellites for each constellation
349 /// @param[in] observations List of GNSS observation data used for the calculation of this epoch
350 /// @param[in, out] rtkSol RtkSolution to update
351 void updatePivotSatellites(Observations& observations, const std::shared_ptr<RtkSolution>& rtkSol);
352
353 /// @brief Adapts the Kalman Filter if a pivot satellite signal was changed
354 /// @param[in] newPivotSatSigId Newly added pivot satellite signal
355 /// @param[in] oldPivotSatSigId Old pivot satellite signal
356 /// @param[in] oldPivotObservedInEpoch Indicates if the old pivot satellite is still observed, or is
357 /// @param[in, out] rtkSol RtkSolution to update
358 void updateKalmanFilterAmbiguitiesForPivotChange(const SatSigId& newPivotSatSigId, const SatSigId& oldPivotSatSigId, bool oldPivotObservedInEpoch, const std::shared_ptr<RtkSolution>& rtkSol);
359
360 /// @brief Adds or remove Ambiguities to/from the Kalman Filter state depending on the received observations
361 /// @param[in] observations List of GNSS observation data used for the calculation of this epoch
362 /// @param[in, out] rtkSol RtkSolution to update
363 void addOrRemoveKalmanFilterAmbiguities(const Observations& observations, const std::shared_ptr<RtkSolution>& rtkSol);
364
365 /// @brief Calculates the single difference of the measurements and estimates
366 /// @param[in] observations List of GNSS observation data used for the calculation of this epoch
367 [[nodiscard]] Differences calcSingleDifferences(const Observations& observations) const;
368
369 /// @brief Calculates the double difference of the measurements and estimates
370 /// @param[in] observations List of GNSS observation data used for the calculation of this epoch
371 /// @param[in] singleDifferences List of single differences
372 [[nodiscard]] Differences calcDoubleDifferences(const Observations& observations, const Differences& singleDifferences) const;
373
374 /// @brief Calculate the measurement noise matrices for each observation type
375 /// @param observations List of GNSS observation data used for the calculation of this epoch
377 calcSingleObsMeasurementNoiseMatrices(const Observations& observations) const;
378
379 /// @brief Calculates the Measurement vector 𝐳, Measurement sensitivity matrix 𝐇 and Measurement noise covariance matrix 𝐑 for the KF update
380 /// @param[in] observations List of GNSS observation data used for the calculation of this epoch
381 /// @param[in] doubleDifferences List of double differences
382 /// @param[in] Rtilde Single observation Measurement Noise Covariance Matrix R for each observation type
383 void calcKalmanUpdateMatrices(const Observations& observations, const Differences& doubleDifferences,
385
386 /// @brief Outlier removal info
388 {
389 /// @brief Defaults Constructor
390 OutlierInfo() = default;
391 /// @brief Constructor
392 /// @param key Measurement key
394
395 std::optional<RtkSolution::PivotChange::Reason> pivot; ///< Pivot change reason, if it is a pivot
397 SatSigId satSigId; ///< Satellit signal id
398 RTK::Meas::MeasKeyTypes key = RTK::Meas::PsrDD{}; ///< Measurement key of the outlier
399 };
400
401 /// @brief Performs the NIS check
402 /// @param[in, out] observations List of GNSS observation data. Elements can be removed
403 /// @param[in, out] rtkSol RtkSolution to update
404 /// @return Info of the removed outliers
405 std::vector<OutlierInfo> removeOutlier(Observations& observations, const std::shared_ptr<RtkSolution>& rtkSol);
406
407 /// @brief Update Valid information
409 {
410 bool valid = true; ///< Flag if the solution is valid
411 double dx = 0.0; ///< Position change due to the update
412 double threshold = 0.0; ///< Allowed position change
413 };
414
415 /// @brief Does the Kalman Filter update
416 /// @param[in, out] rtkSol RtkSolution to update
417 /// @return Update valid information
418 UpdateStatus kalmanFilterUpdate(const std::shared_ptr<RtkSolution>& rtkSol);
419
420 /// @brief Resolves the ambiguities in the Kalman filter and updates the state and covariance matrix
421 /// @param[in] nCarrierMeasUniqueSatellite Amount of used
422 /// @param[in, out] rtkSol RtkSolution to update
423 /// @return True if the ambiguities could be fixed
424 bool resolveAmbiguities(size_t nCarrierMeasUniqueSatellite, const std::shared_ptr<RtkSolution>& rtkSol);
425
426 /// @brief Apply the fixed ambiguities to the kalman filter state
427 /// @param[in] fixedAmb Fixed ambiguities
428 /// @param[in] ambKeys Ambiguity state keys
429 /// @param[in] ambMeasKeys Ambiguity measurement keys
430 void applyFixedAmbiguities(const Eigen::VectorXd& fixedAmb, const std::vector<RTK::States::StateKeyType>& ambKeys, const std::vector<RTK::Meas::MeasKeyTypes>& ambMeasKeys);
431};
432
433/// @brief Converts the enum to a string
434/// @param[in] receiver Enum value to convert into text
435/// @return String representation of the enum
436[[nodiscard]] const char* to_string(const RealTimeKinematic::ReceiverType& receiver);
437
438} // namespace NAV
439
440#ifndef DOXYGEN_IGNORE
441
442/// @brief Formatter
443template<>
444struct fmt::formatter<NAV::RealTimeKinematic::ReceiverType> : fmt::formatter<const char*>
445{
446 /// @brief Defines how to format structs
447 /// @param[in] type Struct to format
448 /// @param[in, out] ctx Format context
449 /// @return Output iterator
450 template<typename FormatContext>
451 auto format(const NAV::RealTimeKinematic::ReceiverType& type, FormatContext& ctx) const
452 {
453 return fmt::formatter<const char*>::format(to_string(type), ctx);
454 }
455};
456
457#endif
Single Point Positioning Algorithm.
Ambiguity resolution algorithms.
Code definitions.
Combination of different cycle-slip detection algorithms.
Inputs pins which can be added dynamically.
Vector space operations.
nlohmann::json json
json namespace
Frequency definition for different satellite systems.
Keys for the RTK algorithm for use inside the KeyedMatrices.
Navigation message information.
GNSS Observation messages.
Kalman Filter with keyed states.
Generalized Kalman Filter class.
Node Class.
Calculates Observation estimates.
Observation Filter.
Observation data used for calculations.
Receiver Clock information.
Receiver information.
RTK Node/Algorithm output.
Signal to Noise Ratio Mask.
Satellite Navigation data (to calculate SatNavData and clock)
Structs identifying a unique satellite.
SPP Algorithm output.
Unordered map wrapper.
ankerl::unordered_dense::map< Key, T > unordered_map
Unordered map type.
Enumerate for GNSS Codes.
Definition Code.hpp:89
ObservationType
Observation types.
Definition GnssObs.hpp:37
@ ObservationType_COUNT
Count.
Definition GnssObs.hpp:41
TsDeque< std::shared_ptr< const NAV::NodeData > > NodeDataQueue
Node data queue type.
Definition Pin.hpp:707
The class is responsible for all time-related tasks.
Definition InsTime.hpp:710
Abstract parent class for all nodes.
Definition Node.hpp:92
Node(std::string name)
Constructor.
Definition Node.cpp:30
Calculates Observation estimates.
ObservationFilter _obsFilter
Observation Filter.
double _dataInterval
Data interval [s].
StdevAccelUnits _gui_stdevAccelUnits
Gui selection for the Unit of the input stdev_accel parameter for the StDev due to acceleration due t...
void updateKalmanFilterAmbiguitiesForPivotChange(const SatSigId &newPivotSatSigId, const SatSigId &oldPivotSatSigId, bool oldPivotObservedInEpoch, const std::shared_ptr< RtkSolution > &rtkSol)
Adapts the Kalman Filter if a pivot satellite signal was changed.
StdevAmbiguityUnits _gui_stdevAmbiguityFloatUnits
Gui selection for the Unit of the input for the StDev of the ambiguities (while float solution)
void recvRoverGnssObs(InputPin::NodeDataQueue &queue, size_t pinIdx)
Receive Function for the RoverGNSS Observations.
void printPivotSatellites()
Prints all pivot satellites.
std::vector< std::pair< InsTime, std::vector< std::string > > > _events
List of event texts (pivot changes, cycle-slips)
size_t nFixSolutions
Percentage of fix solutions.
bool _outputStateEvents
Whether to output state change events.
size_t _nCycleSlipsDual
Cycle-slip detection count (Dual)
void guiConfig() override
ImGui config window which is shown on double click.
static std::string category()
String representation of the Class Category.
StdevAmbiguityUnits
Possible Units for the Standard deviation of the ambiguities.
std::shared_ptr< RtkSolution > calcFallbackSppSolution()
Calculates a SPP solution as fallback in case no base data is available.
bool initialize() override
Initialize the node.
size_t _outlierMinSat
Minumum amount of satellites for doing a NIS check.
KeyedKalmanFilterD< RTK::States::StateKeyType, RTK::Meas::MeasKeyTypes > _kalmanFilter
Kalman Filter representation.
bool _maxPosVarTriggered
Trigger state of the check.
RealTimeKinematic & operator=(const RealTimeKinematic &)=delete
Copy assignment operator.
std::unordered_map< SatSigId, double > _ambiguitiesHold
Ambiguities which are fixed and hold. Values in [cycles].
void calcKalmanUpdateMatrices(const Observations &observations, const Differences &doubleDifferences, const unordered_map< GnssObs::ObservationType, KeyedMatrixXd< RTK::Meas::SingleObs< ReceiverType > > > &Rtilde)
Calculates the Measurement vector 𝐳, Measurement sensitivity matrix 𝐇 and Measurement noise covarianc...
StdevAmbiguityUnits _gui_ambFixUpdateStdDevUnits
Gui selection for the Unit of the input for the StDev of the ambiguities (while float solution)
static constexpr size_t INPUT_PORT_INDEX_BASE_GNSS_OBS
GnssObs.
std::vector< OutlierInfo > removeOutlier(Observations &observations, const std::shared_ptr< RtkSolution > &rtkSol)
Performs the NIS check.
double _ambiguityFloatProcessNoiseVariance
Process noise (variance) for the ambiguities (while float solution) in [cycles^2] (Value used for cal...
std::array< double, 2 > _gui_stdevAccel
GUI selection for the Standard deviation of the acceleration 𝜎_a due to user motion in horizontal and...
double _ambFixUpdateVariance
Measurement noise variance used when fixing ambiguities in [cycles^2] (Value used for calculation)
double _maxPosVar
Do not attempt to fix if the position variance is above the threshold.
size_t _nMinSatForAmbFix
Minimum amount of satellites with carrier observations to try fixing the solution.
double _maxTimeBetweenBaseRoverForRTK
Maximum time between base and rover observations to calculate the RTK solution.
RealTimeKinematic(RealTimeKinematic &&)=delete
Move constructor.
size_t _nMinSatForAmbHold
Minimum amount of satellites with carrier observations for holding the ambiguities.
AmbiguityResolutionParameters _ambiguityResolutionParameters
Ambiguity resolution algorithms and parameters to use.
static void pinAddCallback(Node *node)
Function to call to add a new pin.
size_t _nPivotChange
Amount of pivot changes performed.
std::array< CycleSlipDetector, ReceiverType_COUNT > _cycleSlipDetector
Cycle-slip detector.
gui::widgets::DynamicInputPins _dynamicInputPins
Dynamic input pins.
double _outlierMaxPosVarStartup
Do not attempt to remove outlier if the position variance is above the threshold in the startup phase...
RtkSolution::SolutionType _lastSolutionStatus
Solution type of last epoch.
std::string _eventFilterRegex
Regex for filtering events.
RealTimeKinematic & operator=(RealTimeKinematic &&)=delete
Move assignment operator.
void addEventToGui(const std::shared_ptr< RtkSolution > &rtkSol, const std::string &text)
Adds the event to the GUI list.
size_t _nCycleSlipsSingle
Cycle-slip detection count (Single)
RealTimeKinematic()
Default constructor.
void calcRealTimeKinematicSolution()
Calculates the RTK solution.
size_t _nCycleSlipsLLI
Cycle-slip detection count (LLI)
void assignSolutionToFilter(const std::shared_ptr< NAV::SppSolution > &sppSol)
Assign the SPP solution to the RTK filter.
unordered_map< SatSigId, unordered_map< GnssObs::ObservationType, Difference > > Differences
Difference storage type.
size_t nFloatSolutions
Percentage of float solutions.
@ ReceiverType_COUNT
Amount of receiver types.
void recvBaseGnssObs(InputPin::NodeDataQueue &queue, size_t pinIdx)
Receive Function for the Base GNSS Observations.
unordered_map< GnssObs::ObservationType, KeyedMatrixXd< RTK::Meas::SingleObs< ReceiverType > > > calcSingleObsMeasurementNoiseMatrices(const Observations &observations) const
Calculate the measurement noise matrices for each observation type.
double _gui_ambiguityFloatProcessNoiseStDev
Process noise (standard deviation) for the ambiguities (while float solution) (Selection in GUI)
StdevAmbiguityUnits _gui_stdevAmbiguityFixUnits
Gui selection for the Unit of the input for the StDev of the ambiguities (while fix solution)
void addOrRemoveKalmanFilterAmbiguities(const Observations &observations, const std::shared_ptr< RtkSolution > &rtkSol)
Adds or remove Ambiguities to/from the Kalman Filter state depending on the received observations.
size_t _nMeasExcludedNIS
Measurement excluded due to NIS test count.
static void pinDeleteCallback(Node *node, size_t pinIdx)
Function to call to delete a pin.
static constexpr size_t INPUT_PORT_INDEX_ROVER_GNSS_OBS
GnssObs.
void printObservations(const Observations &observations)
Prints the observations for logging.
std::string type() const override
String representation of the Class Type.
NAV::Receiver< ReceiverType > Receiver
Receiver.
AmbiguityResolutionStrategy _ambiguityResolutionStrategy
Ambiguity resolution strategy.
SPP::Algorithm _sppAlgorithm
SPP algorithm.
bool _calcSPPIfNoBase
Wether to output a SPP solution if no base observations are available.
double _ambiguityFixProcessNoiseVariance
Process noise (standard deviation) for the ambiguities (while fix solution) in [cycles^2] (Value used...
size_t _outlierMinPsrObsKeep
Minumum amount of pseudorange observables to leave when doing a NIS check.
bool _outlierMaxPosVarStartupTriggered
Trigger state of the check.
Differences calcDoubleDifferences(const Observations &observations, const Differences &singleDifferences) const
Calculates the double difference of the measurements and estimates.
void kalmanFilterPrediction()
Does the Kalman Filter prediction.
bool _baseObsReceivedThisEpoch
Flag, whether the observation was received this epoch.
size_t _outlierRemoveEpochs
Amount of epochs to remove an outlier after being found (1 = only current)
size_t nSingleSolutions
Percentage of float solutions.
static constexpr size_t OUTPUT_PORT_INDEX_RTKSOL
Flow (RtkSol)
InsTime _lastUpdate
Last update time.
double _gui_ambiguityFixProcessNoiseStDev
Process noise (standard deviation) for the ambiguities (while fix solution) (Selection in GUI)
RealTimeKinematic(const RealTimeKinematic &)=delete
Copy constructor.
ObservationEstimator _obsEstimator
Observation Estimator.
unordered_map< std::pair< Code, GnssObs::ObservationType >, PivotSatellite > _pivotSatellites
Pivot satellites for each constellation.
std::optional< RtkSolution::PivotChange > updatePivotSatellite(Code code, GnssObs::ObservationType obsType, Observations &observations, const std::shared_ptr< RtkSolution > &rtkSol, const RtkSolution::PivotChange::Reason &reason)
Update the specified pivot satellite and also does a pivot change in the Kalman filter state if neces...
bool _nMinSatForAmbHoldTriggered
Trigger state of the check.
double _gui_ambFixUpdateStdDev
Measurement noise standard deviation used when fixing ambiguities in [cycles] (GUI value)
StdevAccelUnits
Possible Units for the Standard deviation of the acceleration due to user motion.
~RealTimeKinematic() override
Destructor.
size_t _maxRemoveOutlier
Maximum amount of outliers to remove per epoch.
void recvBasePos(InputPin::NodeDataQueue &queue, size_t pinIdx)
Receive Function for the Base Position.
void deinitialize() override
Deinitialize the node.
UpdateStatus kalmanFilterUpdate(const std::shared_ptr< RtkSolution > &rtkSol)
Does the Kalman Filter update.
static constexpr size_t INPUT_PORT_INDEX_GNSS_NAV_INFO
GnssNavInfo.
void restore(const json &j) override
Restores the node from a json object.
void removeSingleObservations(Observations &observations, ObservationFilter::Filtered *filtered, const std::shared_ptr< RtkSolution > &rtkSol)
Removes observations which do not have a second one to do double differences.
void applyFixedAmbiguities(const Eigen::VectorXd &fixedAmb, const std::vector< RTK::States::StateKeyType > &ambKeys, const std::vector< RTK::Meas::MeasKeyTypes > &ambMeasKeys)
Apply the fixed ambiguities to the kalman filter state.
static constexpr size_t INPUT_PORT_INDEX_BASE_POS
Pos.
void checkForCycleSlip(Observations &observations, const std::shared_ptr< RtkSolution > &rtkSol)
Checks for cycle-slips.
Differences calcSingleDifferences(const Observations &observations) const
Calculates the single difference of the measurements and estimates.
bool resolveAmbiguities(size_t nCarrierMeasUniqueSatellite, const std::shared_ptr< RtkSolution > &rtkSol)
Resolves the ambiguities in the Kalman filter and updates the state and covariance matrix.
std::array< Receiver, ReceiverType::ReceiverType_COUNT > _receiver
Receivers.
static std::string typeStatic()
String representation of the Class Type.
void updatePivotSatellites(Observations &observations, const std::shared_ptr< RtkSolution > &rtkSol)
Update the pivot satellites for each constellation.
bool _nMinSatForAmbFixTriggered
Trigger state of the check.
json save() const override
Saves the node into a json object.
SolutionType
Possible types of the RTK solution.
@ RTK_Float
RTK solution with floating point ambiguities.
Single Point Positioning Algorithm.
Definition Algorithm.hpp:38
std::variant< PsrDD, CarrierDD, DopplerDD, States::AmbiguityDD > MeasKeyTypes
Alias for the measurement key type.
Definition Keys.hpp:98
AmbiguityResolutionStrategy
Ambiguity resolution strategies.
@ Continuous
Estimate ambiguities every epoch.
const char * to_string(gui::widgets::PositionWithFrame::ReferenceFrame refFrame)
Converts the enum to a string.
KeyedKalmanFilter< double, StateKeyType, MeasKeyType > KeyedKalmanFilterD
Keyed Kalman Filter class with double as type.
KeyedMatrixX< double, RowKeyType, ColKeyType > KeyedMatrixXd
Dynamic size KeyedMatrix with double types.
Ambiguity resolution algorithms and parameters.
Observation storage type.
Double differenced pseudorange measurement psr_br^1s [m] (one for each satellite signal,...
Definition Keys.hpp:71
Single Observation key.
Definition Keys.hpp:103
Differences (single or double)
std::optional< RtkSolution::PivotChange::Reason > pivot
Pivot change reason, if it is a pivot.
OutlierInfo()=default
Defaults Constructor.
OutlierInfo(const RTK::Meas::MeasKeyTypes &key)
Constructor.
SatSigId satSigId
Satellit signal id.
RTK::Meas::MeasKeyTypes key
Measurement key of the outlier.
GnssObs::ObservationType obsType
Observation type.
PivotSatellite(const SatSigId &satSigId)
Constructor.
SatSigId satSigId
Satellite Signal identifier.
bool valid
Flag if the solution is valid.
double dx
Position change due to the update.
double threshold
Allowed position change.
Receiver information.
Definition Receiver.hpp:34
Reason
Possible reasons for a pivot change.
Identifies a satellite signal (satellite frequency and number)
Inputs pins which can be added dynamically.