GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
rtklib_ppp.h
Go to the documentation of this file.
1 /*!
2  * \file rtklib_ppp.h
3  * \brief Precise Point Positioning
4  * \authors <ul>
5  * <li> 2007-2008, 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-2008, 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_PPP_H
35 #define GNSS_SDR_RTKLIB_PPP_H
36 
37 #include "rtklib.h"
38 
39 
40 #define MIN_PPP(x, y) ((x) <= (y) ? (x) : (y))
41 #define ROUND_PPP(x) static_cast<int>(floor((x) + 0.5))
42 
43 #define SWAP_I(x, y) \
44  do \
45  { \
46  int _z = x; \
47  x = y; \
48  y = _z; \
49  } \
50  while (0)
51 #define SWAP_D(x, y) \
52  do \
53  { \
54  double _z = x; \
55  x = y; \
56  y = _z; \
57  } \
58  while (0)
59 
60 const double MIN_ARC_GAP = 300.0; /* min arc gap (s) */
61 const double CONST_AMB = 0.001; /* constraint to fixed ambiguity */
62 const double THRES_RES = 0.3; /* threshold of residuals test (m) */
63 const double LOG_PI = 1.14472988584940017; /* log(pi) */
64 const double SQRT2 = 1.41421356237309510; /* sqrt(2) */
65 
66 const double VAR_POS_PPP = std::pow(100.0, 2.0); /* init variance receiver position (m^2) */
67 const double VAR_CLK = std::pow(100.0, 2.0); /* init variance receiver clock (m^2) */
68 const double VAR_ZTD = std::pow(0.3, 2.0); /* init variance ztd (m^2) */
69 const double VAR_GRA_PPP = std::pow(0.001, 2.0); /* init variance gradient (m^2) */
70 const double VAR_BIAS = std::pow(100.0, 2.0); /* init variance phase-bias (m^2) */
71 
72 const double VAR_IONO_OFF = std::pow(10.0, 2.0); /* variance of iono-model-off */
73 
74 
75 /* functions originally included in RTKLIB/src/ppp_ar.c v2.4.2*/
76 double lam_LC(int i, int j, int k);
77 
78 double L_LC(int i, int j, int k, const double *L);
79 
80 double P_LC(int i, int j, int k, const double *P);
81 
82 double var_LC(int i, int j, int k, double sig);
83 
84 double q_gamma(double a, double x, double log_gamma_a);
85 
86 double p_gamma(double a, double x, double log_gamma_a);
87 
88 double f_erfc(double x);
89 
90 double conffunc(int N, double B, double sig);
91 
92 void average_LC(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav, const double *azel);
93 
94 int fix_amb_WL(rtk_t *rtk, const nav_t *nav, int sat1, int sat2, int *NW);
95 
96 int is_depend(int sat1, int sat2, int *flgs, int *max_flg);
97 
98 int sel_amb(int *sat1, int *sat2, double *N, double *var, int n);
99 
100 int fix_sol(rtk_t *rtk, const int *sat1, const int *sat2, const double *NC, int n);
101 
102 int fix_amb_ROUND(rtk_t *rtk, int *sat1, int *sat2, const int *NW, int n);
103 
104 int fix_amb_ILS(rtk_t *rtk, int *sat1, int *sat2, int *NW, int n);
105 
106 int pppamb(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav, const double *azel);
107 
108 
109 /* functions originally included in RTKLIB/src/ppp.c v2.4.2 */
110 void pppoutsolstat(rtk_t *rtk, int level, FILE *fp);
111 
112 void testeclipse(const obsd_t *obs, int n, const nav_t *nav, double *rs);
113 
114 double varerr(int sat, int sys, double el, int type, const prcopt_t *opt);
115 
116 void initx(rtk_t *rtk, double xi, double var, int i);
117 
118 int ifmeas(const obsd_t *obs, const nav_t *nav, const double *azel,
119  const prcopt_t *opt, const double *dantr, const double *dants,
120  double phw, double *meas, double *var);
121 
122 double gettgd_ppp(int sat, const nav_t *nav);
123 
124 int corr_ion(gtime_t time, const nav_t *nav, int sat, const double *pos,
125  const double *azel, int ionoopt, double *ion, double *var,
126  int *brk);
127 
128 int corrmeas(const obsd_t *obs, const nav_t *nav, const double *pos,
129  const double *azel, const prcopt_t *opt,
130  const double *dantr, const double *dants, double phw,
131  double *meas, double *var, int *brk);
132 
133 double gfmeas(const obsd_t *obs, const nav_t *nav);
134 
135 void udpos_ppp(rtk_t *rtk);
136 
137 void udclk_ppp(rtk_t *rtk);
138 
139 void udtrop_ppp(rtk_t *rtk);
140 
141 void detslp_ll(rtk_t *rtk, const obsd_t *obs, int n);
142 
143 void detslp_gf(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav);
144 
145 void udbias_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav);
146 
147 void udstate_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav);
148 
149 void satantpcv(const double *rs, const double *rr, const pcv_t *pcv, double *dant);
150 
151 double prectrop(gtime_t time, const double *pos, const double *azel,
152  const prcopt_t *opt, const double *x, double *dtdx,
153  double *var);
154 
155 int res_ppp(int iter, const obsd_t *obs, int n, const double *rs,
156  const double *dts, const double *vare, const int *svh,
157  const nav_t *nav, const double *x, rtk_t *rtk, double *v,
158  double *H, double *R, double *azel);
159 
160 int pppnx(const prcopt_t *opt);
161 
162 void pppos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav);
163 
164 #endif
Definition: rtklib.h:362
Definition: rtklib.h:752
Definition: rtklib.h:399
main header file for the rtklib library
Definition: rtklib.h:1066