|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
PPP-RTK positioning engine. More...
#include "mrtklib/mrtk_ppp_rtk.h"#include <math.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "mrtklib/mrtk_atmos.h"#include "mrtklib/mrtk_clas.h"#include "mrtklib/mrtk_const.h"#include "mrtklib/mrtk_coords.h"#include "mrtklib/mrtk_eph.h"#include "mrtklib/mrtk_foundation.h"#include "mrtklib/mrtk_lambda.h"#include "mrtklib/mrtk_mat.h"#include "mrtklib/mrtk_nav.h"#include "mrtklib/mrtk_time.h"#include "mrtklib/mrtk_trace.h"Go to the source code of this file.
Macros | |
| #define | SQR(x) |
| #define | SQRT(x) |
| #define | MIN(x, y) |
| #define | MAXREF 2 /* max iterations searching reference sat */ |
| #define | VAR_POS SQR(30.0) /* initial variance of receiver pos (m^2) */ |
| #define | VAR_VEL SQR(1.0) /* initial variance of receiver vel (m/s)^2 */ |
| #define | VAR_ACC SQR(1.0) /* initial variance of receiver acc (m/ss)^2 */ |
| #define | VAR_GRA SQR(0.001) /* gradient variance (m^2) */ |
| #define | INIT_ZWD 0.001 /* initial ZWD (m) */ |
| #define | BASELEN 1000.0 /* baseline length for iono update (m) */ |
| #define | MAXPBCORSSR 20.0 /* max phase bias correction of SSR (m) */ |
| #define | VARHOLDAMB 0.001 /* hold-ambiguity constraint variance */ |
| #define | ALPHAAR_DEFAULT 3 /* F-test significance index (5%) */ |
| #define | MINAMB_DEFAULT 2 /* minimum ambiguities for AR */ |
| #define | MAXOBSLOSS_DEFAULT 300.0 /* max obs gap to reset states (s) */ |
| #define | LAM_CARR_L1 (CLIGHT / FREQ1) |
| #define | LAM_CARR_L2 (CLIGHT / FREQ2) |
| #define | LAM_CARR_L5 (CLIGHT / FREQ5) |
| #define | NF_RTK(opt) |
| #define | NP_RTK(opt) |
| #define | NI_RTK(opt) |
| #define | NT_RTK(opt) |
| #define | NR_RTK(opt) |
| #define | NB_RTK(opt) |
| #define | NX_RTK(opt) |
| #define | II_RTK(s, opt) |
| #define | IT_RTK(opt) |
| #define | IB_RTK(s, f, opt) |
Enumerations | |
| enum | ddres_order { FST = 1 , SND , TRD } |
Functions | |
| static void | load_ppp_osr_cpc (clas_osr_ctx_t *ctx, const double *cpc, const gtime_t *pt0) |
| static void | save_ppp_osr_cpc (const clas_osr_ctx_t *ctx, double *cpc, gtime_t *pt0) |
| static uint8_t | obs_code_for_freq (int sat, int f) |
| Return default observation code for frequency index and system. | |
| static double | sat_lambda (int sat, int f, const nav_t *nav) |
| Compute satellite-specific wavelength for frequency index. | |
| static double | varerr (int sat, int sys, double el, int type, const prcopt_t *opt) |
| Compute measurement error variance. | |
| static void | initx (rtk_t *rtk, double xi, double var, int i) |
| Initialize a state and its covariance. | |
| static void | udpos_ppp (rtk_t *rtk, const obsd_t *obs, int n, double tt) |
| Temporal update of position states. | |
| static void | udtrop (rtk_t *rtk, double tt) |
| Temporal update of tropospheric parameters. | |
| static void | udion (rtk_t *rtk, double tt, double bl, const obsd_t *obs, int ns) |
| Temporal update of ionospheric parameters. | |
| static void | detslp_ll (rtk_t *rtk, const obsd_t *obs, int n) |
| Detect cycle slip by LLI flag. | |
| static double | gfmeas_L1L2 (const obsd_t *obs, const nav_t *nav) |
| L1/L2 geometry-free phase measurement. | |
| static double | gfmeas_L1L5 (const obsd_t *obs, const nav_t *nav) |
| L1/L5 geometry-free phase measurement. | |
| static void | detslp_gf (rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) |
| Detect cycle slip by geometry-free phase jump. | |
| static void | udbias_ppp (rtk_t *rtk, double tt, const obsd_t *obs, int n, const nav_t *nav) |
| Temporal update of phase biases. | |
| static void | udstate_ppp (rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) |
| Temporal update of all PPP-RTK states. | |
| static double | prectrop2 (gtime_t time, const double *pos, int r, const double *azel, const prcopt_t *opt, const double *x, double *dtdx) |
| Compute precise tropospheric delay for KF. | |
| static int | validobs (int i, int f, int nf, double *y) |
| Check if zero-difference observation is valid. | |
| static void | ddcov (const int *nb, int n, const double *Ri, const double *Rj, int nv, double *R) |
| Build DD covariance from SD variances. | |
| static int | test_sys (int sys, int m, int qzsmodear, int code) |
| Test if satellite system matches group index. | |
| static int | residual_test (rtk_t *rtk, const int *vflg, const double *v, const double *Q, int *iv, const int m, int *ns, const int flg) |
| Validate residuals and reject outliers. | |
| static int | filter2_ (rtk_t *rtk, const double *x, const double *P, const double *H, const double *v, const double *R, const int n, const int m, double *xp, double *Pp, double *Qp, const int *vflg, const int flg) |
| Inner KF measurement update with residual test. | |
| static int | filter2 (rtk_t *rtk, double *x, double *P, const double *H, const double *v, const double *R, const int n, const int m, const int *vflg, const int flg) |
| KF measurement update with state compaction. | |
| static int | check_same_fac (const clas_ctx_t *clas) |
| Test whether the two L6 channels currently carry the same facility. | |
| static int | valid_zd_sig (rtk_t *rtk, const obsd_t *obs, const nav_t *nav, double *y, int nf, int f, int i, int j, int m, int sati, int *satj, int *sysi, int *sysj, double *lami, double *lamj) |
| Check that a satellite yields a usable zero-difference signal. | |
| static void | set_init_pb (rtk_t *rtk, const nav_t *nav, const obsd_t *obs, int n, int f, int satj) |
| Re-initialize the phase-bias state of one satellite from phase-code. | |
| static int | ddres (rtk_t *rtk, const nav_t *nav, double *x, double **pbslip, const double *P, const obsd_t *obs, double **y, double *e, double *azel, int n, double *v, double *H, double *R, int *vflg, int niter, int pch, int order) |
| Compute DD residuals and measurement matrix, merging L6 channels. | |
| static int | ddmat (rtk_t *rtk, double *D, int *indI, int *indJ) |
| Build SD-to-DD transformation matrix D. | |
| static void | restamb (rtk_t *rtk, const double *bias, int nb, double *xa) |
| Restore SD ambiguities from DD fixed values. | |
| static void | holdamb (rtk_t *rtk, const double *xa) |
| Hold fixed ambiguities via pseudomeasurement constraint. | |
| static void | elsort (rtk_t *rtk, const obsd_t *obs, int *isat, double *el, int n) |
| Sort satellites by elevation angle (ascending) for partial AR. | |
| static double | sddop (const rtk_t *rtk, const double *H, const int *vflg, double elmask, int nv) |
| static double | zddop (const rtk_t *rtk, const double *azel, const obsd_t *obs, double elmask, int n) |
| static double | calpdop (const rtk_t *rtk, const double *H, const double *azel, const int *vflg, const obsd_t *obs, double elmask, int n, int nv) |
| static int | resamb_LAMBDA (rtk_t *rtk, double *bias, double *xa) |
| Resolve integer ambiguity by LAMBDA. | |
| int | ppprtk_outstat (rtk_t *rtk, char *buff) |
| Write PPP-RTK solution status to buffer. | |
| int | ppp_rtk_nx (const prcopt_t *opt) |
| Compute number of estimated states for PPP-RTK. | |
| int | ppp_rtk_na (const prcopt_t *opt) |
| Compute number of non-ambiguity states for PPP-RTK. | |
| static void | check_clas_facility (nav_t *nav, const clas_ctx_t *clas, const clas_grid_t *grid, const prcopt_t *opt) |
| void | ppp_rtk_pos (rtk_t *rtk, const obsd_t *obs, int n, nav_t *nav) |
| PPP-RTK positioning for one epoch (CLAS). | |
| void | rtkinit_ppp_rtk (rtk_t *rtk, const prcopt_t *opt) |
| Initialize RTK control struct for PPP-RTK positioning. | |
| void | rtkfree_ppp_rtk (rtk_t *rtk) |
| Free RTK control struct for PPP-RTK positioning. | |
Variables | |
| static const double | lam_carr [3] = { (CLIGHT / FREQ1) , (CLIGHT / FREQ2) , (CLIGHT / FREQ5) } |
| static const double | chisqr [100] |
| static const double | qf [6][60] |
| struct { | |
| int refsat [5 *2 *2 *6+1] | |
| int refsat2 [5 *2 *6+1] | |
| double cpc [SSR_CH_NUM][MAXSAT *5] | |
| gtime_t pt0 [SSR_CH_NUM][MAXSAT] | |
| int use_ch [5][MAXSAT+1] | |
| int pre_use_ch [5][MAXSAT+1] | |
| clas_osr_ctx_t osr_ctx | |
| double chisq | |
| double * Qp | |
| int Qp_nx | |
| int float_count | |
| int cntdiffp | |
| int floatcnt_reset | |
| int initialized | |
| } | prtk_ctx |
PPP-RTK positioning engine.
References: [1] claslib ppprtk.c — upstream PPP-RTK implementation [2] claslib rtkcmn.c — upstream filter2/residual_test [6] MacMillan et al., Atmospheric gradients and the VLBI terrestrial and celestial reference frames, Geophys. Res. Let., 1997
Notes:
Definition in file mrtk_ppp_rtk.c.
| #define ALPHAAR_DEFAULT 3 /* F-test significance index (5%) */ |
Definition at line 77 of file mrtk_ppp_rtk.c.
Referenced by resamb_LAMBDA().
| #define BASELEN 1000.0 /* baseline length for iono update (m) */ |
Definition at line 71 of file mrtk_ppp_rtk.c.
Referenced by udstate_ppp().
| #define IB_RTK | ( | s, | |
| f, | |||
| opt ) |
Definition at line 109 of file mrtk_ppp_rtk.c.
Referenced by ddres(), holdamb(), restamb(), set_init_pb(), and udbias_ppp().
| #define II_RTK | ( | s, | |
| opt ) |
Definition at line 107 of file mrtk_ppp_rtk.c.
Referenced by ddres(), ppp_rtk_pos(), ppprtk_outstat(), and udion().
| #define INIT_ZWD 0.001 /* initial ZWD (m) */ |
Definition at line 69 of file mrtk_ppp_rtk.c.
Referenced by relposvrs(), udtrop(), udtrop(), and udtrop().
| #define IT_RTK | ( | opt | ) |
Definition at line 108 of file mrtk_ppp_rtk.c.
Referenced by ddres(), ppprtk_outstat(), prectrop2(), and udtrop().
Definition at line 82 of file mrtk_ppp_rtk.c.
Definition at line 83 of file mrtk_ppp_rtk.c.
Definition at line 84 of file mrtk_ppp_rtk.c.
| #define MAXOBSLOSS_DEFAULT 300.0 /* max obs gap to reset states (s) */ |
Definition at line 79 of file mrtk_ppp_rtk.c.
Referenced by ppp_rtk_pos().
| #define MAXPBCORSSR 20.0 /* max phase bias correction of SSR (m) */ |
Definition at line 73 of file mrtk_ppp_rtk.c.
| #define MAXREF 2 /* max iterations searching reference sat */ |
Definition at line 62 of file mrtk_ppp_rtk.c.
Referenced by ddres(), ddres(), ppp_rtk_pos(), and relposvrs().
| #define MIN | ( | x, | |
| y ) |
Definition at line 60 of file mrtk_ppp_rtk.c.
| #define MINAMB_DEFAULT 2 /* minimum ambiguities for AR */ |
Definition at line 78 of file mrtk_ppp_rtk.c.
Referenced by resamb_LAMBDA().
| #define NB_RTK | ( | opt | ) |
Definition at line 103 of file mrtk_ppp_rtk.c.
| #define NF_RTK | ( | opt | ) |
Definition at line 98 of file mrtk_ppp_rtk.c.
Referenced by ddmat(), ddres(), holdamb(), ppp_rtk_pos(), restamb(), and udbias_ppp().
| #define NI_RTK | ( | opt | ) |
| #define NP_RTK | ( | opt | ) |
Definition at line 99 of file mrtk_ppp_rtk.c.
Referenced by ppp_rtk_pos(), residual_test(), and udpos_ppp().
| #define NR_RTK | ( | opt | ) |
| #define NT_RTK | ( | opt | ) |
Definition at line 101 of file mrtk_ppp_rtk.c.
| #define NX_RTK | ( | opt | ) |
| #define SQR | ( | x | ) |
Definition at line 58 of file mrtk_ppp_rtk.c.
Referenced by ddres(), ppp_rtk_pos(), residual_test(), set_init_pb(), udbias_ppp(), udion(), udpos_ppp(), and udtrop().
| #define SQRT | ( | x | ) |
Definition at line 59 of file mrtk_ppp_rtk.c.
| #define VAR_ACC SQR(1.0) /* initial variance of receiver acc (m/ss)^2 */ |
Definition at line 67 of file mrtk_ppp_rtk.c.
| #define VAR_GRA SQR(0.001) /* gradient variance (m^2) */ |
Definition at line 68 of file mrtk_ppp_rtk.c.
| #define VAR_POS SQR(30.0) /* initial variance of receiver pos (m^2) */ |
Definition at line 65 of file mrtk_ppp_rtk.c.
| #define VAR_VEL SQR(1.0) /* initial variance of receiver vel (m/s)^2 */ |
Definition at line 66 of file mrtk_ppp_rtk.c.
| #define VARHOLDAMB 0.001 /* hold-ambiguity constraint variance */ |
Definition at line 76 of file mrtk_ppp_rtk.c.
Referenced by holdamb().
| enum ddres_order |
Order in which ddres() is called within one ppp_rtk_pos() epoch
| Enumerator | |
|---|---|
| FST | |
| SND | |
| TRD | |
Definition at line 1439 of file mrtk_ppp_rtk.c.
|
static |
Definition at line 2258 of file mrtk_ppp_rtk.c.
References rtk_t::opt, prcopt_t::refdop, sddop(), and zddop().
Referenced by ppp_rtk_pos().
|
static |
Definition at line 2500 of file mrtk_ppp_rtk.c.
References clas_ctx_t::current, clas_corr_t::facility, nav_s::filreset, prcopt_t::l6mrg, SSR_CH_NUM, and clas_corr_t::use.
Referenced by ppp_rtk_pos().
|
static |
Test whether the two L6 channels currently carry the same facility.
When both channels carry the same facility, either of them can supply any satellite, so the reference satellite and each non-reference satellite may pick their channel independently. With different facilities the two correction sets are not interchangeable and the DD has to be kept within one channel unless a common reference satellite exists.
Mirrors upstream check_same_fac(), which compares the facility id of the two CurrentCSSR entries directly.
| [in] | clas | CLAS context |
Definition at line 1456 of file mrtk_ppp_rtk.c.
References clas_ctx_t::current, and clas_corr_t::facility.
Referenced by ddres().
|
static |
Build DD covariance from SD variances.
| [in] | nb | Block sizes array |
| [in] | n | Number of blocks |
| [in] | Ri | Reference satellite variances |
| [in] | Rj | Non-reference satellite variances |
| [in] | nv | Total number of DD observations |
| [out] | R | DD covariance matrix (nv x nv) |
Definition at line 1062 of file mrtk_ppp_rtk.c.
Referenced by ddres().
|
static |
Build SD-to-DD transformation matrix D.
| [in,out] | rtk | RTK control struct |
| [out] | D | Transformation matrix (nx x nx) |
| [out] | indI | Reference satellite bias indices |
| [out] | indJ | Non-reference satellite bias indices |
Definition at line 1977 of file mrtk_ppp_rtk.c.
References ssat_t::azel, ssat_t::code, prcopt_t::elmaskar, ssat_t::fix, prcopt_t::glomodear, ssat_t::lock, MAXSAT, rtk_t::na, NF_RTK, rtk_t::nx, rtk_t::opt, prcopt_t::qzsmodear, ssat_t::slip, rtk_t::ssat, ssat_t::sys, test_sys(), trace(), tracemat(), ssat_t::vsat, and rtk_t::x.
Referenced by resamb_LAMBDA().
|
static |
Compute DD residuals and measurement matrix, merging L6 channels.
With opt->l6mrg set, residuals of both L6 channels are supplied and merged: the reference satellite is preferentially one that both channels observe, each non-reference satellite is assigned to a channel (priority channel for l6mrg==1, load-balanced otherwise) with a fallback to the other channel, and a satellite that changes channel has its phase bias re-initialized — only when the channels carry different facilities: same-facility channels share the correction basis, so a switch does not break phase-bias continuity. With l6mrg clear only y[0]/pbslip[0] are read and the merge logic is bypassed.
| [in,out] | rtk | RTK control struct |
| [in] | nav | Navigation data |
| [in] | x | State vector |
| [in,out] | pbslip | Per-channel phase bias slip corrections (NULL for postfit) |
| [in] | P | Covariance matrix (may be NULL) |
| [in] | obs | Observation data |
| [in] | y | Per-channel ZD residuals |
| [in] | e | Line-of-sight vectors (3*n) |
| [in] | azel | Azimuth/elevation (2*n) |
| [in] | n | Number of observations |
| [out] | v | DD residuals |
| [out] | H | Measurement matrix (may be NULL) |
| [out] | R | Measurement covariance |
| [out] | vflg | Residual flags |
| [in] | niter | Reference satellite search iteration |
| [in] | pch | Priority L6 channel |
| [in] | order | Call order within the epoch (FST/SND/TRD) |
Definition at line 1597 of file mrtk_ppp_rtk.c.
References check_same_fac(), nav_s::clas_ctx, ssat_t::code, ddcov(), ecef2pos(), free, freq_idx2freq_num(), FST, prcopt_t::glomodear, IB_RTK, II_RTK, ionmapf(), prcopt_t::ionoopt, IONOOPT_EST, IONOOPT_EST_ADPT, IT_RTK, prcopt_t::l6mrg, lam_carr, mat(), MAXREF, MAXSAT, prcopt_t::mode, NF_RTK, rtk_t::nx, rtk_t::opt, PMODE_DGPS, prectrop2(), prtk_ctx, prcopt_t::qzsmodear, ssat_t::resc, ssat_t::resp, obsd_t::sat, set_init_pb(), rtk_t::sol, SQR, rtk_t::ssat, nav_s::ssr_ch, SSR_CH_NUM, ssat_t::sys, ssr_t::t0, test_sys(), sol_t::time, time_str(), timediff(), trace(), prcopt_t::tropopt, TROPOPT_EST, TROPOPT_ESTG, valid_zd_sig(), validobs(), varerr(), ssat_t::vs, and ssat_t::vsat.
Referenced by ppp_rtk_pos().
Detect cycle slip by geometry-free phase jump.
| [in,out] | rtk | RTK control struct |
| [in] | obs | Observation data |
| [in] | n | Number of observations |
| [in] | nav | Navigation data |
Definition at line 804 of file mrtk_ppp_rtk.c.
References ssat_t::gf, gfmeas_L1L2(), gfmeas_L1L5(), MAXOBS, prcopt_t::nf, rtk_t::opt, obsd_t::sat, ssat_t::slip, rtk_t::ssat, prcopt_t::thresslip, and trace().
Referenced by udbias_ppp().
Detect cycle slip by LLI flag.
| [in,out] | rtk | RTK control struct |
| [in] | obs | Observation data |
| [in] | n | Number of observations |
Definition at line 751 of file mrtk_ppp_rtk.c.
References MAXOBS, prcopt_t::nf, rtk_t::opt, obsd_t::sat, ssat_t::slip, rtk_t::ssat, and trace().
Referenced by udbias_ppp().
Sort satellites by elevation angle (ascending) for partial AR.
| [in] | rtk | RTK control struct |
| [in] | obs | Observation data array |
| [out] | isat | Sorted satellite numbers |
| [out] | el | Sorted elevation angles (rad) |
| [in] | n | Number of observations |
Definition at line 2178 of file mrtk_ppp_rtk.c.
References ssat_t::azel, obsd_t::sat, and rtk_t::ssat.
Referenced by ppp_rtk_pos().
|
static |
KF measurement update with state compaction.
Compacts the state vector to exclude zero/invalid states before calling the inner filter, then maps results back.
| [in,out] | rtk | RTK control struct |
| [in,out] | x | State vector (n) |
| [in,out] | P | Covariance matrix (n x n) |
| [in] | H | Observation matrix (n x m) |
| [in] | v | Residual vector (m) |
| [in] | R | Measurement noise (m x m) |
| [in] | n | Number of states |
| [in] | m | Number of measurements |
| [in] | vflg | Residual flags |
| [in] | flg | Stage flag |
Definition at line 1370 of file mrtk_ppp_rtk.c.
References filter2_(), free, imat(), prcopt_t::ionoopt, IONOOPT_EST_ADPT, mat(), rtk_t::opt, prcopt_t::prnadpt, prtk_ctx, and zeros().
Referenced by ppp_rtk_pos().
|
static |
Inner KF measurement update with residual test.
| [in,out] | rtk | RTK control struct |
| [in] | x | State vector (n) |
| [in] | P | Covariance matrix (n x n) |
| [in] | H | Observation matrix (n x m) |
| [in] | v | Residual vector (m) |
| [in] | R | Measurement noise (m x m) |
| [in] | n | Number of states |
| [in] | m | Number of measurements |
| [out] | xp | Updated state vector (n) |
| [out] | Pp | Updated covariance (n x n) |
| [in] | vflg | Residual flags |
| [in] | flg | Stage flag (0:prefit, 1+:postfit) |
Definition at line 1268 of file mrtk_ppp_rtk.c.
References eye(), free, imat(), prcopt_t::ionoopt, IONOOPT_EST_ADPT, mat(), matcpy(), matinv(), matmul(), rtk_t::opt, prcopt_t::prnadpt, prtk_ctx, Qp, residual_test(), and trace().
Referenced by filter2().
L1/L2 geometry-free phase measurement.
Definition at line 772 of file mrtk_ppp_rtk.c.
References obsd_t::L, obsd_t::sat, and sat_lambda().
Referenced by detslp_gf().
L1/L5 geometry-free phase measurement.
Definition at line 784 of file mrtk_ppp_rtk.c.
References obsd_t::L, obsd_t::sat, and sat_lambda().
Referenced by detslp_gf().
|
static |
Hold fixed ambiguities via pseudomeasurement constraint.
| [in,out] | rtk | RTK control struct |
| [in] | xa | Fixed state vector |
Definition at line 2110 of file mrtk_ppp_rtk.c.
References ssat_t::azel, ssat_t::code, prcopt_t::elmaskhold, filter(), ssat_t::fix, free, prcopt_t::glomodear, IB_RTK, mat(), MAXSAT, rtk_t::na, NF_RTK, rtk_t::nx, rtk_t::opt, rtk_t::P, prcopt_t::qzsmodear, rtk_t::ssat, ssat_t::sys, test_sys(), trace(), VARHOLDAMB, prcopt_t::varholdamb, ssat_t::vsat, rtk_t::x, and zeros().
Referenced by ppp_rtk_pos().
|
static |
Initialize a state and its covariance.
| [in,out] | rtk | RTK control struct |
| [in] | xi | Initial state value |
| [in] | var | Initial variance |
| [in] | i | State index |
Definition at line 384 of file mrtk_ppp_rtk.c.
References rtk_t::nx, rtk_t::P, and rtk_t::x.
Referenced by set_init_pb(), udbias_ppp(), udion(), udpos_ppp(), and udtrop().
|
static |
Definition at line 199 of file mrtk_ppp_rtk.c.
References cpc, clas_osr_ctx_t::cpctmp, MAXSAT, pt0, and clas_osr_ctx_t::pt0tmp.
Referenced by ppp_rtk_pos().
|
static |
Return default observation code for frequency index and system.
| [in] | sat | Satellite number |
| [in] | f | Frequency index (0=L1, 1=L2, 2=L5) |
Definition at line 235 of file mrtk_ppp_rtk.c.
References CODE_L1C, CODE_L2I, CODE_L2W, CODE_L5Q, CODE_L6I, CODE_L7I, satsys(), SYS_CMP, SYS_GAL, SYS_GPS, and SYS_QZS.
Referenced by sat_lambda().
|
extern |
Compute number of non-ambiguity states for PPP-RTK.
| [in] | opt | Processing options |
Definition at line 2498 of file mrtk_ppp_rtk.c.
References NR_RTK.
Referenced by rtkinit().
|
extern |
Compute number of estimated states for PPP-RTK.
| [in] | opt | Processing options |
Definition at line 2496 of file mrtk_ppp_rtk.c.
References NX_RTK.
Referenced by rtkinit().
PPP-RTK positioning for one epoch (CLAS).
Main entry point for the CLAS PPP-RTK positioning engine. Uses double-differencing with CLAS grid corrections (STEC, ZWD) and iterative Kalman filter with LAMBDA integer ambiguity resolution.
Uses CLAS grid corrections with a short CSSR backup fallback matching claslib.
| [in,out] | rtk | RTK control/result struct |
| [in] | obs | Observation data for epoch |
| [in] | n | Number of observations |
| [in,out] | nav | Navigation data (includes SSR via nav->ssr_ch[][]) |
Definition at line 2540 of file mrtk_ppp_rtk.c.
References prcopt_t::afgainion, prcopt_t::afgainpva, sol_t::age, prcopt_t::arfilter, prcopt_t::armaxdelsat, ARMODE_FIXHOLD, calpdop(), check_clas_facility(), clas_backup_current(), clas_backup_valid(), clas_bank_get_close(), clas_check_grid_status(), clas_clear_current(), nav_s::clas_ctx, clas_get_grid_index(), clas_osr_satcorr_update(), clas_osr_zdres(), clas_restore_backup(), clas_update_global(), clas_update_local(), clas_ctx_t::current, ddres(), prcopt_t::dynamics, ecef2pos(), prcopt_t::elmaskar, prcopt_t::elmaskhold, elsort(), nav_s::filreset, filter2(), ssat_t::fix, prcopt_t::floatcnt, prcopt_t::forgetion, prcopt_t::forgetpva, free, FST, clas_ctx_t::grid, prcopt_t::gridsel, holdamb(), II_RTK, prcopt_t::ionoopt, IONOOPT_EST_ADPT, obsd_t::L, clas_ctx_t::l6buf, prcopt_t::l6mrg, load_ppp_osr_cpc(), ssat_t::lock, mat(), matcpy(), prcopt_t::maxdiffp, prcopt_t::maxinno_ext, MAXOBS, MAXOBSLOSS_DEFAULT, prcopt_t::maxobsloss_s, prcopt_t::maxpdopar, prcopt_t::maxpdophold, MAXREF, MAXSAT, prcopt_t::minfix, prcopt_t::minlock, prcopt_t::mode, prcopt_t::modear, rtk_t::na, clas_grid_t::network, prcopt_t::nf, NF_RTK, rtk_t::nfix, prcopt_t::niter, norm(), NP_RTK, NR_RTK, sol_t::ns, rtk_t::nx, rtk_t::opt, ssat_t::outc, rtk_t::P, rtk_t::Pa, ssat_t::ph, PMODE_DGPS, prcopt_t::poserrcnt, prcopt_t::posopt, prcopt_t::prnadpt, prtk_ctx, ssat_t::pt, rtk_t::Q, sol_t::qr, R2D, sol_t::ratio, obsd_t::rcv, prcopt_t::regularly, resamb_LAMBDA(), sol_t::rr, obsd_t::sat, prcopt_t::sateph, satposs(), satsys(), save_ppp_osr_cpc(), set_ssr_ch_idx(), ssat_t::slip, ssat_t::slipc, SND, obsd_t::SNR, ssat_t::snr, rtk_t::sol, SOLQ_DGPS, SOLQ_FIX, SOLQ_FLOAT, SOLQ_NONE, SOLQ_SINGLE, SQR, rtk_t::ssat, nav_s::ssr_ch, SSR_CH_NUM, sol_t::stat, ssat_t::sys, ssr_t::t0, prcopt_t::thresar, clas_l6buf_t::time, gtime_t::time, obsd_t::time, sol_t::time, time2gpst(), time_str(), timediff(), trace(), tracemat(), TRD, rtk_t::tt, udstate_ppp(), ssat_t::vsat, rtk_t::x, rtk_t::xa, and zeros().
Referenced by rtkpos().
|
extern |
Write PPP-RTK solution status to buffer.
PPP-RTK uses a different state layout from standard PPP (no clock states, iono at NP, trop at NP+NI). This function outputs state information using the correct PPP-RTK indices (II_RTK, IT_RTK, IB_RTK).
| [in,out] | rtk | RTK control/result struct |
| [out] | buff | Output buffer |
Definition at line 2423 of file mrtk_ppp_rtk.c.
References ssat_t::azel, prcopt_t::dynamics, ecef2enu(), ecef2pos(), II_RTK, prcopt_t::ionoopt, IONOOPT_EST, IONOOPT_EST_ADPT, IT_RTK, MAXSAT, rtk_t::nx, rtk_t::opt, rtk_t::P, R2D, sol_t::rr, satno2id(), rtk_t::sol, SOLQ_FIX, SQRT, rtk_t::ssat, sol_t::stat, sol_t::time, time2gpst(), prcopt_t::tropopt, TROPOPT_EST, TROPOPT_ESTG, ssat_t::vs, rtk_t::x, and rtk_t::xa.
Referenced by pppoutstat().
|
static |
Compute precise tropospheric delay for KF.
| [in] | time | Observation time |
| [in] | pos | Receiver position (lat/lon/hgt) |
| [in] | r | Unused (receiver index, always 0) |
| [in] | azel | Azimuth/elevation (rad) |
| [in] | opt | Processing options |
| [in] | x | State vector |
| [out] | dtdx | Partial derivatives [3] |
Definition at line 1008 of file mrtk_ppp_rtk.c.
References IT_RTK, tropmapf(), prcopt_t::tropopt, and TROPOPT_ESTG.
Referenced by ddres().
|
static |
Resolve integer ambiguity by LAMBDA.
| [in,out] | rtk | RTK control struct |
| [out] | bias | DD fixed ambiguity biases |
| [out] | xa | Fixed state vector |
Definition at line 2280 of file mrtk_ppp_rtk.c.
References prcopt_t::alphaar, ALPHAAR_DEFAULT, ARMODE_OFF, ddmat(), free, lambda(), mat(), matinv(), matmul(), MAXOBS, prcopt_t::minamb, MINAMB_DEFAULT, prcopt_t::mode, prcopt_t::modear, rtk_t::na, rtk_t::nx, rtk_t::opt, rtk_t::P, rtk_t::Pa, PMODE_DGPS, qf, sol_t::ratio, restamb(), rtk_t::sol, trace(), tracemat(), rtk_t::x, rtk_t::xa, and zeros().
Referenced by ppp_rtk_pos(), and relposvrs().
|
static |
Validate residuals and reject outliers.
| [in,out] | rtk | RTK control struct |
| [in] | vflg | Residual flags (sat/type/freq encoded) |
| [in] | v | Residual vector |
| [in] | Q | Innovation covariance matrix (m x m) |
| [out] | iv | Indices of valid residuals |
| [in] | m | Total number of residuals |
| [out] | ns | Count per frequency/type |
| [in] | flg | Stage flag (0:prefit, 1:postfit float, 2:postfit fix) |
Definition at line 1123 of file mrtk_ppp_rtk.c.
References chisqr, free, FREQ1, FREQ2, lam_carr, prcopt_t::maxinno, prcopt_t::maxinno_ext, MAXSAT, prcopt_t::nf, NP_RTK, rtk_t::opt, ssat_t::outc, prtk_ctx, ssat_t::rejc, SQR, rtk_t::ssat, trace(), ssat_t::vsat, and zeros().
Referenced by filter2_().
|
static |
Restore SD ambiguities from DD fixed values.
| [in,out] | rtk | RTK control struct |
| [in] | bias | DD ambiguity biases |
| [in] | nb | Number of DD ambiguities |
| [out] | xa | Fixed state vector |
Definition at line 2055 of file mrtk_ppp_rtk.c.
References ssat_t::code, ssat_t::fix, prcopt_t::glomodear, IB_RTK, ssat_t::lock, MAXSAT, rtk_t::na, NF_RTK, rtk_t::nx, rtk_t::opt, prcopt_t::qzsmodear, rtk_t::ssat, ssat_t::sys, test_sys(), trace(), rtk_t::x, and rtk_t::xa.
Referenced by resamb_LAMBDA().
|
extern |
Free RTK control struct for PPP-RTK positioning.
| [in,out] | rtk | RTK control struct |
Definition at line 3223 of file mrtk_ppp_rtk.c.
References prtk_ctx, and trace().
Initialize RTK control struct for PPP-RTK positioning.
| [in,out] | rtk | RTK control struct |
| [in] | opt | Processing options |
Definition at line 3205 of file mrtk_ppp_rtk.c.
References prtk_ctx, and trace().
|
static |
Compute satellite-specific wavelength for frequency index.
Uses direct obs code to frequency mapping, bypassing obsdef tables which may be rearranged by apply_pppsig() for MADOCA PPP signal selection.
| [in] | sat | Satellite number |
| [in] | f | Frequency index (0,1,2) |
| [in] | nav | Navigation data (unused, kept for API compatibility) |
Definition at line 274 of file mrtk_ppp_rtk.c.
References CLIGHT, code2obs(), FREQ1, FREQ2, FREQ5, FREQ6, FREQ7, FREQ8, freq_idx2freq_num(), freq_num2freq(), nav_s::glo_fcn, obs_code_for_freq(), satsys(), and SYS_GLO.
Referenced by gfmeas_L1L2(), gfmeas_L1L5(), set_init_pb(), udbias_ppp(), and valid_zd_sig().
|
static |
Definition at line 212 of file mrtk_ppp_rtk.c.
References cpc, clas_osr_ctx_t::cpctmp, MAXSAT, pt0, and clas_osr_ctx_t::pt0tmp.
Referenced by ppp_rtk_pos().
|
static |
Definition at line 2211 of file mrtk_ppp_rtk.c.
References ssat_t::azel, free, mat(), matinv(), matmul(), rtk_t::nx, rtk_t::ssat, and ssat_t::vsat.
Referenced by calpdop().
|
static |
Re-initialize the phase-bias state of one satellite from phase-code.
Used when a satellite switches L6 channel: the accumulated bias belongs to the previous channel's correction set and must not carry over. Mirrors the second half of udbias_ppp(), restricted to a single satellite.
| [in,out] | rtk | RTK control struct |
| [in] | nav | Navigation data |
| [in] | obs | Observation data |
| [in] | n | Number of observations |
| [in] | f | Frequency index |
| [in] | satj | Satellite to reset |
Definition at line 1523 of file mrtk_ppp_rtk.c.
References free, IB_RTK, initx(), obsd_t::L, ssat_t::lock, prcopt_t::minlock, rtk_t::opt, obsd_t::P, ssat_t::pbreset, obsd_t::sat, sat_lambda(), SQR, rtk_t::ssat, prcopt_t::std, trace(), rtk_t::x, and zeros().
Referenced by ddres().
|
static |
Test if satellite system matches group index.
| [in] | sys | Satellite system (SYS_*) |
| [in] | m | Group index (0:GPS/SBS, 1:GLO, 2:GAL, 3:BDS, 4:QZS, 5:GPS-L2C) |
| [in] | qzsmodear | QZSS AR mode (0:off, 1:on, 2:gps-qzs) |
| [in] | code | Observation code indicator (CODE_*) |
Definition at line 1089 of file mrtk_ppp_rtk.c.
References CODE_L2X, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_QZS, and SYS_SBS.
Referenced by ddidx(), ddmat(), ddmat(), ddres(), holdamb(), restamb(), and valid_zd_sig().
Temporal update of phase biases.
| [in,out] | rtk | RTK control struct |
| [in] | tt | Time step (s) |
| [in] | obs | Observation data |
| [in] | n | Number of observations |
| [in] | nav | Navigation data |
Definition at line 856 of file mrtk_ppp_rtk.c.
References ARMODE_INST, detslp_gf(), detslp_ll(), free, IB_RTK, initx(), prcopt_t::ionoopt, IONOOPT_IFLC, obsd_t::L, ssat_t::lock, MAXOBS, prcopt_t::maxout, MAXSAT, prcopt_t::minlock, prcopt_t::modear, prcopt_t::nf, NF_RTK, rtk_t::nx, rtk_t::opt, ssat_t::outc, obsd_t::P, rtk_t::P, ssat_t::pbreset, prcopt_t::prn, prtk_ctx, obsd_t::sat, sat_lambda(), ssat_t::slip, SQR, rtk_t::ssat, prcopt_t::std, trace(), rtk_t::x, and zeros().
Referenced by udstate_ppp().
Temporal update of ionospheric parameters.
| [in,out] | rtk | RTK control struct |
| [in] | tt | Time step (s) |
| [in] | bl | Baseline length (m) |
| [in] | obs | Observation data |
| [in] | ns | Number of observations |
Definition at line 679 of file mrtk_ppp_rtk.c.
References ssat_t::azel, clas_osr_selfreqpair(), II_RTK, initx(), prcopt_t::ionoopt, IONOOPT_EST_ADPT, prcopt_t::maxout, MAXSAT, prcopt_t::nf, rtk_t::nx, rtk_t::opt, ssat_t::outc, rtk_t::P, prcopt_t::prn, prcopt_t::prnionomax, rtk_t::Q, obsd_t::sat, SQR, rtk_t::ssat, prcopt_t::std, trace(), and rtk_t::x.
Referenced by udstate_ppp().
Temporal update of position states.
| [in,out] | rtk | RTK control struct |
| [in] | obs | Observation data |
| [in] | n | Number of observations |
| [in] | tt | Time step (s) |
Definition at line 403 of file mrtk_ppp_rtk.c.
References covecef(), prcopt_t::dynamics, ecef2pos(), eye(), free, initx(), mat(), matcpy(), matmul(), prcopt_t::mode, NI_RTK, norm(), NP_RTK, rtk_t::nx, rtk_t::opt, rtk_t::P, PMODE_PPP_FIXED, prcopt_t::prn, sol_t::rr, prcopt_t::ru, rtk_t::sol, SQR, prcopt_t::stats_prnposith, prcopt_t::stats_prnpositv, prcopt_t::stats_tconstiono, trace(), VAR_ACC, VAR_POS, VAR_VEL, and rtk_t::x.
Referenced by udstate_ppp().
Temporal update of all PPP-RTK states.
| [in,out] | rtk | RTK control struct |
| [in] | obs | Observation data |
| [in] | n | Number of observations |
| [in] | nav | Navigation data |
Definition at line 971 of file mrtk_ppp_rtk.c.
References BASELEN, prcopt_t::ionoopt, IONOOPT_EST, rtk_t::opt, trace(), prcopt_t::tropopt, TROPOPT_EST, rtk_t::tt, udbias_ppp(), udion(), udpos_ppp(), and udtrop().
Referenced by ppp_rtk_pos().
|
static |
Temporal update of tropospheric parameters.
| [in,out] | rtk | RTK control struct |
| [in] | tt | Time step (s) |
Definition at line 643 of file mrtk_ppp_rtk.c.
References INIT_ZWD, initx(), IT_RTK, rtk_t::nx, rtk_t::opt, rtk_t::P, prcopt_t::prn, SQR, prcopt_t::std, trace(), prcopt_t::tropopt, TROPOPT_ESTG, rtk_t::tt, VAR_GRA, and rtk_t::x.
Referenced by udstate_ppp().
|
static |
Check that a satellite yields a usable zero-difference signal.
Validates the candidate non-reference satellite j against the reference satellite i for system m and frequency f on one L6 channel's residual vector, and reports the satellite/system/wavelength pair on success.
| [in] | rtk | RTK control struct |
| [in] | obs | Observation data |
| [in] | nav | Navigation data |
| [in] | y | ZD residuals of the channel under test |
| [in] | nf | Number of frequencies |
| [in] | f | Frequency index (f<nf: phase, f>=nf: code) |
| [in] | i | Reference satellite observation index |
| [in] | j | Candidate satellite observation index |
| [in] | m | System loop index |
| [in] | sati | Reference satellite number |
| [out] | satj | Candidate satellite number |
| [out] | sysi | Reference satellite system |
| [out] | sysj | Candidate satellite system |
| [out] | lami | Reference satellite wavelength (m) |
| [out] | lamj | Candidate satellite wavelength (m) |
Definition at line 1482 of file mrtk_ppp_rtk.c.
References ssat_t::code, rtk_t::opt, prcopt_t::qzsmodear, obsd_t::sat, sat_lambda(), rtk_t::ssat, ssat_t::sys, test_sys(), and validobs().
Referenced by ddres().
|
static |
Check if zero-difference observation is valid.
| [in] | i | Observation index |
| [in] | f | Frequency index (0..nf*2-1) |
| [in] | nf | Number of frequencies |
| [in] | y | ZD residual array |
Definition at line 1045 of file mrtk_ppp_rtk.c.
Referenced by ddres(), ddres(), and valid_zd_sig().
|
static |
Compute measurement error variance.
| [in] | sat | Satellite number |
| [in] | sys | Satellite system |
| [in] | el | Elevation angle (rad) |
| [in] | type | Measurement type (0:phase, 1:code, 2:iono, 3:trop) |
| [in] | opt | Processing options |
Definition at line 334 of file mrtk_ppp_rtk.c.
References EFACT_CMP, EFACT_GAL, EFACT_GLO, EFACT_GPS, EFACT_IRN, EFACT_QZS, EFACT_SBS, prcopt_t::eratio, prcopt_t::err, prcopt_t::ionoopt, IONOOPT_EST, IONOOPT_EST_ADPT, IONOOPT_IFLC, prcopt_t::stats_erriono, prcopt_t::stats_errtrop, SYS_CMP, SYS_GAL, SYS_GLO, SYS_IRN, SYS_QZS, SYS_SBS, prcopt_t::tropopt, and TROPOPT_EST.
Referenced by ddres().
|
static |
Definition at line 2238 of file mrtk_ppp_rtk.c.
References dops(), free, mat(), obsd_t::sat, rtk_t::ssat, and ssat_t::vsat.
Referenced by calpdop().
| double chisq |
Definition at line 181 of file mrtk_ppp_rtk.c.
|
static |
Definition at line 114 of file mrtk_ppp_rtk.c.
Referenced by residual_test(), residual_test(), and valsol().
| int cntdiffp |
Definition at line 191 of file mrtk_ppp_rtk.c.
Referenced by relposvrs().
| double cpc[SSR_CH_NUM][MAXSAT *5] |
Definition at line 167 of file mrtk_ppp_rtk.c.
Referenced by clas_osr_adjust_cpc(), load_ppp_osr_cpc(), and save_ppp_osr_cpc().
| int float_count |
Definition at line 188 of file mrtk_ppp_rtk.c.
| int floatcnt_reset |
Definition at line 194 of file mrtk_ppp_rtk.c.
| int initialized |
Definition at line 196 of file mrtk_ppp_rtk.c.
Definition at line 86 of file mrtk_ppp_rtk.c.
Referenced by ddres(), ddres(), residual_test(), and residual_test().
| clas_osr_ctx_t osr_ctx |
Definition at line 178 of file mrtk_ppp_rtk.c.
Referenced by clas_osr_compensatedisp(), clas_osr_corrmeas(), clas_osr_zdres(), and clas_ssr2osr().
| int pre_use_ch[5][MAXSAT+1] |
Definition at line 175 of file mrtk_ppp_rtk.c.
Referenced by ddres().
| struct { ... } prtk_ctx |
Referenced by ddres(), filter2(), filter2_(), ppp_rtk_pos(), residual_test(), rtkfree_ppp_rtk(), rtkinit_ppp_rtk(), and udbias_ppp().
| gtime_t pt0[SSR_CH_NUM][MAXSAT] |
Definition at line 168 of file mrtk_ppp_rtk.c.
Referenced by load_ppp_osr_cpc(), and save_ppp_osr_cpc().
|
static |
Definition at line 125 of file mrtk_ppp_rtk.c.
Referenced by resamb_LAMBDA().
| double* Qp |
Definition at line 184 of file mrtk_ppp_rtk.c.
Referenced by filter2_(), filter2_(), and relposvrs().
| int Qp_nx |
Definition at line 185 of file mrtk_ppp_rtk.c.
| int refsat[5 *2 *2 *6+1] |
Definition at line 162 of file mrtk_ppp_rtk.c.
Referenced by ddres().
| int refsat2[5 *2 *6+1] |
Definition at line 163 of file mrtk_ppp_rtk.c.
Referenced by ddres().
| int use_ch[5][MAXSAT+1] |
Definition at line 174 of file mrtk_ppp_rtk.c.
Referenced by ddres().