SolverPPP.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: SolverPPP.hpp 2645 2011-06-08 03:23:24Z yanweignss $"
00002 
00008 #ifndef GPSTK_SOLVERPPP_HPP
00009 #define GPSTK_SOLVERPPP_HPP
00010 
00011 //============================================================================
00012 //
00013 //  This file is part of GPSTk, the GPS Toolkit.
00014 //
00015 //  The GPSTk is free software; you can redistribute it and/or modify
00016 //  it under the terms of the GNU Lesser General Public License as published
00017 //  by the Free Software Foundation; either version 2.1 of the License, or
00018 //  any later version.
00019 //
00020 //  The GPSTk is distributed in the hope that it will be useful,
00021 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 //  GNU Lesser General Public License for more details.
00024 //
00025 //  You should have received a copy of the GNU Lesser General Public
00026 //  License along with GPSTk; if not, write to the Free Software Foundation,
00027 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028 //
00029 //  Dagoberto Salazar - gAGE ( http://www.gage.es ). 2008, 2009
00030 //
00031 //============================================================================
00032 
00033 
00034 #include "CodeKalmanSolver.hpp"
00035 
00036 
00037 namespace gpstk
00038 {
00039 
00041 
00042 
00044 
00210    class SolverPPP : public CodeKalmanSolver
00211    {
00212    public:
00213 
00219       SolverPPP(bool useNEU = false);
00220 
00221 
00236       virtual int Compute( const Vector<double>& prefitResiduals,
00237                            const Matrix<double>& designMatrix,
00238                            const Matrix<double>& weightMatrix )
00239          throw(InvalidSolver);
00240 
00241 
00257       virtual int Compute( const Vector<double>& prefitResiduals,
00258                            const Matrix<double>& designMatrix,
00259                            const Vector<double>& weightVector )
00260          throw(InvalidSolver);
00261 
00262 
00268       virtual gnssSatTypeValue& Process(gnssSatTypeValue& gData)
00269          throw(ProcessingException);
00270 
00271 
00277       virtual gnssRinex& Process(gnssRinex& gData)
00278          throw(ProcessingException);
00279 
00280 
00290       virtual SolverPPP& Reset( const Vector<double>& newState,
00291                                 const Matrix<double>& newErrorCov )
00292       { kFilter.Reset( newState, newErrorCov ); return (*this); };
00293 
00294 
00301       virtual SolverPPP& setNEU( bool useNEU );
00302 
00303 
00307       virtual double getWeightFactor(void) const
00308       { return std::sqrt(weightFactor); };
00309 
00310 
00319       virtual SolverPPP& setWeightFactor(double factor)
00320       { weightFactor = (factor*factor); return (*this); };
00321 
00322 
00324       StochasticModel* getXCoordinatesModel() const
00325       { return pCoordXStoModel; };
00326 
00327 
00333       SolverPPP& setXCoordinatesModel(StochasticModel* pModel)
00334       { pCoordXStoModel = pModel; return (*this); };
00335 
00336 
00338       StochasticModel* getYCoordinatesModel() const
00339       { return pCoordYStoModel; };
00340 
00341 
00347       SolverPPP& setYCoordinatesModel(StochasticModel* pModel)
00348       { pCoordYStoModel = pModel; return (*this); };
00349 
00350 
00352       StochasticModel* getZCoordinatesModel() const
00353       { return pCoordZStoModel; };
00354 
00355 
00361       SolverPPP& setZCoordinatesModel(StochasticModel* pModel)
00362       { pCoordZStoModel = pModel; return (*this); };
00363 
00364 
00376       virtual SolverPPP& setCoordinatesModel(StochasticModel* pModel);
00377 
00378 
00380       virtual StochasticModel* getTroposphereModel(void) const
00381       { return pTropoStoModel; };
00382 
00383 
00394       virtual SolverPPP& setTroposphereModel(StochasticModel* pModel)
00395       { pTropoStoModel = pModel; return (*this); };
00396 
00397 
00399       virtual StochasticModel* getReceiverClockModel(void) const
00400       { return pClockStoModel; };
00401 
00402 
00413       virtual SolverPPP& setReceiverClockModel(StochasticModel* pModel)
00414       { pClockStoModel = pModel; return (*this); };
00415 
00416 
00418       virtual StochasticModel* getPhaseBiasesModel(void) const
00419       { return pBiasStoModel; };
00420 
00421 
00435       virtual SolverPPP& setPhaseBiasesModel(StochasticModel* pModel)
00436       { pBiasStoModel = pModel; return (*this); };
00437 
00438 
00440       virtual Matrix<double> getPhiMatrix(void) const
00441       { return phiMatrix; };
00442 
00443 
00453       virtual SolverPPP& setPhiMatrix(const Matrix<double> & pMatrix)
00454       { phiMatrix = pMatrix; return (*this); };
00455 
00456 
00458       virtual Matrix<double> getQMatrix(void) const
00459       { return qMatrix; };
00460 
00461 
00471       virtual SolverPPP& setQMatrix(const Matrix<double> & pMatrix)
00472       { qMatrix = pMatrix; return (*this); };
00473 
00474 
00475 
00478       virtual SolverPPP& setKinematic( bool kinematicMode = true,
00479                                        double sigmaX = 100.0,
00480                                        double sigmaY = 100.0,
00481                                        double sigmaZ = 100.0 );
00482 
00483 
00485       virtual int getIndex(void) const;
00486 
00487 
00489       virtual std::string getClassName(void) const;
00490 
00491 
00493       virtual ~SolverPPP() {};
00494 
00495 
00496    private:
00497 
00498 
00500       int numVar;
00501 
00502 
00504       int numUnknowns;
00505 
00506 
00508       int numMeas;
00509 
00510 
00512       double weightFactor;
00513 
00514 
00516       StochasticModel* pCoordXStoModel;
00517 
00518 
00520       StochasticModel* pCoordYStoModel;
00521 
00522 
00524       StochasticModel* pCoordZStoModel;
00525 
00526 
00528       StochasticModel* pTropoStoModel;
00529 
00530 
00532       StochasticModel* pClockStoModel;
00533 
00534 
00536       StochasticModel* pBiasStoModel;
00537 
00538 
00540       Matrix<double> phiMatrix;
00541 
00542 
00544       Matrix<double> qMatrix;
00545 
00546 
00548       Matrix<double> hMatrix;
00549 
00550 
00552       Matrix<double> rMatrix;
00553 
00554 
00556       Vector<double> measVector;
00557 
00558 
00560       bool firstTime;
00561 
00562 
00564       SatIDSet satSet;
00565 
00566 
00568       struct filterData
00569       {
00570             // Default constructor initializing the data in the structure
00571          filterData() : ambiguity(0.0) {};
00572 
00573          double ambiguity;                  
00574          std::map<TypeID, double> vCovMap;  
00575          std::map<SatID,  double> aCovMap;  
00576 
00577       };
00578 
00579 
00581       std::map<SatID, filterData> KalmanData;
00582 
00583 
00585       SimpleKalmanFilter kFilter;
00586 
00587 
00589       void Init(void);
00590 
00591 
00593       StochasticModel constantModel;
00594 
00596       WhiteNoiseModel whitenoiseModelX;
00597       WhiteNoiseModel whitenoiseModelY;
00598       WhiteNoiseModel whitenoiseModelZ;
00599 
00600 
00602       RandomWalkModel rwalkModel;
00603 
00604 
00606       WhiteNoiseModel whitenoiseModel;
00607 
00608 
00610       PhaseAmbiguityModel biasModel;
00611 
00612 
00614       static int classIndex;
00615 
00617       int index;
00618 
00620       void setIndex(void)
00621       { index = classIndex++; };
00622 
00623 
00624          // Some methods that we want to hide
00625       virtual int Compute( const Vector<double>& prefitResiduals,
00626                            const Matrix<double>& designMatrix )
00627          throw(InvalidSolver)
00628       { return 0; };
00629 
00630 
00631       virtual SolverPPP& setDefaultEqDefinition(
00632                                        const gnssEquationDefinition& eqDef )
00633       { return (*this); };
00634 
00635 
00636 
00637    }; // End of class 'SolverPPP'
00638 
00640 
00641 }  // End of namespace gpstk
00642 #endif   // GPSTK_SOLVERPPP_HPP

Generated on Tue May 22 03:31:01 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1