16#include <fmt/format.h>
60 bool ShowGuiWidgets(
const char*
id,
float itemWidth,
float unitWidth);
76 std::shared_ptr<SppSolution>
calcSppSolution(
const std::shared_ptr<const GnssObs>& gnssObs,
77 const std::vector<const GnssNavInfo*>& gnssNavInfos,
78 const std::string& nameId);
117 std::vector<States::StateKeyType>
determineStateKeys(
const std::set<SatelliteSystem>& usedSatSystems,
size_t nDoppMeas,
const std::string& nameId)
const;
124 std::vector<Meas::MeasKeyTypes>
determineMeasKeys(
const Observations& observations,
size_t nPsrMeas,
size_t nDoppMeas,
const std::string& nameId)
const;
133 const std::vector<Meas::MeasKeyTypes>& measKeys,
135 const std::string& nameId)
const;
144 const std::string& nameId);
153 const std::string& nameId);
165 const Eigen::Vector3d& e_oldPos,
166 size_t nParams,
size_t nUniqueDopplerMeas,
double dt,
const std::string& nameId);
174 const std::string& nameId);
180 void computeDOPs(
const std::shared_ptr<SppSolution>& sppSol,
182 const std::string& nameId);
238#ifndef DOXYGEN_IGNORE
242struct fmt::formatter<
NAV::SPP::Algorithm::EstimatorType> : fmt::formatter<const char*>
248 template<
typename FormatContext>
251 return fmt::formatter<const char*>::format(
NAV::to_string(type), ctx);
257struct fmt::formatter<
NAV::SPP::Algorithm::ReceiverType> : fmt::formatter<const char*>
263 template<
typename FormatContext>
266 return fmt::formatter<const char*>::format(
NAV::to_string(type), ctx);
std::ostream & operator<<(std::ostream &os, const NAV::SPP::Algorithm::EstimatorType &obj)
Stream insertion operator overload.
nlohmann::json json
json namespace
Keys for the SPP algorithm for use inside the KeyedMatrices.
GNSS Observation messages.
Calculates Observation estimates.
Observation data used for calculations.
@ Doppler
Doppler (Pseudorange rate)
@ Pseudorange
Pseudorange.
The class is responsible for all time-related tasks.
Calculates Observation estimates.
Single Point Positioning Algorithm.
KeyedMatrixXd< Meas::MeasKeyTypes, States::StateKeyType > calcMatrixH(const std::vector< States::StateKeyType > &stateKeys, const std::vector< Meas::MeasKeyTypes > &measKeys, const Observations &observations, const std::string &nameId) const
Calculates the measurement sensitivity matrix 𝐇
std::vector< States::StateKeyType > determineStateKeys(const std::set< SatelliteSystem > &usedSatSystems, size_t nDoppMeas, const std::string &nameId) const
Returns a list of state keys.
friend void to_json(json &j, const Algorithm &obj)
Converts the provided object into json.
Receiver _receiver
Receiver.
bool canEstimateInterFrequencyBias() const
Checks if the SPP algorithm can estimate inter-frequency biases.
void reset()
Reset the algorithm.
NAV::Receiver< ReceiverType > Receiver
Receiver.
void computeDOPs(const std::shared_ptr< SppSolution > &sppSol, const KeyedMatrixXd< Meas::MeasKeyTypes, States::StateKeyType > &H, const std::string &nameId)
Computes all DOP values (by reference)
void updateInterFrequencyBiases(const Observations &observations, const std::string &nameId)
Updates the inter frequency biases.
std::vector< Meas::MeasKeyTypes > determineMeasKeys(const Observations &observations, size_t nPsrMeas, size_t nDoppMeas, const std::string &nameId) const
Returns a list of measurement keys.
Eigen::Matrix3d _e_lastPositionCovarianceMatrix
Last position covariance matrix.
void assignKalmanFilterResult(const KeyedVectorXd< States::StateKeyType > &state, const KeyedMatrixXd< States::StateKeyType, States::StateKeyType > &variance, const std::string &nameId)
Assigns the result to the receiver variable.
ObservationFilter _obsFilter
Observation Filter.
friend void from_json(const json &j, Algorithm &obj)
Converts the provided json object into a node object.
InsTime _lastUpdate
Time of last update.
bool _estimateInterFreqBiases
Estimate Inter-frequency biases.
static KeyedVectorXd< Meas::MeasKeyTypes > calcMeasInnovation(const std::vector< Meas::MeasKeyTypes > &measKeys, const Observations &observations, const std::string &nameId)
Calculates the measurement innovation vector 𝜹𝐳
const InsTime & getLastUpdateTime() const
Get the last update time.
std::shared_ptr< SppSolution > calcSppSolution(const std::shared_ptr< const GnssObs > &gnssObs, const std::vector< const GnssNavInfo * > &gnssNavInfos, const std::string &nameId)
Calculate the SPP solution.
const std::array< SPP::States::StateKeyType, 3 > & PosKey
All position keys.
EstimatorType getEstimatorType() const
Get the Estimator Type.
bool canCalculateVelocity(size_t nDoppMeas) const
Checks if the SPP algorithm can calculate the position (always true for Kalman filter)
const std::array< SPP::States::StateKeyType, 6 > & PosVelKey
All position and velocity keys.
static KeyedMatrixXd< Meas::MeasKeyTypes, Meas::MeasKeyTypes > calcMatrixR(const std::vector< Meas::MeasKeyTypes > &measKeys, const Observations &observations, const std::string &nameId)
Calculates the measurement noise covariance matrix 𝐑
SPP::KalmanFilter _kalmanFilter
SPP specific Kalman filter.
void assignLeastSquaresResult(const KeyedVectorXd< States::StateKeyType > &state, const KeyedMatrixXd< States::StateKeyType, States::StateKeyType > &variance, const Eigen::Vector3d &e_oldPos, size_t nParams, size_t nUniqueDopplerMeas, double dt, const std::string &nameId)
Assigns the result to the receiver variable.
ObservationEstimator _obsEstimator
Observation Estimator.
EstimatorType
Possible SPP estimation algorithms.
@ WeightedLeastSquares
Weighted Linear Least Squares.
@ COUNT
Amount of items in the enum.
@ KalmanFilter
Kalman Filter.
@ LeastSquares
Linear Least Squares.
const std::array< SPP::States::StateKeyType, 3 > & VelKey
All velocity keys.
ReceiverType
Receiver Types.
@ ReceiverType_COUNT
Amount of receiver types.
EstimatorType _estimatorType
Estimator type used for the calculations.
Eigen::Matrix3d _e_lastVelocityCovarianceMatrix
Last velocity covariance matrix.
bool ShowGuiWidgets(const char *id, float itemWidth, float unitWidth)
Shows the GUI input to select the options.
The Spp Kalman Filter related options.
constexpr std::array< StateKeyType, 3 > Pos
All position keys.
constexpr std::array< StateKeyType, 6 > PosVel
Vector with all position and velocity keys.
constexpr std::array< StateKeyType, 3 > Vel
All velocity keys.
void to_json(json &j, const Algorithm &obj)
Converts the provided object into json.
void from_json(const json &j, Algorithm &obj)
Converts the provided json object into a node object.
const char * to_string(gui::widgets::PositionWithFrame::ReferenceFrame refFrame)
Converts the enum to a string.
KeyedVectorX< double, RowKeyType > KeyedVectorXd
Dynamic size KeyedVector with double types.
KeyedMatrixX< double, RowKeyType, ColKeyType > KeyedMatrixXd
Dynamic size KeyedMatrix with double types.
Observation storage type.