80 [[nodiscard]] std::string
type()
const override;
83 [[nodiscard]]
static std::string
category();
90 [[nodiscard]]
json save()
const override;
258 std::vector<std::pair<InsTime, std::vector<std::string>>>
_events;
289 void addEventToGui(
const std::shared_ptr<RtkSolution>& rtkSol,
const std::string& text);
342 Observations& observations,
const std::shared_ptr<RtkSolution>& rtkSol,
395 std::optional<RtkSolution::PivotChange::Reason>
pivot;
424 bool resolveAmbiguities(
size_t nCarrierMeasUniqueSatellite,
const std::shared_ptr<RtkSolution>& rtkSol);
430 void applyFixedAmbiguities(
const Eigen::VectorXd& fixedAmb,
const std::vector<RTK::States::StateKeyType>& ambKeys,
const std::vector<RTK::Meas::MeasKeyTypes>& ambMeasKeys);
440#ifndef DOXYGEN_IGNORE
444struct fmt::formatter<
NAV::RealTimeKinematic::ReceiverType> : fmt::formatter<const char*>
450 template<
typename FormatContext>
453 return fmt::formatter<const char*>::format(to_string(type), ctx);
Single Point Positioning Algorithm.
Ambiguity resolution algorithms.
Combination of different cycle-slip detection algorithms.
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.
Calculates Observation estimates.
Observation data used for calculations.
Receiver Clock information.
RTK Node/Algorithm output.
Signal to Noise Ratio Mask.
Satellite Navigation data (to calculate SatNavData and clock)
Structs identifying a unique satellite.
ankerl::unordered_dense::map< Key, T > unordered_map
Unordered map type.
Enumerate for GNSS Codes.
ObservationType
Observation types.
@ ObservationType_COUNT
Count.
The class is responsible for all time-related tasks.
Abstract parent class for all nodes.
Node(std::string name)
Constructor.
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
Receiver Types.
@ 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.
bool _applyFixedAmbiguitiesWithUpdate
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.
std::variant< PsrDD, CarrierDD, DopplerDD, States::AmbiguityDD > MeasKeyTypes
Alias for the measurement key type.
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,...
Differences (single or double)
double measurement
Measurement.
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.
Pivot satellite information.
PivotSatellite(const SatSigId &satSigId)
Constructor.
SatSigId satSigId
Satellite Signal identifier.
Update Valid information.
bool valid
Flag if the solution is valid.
double dx
Position change due to the update.
double threshold
Allowed position change.
Reason
Possible reasons for a pivot change.
Identifies a satellite signal (satellite frequency and number)