Skip to content

Commit

Permalink
- Add updates from Google decimeter challenge release
Browse files Browse the repository at this point in the history
- Extend iono-free option to include L1/L5
- Updates to initial phase bias estimate code2freq
- Updates to doppler based cycle slip detection
- Update Embarcadero project files for latest version of compiler
- Adjustments to trace debug messages and message levels
  • Loading branch information
rtklibexplorer committed Mar 16, 2022
1 parent 4df03b9 commit ce99498
Show file tree
Hide file tree
Showing 10 changed files with 868 additions and 123 deletions.
245 changes: 241 additions & 4 deletions app/consapp/rnx2rtkp/bcc/_rnx2rtkp.cbproj

Large diffs are not rendered by default.

272 changes: 259 additions & 13 deletions app/winapp/rtknavi/rtknavi.cbproj

Large diffs are not rendered by default.

246 changes: 246 additions & 0 deletions app/winapp/rtkpost/rtkpost.cbproj

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions src/ephemeris.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static double var_uraeph(int sys, int ura)
}
else { /* gps ura (ref [1] 20.3.3.3.1.1) */
return ura<0||14<ura?SQR(6144.0):SQR(ura_value[ura]);
}
}
}
/* variance by ura ssr (ref [10] table 3.3-1 DF389) --------------------------*/
static double var_urassr(int ura)
Expand Down Expand Up @@ -256,7 +256,7 @@ extern void eph2pos(gtime_t time, const eph_t *eph, double *rs, double *dts,
r+=eph->crs*sin2u+eph->crc*cos2u;
i+=eph->cis*sin2u+eph->cic*cos2u;
x=r*cos(u); y=r*sin(u); cosi=cos(i);

/* beidou geo satellite */
if (sys==SYS_CMP&&(prn<=5||prn>=59)) { /* ref [9] table 4-1 */
O=eph->OMG0+eph->OMGd*tk-omge*eph->toes;
Expand Down Expand Up @@ -284,6 +284,8 @@ extern void eph2pos(gtime_t time, const eph_t *eph, double *rs, double *dts,

/* position and clock error variance */
*var=var_uraeph(sys,eph->sva);
trace(4,"eph2pos: sat=%d, dts=%.10f rs=%.4f %.4f %.4f var=%.3f\n",eph->sat,
*dts,rs[0],rs[1],rs[2],*var);
}
/* glonass orbit differential equations --------------------------------------*/
static void deq(const double *x, double *xdot, const double *acc)
Expand Down Expand Up @@ -418,7 +420,7 @@ extern void seph2pos(gtime_t time, const seph_t *seph, double *rs, double *dts,

*var=var_uraeph(SYS_SBS,seph->sva);
}
/* select ephememeris --------------------------------------------------------*/
/* select ephemeris --------------------------------------------------------*/
static eph_t *seleph(gtime_t time, int sat, int iode, const nav_t *nav)
{
double t,tmax,tmin;
Expand Down Expand Up @@ -455,7 +457,7 @@ static eph_t *seleph(gtime_t time, int sat, int iode, const nav_t *nav)
if (t<=tmin) {j=i; tmin=t;} /* toe closest to time */
}
if (iode>=0||j<0) {
trace(3,"no broadcast ephemeris: %s sat=%2d iode=%3d\n",time_str(time,0),
trace(2,"no broadcast ephemeris: %s sat=%2d iode=%3d\n",time_str(time,0),
sat,iode);
return NULL;
}
Expand Down Expand Up @@ -807,7 +809,7 @@ extern void satposs(gtime_t teph, const obsd_t *obs, int n, const nav_t *nav,
}
for (i=0;i<n&&i<2*MAXOBS;i++) {
trace(4,"%s sat=%2d rs=%13.3f %13.3f %13.3f dts=%12.3f var=%7.3f svh=%02X\n",
time_str(time[i],6),obs[i].sat,rs[i*6],rs[1+i*6],rs[2+i*6],
time_str(time[i],9),obs[i].sat,rs[i*6],rs[1+i*6],rs[2+i*6],
dts[i*2]*1E9,var[i],svh[i]);
}
}
Expand Down
39 changes: 21 additions & 18 deletions src/pntpos.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,14 @@ static double gettgd(int sat, const nav_t *nav, int type)
/* test SNR mask -------------------------------------------------------------*/
static int snrmask(const obsd_t *obs, const double *azel, const prcopt_t *opt)
{
int f2;

if (testsnr(0,0,azel[1],obs->SNR[0]*SNR_UNIT,&opt->snrmask)) {
return 0;
}
if (opt->ionoopt==IONOOPT_IFLC) {
if (testsnr(0,1,azel[1],obs->SNR[1]*SNR_UNIT,&opt->snrmask)) return 0;
f2=seliflc(opt->nf,satsys(obs->sat,NULL));
if (testsnr(0,f2,azel[1],obs->SNR[f2]*SNR_UNIT,&opt->snrmask)) return 0;
}
return 1;
}
Expand All @@ -107,12 +110,13 @@ static double prange(const obsd_t *obs, const nav_t *nav, const prcopt_t *opt,
double *var)
{
double P1,P2,gamma,b1,b2;
int sat,sys;
int sat,sys,f2;

sat=obs->sat;
sys=satsys(sat,NULL);
P1=obs->P[0];
P2=obs->P[1];
f2=seliflc(opt->nf,satsys(obs->sat,NULL));
P2=obs->P[f2];
*var=0.0;

if (P1==0.0||(opt->ionoopt==IONOOPT_IFLC&&P2==0.0)) return 0.0;
Expand All @@ -124,17 +128,17 @@ static double prange(const obsd_t *obs, const nav_t *nav, const prcopt_t *opt,
}
if (opt->ionoopt==IONOOPT_IFLC) { /* dual-frequency */

if (sys==SYS_GPS||sys==SYS_QZS) { /* L1-L2,G1-G2 */
gamma=SQR(FREQL1/FREQL2);
if (sys==SYS_GPS||sys==SYS_QZS) { /* L1-L2 or L1-L5 */
gamma=f2==1?SQR(FREQL1/FREQL2):SQR(FREQL1/FREQL5);
return (P2-gamma*P1)/(1.0-gamma);
}
else if (sys==SYS_GLO) { /* G1-G2 */
gamma=SQR(FREQ1_GLO/FREQ2_GLO);
else if (sys==SYS_GLO) { /* G1-G2 or G1-G3 */
gamma=f2==1?SQR(FREQ1_GLO/FREQ2_GLO):SQR(FREQ1_GLO/FREQ2_GLO);
return (P2-gamma*P1)/(1.0-gamma);
}
else if (sys==SYS_GAL) { /* E1-E5b */
gamma=SQR(FREQL1/FREQE5b);
if (getseleph(SYS_GAL)) { /* F/NAV */
else if (sys==SYS_GAL) { /* E1-E5b, E1-E5a */
gamma=f2==1?SQR(FREQL1/FREQE5b):SQR(FREQL1/FREQL5);
if (f2==1&&getseleph(SYS_GAL)) { /* F/NAV */
P2-=gettgd(sat,nav,0)-gettgd(sat,nav,1); /* BGD_E5aE5b */
}
return (P2-gamma*P1)/(1.0-gamma);
Expand Down Expand Up @@ -337,7 +341,7 @@ static int rescode(int iter, const obsd_t *obs, int n, const double *rs,
else if (sys==SYS_QZS) {v[nv]-=x[8]; H[8+nv*NX]=1.0; mask[5]=1;}
#endif
else mask[0]=1;

vsat[i]=1; resp[i]=v[nv]; (*ns)++;

/* variance of pseudorange error */
Expand Down Expand Up @@ -398,9 +402,9 @@ static int estpos(const obsd_t *obs, int n, const double *rs, const double *dts,
v=mat(n+4,1); H=mat(NX,n+4); var=mat(n+4,1);

for (i=0;i<3;i++) x[i]=sol->rr[i];

for (i=0;i<MAXITR;i++) {

/* pseudorange residuals (m) */
nv=rescode(i,obs,n,rs,dts,vare,svh,nav,x,opt,ssat,v,H,var,azel,vsat,resp,
&ns);
Expand All @@ -409,7 +413,7 @@ static int estpos(const obsd_t *obs, int n, const double *rs, const double *dts,
sprintf(msg,"lack of valid sats ns=%d",nv);
break;
}
/* weighted by Std */
/* weight by variance (lsq uses sqrt of weight */
for (j=0;j<nv;j++) {
sig=sqrt(var[j]);
v[j]/=sig;
Expand Down Expand Up @@ -472,7 +476,7 @@ static int raim_fde(const obsd_t *obs, int n, const double *rs,

for (i=0;i<n;i++) {

/* satellite exclution */
/* satellite exclusion */
for (j=k=0;j<n;j++) {
if (j==i) continue;
obs_e[k]=obs[j];
Expand Down Expand Up @@ -585,8 +589,6 @@ static void estvel(const obsd_t *obs, int n, const double *rs, const double *dts
double err=opt->err[4]; /* Doppler error (Hz) */
int i,j,nv;

trace(3,"estvel : n=%d\n",n);

v=mat(n,1); H=mat(4,n);

for (i=0;i<MAXITR;i++) {
Expand All @@ -601,6 +603,7 @@ static void estvel(const obsd_t *obs, int n, const double *rs, const double *dts
for (j=0;j<4;j++) x[j]+=dx[j];

if (norm(dx,4)<1E-6) {
trace(3,"estvel : vx=%.3f vy=%.3f vz=%.3f, n=%d\n",x[0],x[1],x[2],n);
matcpy(sol->rr+3,x,3,1);
sol->qv[0]=(float)Q[0]; /* xx */
sol->qv[1]=(float)Q[5]; /* yy */
Expand Down Expand Up @@ -664,7 +667,7 @@ extern int pntpos(const obsd_t *obs, int n, const nav_t *nav,
/* satellite positons, velocities and clocks */
satposs(sol->time,obs,n,nav,opt_.sateph,rs,dts,var,svh);

/* estimate receiver position with pseudorange */
/* estimate receiver position and time with pseudorange */
stat=estpos(obs,n,rs,dts,var,svh,nav,&opt_,ssat,sol,azel_,vsat,resp,msg);

/* RAIM FDE */
Expand Down
4 changes: 2 additions & 2 deletions src/postpos.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ static int valcomb(const sol_t *solf, const sol_t *solb)
}
return 1;
}
/* combine forward/backward solutions and output results ---------------------*/
/* combine forward/backward solutions and save results ---------------------*/
static void combres(FILE *fp, FILE *fptm, const prcopt_t *popt, const solopt_t *sopt)
{
gtime_t time={0};
Expand Down Expand Up @@ -933,7 +933,7 @@ static void setpcv(gtime_t time, prcopt_t *popt, nav_t *nav, const pcvs_t *pcvs,
if (!(satsys(i+1,NULL)&popt->navsys)) continue;
if (!(pcv=searchpcv(i+1,"",time,pcvs))) {
satno2id(i+1,id);
trace(3,"no satellite antenna pcv: %s\n",id);
trace(4,"no satellite antenna pcv: %s\n",id);
continue;
}
nav->pcvs[i]=*pcv;
Expand Down
8 changes: 4 additions & 4 deletions src/rinex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ static void set_index(double ver, int sys, const char *opt,
/* list rejected observation types */
for (i=0;i<n;i++) {
if (!ind->code[i]||!ind->pri[i]||ind->pos[i]>=0) continue;
trace(3,"reject obs type: sys=%2d, obs=%s\n",sys,tobs[i]);
trace(4,"reject obs type: sys=%2d, obs=%s\n",sys,tobs[i]);
}
ind->n=n;

Expand Down Expand Up @@ -1153,7 +1153,7 @@ static int decode_eph(double ver, int sat, gtime_t toc, const double *data,
sys=satsys(sat,NULL);

if (!(sys&(SYS_GPS|SYS_GAL|SYS_QZS|SYS_CMP|SYS_IRN))) {
trace(3,"ephemeris error: invalid satellite sat=%2d\n",sat);
trace(4,"ephemeris error: invalid satellite sat=%2d\n",sat);
return 0;
}
*eph=eph0;
Expand Down Expand Up @@ -1263,7 +1263,7 @@ static int decode_geph(double ver, int sat, gtime_t toc, double *data,
trace(4,"decode_geph: ver=%.2f sat=%2d\n",ver,sat);

if (satsys(sat,NULL)!=SYS_GLO) {
trace(3,"glonass ephemeris error: invalid satellite sat=%2d\n",sat);
trace(4,"glonass ephemeris error: invalid satellite sat=%2d\n",sat);
return 0;
}
*geph=geph0;
Expand Down Expand Up @@ -1318,7 +1318,7 @@ static int decode_seph(double ver, int sat, gtime_t toc, double *data,
trace(4,"decode_seph: ver=%.2f sat=%2d\n",ver,sat);

if (satsys(sat,NULL)!=SYS_SBS) {
trace(3,"geo ephemeris error: invalid satellite sat=%2d\n",sat);
trace(4,"geo ephemeris error: invalid satellite sat=%2d\n",sat);
return 0;
}
*seph=seph0;
Expand Down
5 changes: 5 additions & 0 deletions src/rtkcmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -3699,6 +3699,11 @@ extern double ionppp(const double *pos, const double *azel, double re,
}
return 1.0/sqrt(1.0-rp*rp);
}
/* select iono-free linear combination (L1/L2 or L1/L5) ----------------------*/
extern int seliflc(int optnf,int sys)
{
return((optnf==2||sys==SYS_GLO||sys==SYS_CMP)?1:2);
}
/* troposphere model -----------------------------------------------------------
* compute tropospheric delay by standard atmosphere and saastamoinen model
* args : gtime_t time I time
Expand Down
2 changes: 1 addition & 1 deletion src/rtklib.h
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,6 @@ typedef struct { /* RTK control/result type */
int nfix; /* number of continuous fixes of ambiguity */
int excsat; /* index of next satellite to be excluded for partial ambiguity resolution */
int nb_ar; /* number of ambiguities used for AR last epoch */
double com_bias; /* phase bias common between all sats (used to be distributed to all sats */
char holdamb; /* set if fix-and-hold has occurred at least once */
ambc_t ambc[MAXSAT]; /* ambiguity control */
ssat_t ssat[MAXSAT]; /* satellite status */
Expand Down Expand Up @@ -1482,6 +1481,7 @@ EXPORT int ionocorr(gtime_t time, const nav_t *nav, int sat, const double *pos,
const double *azel, int ionoopt, double *ion, double *var);
EXPORT int tropcorr(gtime_t time, const nav_t *nav, const double *pos,
const double *azel, int tropopt, double *trp, double *var);
EXPORT int seliflc(int optnf, int sys);

/* antenna models ------------------------------------------------------------*/
EXPORT int readpcv(const char *file, pcvs_t *pcvs);
Expand Down
Loading

0 comments on commit ce99498

Please sign in to comment.