#include <CodeKalmanSolver.hpp>
Inheritance diagram for CodeKalmanSolver:


This class may be used either in a Vector- and Matrix-oriented way, or with GNSS data structure objects from "DataStructures" class.
A typical way to use this class with GNSS data structures follows:
// Data stream RinexObsStream rin("ebre0300.02o"); // More declarations here: Ionospheric and tropospheric models, // ephemeris, etc. // Declare the modeler object, setting all the parameters in // one pass ModelObs model( ionoStore, mopsTM, bceStore, TypeID::C1 ); // Set initial position (Bancroft method) model.Prepare(); // Declare a CodeKalmanSolver object CodeKalmanSolver kSolver; // This object will compute the appropriate MOPS weights ComputeMOPSWeights mopsW(nominalPos, bceStore); gnssRinex gRin; while(rin >> gRin) { gRin >> model >> mopsW >> kSolver; }
The "CodeKalmanSolver" object will extract all the data it needs from the GNSS data structure that is "gRin" and will try to solve the code-based system of equations using a simple Kalman filter. It will also insert back postfit residual data into "gRin" if it successfully solves the equation system.
This class may optionally use weights assigned to each satellite. This can be achieved with objects from classes such as "ComputeIURAWeights", "ComputeMOPSWeights", etc., but in any case this is not mandatory.
By default, it will build the geometry matrix from the values of coefficients dx, dy, dz and cdt, and the independent vector will be composed of the code prefit residuals (TypeID::prefitC) values.
You may change the former by redefining the default equation definition to be used. For instance:
// Define our own set of unknowns TypeIDSet unknownsSet; unknownsSet.insert(TypeID::dLat); unknownsSet.insert(TypeID::dLon); unknownsSet.insert(TypeID::dH); unknownsSet.insert(TypeID::cdt); // Create a new equation definition // newEq(independent value, set of unknowns) gnssEquationDefinition newEq(TypeID::prefitC, unknownsSet); // Reconfigure solver kSolver.setDefaultEqDefinition(newEq);
By default, this class assigns a 'constant' stochastic model (StochasticModel) to coordinates and a 'white noise' stochastic model (WhiteNoiseModel) to the receiver clock (cdt). This may be changed at will using the appropriate methods.
For instance, in orden to use a 'full kinematic' mode we assign a white noise model to all the coordinates:
// Define a white noise model with 100 m of sigma WhiteNoiseModel wnM(100.0); // Configure the solver to use this model for all coordinates kSolver.setCoordinatesModel(&wnM);
Be aware, however, that you MUST NOT use this method to set a state-aware stochastic model (like RandomWalkModel, for instance) to ALL coordinates, because the results will certainly be erroneous. Use this method ONLY with non-state-aware stochastic models like 'StochasticModel' (constant coordinates) or 'WhiteNoiseModel'.
In order to overcome the former limitation, this class provides methods to set different, specific stochastic models for each coordinate, like:
// Define a white noise model with 2 m of sigma for horizontal // coordinates (in this case, the solver is previously set to use // dLat, dLon and dH). WhiteNoiseModel wnHorizontalModel(2.0); // Define a random walk model with 0.04 m*m/s of process spectral // density for vertical coordinates. RandomWalkModel rwVerticalModel(0.04); // Configure the solver to use these models kSolver.setXCoordinatesModel(&wnHorizontalModel); kSolver.setYCoordinatesModel(&wnHorizontalModel); kSolver.setZCoordinatesModel(&rwVerticalModel);
Definition at line 169 of file CodeKalmanSolver.hpp.
Public Member Functions | |
| CodeKalmanSolver () | |
| Default constructor. | |
| CodeKalmanSolver (const gnssEquationDefinition &eqDef) | |
| Explicit constructor. | |
| virtual int | Compute (const Vector< double > &prefitResiduals, const Matrix< double > &designMatrix, const Matrix< double > &weightMatrix) throw (InvalidSolver) |
| Compute the code-based Kalman solution of the given equations set. | |
| virtual int | Compute (const Vector< double > &prefitResiduals, const Matrix< double > &designMatrix, const Vector< double > &weightVector) throw (InvalidSolver) |
| Compute the code-based Kalman solution of the given equations set. | |
| virtual gnssSatTypeValue & | Process (gnssSatTypeValue &gData) throw (ProcessingException) |
| Returns a reference to a gnnsSatTypeValue object after solving the previously defined equation system. | |
| virtual gnssRinex & | Process (gnssRinex &gData) throw (ProcessingException) |
| Returns a reference to a gnnsRinex object after solving the previously defined equation system. | |
| StochasticModel * | getXCoordinatesModel () const |
| Get stochastic model pointer for dx (or dLat) coordinate. | |
| CodeKalmanSolver & | setXCoordinatesModel (StochasticModel *pModel) |
| Set coordinates stochastic model for dx (or dLat) coordinate. | |
| StochasticModel * | getYCoordinatesModel () const |
| Get stochastic model pointer for dy (or dLon) coordinate. | |
| CodeKalmanSolver & | setYCoordinatesModel (StochasticModel *pModel) |
| Set coordinates stochastic model for dy (or dLon) coordinate. | |
| StochasticModel * | getZCoordinatesModel () const |
| Get stochastic model pointer for dz (or dH) coordinate. | |
| CodeKalmanSolver & | setZCoordinatesModel (StochasticModel *pModel) |
| Set coordinates stochastic model for dz (or dH) coordinate. | |
| CodeKalmanSolver & | setCoordinatesModel (StochasticModel *pModel) |
| Set a single coordinates stochastic model to ALL coordinates. | |
| StochasticModel * | getReceiverClockModel () const |
| Get receiver clock stochastic model pointer. | |
| CodeKalmanSolver & | setReceiverClockModel (StochasticModel *pModel) |
| Set receiver clock stochastic model. | |
| Matrix< double > | getPhiMatrix () const |
| Get the State Transition Matrix (phiMatrix). | |
| CodeKalmanSolver & | setPhiMatrix (const Matrix< double > &pMatrix) |
| Set the State Transition Matrix (phiMatrix). | |
| Matrix< double > | getQMatrix () const |
| Get the Noise covariance matrix (QMatrix). | |
| CodeKalmanSolver & | setQMatrix (const Matrix< double > &pMatrix) |
| Set the Noise Covariance Matrix (QMatrix). | |
| virtual std::string | getClassName (void) const |
| Returns a string identifying this object. | |
| virtual | ~CodeKalmanSolver () |
| Destructor. | |
|
|
Default constructor.
Definition at line 44 of file CodeKalmanSolver.cpp. References gnssData::body, gnssData::header, and gpstk::TypeIDSet. |
|
|
Explicit constructor. Sets the default equation definition to be used when fed with GNSS data structures.
Definition at line 104 of file CodeKalmanSolver.cpp. References SolverLMS::setDefaultEqDefinition(). |
|
|
Destructor.
Definition at line 361 of file CodeKalmanSolver.hpp. |
|
||||||||||||||||
|
Compute the code-based Kalman solution of the given equations set.
Reimplemented in SolverPPP. Definition at line 133 of file CodeKalmanSolver.cpp. References GPSTK_THROW. |
|
||||||||||||||||
|
Compute the code-based Kalman solution of the given equations set.
Reimplemented in SolverPPP. Definition at line 188 of file CodeKalmanSolver.cpp. References GPSTK_RETHROW, GPSTK_THROW, and gpstk::inverseChol(). |
|
|
Returns a string identifying this object.
Reimplemented from SolverLMS. Reimplemented in SolverPPP, and SolverPPPFB. Definition at line 39 of file CodeKalmanSolver.cpp. |
|
|
Get the State Transition Matrix (phiMatrix).
Reimplemented in SolverPPP. Definition at line 321 of file CodeKalmanSolver.hpp. |
|
|
Get the Noise covariance matrix (QMatrix).
Reimplemented in SolverPPP. Definition at line 339 of file CodeKalmanSolver.hpp. |
|
|
Get receiver clock stochastic model pointer.
Reimplemented in SolverPPP. Definition at line 307 of file CodeKalmanSolver.hpp. |
|
|
Get stochastic model pointer for dx (or dLat) coordinate.
Reimplemented in SolverPPP. Definition at line 251 of file CodeKalmanSolver.hpp. |
|
|
Get stochastic model pointer for dy (or dLon) coordinate.
Reimplemented in SolverPPP. Definition at line 265 of file CodeKalmanSolver.hpp. |
|
|
Get stochastic model pointer for dz (or dH) coordinate.
Reimplemented in SolverPPP. Definition at line 279 of file CodeKalmanSolver.hpp. |
|
|
Returns a reference to a gnnsRinex object after solving the previously defined equation system.
Reimplemented from SolverLMS. Reimplemented in SolverPPP, and SolverPPPFB. Definition at line 348 of file CodeKalmanSolver.cpp. References satTypeValueMap::getVectorOfTypeID(), GPSTK_THROW, and satTypeValueMap::numSats(). |
|
|
Returns a reference to a gnnsSatTypeValue object after solving the previously defined equation system.
Reimplemented from SolverLMS. Reimplemented in SolverPPP, and SolverPPPFB. Definition at line 308 of file CodeKalmanSolver.cpp. References gnssData::body, GPSTK_THROW, and gnssRinex::header. |
|
|
Set a single coordinates stochastic model to ALL coordinates.
Reimplemented in SolverPPP. Definition at line 468 of file CodeKalmanSolver.cpp. |
|
|
Set the State Transition Matrix (phiMatrix).
Reimplemented in SolverPPP. Definition at line 334 of file CodeKalmanSolver.hpp. |
|
|
Set the Noise Covariance Matrix (QMatrix).
Reimplemented in SolverPPP. Definition at line 352 of file CodeKalmanSolver.hpp. |
|
|
Set receiver clock stochastic model.
Reimplemented in SolverPPP. Definition at line 316 of file CodeKalmanSolver.hpp. |
|
|
Set coordinates stochastic model for dx (or dLat) coordinate.
Reimplemented in SolverPPP. Definition at line 260 of file CodeKalmanSolver.hpp. |
|
|
Set coordinates stochastic model for dy (or dLon) coordinate.
Reimplemented in SolverPPP. Definition at line 274 of file CodeKalmanSolver.hpp. |
|
|
Set coordinates stochastic model for dz (or dH) coordinate.
Reimplemented in SolverPPP. Definition at line 288 of file CodeKalmanSolver.hpp. |
1.3.9.1