GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
rtklib_rtkpos.h
Go to the documentation of this file.
1 /*!
2  * \file rtklib_rtkpos.h
3  * \brief rtklib ppp-related functions
4  * \authors <ul>
5  * <li> 2007-2013, T. Takasu
6  * <li> 2017, Javier Arribas
7  * <li> 2017, Carles Fernandez
8  * </ul>
9  *
10  * This is a derived work from RTKLIB http://www.rtklib.com/
11  * The original source code at https://github.com/tomojitakasu/RTKLIB is
12  * released under the BSD 2-clause license with an additional exclusive clause
13  * that does not apply here. This additional clause is reproduced below:
14  *
15  * " The software package includes some companion executive binaries or shared
16  * libraries necessary to execute APs on Windows. These licenses succeed to the
17  * original ones of these software. "
18  *
19  * Neither the executive binaries nor the shared libraries are required by, used
20  * or included in GNSS-SDR.
21  *
22  * -----------------------------------------------------------------------------
23  * Copyright (C) 2007-2013, T. Takasu
24  * Copyright (C) 2017, Javier Arribas
25  * Copyright (C) 2017, Carles Fernandez
26  * All rights reserved.
27  *
28  * SPDX-License-Identifier: BSD-2-Clause
29  *
30  *
31  * -----------------------------------------------------------------------------
32  */
33 
34 #ifndef GNSS_SDR_RTKLIB_RKTPOS_H
35 #define GNSS_SDR_RTKLIB_RKTPOS_H
36 
37 #include "rtklib.h"
38 #include "rtklib_rtkcmn.h"
39 
40 /* constants/macros ----------------------------------------------------------*/
41 const double VAR_POS = std::pow(30.0, 2.0); /* initial variance of receiver pos (m^2) */
42 const double VAR_VEL = std::pow(10.0, 2.0); /* initial variance of receiver vel ((m/s)^2) */
43 const double VAR_ACC = std::pow(10.0, 2.0); /* initial variance of receiver acc ((m/ss)^2) */
44 const double VAR_HWBIAS = std::pow(1.0, 2.0); /* initial variance of h/w bias ((m/MHz)^2) */
45 const double VAR_GRA = std::pow(0.001, 2.0); /* initial variance of gradient (m^2) */
46 const double INIT_ZWD = 0.15; /* initial zwd (m) */
47 
48 const double PRN_HWBIA = 1E-6; /* process noise of h/w bias (m/MHz/sqrt(s)) */
49 const double MAXAC = 30.0; /* max accel for doppler slip detection (m/s^2) */
50 
51 const double VAR_HOLDAMB = 0.001; /* constraint to hold ambiguity (cycle^2) */
52 
53 const double TTOL_MOVEB = (1.0 + 2 * DTTOL);
54 /* time sync tolerance for moving-baseline (s) */
55 
56 /* number of parameters (pos,ionos,tropos,hw-bias,phase-bias,real,estimated) */
57 
58 
59 /* state variable index */
60 #define II_RTK(s, opt) (NP_RTK(opt) + (s)-1) /* ionos (s:satellite no) */
61 #define IT_RTK(r, opt) (NP_RTK(opt) + NI_RTK(opt) + NT_RTK(opt) / 2 * (r)) /* tropos (r:0=rov,1:ref) */
62 #define IL_RTK(f, opt) (NP_RTK(opt) + NI_RTK(opt) + NT_RTK(opt) + (f)) /* receiver h/w bias */
63 #define IB_RTK(s, f, opt) (NR_RTK(opt) + MAXSAT * (f) + (s)-1) /* phase bias (s:satno,f:freq) */
64 
65 int rtkopenstat(const char *file, int level);
66 
67 void rtkclosestat();
68 
69 void rtkoutstat(rtk_t *rtk);
70 
71 void swapsolstat();
72 
73 void outsolstat(rtk_t *rtk);
74 
75 void errmsg(rtk_t *rtk, const char *format, ...);
76 
77 double sdobs(const obsd_t *obs, int i, int j, int f);
78 
79 double gfobs_L1L2(const obsd_t *obs, int i, int j, const double *lam);
80 
81 double gfobs_L1L5(const obsd_t *obs, int i, int j, const double *lam);
82 
83 double varerr(int sat, int sys, double el, double bl, double dt, int f,
84  const prcopt_t *opt);
85 
86 
87 double baseline(const double *ru, const double *rb, double *dr);
88 
89 void initx_rtk(rtk_t *rtk, double xi, double var, int i);
90 
91 int selsat(const obsd_t *obs, const double *azel, int nu, int nr,
92  const prcopt_t *opt, int *sat, int *iu, int *ir);
93 
94 void udpos(rtk_t *rtk, double tt);
95 
96 void udion(rtk_t *rtk, double tt, double bl, const int *sat, int ns);
97 
98 void udtrop(rtk_t *rtk, double tt, double bl);
99 
100 void udrcvbias(rtk_t *rtk, double tt);
101 
102 void detslp_ll(rtk_t *rtk, const obsd_t *obs, int i, int rcv);
103 void detslp_gf_L1L2(rtk_t *rtk, const obsd_t *obs, int i, int j,
104  const nav_t *nav);
105 
106 void detslp_gf_L1L5(rtk_t *rtk, const obsd_t *obs, int i, int j,
107  const nav_t *nav);
108 
109 void detslp_dop(rtk_t *rtk, const obsd_t *obs, int i, int rcv,
110  const nav_t *nav);
111 
112 void udbias(rtk_t *rtk, double tt, const obsd_t *obs, const int *sat,
113  const int *iu, const int *ir, int ns, const nav_t *nav);
114 
115 void udstate(rtk_t *rtk, const obsd_t *obs, const int *sat,
116  const int *iu, const int *ir, int ns, const nav_t *nav);
117 
118 void zdres_sat(int base, double r, const obsd_t *obs, const nav_t *nav,
119  const double *azel, const double *dant,
120  const prcopt_t *opt, double *y);
121 
122 int zdres(int base, const obsd_t *obs, int n, const double *rs,
123  const double *dts, const int *svh, const nav_t *nav,
124  const double *rr, const prcopt_t *opt, int index, double *y,
125  double *e, double *azel);
126 
127 int validobs(int i, int j, int f, int nf, const double *y);
128 
129 void ddcov(const int *nb, int n, const double *Ri, const double *Rj,
130  int nv, double *R);
131 
132 int constbl(rtk_t *rtk, const double *x, const double *P, double *v,
133  double *H, double *Ri, double *Rj, int index);
134 
135 double prectrop(gtime_t time, const double *pos, int r,
136  const double *azel, const prcopt_t *opt, const double *x,
137  double *dtdx);
138 
139 double gloicbcorr(int sat1, int sat2, const prcopt_t *opt, double lam1,
140  double lam2, int f);
141 
142 int test_sys(int sys, int m);
143 
144 int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x,
145  const double *P, const int *sat, double *y, const double *e,
146  double *azel, const int *iu, const int *ir, int ns, double *v,
147  double *H, double *R, int *vflg);
148 
149 double intpres(gtime_t time, const obsd_t *obs, int n, const nav_t *nav,
150  rtk_t *rtk, double *y);
151 
152 
153 int ddmat(rtk_t *rtk, double *D);
154 
155 void restamb(rtk_t *rtk, const double *bias, int nb, double *xa);
156 
157 void holdamb(rtk_t *rtk, const double *xa);
158 
159 int resamb_LAMBDA(rtk_t *rtk, double *bias, double *xa);
160 
161 int valpos(rtk_t *rtk, const double *v, const double *R, const int *vflg,
162  int nv, double thres);
163 
164 int relpos(rtk_t *rtk, const obsd_t *obs, int nu, int nr,
165  const nav_t *nav);
166 
167 void rtkinit(rtk_t *rtk, const prcopt_t *opt);
168 
169 void rtkfree(rtk_t *rtk);
170 
171 int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav);
172 
173 
174 #endif
Definition: rtklib.h:361
rtklib common functions
Definition: rtklib.h:746
main header file for the rtklib library
const double DTTOL
tolerance of time difference (s)
Definition: rtklib.h:140
Definition: rtklib.h:1059