Skip to content

Commit

Permalink
unfix ambiguity between gps and qzss
Browse files Browse the repository at this point in the history
  • Loading branch information
tomojitakasu committed Jan 30, 2018
1 parent 91eb763 commit 14a0e1c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/rtkpos.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*------------------------------------------------------------------------------
* rtkpos.c : precise positioning
*
* Copyright (C) 2007-2013 by T.TAKASU, All rights reserved.
* Copyright (C) 2007-2018 by T.TAKASU, All rights reserved.
*
* version : $Revision: 1.1 $ $Date: 2008/07/17 21:48:06 $
* history : 2007/01/12 1.0 new
Expand Down Expand Up @@ -34,6 +34,7 @@
* 2014/10/21 1.16 fix bug on beidou amb-res with pos2-bdsarmode=0
* 2014/11/08 1.17 fix bug on ar-degradation by unhealthy satellites
* 2015/03/23 1.18 residuals referenced to reference satellite
* 2018/01/29 1.19 unfix ambiguity between gps and qzss
*-----------------------------------------------------------------------------*/
#include <stdarg.h>
#include "rtklib.h"
Expand Down Expand Up @@ -1004,12 +1005,12 @@ static double gloicbcorr(int sat1, int sat2, const prcopt_t *opt, double lam1,

return opt->exterr.gloicb[f]*0.01*dfreq; /* (m) */
}
/* test navi system (m=0:gps/qzs/sbs,1:glo,2:gal,3:bds) ----------------------*/
/* test navi system (m=0:gps/sbs,1:glo,2:gal,3:bds,4:qzs) --------------------*/
static int test_sys(int sys, int m)
{
switch (sys) {
case SYS_GPS: return m==0;
case SYS_QZS: return m==0;
case SYS_QZS: return m==4;
case SYS_SBS: return m==0;
case SYS_GLO: return m==1;
case SYS_GAL: return m==2;
Expand Down Expand Up @@ -1049,7 +1050,7 @@ static int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x,
tropr[i]=prectrop(rtk->sol.time,posr,1,azel+ir[i]*2,opt,x,dtdxr+i*3);
}
}
for (m=0;m<4;m++) /* m=0:gps/qzs/sbs,1:glo,2:gal,3:bds */
for (m=0;m<5;m++) /* m=0:gps/sbs,1:glo,2:gal,3:bds,4:qzs */

for (f=opt->mode>PMODE_DGPS?0:nf;f<nf*2;f++) {

Expand Down Expand Up @@ -1248,7 +1249,7 @@ static int ddmat(rtk_t *rtk, double *D)
}
for (i=0;i<na;i++) D[i+i*nx]=1.0;

for (m=0;m<4;m++) { /* m=0:gps/qzs/sbs,1:glo,2:gal,3:bds */
for (m=0;m<5;m++) { /* m=0:gps/sbs,1:glo,2:gal,3:bds,4:qzs */

if (m==1&&rtk->opt.glomodear==0) continue;
if (m==3&&rtk->opt.bdsmodear==0) continue;
Expand Down Expand Up @@ -1297,7 +1298,7 @@ static void restamb(rtk_t *rtk, const double *bias, int nb, double *xa)
for (i=0;i<rtk->nx;i++) xa[i]=rtk->x [i];
for (i=0;i<rtk->na;i++) xa[i]=rtk->xa[i];

for (m=0;m<4;m++) for (f=0;f<nf;f++) {
for (m=0;m<5;m++) for (f=0;f<nf;f++) {

for (n=i=0;i<MAXSAT;i++) {
if (!test_sys(rtk->ssat[i].sys,m)||rtk->ssat[i].fix[f]!=2) {
Expand All @@ -1324,7 +1325,7 @@ static void holdamb(rtk_t *rtk, const double *xa)

v=mat(nb,1); H=zeros(nb,rtk->nx);

for (m=0;m<4;m++) for (f=0;f<nf;f++) {
for (m=0;m<5;m++) for (f=0;f<nf;f++) {

for (n=i=0;i<MAXSAT;i++) {
if (!test_sys(rtk->ssat[i].sys,m)||rtk->ssat[i].fix[f]!=2||
Expand Down

0 comments on commit 14a0e1c

Please sign in to comment.