PRSolution Class Reference
[GPS solution algorithms and Tropospheric]

#include <PRSolution.hpp>

Collaboration diagram for PRSolution:

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 PRSolution.hpp.

Public Member Functions

 PRSolution () throw ()
 Constructor.
int RAIMCompute (const DayTime &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 DayTime &Tr, std::vector< SatID > &Sats, const std::vector< double > &Pseudorange, const XvtStore< SatID > &Eph, Matrix< double > &SVP, std::ostream *pDebug=NULL) throw ()
 Compute the satellite position / corrected range matrix (SVP) which is used by AutonomousPRSolution().
int AutonomousPRSolution (const DayTime &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) throw (Exception)
 Compute a single autonomous pseudorange solution.

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

PRSolution  )  throw () [inline]
 

Constructor.

Definition at line 59 of file PRSolution.hpp.


Member Function Documentation

int AutonomousPRSolution const DayTime 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
throw (Exception) [static]
 

Compute a single autonomous pseudorange solution.

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 527 of file PRSolution.cpp.

References GPSGeoid::angVelocity(), GPSGeoid::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 92 of file PRSolution.hpp.

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

Compute the satellite position / corrected range matrix (SVP) which is used by AutonomousPRSolution().

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 404 of file PRSolution.cpp.

References gpstk::C_GPS_M, Xvt::dtime, and Xvt::x.

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

int RAIMCompute const DayTime 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 183 of file PRSolution.cpp.

References GPSTK_RETHROW, Combinations::isSelected(), Combinations::Next(), and gpstk::RMS().


Member Data Documentation

bool Algebraic
 

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

Definition at line 104 of file PRSolution.hpp.

double Convergence
 

the RSS change in solution at the end of iterations.

Definition at line 170 of file PRSolution.hpp.

double ConvergenceLimit
 

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

Definition at line 139 of file PRSolution.hpp.

Matrix<double> Covariance
 

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

Definition at line 154 of file PRSolution.hpp.

bool Debug
 

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

Definition at line 125 of file PRSolution.hpp.

int MaxNIterations
 

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

Definition at line 135 of file PRSolution.hpp.

double MaxSlope
 

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

Definition at line 164 of file PRSolution.hpp.

int NIterations
 

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

Definition at line 167 of file PRSolution.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 122 of file PRSolution.hpp.

int Nsvs
 

the number of good satellites used in the final computation

Definition at line 173 of file PRSolution.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 129 of file PRSolution.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 110 of file PRSolution.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 115 of file PRSolution.hpp.

double RMSLimit
 

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

Definition at line 98 of file PRSolution.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 159 of file PRSolution.hpp.

double SlopeLimit
 

Slope limit.

Definition at line 101 of file PRSolution.hpp.

Vector<double> Solution
 

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

Definition at line 149 of file PRSolution.hpp.

bool Valid
 

flag: output content is valid.

Definition at line 144 of file PRSolution.hpp.


The documentation for this class was generated from the following files:
Generated on Thu Nov 20 03:37:25 2008 for GPS ToolKit Software Library by  doxygen 1.3.9.1