GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
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
60const double MIN_ARC_GAP = 300.0; /* min arc gap (s) */
61const double CONST_AMB = 0.001; /* constraint to fixed ambiguity */
62const double THRES_RES = 0.3; /* threshold of residuals test (m) */
63const double LOG_PI = 1.14472988584940017; /* log(pi) */
64const double SQRT2 = 1.41421356237309510; /* sqrt(2) */
65
66const double VAR_POS_PPP = std::pow(100.0, 2.0); /* init variance receiver position (m^2) */
67const double VAR_CLK = std::pow(100.0, 2.0); /* init variance receiver clock (m^2) */
68const double VAR_ZTD = std::pow(0.3, 2.0); /* init variance ztd (m^2) */
69const double VAR_GRA_PPP = std::pow(0.001, 2.0); /* init variance gradient (m^2) */
70const double VAR_BIAS = std::pow(100.0, 2.0); /* init variance phase-bias (m^2) */
71
72const 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*/
76double lam_LC(int i, int j, int k);
77
78double L_LC(int i, int j, int k, const double *L);
79
80double P_LC(int i, int j, int k, const double *P);
81
82double var_LC(int i, int j, int k, double sig);
83
84double q_gamma(double a, double x, double log_gamma_a);
85
86double p_gamma(double a, double x, double log_gamma_a);
87
88double f_erfc(double x);
89
90double conffunc(int N, double B, double sig);
91
92void average_LC(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav, const double *azel);
93
94int fix_amb_WL(rtk_t *rtk, const nav_t *nav, int sat1, int sat2, int *NW);
95
96int is_depend(int sat1, int sat2, int *flgs, int *max_flg);
97
98int sel_amb(int *sat1, int *sat2, double *N, double *var, int n);
99
100int fix_sol(rtk_t *rtk, const int *sat1, const int *sat2, const double *NC, int n);
101
102int fix_amb_ROUND(rtk_t *rtk, int *sat1, int *sat2, const int *NW, int n);
103
104int fix_amb_ILS(rtk_t *rtk, int *sat1, int *sat2, int *NW, int n);
105
106int 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 */
110void pppoutsolstat(rtk_t *rtk, int level, FILE *fp);
111
112void testeclipse(const obsd_t *obs, int n, const nav_t *nav, double *rs);
113
114double varerr(int sat, int sys, double el, int type, const prcopt_t *opt);
115
116void initx(rtk_t *rtk, double xi, double var, int i);
117
118int 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
122double gettgd_ppp(int sat, const nav_t *nav);
123
124int 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
128int 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
133double gfmeas(const obsd_t *obs, const nav_t *nav);
134
135void udpos_ppp(rtk_t *rtk);
136
137void udclk_ppp(rtk_t *rtk);
138
139void udtrop_ppp(rtk_t *rtk);
140
141void detslp_ll(rtk_t *rtk, const obsd_t *obs, int n);
142
143void detslp_gf(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav);
144
145void udbias_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav);
146
147void udstate_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav);
148
149void satantpcv(const double *rs, const double *rr, const pcv_t *pcv, double *dant);
150
151double prectrop(gtime_t time, const double *pos, const double *azel,
152 const prcopt_t *opt, const double *x, double *dtdx,
153 double *var);
154
155int 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
160int pppnx(const prcopt_t *opt);
161
162void pppos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav);
163
164#endif
main header file for the rtklib library