53 void predict(
const double& dt,
const Eigen::Vector3d& lla_pos,
const std::string& nameId);
61 void update(
const std::vector<Meas::MeasKeyTypes>& measKeys,
65 const std::string& nameId);
76 const std::string& nameId);
98 bool ShowGuiWidgets(
const char*
id,
bool useDoppler,
bool multiConstellation,
bool estimateInterFrequencyBiases,
float itemWidth,
float unitWidth);
105 [[nodiscard]]
const std::vector<SPP::States::StateKeyTypes>&
getStateKeys()
const;
118 bool _initialized =
false;
125 enum class QCalculationAlgorithm
131 QCalculationAlgorithm _qCalculationAlgorithm = QCalculationAlgorithm::VanLoan;
136 enum class CovarianceAccelUnits
142 CovarianceAccelUnits _gui_covarianceAccelUnit = CovarianceAccelUnits::m_sqrts3;
146 std::array<double, 2> _gui_covarianceAccel = { 3.0, 1.5 } ;
148 std::array<double, 2> _covarianceAccel = { 3.0, 1.5 };
153 enum class CovarianceClkPhaseDriftUnits
159 CovarianceClkPhaseDriftUnits _gui_covarianceClkPhaseDriftUnit = CovarianceClkPhaseDriftUnits::m2_s;
162 double _gui_covarianceClkPhaseDrift = 0.01 ;
164 double _covarianceClkPhaseDrift = 0.01;
169 enum class CovarianceClkFrequencyDriftUnits
175 CovarianceClkFrequencyDriftUnits _gui_covarianceClkFrequencyDriftUnit = CovarianceClkFrequencyDriftUnits::m2_s3;
178 double _gui_covarianceClkFrequencyDrift = 0.04 ;
180 double _covarianceClkFrequencyDrift = 0.04;
185 CovarianceClkPhaseDriftUnits _gui_covarianceInterSysClkPhaseDriftUnit = CovarianceClkPhaseDriftUnits::m2_s;
188 double _gui_covarianceInterSysClkPhaseDrift = 0.01 ;
190 double _covarianceInterSysClkPhaseDrift = 0.01;
195 CovarianceClkFrequencyDriftUnits _gui_covarianceInterSysClkFrequencyDriftUnit = CovarianceClkFrequencyDriftUnits::m2_s3;
198 double _gui_covarianceInterSysClkFrequencyDrift = 0.04 ;
200 double _covarianceInterSysClkFrequencyDrift = 0.04;
205 CovarianceClkPhaseDriftUnits _gui_covarianceInterFrequencyBiasUnit = CovarianceClkPhaseDriftUnits::m2_s;
208 double _gui_covarianceInterFrequencyBias = 1e-6 ;
210 double _covarianceInterFrequencyBias = 1e-6;
216 enum class InitCovarianceVelocityUnits
222 InitCovarianceVelocityUnits _gui_initCovarianceVelocityUnit = InitCovarianceVelocityUnits::m_s;
225 double _gui_initCovarianceVelocity = 10 ;
227 double _initCovarianceVelocity = 100;
232 enum class InitCovarianceClockDriftUnits
240 InitCovarianceClockDriftUnits _gui_initCovarianceClockDriftUnit = InitCovarianceClockDriftUnits::s_s;
243 double _gui_initCovarianceClockDrift = 1e-6 ;
245 double _initCovarianceClockDrift = std::pow(1e-6 *
InsConst<>::C, 2);
250 InitCovarianceClockDriftUnits _gui_initCovarianceInterSysClockDriftUnit = InitCovarianceClockDriftUnits::s_s;
253 double _gui_initCovarianceInterSysClockDrift = 1e-6 ;
255 double _initCovarianceInterSysClockDrift = std::pow(1e-6 *
InsConst<>::C, 2);
nlohmann::json json
json namespace
Definition FlowManager.hpp:21
The class is responsible for all time-related tasks.
Kalman Filter with keyed states.
Keys for the SPP algorithm for use inside the KeyedMatrices.
Structs identifying a unique satellite.
Frequency definition for different satellite systems.
Definition Frequency.hpp:59
static constexpr Scalar C
Speed of light [m/s].
Definition Constants.hpp:35
Keyed Kalman Filter class.
Definition KeyedKalmanFilter.hpp:37
Dynamic sized KeyedMatrix.
Definition KeyedMatrix.hpp:2055
Dynamic sized KeyedVector.
Definition KeyedMatrix.hpp:1569
The Spp Kalman Filter related options.
Definition KalmanFilter.hpp:33
const std::vector< SPP::States::StateKeyTypes > & getStateKeys() const
Get the States in the Kalman Filter.
void deinitialize()
Deinitialize the KF (can be used to reinitialize the Filter when results seem strange)
void setClockBiasErrorCovariance(double clkPhaseDrift)
Set the P matrix entry for the covariance of the clock phase drift.
const KeyedMatrixXd< States::StateKeyTypes, States::StateKeyTypes > & getErrorCovarianceMatrix() const
Returns the Error covariance matrix 𝐏
SatelliteSystem updateInterSystemTimeDifferences(const std::set< SatelliteSystem > &usedSatSystems, SatelliteSystem oldRefSys, SatelliteSystem newRefSys, const std::string &nameId)
Adds the inter system time difference bias and drift.
void predict(const double &dt, const Eigen::Vector3d &lla_pos, const std::string &nameId)
Does the Kalman Filter prediction.
const KeyedVectorXd< States::StateKeyTypes > & getState() const
Returns the State vector x̂
void addInterFrequencyBias(const Frequency &freq)
Adds the frequency as inter-frequency bias state.
void update(const std::vector< Meas::MeasKeyTypes > &measKeys, const KeyedMatrixXd< Meas::MeasKeyTypes, States::StateKeyTypes > &H, const KeyedMatrixXd< Meas::MeasKeyTypes, Meas::MeasKeyTypes > &R, const KeyedVectorXd< Meas::MeasKeyTypes > &dz, const std::string &nameId)
Does the Kalman Filter update.
friend void to_json(json &j, const KalmanFilter &data)
Converts the provided data into a json object.
KeyedMatrixXd< States::StateKeyTypes, States::StateKeyTypes > calcProcessNoiseMatrixGroves(double dt, const Eigen::Vector3d &lla_pos, const std::string &nameId) const
Calculates the process noise matrix Q.
friend void from_json(const json &j, KalmanFilter &data)
Converts the provided json object into the data object.
void reset()
Resets the filter.
void initialize(const KeyedVectorXd< States::StateKeyTypes > &states, const KeyedMatrixXd< States::StateKeyTypes, States::StateKeyTypes > &variance)
Initialize the filter.
bool ShowGuiWidgets(const char *id, bool useDoppler, bool multiConstellation, bool estimateInterFrequencyBiases, float itemWidth, float unitWidth)
Shows the GUI input to select the options.
bool isInitialized() const
Checks wether the Kalman filter is initialized.
Definition KalmanFilter.hpp:47
Satellite System type.
Definition SatelliteSystem.hpp:43