typedef struct {
/* processing options type */
int mode; /* positioning mode (PMODE_???) */
int refpos; /* base position for relative mode是为了判断输入文件是哪一种模式 */
/* (0:pos in prcopt, 1:average of single pos, */
/* 2:read from file, 3:rinex header, 4:rtcm pos) */
int soltype; /* solution type (0:forward,1:backward,2:combined) */
int nf; /* number of frequencies (1:L1,2:L1+L2,3:L1+L2+L5) */
int navsys; /* navigation system */
double elmin; /* elevation mask angle (rad) */
snrmask_t snrmask; /* SNR mask */
int sateph; /* satellite ephemeris/clock (EPHOPT_???) */
int modear; /* AR mode (0:off,1:continuous,2:instantaneous,3:fix and hold,4:ppp-ar) */
int glomodear; /* GLONASS AR mode (0:off,1:on,2:auto cal,3:ext cal) */
int bdsmodear; /* BeiDou AR mode (0:off,1:on) */
int maxout; /* obs outage count to reset bias */
int minlock; /* min lock count to fix ambiguity */
int minfix; /* min fix count to hold ambiguity */
int armaxiter; /* max iteration to resolve ambiguity */
int ionoopt; /* ionosphere option (IONOOPT_???) */
int tropopt; /* troposphere option (TROPOPT_???) */
int dynamics; /* dynamics model (0:none,1:velociy,2:accel) */
int tidecorr; /* earth tide correction (0:off,1:solid,2:solid+otl+pole) */
int niter; /* number of filter iteration */
int codesmooth; /* code smoothing window size (0:none) */
int intpref; /* interpolate reference obs (for post mission) */
int sbascorr; /* SBAS correction options */
int sbassatsel; /* SBAS satellite selection (0:all) */
int rovpos; /* rover position for fixed mode */
double eratio[NFREQ]; /* code/phase error ratio */
double err[5]; /* measurement error factor */
/* [0]:reserved */
/* [1-3]:error factor a/b/c of phase (m) */
/* [4]:doppler frequency (hz) */
double std[3]; /* initial-state std [0]bias,[1]iono [2]trop */
double prn[6]; /* process-noise std [0]bias,[1]iono [2]trop [3]acch [4]accv [5] pos */
double sclkstab; /* satellite clock stability (sec/sec) */
double thresar[8]; /* AR validation threshold */
double elmaskar; /* elevation mask of AR for rising satellite (deg) */
double elmaskhold; /* elevation mask to hold ambiguity (deg) */
double thresslip; /* slip threshold of geometry-free phase (m) */
double maxtdiff; /* max difference of time (sec) */
double maxinno; /* reject threshold of innovation (m) */
double maxgdop; /* reject threshold of gdop */
double baseline[2]; /* baseline length constraint {const,sigma} (m) */
double ru[3]; /* rover position for fixed mode {x,y,z} (ecef) (m) */
double rb[3]; /* base position for relative mode {x,y,z} (ecef) (m) */
char anttype[2][MAXANT]; /* antenna types {rover,base} */
double antdel[2][3]; /* antenna delta {
{rov_e,rov_n,rov_u},{ref_e,ref_n,ref_u}} */
pcv_t pcvr[2]; /* receiver antenna parameters {rov,base} */
unsigned char exsats[MAXSAT]; /* excluded satellites (1:excluded,2:included) */
int maxaveep; /* max averaging epoches */
int initrst; /* initialize by restart */
int outsingle; /* output single by dgps/float/fix/ppp outage */
char rnxopt[2][256]; /* rinex options {rover,base} */
int posopt[6]; /* positioning options */
int syncsol; /* solution sync mode (0:off,1:on) */
double odisp[2][6*11]; /* ocean tide loading parameters {rov,base} */
exterr_t exterr; /* extended receiver error model */
int freqopt; /* disable L2-AR */
char pppopt[256]; /* ppp option */
} prcopt_t;
该数据结构主要是存储是在定位过程的一些参数选项
typedef struct {
/* solution type */
gtime_t time; /* time (GPST) */
double rr[6]; /* position/velocity (m|m/s) */ /* {x,y,z,vx,vy,vz} or {e,n,u,ve,vn,vu} */
float qr[6]; /* position variance/covariance (m^2) *//* {c_xx,c_yy,c_zz,c_xy,c_yz,c_zx} or */ /* {c_ee,c_nn,c_uu,c_en,c_nu,c_ue} */
float qv[6]; /* velocity variance/covariance (m^2/s^2) */
double dtr[6]; /* receiver clock bias to time systems (s) */
unsigned char type; /* type (0:xyz-ecef,1:enu-baseline) */
unsigned char stat; /* solution status (SOLQ_???) */
unsigned char ns; /* number of valid satellites */
float age; /* age of differential (s) */
float ratio; /* AR ratio factor for valiation */
float thres; /* AR ratio threshold for valiation */
} sol_t;
关于sol_t->stat有以下几种可选值:
#define SOLQ_NONE 0/* solution status: no solution */
#define SOLQ_FIX 1 /* solution status: fix*/
#define SOLQ_FLOAT 2 /* solution status: float */
#define SOLQ_SBAS 3 /* solution status: SBAS */#define SOLQ_DGPS 4 /* solution status: DGPS/DGNSS */
#define SOLQ_SINGLE 5 /* solution status: single */
#define SOLQ_PPP 6 /* solution status: PPP */
#define SOLQ_DR 7 /* solution status: dead reconing */
#define SOLQ_WL_FIX 8 /* solution status: wide lane fixed */
#define MAXSOLQ 8 /* max number of solution status */
这个数据结构基本上每个算法都会用到
typedef struct {
/* navigation data type */
int n,nmax; /* number of broadcast ephemeris */
int ng,ngmax; /* number of glonass ephemeris */
int ns,nsmax; /* number of sbas ephemeris */
int ne,nemax; /* number of precise ephemeris */
int nc,ncmax; /* number of precise clock */
int na,namax; /* number of almanac data */
int nt,ntmax; /* number of tec grid data */
int nf,nfmax; /* number of satellite fcb data */
eph_t *eph; /* GPS/QZS/GAL ephemeris */
geph_t *geph; /* GLONASS ephemeris */
seph_t *seph; /* SBAS ephemeris */
peph_t *peph; /* precise ephemeris */
pclk_t *pclk; /* precise clock */
alm_t *alm; /* almanac data */
tec_t *tec; /* tec grid data */
fcbd_t *fcb; /* satellite fcb data */
erp_t erp; /* earth rotation parameters */
double utc_gps[4]; /* GPS delta-UTC parameters {A0,A1,T,W} */
double utc_glo[4]; /* GLONASS UTC GPS time parameters */
double utc_gal[4]; /* Galileo UTC GPS time parameters */
double utc_qzs[4]; /* QZS UTC GPS time parameters */
double utc_cmp[4]; /* BeiDou UTC parameters */
double utc_irn[4]; /* IRNSS UTC parameters */
double utc_sbs[4]; /* SBAS UTC parameters */
double ion_gps[8]; /* GPS iono model parameters {a0,a1,a2,a3,b0,b1,b2,b3} */
double ion_gal[4]; /* Galileo iono model parameters {ai0,ai1,ai2,0} */
double ion_qzs[8]; /* QZSS iono model parameters {a0,a1,a2,a3,b0,b1,b2,b3} */
double ion_cmp[8]; /* BeiDou iono model parameters {a0,a1,a2,a3,b0,b1,b2,b3} */
double ion_irn[8]; /* IRNSS iono model parameters {a0,a1,a2,a3,b0,b1,b2,b3} */
int leaps; /* leap seconds (s) */
double lam[MAXSAT][NFREQ]; /* carrier wave lengths (m) */
double cbias[MAXSAT][3]; /* satellite dcb (0:p1-p2,1:p1-c1,2:p2-c2) (m) */
double rbias[MAXRCV][2][3]; /* receiver dcb (0:p1-p2,1:p1-c1,2:p2-c2) (m) */
double wlbias[MAXSAT]; /* wide-lane bias (cycle) */
double glo_cpbias[4]; /* glonass code-phase bias {1C,1P,2C,2P} (m) */
char glo_fcn[MAXPRNGLO+1]; /* glonass frequency channel number + 8 */
pcv_t pcvs[MAXSAT]; /* satellite antenna pcv */
sbssat_t sbssat; /* SBAS satellite corrections */
sbsion_t sbsion[MAXBAND+1]; /* SBAS ionosphere corrections */
dgps_t dgps[MAXSAT]; /* DGPS corrections */
ssr_t ssr[MAXSAT]; /* SSR corrections */
lexeph_t lexeph[MAXSAT]; /* LEX ephemeris */
lexion_t lexion; /* LEX ionosphere correction */
pppcorr_t pppcorr; /* ppp corrections */
} nav_t;
对导航数据文件的藐视
typedef struct {
/* observation data record */
gtime_t time; /* receiver sampling time (GPST) */
unsigned char sat,rcv; /* satellite/receiver number */
unsigned char SNR [NFREQ+NEXOBS]; /* signal strength (0.25 dBHz) */
unsigned char LLI [NFREQ+NEXOBS]; /* loss of lock indicator */
unsigned char code[NFREQ+NEXOBS]; /* code indicator (CODE_???) */
double L[NFREQ+NEXOBS]; /* observation data carrier-phase (cycle) */
double P[NFREQ+NEXOBS]; /* observation data pseudorange (m) */
float D[NFREQ+NEXOBS]; /* observation data doppler frequency (Hz) */
} obsd_t;
typedef struct {
/* RTK control/result type */
sol_t sol; /* RTK solution */
double rb[6]; /* base position/velocity (ecef) (m|m/s) */
int nx; /* number of float states */
int na; /* number of fixed states */
double tt; /* time difference between current and previous (s) */
/* 浮点解状态向量
* 1-3: 位置坐标(ecef);
* 4-6: 速度矢量(ecef);
* 7-9: 加速度矢量(ecef);
* : 每一颗卫星的电离层延迟量;
* : rover和ref的对流层延迟模型参数;
* : GLONASS卫星的receiver h/w bias;
* : 每一颗卫星的每一个频点的相位偏差值(相位偏差的站间差,包含固定状态的相位偏差,且固定状态的相位偏差排在前面)
*/
double *x;
double *P; /* 浮点解状态向量的协方差 */
double *xa; /* 模糊度固定后的状态向量 */
double *Pa; /* 固定解状态的状态向量的协方差 */
int nfix; /* number of continuous fixes of ambiguity */
ambc_t ambc[MAXSAT]; /* ambibuity control */
ssat_t ssat[MAXSAT]; /* satellite status */
int neb; /* bytes in error message buffer */
char errbuf[MAXERRMSG]; /* error message buffer */
prcopt_t opt; /* processing options */
} rtk_t;