GNSS-SDR  0.0.19
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 #ifndef GNSS_SDR_RTKLIB_RKTPOS_H
33 #define GNSS_SDR_RTKLIB_RKTPOS_H
34 
35 #include "rtklib.h"
36 #include "rtklib_rtkcmn.h"
37 
38 /** \addtogroup PVT
39  * \{ */
40 /** \addtogroup RTKLIB_Library
41  * \{ */
42 
43 
44 /* constants/macros ----------------------------------------------------------*/
45 const double VAR_POS = std::pow(30.0, 2.0); /* initial variance of receiver pos (m^2) */
46 const double VAR_VEL = std::pow(10.0, 2.0); /* initial variance of receiver vel ((m/s)^2) */
47 const double VAR_ACC = std::pow(10.0, 2.0); /* initial variance of receiver acc ((m/ss)^2) */
48 const double VAR_HWBIAS = std::pow(1.0, 2.0); /* initial variance of h/w bias ((m/MHz)^2) */
49 const double VAR_GRA = std::pow(0.001, 2.0); /* initial variance of gradient (m^2) */
50 const double INIT_ZWD = 0.15; /* initial zwd (m) */
51 
52 const double PRN_HWBIA = 1E-6; /* process noise of h/w bias (m/MHz/sqrt(s)) */
53 const double MAXAC = 30.0; /* max accel for doppler slip detection (m/s^2) */
54 
55 const double VAR_HOLDAMB = 0.001; /* constraint to hold ambiguity (cycle^2) */
56 
57 const double TTOL_MOVEB = (1.0 + 2 * DTTOL);
58 /* time sync tolerance for moving-baseline (s) */
59 
60 /* number of parameters (pos,ionos,tropos,hw-bias,phase-bias,real,estimated) */
61 
62 
63 /* state variable index */
64 // clang-format off
65 #define II_RTK(s, opt) (NP_RTK(opt) + (s)-1) /* ionos (s:satellite no) */
66 #define IT_RTK(r, opt) (NP_RTK(opt) + NI_RTK(opt) + NT_RTK(opt) / 2 * (r)) /* tropos (r:0=rov,1:ref) */
67 #define IL_RTK(f, opt) (NP_RTK(opt) + NI_RTK(opt) + NT_RTK(opt) + (f)) /* receiver h/w bias */
68 #define IB_RTK(s, f, opt) (NR_RTK(opt) + MAXSAT * (f) + (s)-1) /* phase bias (s:satno,f:freq) */
69 // clang-format on
70 
71 int rtkopenstat(const char *file, int level);
72 
73 void rtkclosestat();
74 
75 void rtkoutstat(rtk_t *rtk);
76 
77 void swapsolstat();
78 
79 void outsolstat(rtk_t *rtk);
80 
81 void errmsg(rtk_t *rtk, const char *format, ...);
82 
83 double sdobs(const obsd_t *obs, int i, int j, int f);
84 
85 double gfobs_L1L2(const obsd_t *obs, int i, int j, const double *lam);
86 
87 double gfobs_L1L5(const obsd_t *obs, int i, int j, const double *lam);
88 
89 double varerr(int sat, int sys, double el, double bl, double dt, int f,
90  const prcopt_t *opt);
91 
92 
93 double baseline(const double *ru, const double *rb, double *dr);
94 
95 void initx_rtk(rtk_t *rtk, double xi, double var, int i);
96 
97 int selsat(const obsd_t *obs, const double *azel, int nu, int nr,
98  const prcopt_t *opt, int *sat, int *iu, int *ir);
99 
100 void udpos(rtk_t *rtk, double tt);
101 
102 void udion(rtk_t *rtk, double tt, double bl, const int *sat, int ns);
103 
104 void udtrop(rtk_t *rtk, double tt, double bl);
105 
106 void udrcvbias(rtk_t *rtk, double tt);
107 
108 void detslp_ll(rtk_t *rtk, const obsd_t *obs, int i, int rcv);
109 void detslp_gf_L1L2(rtk_t *rtk, const obsd_t *obs, int i, int j,
110  const nav_t *nav);
111 
112 void detslp_gf_L1L5(rtk_t *rtk, const obsd_t *obs, int i, int j,
113  const nav_t *nav);
114 
115 void detslp_dop(rtk_t *rtk, const obsd_t *obs, int i, int rcv,
116  const nav_t *nav);
117 
118 void udbias(rtk_t *rtk, double tt, const obsd_t *obs, const int *sat,
119  const int *iu, const int *ir, int ns, const nav_t *nav);
120 
121 void udstate(rtk_t *rtk, const obsd_t *obs, const int *sat,
122  const int *iu, const int *ir, int ns, const nav_t *nav);
123 
124 void zdres_sat(int base, double r, const obsd_t *obs, const nav_t *nav,
125  const double *azel, const double *dant,
126  const prcopt_t *opt, double *y);
127 
128 int zdres(int base, const obsd_t *obs, int n, const double *rs,
129  const double *dts, const int *svh, const nav_t *nav,
130  const double *rr, const prcopt_t *opt, int index, double *y,
131  double *e, double *azel);
132 
133 int validobs(int i, int j, int f, int nf, const double *y);
134 
135 void ddcov(const int *nb, int n, const double *Ri, const double *Rj,
136  int nv, double *R);
137 
138 int constbl(rtk_t *rtk, const double *x, const double *P, double *v,
139  double *H, double *Ri, double *Rj, int index);
140 
141 double prectrop(gtime_t time, const double *pos, int r,
142  const double *azel, const prcopt_t *opt, const double *x,
143  double *dtdx);
144 
145 double gloicbcorr(int sat1, int sat2, const prcopt_t *opt, double lam1,
146  double lam2, int f);
147 
148 int test_sys(int sys, int m);
149 
150 int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x,
151  const double *P, const int *sat, double *y, const double *e,
152  double *azel, const int *iu, const int *ir, int ns, double *v,
153  double *H, double *R, int *vflg);
154 
155 double intpres(gtime_t time, const obsd_t *obs, int n, const nav_t *nav,
156  rtk_t *rtk, double *y);
157 
158 
159 int ddmat(rtk_t *rtk, double *D);
160 
161 void restamb(rtk_t *rtk, const double *bias, int nb, double *xa);
162 
163 void holdamb(rtk_t *rtk, const double *xa);
164 
165 int resamb_LAMBDA(rtk_t *rtk, double *bias, double *xa);
166 
167 int valpos(rtk_t *rtk, const double *v, const double *R, const int *vflg,
168  int nv, double thres);
169 
170 int relpos(rtk_t *rtk, const obsd_t *obs, int nu, int nr,
171  const nav_t *nav);
172 
173 void rtkinit(rtk_t *rtk, const prcopt_t *opt);
174 
175 void rtkfree(rtk_t *rtk);
176 
177 int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav);
178 
179 
180 /** \} */
181 /** \} */
182 #endif // GNSS_SDR_RTKLIB_RKTPOS_H
Definition: rtklib.h:362
rtklib common functions
Definition: rtklib.h:752
main header file for the rtklib library
const double DTTOL
tolerance of time difference (s)
Definition: rtklib.h:146
Definition: rtklib.h:1066