Skip to content

Commit

Permalink
CLK BDS2/3 in SPP
Browse files Browse the repository at this point in the history
  • Loading branch information
thetengda committed Mar 29, 2023
1 parent 81ee67a commit 5d1b56c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
19 changes: 13 additions & 6 deletions src/pntpos.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

/* constants/macros ----------------------------------------------------------*/

#define NX (3 + NSYS) /* # of estimated parameters */
#define NX (3 + NSYS+1) /* # of estimated parameters */

#define MAXITR 10 /* max number of iteration for point pos */
#define ERR_ION 5.0 /* ionospheric delay Std (m) */
Expand Down Expand Up @@ -252,7 +252,6 @@ static int rescode(int iter, const obsd_t *obs, int n, const double *rs, const d
if (isys < 0 || isys >= NSYS) {
continue;
}
dtr = x[3 + isys];

/* reject duplicated observation data */
if (i < n - 1 && i < MAXOBS - 1 && sat == obs[i + 1].sat) {
Expand Down Expand Up @@ -295,17 +294,25 @@ static int rescode(int iter, const obsd_t *obs, int n, const double *rs, const d
if ((P = prange(obs + i, nav, opt, &vmeas)) == 0.0)
continue;

/* pseudorange residual */
v[nv] = P - (r + dtr - CLIGHT * dts[i * 2] + dion + dtrp);


/* design matrix */
for (j = 0; j < NX; j++) {
H[j + nv * NX] = j < 3 ? -e[j] : 0.0; // x y z
}
/* time system offset and receiver bias correction */
//fixed: a dtr for a system, not isb
H[isys + 3 + nv * NX] = 1.0;
mask[isys] = 1;
if (bds2or3(sat) == 2) {
H[NX - 1 + nv * NX] = 1.0;
mask[NX - 3 - 1] = 1;
dtr = x[NX-1];
} else {
H[isys + 3 + nv * NX] = 1.0;
mask[isys] = 1;
dtr = x[3 + isys];
}
/* pseudorange residual */
v[nv] = P - (r + dtr - CLIGHT * dts[i * 2] + dion + dtrp);

vsat[i] = 1;
resp[i] = v[nv];
Expand Down
11 changes: 7 additions & 4 deletions src/ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ static void udpos_ppp(rtk_t *rtk) {
/* temporal update of clock --------------------------------------------------*/
static void udclk_ppp(rtk_t *rtk) {
double dtr;
int i;
int i,j;

trace(3, "udclk_ppp:\n");

Expand All @@ -667,9 +667,12 @@ static void udclk_ppp(rtk_t *rtk) {
// dtr = rtk->sol.dtr[0];
// fixed: dtr are derived from spp for each system
dtr = rtk->sol.dtr[i];
if(dtr==0){ // spp do not get dtr(i)
dtr = rtk->sol.dtr[0]; // use dtr(G) instead
}
// if(dtr==0){ // spp do not get dtr(i)
// for(j=0;j<NSYS+1;++j){
// if(rtk->sol.dtr[j]!=0)
// dtr = rtk->sol.dtr[j]; // use dtr(G) instead
// }
// }
// } else {
// dtr = i == 0 ? rtk->sol.dtr[0] : rtk->sol.dtr[0] + rtk->sol.dtr[i];
// }
Expand Down

0 comments on commit 5d1b56c

Please sign in to comment.