SolverPPP Class Reference
[Mathematical algorithmsGPS solution algorithms and Tropospheric]

#include <SolverPPP.hpp>

Inheritance diagram for SolverPPP:

Inheritance graph
[legend]
Collaboration diagram for SolverPPP:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class computes the Precise Point Positioning (PPP) solution using a Kalman solver that combines ionosphere-free code and phase measurements.

This class may be used either in a Vector- and Matrix-oriented way, or with GNSS data structure objects from "DataStructures" class (much more simple to use it this way).

A typical way to use this class with GNSS data structures follows:

      // INITIALIZATION PART

      // EBRE station nominal position
   Position nominalPos(4833520.192, 41537.1043, 4147461.560);
   RinexObsStream rin("ebre0300.02o");  // Data stream

      // Load all the SP3 ephemerides files
   SP3EphemerisStore SP3EphList;
   SP3EphList.loadFile("igs11512.sp3");
   SP3EphList.loadFile("igs11513.sp3");
   SP3EphList.loadFile("igs11514.sp3");

   NeillTropModel neillTM( nominalPos.getAltitude(),
                           nominalPos.getGeodeticLatitude(),
                           30 );

      // Objects to compute the tropospheric data
   BasicModel basicM(nominalPos, SP3EphList);
   ComputeTropModel computeTropo(neillTM);

      // More declarations here: ComputeMOPSWeights, SimpleFilter,
      // LICSDetector, MWCSDetector, SolidTides, OceanLoading, 
      // PoleTides, CorrectObservables, ComputeWindUp, ComputeLinear,
      // LinearCombinations, etc.

      // Declare a SolverPPP object
   SolverPPP pppSolver;

     // PROCESSING PART

   gnssRinex gRin;

   while(rin >> gRin)
   {
      try
      {
         gRin  >> basicM
               >> correctObs
               >> compWindup
               >> computeTropo
               >> linear1      // Compute combinations
               >> pcFilter
               >> markCSLI2
               >> markCSMW
               >> markArc
               >> linear2      // Compute prefit residuals
               >> phaseAlign
               >> pppSolver;
      }
      catch(...)
      {
         cerr << "Unknown exception at epoch: " << time << endl;
         continue;
      }

         // Print results
      cout << time.DOYsecond()      << "  "; // Output field #1
      cout << pppSolver.solution[1] << "  "; // dx: Output field #2
      cout << pppSolver.solution[2] << "  "; // dy: Output field #3
      cout << pppSolver.solution[3] << "  "; // dz: Output field #4
      cout << pppSolver.solution[0] << "  "; // wetTropo: Out field #5
      cout << endl;
   }

The "SolverPPP" object will extract all the data it needs from the GNSS data structure that is "gRin" and will try to solve the PPP system of equations using a Kalman filter. It will also insert back postfit residual data (both code and phase) into "gRin" if it successfully solves the equation system.

By default, it will build the geometry matrix from the values of coefficients wetMap, dx, dy, dz and cdt, IN THAT ORDER. Please note that the first field of the solution will be the estimation of the zenital wet tropospheric component (or at least, the part that wasn't modeled by the tropospheric model used).

You may configure the solver to work with a NEU system in the class constructor or using the "setNEU()" method.

In any case, the "SolverPPP" object will also automatically add and estimate the ionosphere-free phase ambiguities. The independent vector is composed of the code and phase prefit residuals.

This class expects some weights assigned to each satellite. That can be achieved with objects from classes such as "ComputeIURAWeights", "ComputeMOPSWeights", etc.

If these weights are not assigned, then the "SolverPPP" object will set a value of "1.0" to code measurements, and "weightFactor" to phase measurements. The default value of "weightFactor" is "10000.0". This implies that code sigma is 1 m, and phase sigma is 1 cm.

By default, the stochastic models used for each type of variable are:

You may change this assignment with methods "setCoordinatesModel()", "setXCoordinatesModel()", "setYCoordinatesModel()", "setZCoordinatesModel()", "setTroposphereModel()" and "setReceiverClockModel()". However, you are not allowed to change the phase biases stochastic model.

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
   pppSolver.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
   pppSolver.setXCoordinatesModel(&wnHorizontalModel);
   pppSolver.setYCoordinatesModel(&wnHorizontalModel);
   pppSolver.setZCoordinatesModel(&rwVerticalModel);

Warning:
"SolverPPP" is based on a Kalman filter, and Kalman filters are objets that store their internal state, so you MUST NOT use the SAME object to process DIFFERENT data streams.
See also:
SolverBase.hpp, SolverLMS.hpp and CodeKalmanSolver.hpp for base classes.

Definition at line 210 of file SolverPPP.hpp.

Public Member Functions

 SolverPPP (bool useNEU=false)
 Common constructor.
virtual int Compute (const Vector< double > &prefitResiduals, const Matrix< double > &designMatrix, const Matrix< double > &weightMatrix) throw (InvalidSolver)
 Compute the PPP 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 PPP Solution of the given equations set.
virtual gnssSatTypeValueProcess (gnssSatTypeValue &gData) throw (ProcessingException)
 Returns a reference to a gnnsSatTypeValue object after solving the previously defined equation system.
virtual gnssRinexProcess (gnssRinex &gData) throw (ProcessingException)
 Returns a reference to a gnnsRinex object after solving the previously defined equation system.
virtual SolverPPPReset (const Vector< double > &newState, const Matrix< double > &newErrorCov)
 Resets the PPP internal Kalman filter.
virtual SolverPPPsetNEU (bool useNEU)
 Sets if a NEU system will be used.
virtual double getWeightFactor (void) const
 Get the weight factor multiplying the phase measurements sigmas.
virtual SolverPPPsetWeightFactor (double factor)
 Set the weight factor multiplying the phase measurement sigma.
StochasticModelgetXCoordinatesModel () const
 Get stochastic model pointer for dx (or dLat) coordinate.
SolverPPPsetXCoordinatesModel (StochasticModel *pModel)
 Set coordinates stochastic model for dx (or dLat) coordinate.
StochasticModelgetYCoordinatesModel () const
 Get stochastic model pointer for dy (or dLon) coordinate.
SolverPPPsetYCoordinatesModel (StochasticModel *pModel)
 Set coordinates stochastic model for dy (or dLon) coordinate.
StochasticModelgetZCoordinatesModel () const
 Get stochastic model pointer for dz (or dH) coordinate.
SolverPPPsetZCoordinatesModel (StochasticModel *pModel)
 Set coordinates stochastic model for dz (or dH) coordinate.
virtual SolverPPPsetCoordinatesModel (StochasticModel *pModel)
 Set a single coordinates stochastic model to ALL coordinates.
virtual StochasticModelgetTroposphereModel (void) const
 Get wet troposphere stochastic model pointer.
virtual SolverPPPsetTroposphereModel (StochasticModel *pModel)
 Set zenital wet troposphere stochastic model.
virtual StochasticModelgetReceiverClockModel (void) const
 Get receiver clock stochastic model pointer.
virtual SolverPPPsetReceiverClockModel (StochasticModel *pModel)
 Set receiver clock stochastic model.
virtual StochasticModelgetPhaseBiasesModel (void) const
 Get phase biases stochastic model pointer.
virtual SolverPPPsetPhaseBiasesModel (StochasticModel *pModel)
 Set phase biases stochastic model.
virtual Matrix< double > getPhiMatrix (void) const
 Get the State Transition Matrix (phiMatrix).
virtual SolverPPPsetPhiMatrix (const Matrix< double > &pMatrix)
 Set the State Transition Matrix (phiMatrix).
virtual Matrix< double > getQMatrix (void) const
 Get the Noise covariance matrix (QMatrix).
virtual SolverPPPsetQMatrix (const Matrix< double > &pMatrix)
 Set the Noise Covariance Matrix (QMatrix).
virtual SolverPPPsetKinematic (bool kinematicMode=true, double sigmaX=100.0, double sigmaY=100.0, double sigmaZ=100.0)
 Set the positioning mode, kinematic or static.
virtual int getIndex (void) const
 Returns an index identifying this object.
virtual std::string getClassName (void) const
 Returns a string identifying this object.
virtual ~SolverPPP ()
 Destructor.


Constructor & Destructor Documentation

SolverPPP bool  useNEU = false  ) 
 

Common constructor.

Parameters:
useNEU If true, will compute dLat, dLon, dH coordinates; if false (the default), will compute dx, dy, dz.

Definition at line 56 of file SolverPPP.cpp.

References SolverPPP::setNEU().

virtual ~SolverPPP  )  [inline, virtual]
 

Destructor.

Definition at line 492 of file SolverPPP.hpp.


Member Function Documentation

int Compute const Vector< double > &  prefitResiduals,
const Matrix< double > &  designMatrix,
const Vector< double > &  weightVector
throw (InvalidSolver) [virtual]
 

Compute the PPP Solution of the given equations set.

Parameters:
prefitResiduals Vector of prefit residuals
designMatrix Design matrix for the equation system
weightVector Vector of weights assigned to each satellite.
Warning:
A typical Kalman filter works with the measurements noise covariance matrix, instead of the vector of weights. Beware of this detail, because this method uses the later.
Returns:
0 if OK -1 if problems arose

Reimplemented from CodeKalmanSolver.

Definition at line 117 of file SolverPPP.cpp.

References GPSTK_THROW.

int Compute const Vector< double > &  prefitResiduals,
const Matrix< double > &  designMatrix,
const Matrix< double > &  weightMatrix
throw (InvalidSolver) [virtual]
 

Compute the PPP Solution of the given equations set.

Parameters:
prefitResiduals Vector of prefit residuals
designMatrix Design matrix for the equation system
weightMatrix Matrix of weights
Warning:
A typical Kalman filter works with the measurements noise covariance matrix, instead of the matrix of weights. Beware of this detail, because this method uses the later.
Returns:
0 if OK -1 if problems arose

Reimplemented from CodeKalmanSolver.

Definition at line 168 of file SolverPPP.cpp.

References GPSTK_RETHROW, GPSTK_THROW, and gpstk::inverseChol().

std::string getClassName void   )  const [virtual]
 

Returns a string identifying this object.

Reimplemented from CodeKalmanSolver.

Reimplemented in SolverPPPFB.

Definition at line 47 of file SolverPPP.cpp.

int getIndex void   )  const [virtual]
 

Returns an index identifying this object.

Definition at line 42 of file SolverPPP.cpp.

virtual StochasticModel* getPhaseBiasesModel void   )  const [inline, virtual]
 

Get phase biases stochastic model pointer.

Definition at line 418 of file SolverPPP.hpp.

virtual Matrix<double> getPhiMatrix void   )  const [inline, virtual]
 

Get the State Transition Matrix (phiMatrix).

Reimplemented from CodeKalmanSolver.

Definition at line 440 of file SolverPPP.hpp.

virtual Matrix<double> getQMatrix void   )  const [inline, virtual]
 

Get the Noise covariance matrix (QMatrix).

Reimplemented from CodeKalmanSolver.

Definition at line 458 of file SolverPPP.hpp.

virtual StochasticModel* getReceiverClockModel void   )  const [inline, virtual]
 

Get receiver clock stochastic model pointer.

Reimplemented from CodeKalmanSolver.

Definition at line 399 of file SolverPPP.hpp.

virtual StochasticModel* getTroposphereModel void   )  const [inline, virtual]
 

Get wet troposphere stochastic model pointer.

Definition at line 380 of file SolverPPP.hpp.

virtual double getWeightFactor void   )  const [inline, virtual]
 

Get the weight factor multiplying the phase measurements sigmas.

This factor is the code_sigma/phase_sigma ratio.

Definition at line 307 of file SolverPPP.hpp.

References gpstk::sqrt().

StochasticModel* getXCoordinatesModel  )  const [inline]
 

Get stochastic model pointer for dx (or dLat) coordinate.

Reimplemented from CodeKalmanSolver.

Definition at line 324 of file SolverPPP.hpp.

StochasticModel* getYCoordinatesModel  )  const [inline]
 

Get stochastic model pointer for dy (or dLon) coordinate.

Reimplemented from CodeKalmanSolver.

Definition at line 338 of file SolverPPP.hpp.

StochasticModel* getZCoordinatesModel  )  const [inline]
 

Get stochastic model pointer for dz (or dH) coordinate.

Reimplemented from CodeKalmanSolver.

Definition at line 352 of file SolverPPP.hpp.

gnssRinex & Process gnssRinex gData  )  throw (ProcessingException) [virtual]
 

Returns a reference to a gnnsRinex object after solving the previously defined equation system.

Parameters:
gData Data object holding the data.

Reimplemented from CodeKalmanSolver.

Reimplemented in SolverPPPFB.

Definition at line 324 of file SolverPPP.cpp.

References Vector::end(), Matrix::end(), GPSTK_THROW, and gpstk::SatIDSet.

gnssSatTypeValue & Process gnssSatTypeValue gData  )  throw (ProcessingException) [virtual]
 

Returns a reference to a gnnsSatTypeValue object after solving the previously defined equation system.

Parameters:
gData Data object holding the data.

Reimplemented from CodeKalmanSolver.

Reimplemented in SolverPPPFB.

Definition at line 284 of file SolverPPP.cpp.

References gnssData::body, GPSTK_THROW, and gnssRinex::header.

virtual SolverPPP& Reset const Vector< double > &  newState,
const Matrix< double > &  newErrorCov
[inline, virtual]
 

Resets the PPP internal Kalman filter.

Parameters:
newState System state vector
newErrorCov Error covariance matrix
Warning:
Take care of dimensions: In this case newState must be 6x1 and newErrorCov must be 6x6.

Definition at line 290 of file SolverPPP.hpp.

SolverPPP & setCoordinatesModel StochasticModel pModel  )  [virtual]
 

Set a single coordinates stochastic model to ALL coordinates.

Parameters:
pModel Pointer to StochasticModel associated with coordinates.
Warning:
Do NOT use this method to set the SAME 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'.

Reimplemented from CodeKalmanSolver.

Definition at line 768 of file SolverPPP.cpp.

Referenced by SolverPPP::setKinematic().

SolverPPP & setKinematic bool  kinematicMode = true,
double  sigmaX = 100.0,
double  sigmaY = 100.0,
double  sigmaZ = 100.0
[virtual]
 

Set the positioning mode, kinematic or static.

Definition at line 783 of file SolverPPP.cpp.

References SolverPPP::setCoordinatesModel(), WhiteNoiseModel::setSigma(), SolverPPP::setXCoordinatesModel(), SolverPPP::setYCoordinatesModel(), and SolverPPP::setZCoordinatesModel().

SolverPPP & setNEU bool  useNEU  )  [virtual]
 

Sets if a NEU system will be used.

Parameters:
useNEU Boolean value indicating if a NEU system will be used

Reimplemented in SolverPPPFB.

Definition at line 724 of file SolverPPP.cpp.

References gnssData::body, gnssData::header, and gpstk::TypeIDSet.

Referenced by SolverPPP::SolverPPP().

virtual SolverPPP& setPhaseBiasesModel StochasticModel pModel  )  [inline, virtual]
 

Set phase biases stochastic model.

Parameters:
pModel Pointer to StochasticModel associated with phase biases.
Warning:
Be aware that some stochastic models store their internal state (for instance, 'RandomWalkModel' and 'PhaseAmbiguityModel'). If that is your case, you MUST NOT use the SAME model in DIFFERENT solver objects.

This method should be used with caution, because model must be of PhaseAmbiguityModel class in order to make sense.

Definition at line 435 of file SolverPPP.hpp.

virtual SolverPPP& setPhiMatrix const Matrix< double > &  pMatrix  )  [inline, virtual]
 

Set the State Transition Matrix (phiMatrix).

Parameters:
pMatrix State Transition matrix.
Warning:
Process() methods set phiMatrix and qMatrix according to the stochastic models already defined. Therefore, you must use the Compute() methods directly if you use this method.

Reimplemented from CodeKalmanSolver.

Definition at line 453 of file SolverPPP.hpp.

virtual SolverPPP& setQMatrix const Matrix< double > &  pMatrix  )  [inline, virtual]
 

Set the Noise Covariance Matrix (QMatrix).

Parameters:
pMatrix Noise Covariance matrix.
Warning:
Process() methods set phiMatrix and qMatrix according to the stochastic models already defined. Therefore, you must use the Compute() methods directly if you use this method.

Reimplemented from CodeKalmanSolver.

Definition at line 471 of file SolverPPP.hpp.

virtual SolverPPP& setReceiverClockModel StochasticModel pModel  )  [inline, virtual]
 

Set receiver clock stochastic model.

Parameters:
pModel Pointer to StochasticModel associated with receiver clock.
Warning:
Be aware that some stochastic models store their internal state (for instance, 'RandomWalkModel' and 'PhaseAmbiguityModel'). If that is your case, you MUST NOT use the SAME model in DIFFERENT solver objects.

Reimplemented from CodeKalmanSolver.

Definition at line 413 of file SolverPPP.hpp.

virtual SolverPPP& setTroposphereModel StochasticModel pModel  )  [inline, virtual]
 

Set zenital wet troposphere stochastic model.

Parameters:
pModel Pointer to StochasticModel associated with zenital wet troposphere.
Warning:
Be aware that some stochastic models store their internal state (for instance, 'RandomWalkModel' and 'PhaseAmbiguityModel'). If that is your case, you MUST NOT use the SAME model in DIFFERENT solver objects.

Definition at line 394 of file SolverPPP.hpp.

virtual SolverPPP& setWeightFactor double  factor  )  [inline, virtual]
 

Set the weight factor multiplying the phase measurement sigma.

Parameters:
factor Factor multiplying the phase measurement sigma
Warning:
This factor should be the code_sigma/phase_sigma ratio. For instance, if we assign a code sigma of 1 m and a phase sigma of 10 cm, the ratio is 100, and so should be "factor".

Definition at line 319 of file SolverPPP.hpp.

SolverPPP& setXCoordinatesModel StochasticModel pModel  )  [inline]
 

Set coordinates stochastic model for dx (or dLat) coordinate.

Parameters:
pModel Pointer to StochasticModel associated with dx (or dLat) coordinate.

Reimplemented from CodeKalmanSolver.

Definition at line 333 of file SolverPPP.hpp.

Referenced by SolverPPP::setKinematic().

SolverPPP& setYCoordinatesModel StochasticModel pModel  )  [inline]
 

Set coordinates stochastic model for dy (or dLon) coordinate.

Parameters:
pModel Pointer to StochasticModel associated with dy (or dLon) coordinate.

Reimplemented from CodeKalmanSolver.

Definition at line 347 of file SolverPPP.hpp.

Referenced by SolverPPP::setKinematic().

SolverPPP& setZCoordinatesModel StochasticModel pModel  )  [inline]
 

Set coordinates stochastic model for dz (or dH) coordinate.

Parameters:
pModel Pointer to StochasticModel associated with dz (or dH) coordinate.

Reimplemented from CodeKalmanSolver.

Definition at line 361 of file SolverPPP.hpp.

Referenced by SolverPPP::setKinematic().


The documentation for this class was generated from the following files:
Generated on Wed Jun 19 03:31:41 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1