PRSolution2 Class Reference
[GPS solution algorithms and Tropospheric]

#include <PRSolution2.hpp>

Collaboration diagram for PRSolution2:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class defines an interface to routines which compute a position and time solution from pseudorange data, with a data editing algorithm based on Receiver Autonomous Integrity Monitoring (RAIM) concepts.

RAIM ref. "A Baseline GPS RAIM Scheme and a Note on the Equivalence of Three RAIM Methods," by R. Grover Brown, Journal of the Institute of Navigation, Vol. 39, No. 3, Fall 1992, pg 301.

Definition at line 55 of file PRSolution2.hpp.

Public Member Functions

 PRSolution2 () throw ()
 Constructor.
int RAIMCompute (const CommonTime &Tr, std::vector< SatID > &Satellite, const std::vector< double > &Pseudorange, const XvtStore< SatID > &Eph, TropModel *pTropModel) throw (Exception)
 Compute a position/time solution, given satellite PRNs and pseudoranges using a RAIM algorithm.
bool isValid () const throw ()
 Return the status of solution.

Static Public Member Functions

int PrepareAutonomousSolution (const CommonTime &Tr, std::vector< SatID > &Sats, const std::vector< double > &Pseudorange, const XvtStore< SatID > &Eph, Matrix< double > &SVP, std::ostream *pDebug=NULL) throw ()
 -------------------------------------------------------------------------/// ----------------------PrepareAutonomousSolution--------------------------/// -------------------------------------------------------------------------///
int AutonomousPRSolution (const CommonTime &Tr, const std::vector< bool > &Use, const Matrix< double > SVP, TropModel *pTropModel, const bool Algebraic, int &n_iterate, double &converge, Vector< double > &Sol, Matrix< double > &Cov, Vector< double > &Resid, Vector< double > &Slope, std::ostream *pDebug=NULL, Vector< int > *satSystems=NULL) throw (Exception)
 Change.

Public Attributes

double RMSLimit
 RMS limit - either residual of fit or distance (see ResidualCriterion).
double SlopeLimit
 Slope limit.
bool Algebraic
 Use an algebraic (if true) or linearized least squares (if false) algorithm.
bool ResidualCriterion
 Use a rejection criterion based on RMS residual of fit (true) or RMS distance from an a priori position.
bool ReturnAtOnce
 Return as soon as a solution meeting the limit requirements is found (this makes it a non-RAIM algorithm).
int NSatsReject
 Maximum number of satellites that may be rejected in the RAIM algorithm; if this = -1, as many as possible will be rejected (RAIM requires at least 5 satellites).
bool Debug
 If true, RAIMCompute() will output solution information to *pDebugStream.
std::ostream * pDebugStream
 Pointer to an ostream, default &std::cout; if Debug is true, RAIMCompute() will print all preliminary solutions to this stream.
int MaxNIterations
 Maximum number of iterations allowed in the linearized least squares algorithm.
double ConvergenceLimit
 Convergence limit (m): continue iteration loop while RSS change in solution exceeds this.
bool Valid
 flag: output content is valid.
Vector< double > Solution
 Vector<double> containing the computed position solution (ECEF, meter); valid only when isValid() is true.
Matrix< double > Covariance
 4x4 Matrix<double> containing the computed solution covariance (meter); valid only when isValid() is true.
double RMSResidual
 Root mean square residual of fit (except when RMSDistanceFlag is set, then RMS distance from apriori 4-position); in meters.
double MaxSlope
 Slope computed in the RAIM algorithm (largest of all satellite values) for the returned solution, dimensionless ??.
int NIterations
 the actual number of iterations used (linearized least squares algorithm)
double Convergence
 the RSS change in solution at the end of iterations.
int Nsvs
 the number of good satellites used in the final computation


Constructor & Destructor Documentation

PRSolution2  )  throw () [inline]
 

Constructor.

Definition at line 59 of file PRSolution2.hpp.


Member Function Documentation

int AutonomousPRSolution const CommonTime Tr,
const std::vector< bool > &  Use,
const Matrix< double >  SVP,
TropModel pTropModel,
const bool  Algebraic,
int &  n_iterate,
double &  converge,
Vector< double > &  Sol,
Matrix< double > &  Cov,
Vector< double > &  Resid,
Vector< double > &  Slope,
std::ostream *  pDebug = NULL,
Vector< int > *  satSystems = NULL
throw (Exception) [static]
 

Change.

Input only:

Parameters:
Tr Measured time of reception of the data.
Use std::vector<bool> of length N, the number of satellites; false means do not include that sat. in the computation.
SVP Matrix<double> of dimension (N,4). This Matrix must have been computed by calling PrepareAutonomousPRSolution().
Algebraic bool flag indicating algorithm to use : algebraic (true) or linearized least squares (false).
pTropModel pointer to a gpstk::TropModel for use within the algorithm
Weight matrix TD...

Input and output (for least squares only; ignored if Algebraic==true):

Parameters:
n_iterate integer limit on the number of iterations. On output, it is the number of iterations actually used.
converge double convergence criterion, = RSS change in solution, in meters. On output, it is the the final value.
Output: (these will be resized within the function)
Parameters:
Sol gpstk::Vector<double> solution (ECEF + time components; all in meters)
Cov gpstk::Matrix<double> 4X4 covariance matrix (meter*meter)
Resid gpstk::Vector<double> post-fit range residuals for each satellite (m), the length of this Vector is the number of satellites actually used (see Use).
Slope gpstk::Vector<double> slope value used in RAIM for each good satellite, length N
pDebug pointer to an ostream for debug output, NULL (the default) for no debug output.
Returns:
Return values: 0 ok -1 failed to converge -2 singular problem -3 not enough good data to form a solution (at least 4 satellites required) -4 ephemeris not found for one or more satellites

Definition at line 667 of file PRSolution2.cpp.

References GPSEllipsoid::angVelocity(), GPSEllipsoid::c(), GPSTK_RETHROW, GPSTK_THROW, gpstk::inverseSVD(), gpstk::Minkowski(), gpstk::norm(), Vector::resize(), gpstk::RSS(), SQRT, gpstk::transpose(), and Xvt::x.

bool isValid void   )  const throw () [inline]
 

Return the status of solution.

Definition at line 94 of file PRSolution2.hpp.

int PrepareAutonomousSolution const CommonTime Tr,
std::vector< SatID > &  Sats,
const std::vector< double > &  Pseudorange,
const XvtStore< SatID > &  Eph,
Matrix< double > &  SVP,
std::ostream *  pDebug = NULL
throw () [static]
 

-------------------------------------------------------------------------/// ----------------------PrepareAutonomousSolution--------------------------/// -------------------------------------------------------------------------///

SVP is output, dimensioned (N,4) where N is the number of satellites and the length of both Satellite and Pseudorange. Data is ignored whenever Sats[i].id is < 0. NB caller should verify that the number of good entries (Satellite[.] > 0) is > 4 before proceeding.

Parameters:
Tr Measured time of reception of the data.
Sats std::vector<SatID> of satellites; satellites that are to be excluded by the algorithm are marked by a negative 'prn' member.
Pseudorange std::vector<double> of raw pseudoranges (parallel to Satellite), in meters
Eph gpstk::XvtStore<SatID> to be used in the algorithm.
SVP gpstk::Matrix<double> of dimension (N,4), N is the number of unmarked satellites in Sats[], on output this contains the satellite positions at transmit time, and the corrected pseudorange.
pDebug pointer to an ostream for debug output, NULL (the default) for no debug output.
Returns:
Return values: 0 ok -4 ephemeris not found for all the satellites

Definition at line 500 of file PRSolution2.cpp.

References gpstk::C_MPS, Xvt::clkbias, Xvt::relcorr, Matrix::size(), and Xvt::x.

Referenced by ModelObs::Prepare(), and ModeledPR::Prepare().

int RAIMCompute const CommonTime Tr,
std::vector< SatID > &  Satellite,
const std::vector< double > &  Pseudorange,
const XvtStore< SatID > &  Eph,
TropModel pTropModel
throw (Exception)
 

Compute a position/time solution, given satellite PRNs and pseudoranges using a RAIM algorithm.

Parameters:
Tr Measured time of reception of the data.
Satellite std::vector<SatID> of satellites; on successful return, satellites that were excluded by the algorithm are marked by a negative 'prn' member.
Pseudorange std::vector<double> of raw pseudoranges (parallel to Satellite), in meters.
Eph gpstk::EphemerisStore to be used in the algorithm.
Returns:
Return values: 2 solution is found, but it is not good (RMS residual exceed limits) 1 solution is found, but it is suspect (slope is large) 0 ok -1 algorithm failed to converge -2 singular problem, no solution is possible -3 not enough good data (> 4) to form a (RAIM) solution (the 4 satellite solution might be returned - check isValid()) -4 ephemeris is not found for one or more satellites

Definition at line 217 of file PRSolution2.cpp.

References gpstk::abs(), GPSTK_RETHROW, Combinations::isSelected(), Combinations::Next(), gpstk::RMS(), GPSWeekSecond::sow, and GPSWeek::week.


Member Data Documentation

bool Algebraic
 

Use an algebraic (if true) or linearized least squares (if false) algorithm.

Definition at line 106 of file PRSolution2.hpp.

double Convergence
 

the RSS change in solution at the end of iterations.

Definition at line 172 of file PRSolution2.hpp.

double ConvergenceLimit
 

Convergence limit (m): continue iteration loop while RSS change in solution exceeds this.

Definition at line 141 of file PRSolution2.hpp.

Matrix<double> Covariance
 

4x4 Matrix<double> containing the computed solution covariance (meter); valid only when isValid() is true.

Definition at line 156 of file PRSolution2.hpp.

bool Debug
 

If true, RAIMCompute() will output solution information to *pDebugStream.

Definition at line 127 of file PRSolution2.hpp.

int MaxNIterations
 

Maximum number of iterations allowed in the linearized least squares algorithm.

Definition at line 137 of file PRSolution2.hpp.

double MaxSlope
 

Slope computed in the RAIM algorithm (largest of all satellite values) for the returned solution, dimensionless ??.

Definition at line 166 of file PRSolution2.hpp.

int NIterations
 

the actual number of iterations used (linearized least squares algorithm)

Definition at line 169 of file PRSolution2.hpp.

int NSatsReject
 

Maximum number of satellites that may be rejected in the RAIM algorithm; if this = -1, as many as possible will be rejected (RAIM requires at least 5 satellites).

A (single) non-RAIM solution can be obtained by setting this to 0 before calling RAIMCompute().

Definition at line 124 of file PRSolution2.hpp.

int Nsvs
 

the number of good satellites used in the final computation

Definition at line 175 of file PRSolution2.hpp.

std::ostream* pDebugStream
 

Pointer to an ostream, default &std::cout; if Debug is true, RAIMCompute() will print all preliminary solutions to this stream.

Definition at line 131 of file PRSolution2.hpp.

bool ResidualCriterion
 

Use a rejection criterion based on RMS residual of fit (true) or RMS distance from an a priori position.

If false, member Vector Solution must be defined as this a priori position when RAIMCompute() is called.

Definition at line 112 of file PRSolution2.hpp.

bool ReturnAtOnce
 

Return as soon as a solution meeting the limit requirements is found (this makes it a non-RAIM algorithm).

Definition at line 117 of file PRSolution2.hpp.

double RMSLimit
 

RMS limit - either residual of fit or distance (see ResidualCriterion).

Definition at line 100 of file PRSolution2.hpp.

double RMSResidual
 

Root mean square residual of fit (except when RMSDistanceFlag is set, then RMS distance from apriori 4-position); in meters.

Definition at line 161 of file PRSolution2.hpp.

double SlopeLimit
 

Slope limit.

Definition at line 103 of file PRSolution2.hpp.

Vector<double> Solution
 

Vector<double> containing the computed position solution (ECEF, meter); valid only when isValid() is true.

Definition at line 151 of file PRSolution2.hpp.

bool Valid
 

flag: output content is valid.

Definition at line 146 of file PRSolution2.hpp.


The documentation for this class was generated from the following files:
Generated on Tue May 21 03:31:53 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1