58 #ifndef GNSS_SDR_RTKLIB_RTKCMN_H 59 #define GNSS_SDR_RTKLIB_RTKCMN_H 65 #if HAS_STD_FILESYSTEM 66 #include <system_error> 67 namespace errorlib =
std;
68 #if HAS_STD_FILESYSTEM_EXPERIMENTAL 69 #include <experimental/filesystem> 70 namespace fs = std::experimental::filesystem;
73 namespace fs = std::filesystem;
76 #include <boost/filesystem/operations.hpp> 77 #include <boost/filesystem/path.hpp> 78 #include <boost/filesystem/path_traits.hpp> 79 #include <boost/system/error_code.hpp> 80 namespace fs = boost::filesystem;
81 namespace errorlib = boost::system;
89 (X)[1] = (X)[2] = (X)[3] = (X)[6] = 0.0; \ 90 (X)[4] = (X)[8] = cos(t); \ 100 (X)[1] = (X)[3] = (X)[5] = (X)[7] = 0.0; \ 101 (X)[0] = (X)[8] = cos(t); \ 111 (X)[2] = (X)[5] = (X)[6] = (X)[7] = 0.0; \ 112 (X)[0] = (X)[4] = cos(t); \ 118 char *strncpy_no_trunc(
char *out,
size_t outsz,
const char *in,
size_t insz);
119 void fatalerr(
const char *format, ...);
120 int satno(
int sys,
int prn);
121 int satsys(
int sat,
int *prn);
122 int satid2no(
const char *
id);
123 std::string satno2id(
int sat);
124 int satexclude(
int sat,
int svh,
const prcopt_t *opt);
125 int testsnr(
int base,
int freq,
double el,
double snr,
const snrmask_t *mask);
126 unsigned char obs2code(
const char *obs,
int *freq);
127 char *code2obs(
unsigned char code,
int *freq);
128 void setcodepri(
int sys,
int freq,
const char *pri);
129 int getcodepri(
int sys,
unsigned char code,
const char *opt);
130 unsigned int getbitu(
const unsigned char *buff,
int pos,
int len);
131 int getbits(
const unsigned char *buff,
int pos,
int len);
132 void setbitu(
unsigned char *buff,
int pos,
int len,
unsigned int data);
133 void setbits(
unsigned char *buff,
int pos,
int len,
int data);
134 unsigned int rtk_crc32(
const unsigned char *buff,
int len);
135 unsigned int rtk_crc24q(
const unsigned char *buff,
int len);
136 unsigned short rtk_crc16(
const unsigned char *buff,
int len);
137 int decode_word(
unsigned int word,
unsigned char *data);
138 double *mat(
int n,
int m);
139 int *imat(
int n,
int m);
140 double *zeros(
int n,
int m);
142 double dot(
const double *a,
const double *b,
int n);
143 double norm_rtk(
const double *a,
int n);
144 void cross3(
const double *a,
const double *b,
double *c);
145 int normv3(
const double *a,
double *b);
146 void matcpy(
double *A,
const double *B,
int n,
int m);
147 void matmul(
const char *tr,
int n,
int k,
int m,
double alpha,
148 const double *A,
const double *B,
double beta,
double *C);
149 int matinv(
double *A,
int n);
150 int solve(
const char *tr,
const double *A,
const double *Y,
int n,
152 int lsq(
const double *A,
const double *y,
int n,
int m,
double *x,
154 int filter_(
const double *x,
const double *P,
const double *H,
155 const double *v,
const double *R,
int n,
int m,
156 double *xp,
double *Pp);
157 int filter(
double *x,
double *P,
const double *H,
const double *v,
158 const double *R,
int n,
int m);
159 int smoother(
const double *xf,
const double *Qf,
const double *xb,
160 const double *Qb,
int n,
double *xs,
double *Qs);
161 void matfprint(
const double A[],
int n,
int m,
int p,
int q, FILE *fp);
162 void matsprint(
const double A[],
int n,
int m,
int p,
int q, std::string &buffer);
163 void matprint(
const double A[],
int n,
int m,
int p,
int q);
164 double str2num(
const char *s,
int i,
int n);
165 int str2time(
const char *s,
int i,
int n,
gtime_t *t);
166 gtime_t epoch2time(
const double *ep);
167 void time2epoch(
gtime_t t,
double *ep);
168 gtime_t gpst2time(
int week,
double sec);
169 double time2gpst(
gtime_t t,
int *week);
170 gtime_t gst2time(
int week,
double sec);
171 double time2gst(
gtime_t t,
int *week);
172 gtime_t bdt2time(
int week,
double sec);
173 double time2bdt(
gtime_t t,
int *week);
179 int read_leaps_text(FILE *fp);
180 int read_leaps_usno(FILE *fp);
181 int read_leaps(
const char *file);
187 double utc2gmst(
gtime_t t,
double ut1_utc);
188 void time2str(
gtime_t t,
char *s,
int n);
189 char *time_str(
gtime_t t,
int n);
191 int adjgpsweek(
int week,
bool pre_2009_file =
false);
192 unsigned int tickget();
193 void sleepms(
int ms);
194 void deg2dms(
double deg,
double *dms,
int ndec);
195 void deg2dms(
double deg,
double *dms);
196 double dms2deg(
const double *dms);
197 void ecef2pos(
const double *r,
double *pos);
198 void pos2ecef(
const double *pos,
double *r);
199 void xyz2enu(
const double *pos,
double *E);
200 void ecef2enu(
const double *pos,
const double *r,
double *e);
201 void enu2ecef(
const double *pos,
const double *e,
double *r);
202 void covenu(
const double *pos,
const double *P,
double *Q);
203 void covecef(
const double *pos,
const double *Q,
double *P);
204 void ast_args(
double t,
double *f);
205 void nut_iau1980(
double t,
const double *f,
double *dpsi,
double *deps);
206 void eci2ecef(
gtime_t tutc,
const double *erpv,
double *U,
double *gmst);
207 int decodef(
char *p,
int n,
double *v);
209 int readngspcv(
const char *file,
pcvs_t *pcvs);
210 int readantex(
const char *file,
pcvs_t *pcvs);
211 int readpcv(
const char *file,
pcvs_t *pcvs);
212 pcv_t *searchpcv(
int sat,
const char *type,
gtime_t time,
214 void readpos(
const char *file,
const char *rcv,
double *pos);
215 int readblqrecord(FILE *fp,
double *odisp);
216 int readblq(
const char *file,
const char *sta,
double *odisp);
217 int readerp(
const char *file,
erp_t *erp);
218 int geterp(
const erp_t *erp,
gtime_t time,
double *erpv);
219 int cmpeph(
const void *p1,
const void *p2);
220 void uniqeph(
nav_t *nav);
221 int cmpgeph(
const void *p1,
const void *p2);
222 void uniqgeph(
nav_t *nav);
223 int cmpseph(
const void *p1,
const void *p2);
224 void uniqseph(
nav_t *nav);
225 void uniqnav(
nav_t *nav);
226 int cmpobs(
const void *p1,
const void *p2);
227 int sortobs(
obs_t *obs);
229 int readnav(
const char *file,
nav_t *nav);
230 int savenav(
const char *file,
const nav_t *nav);
231 void freeobs(
obs_t *obs);
232 void freenav(
nav_t *nav,
int opt);
234 void traceopen(
const char *file);
236 void tracelevel(
int level);
238 void trace(
int level,
const char *format, ...);
239 void tracet(
int level,
const char *format, ...);
240 void tracemat(
int level,
const double *A,
int n,
int m,
int p,
int q);
241 void traceobs(
int level,
const obsd_t *obs,
int n);
249 int execcmd(
const char *cmd);
250 void createdir(fs::path
const &path);
251 int reppath(std::string
const &path, std::string &rpath,
gtime_t time,
const char *rov,
253 double satwavelen(
int sat,
int frq,
const nav_t *nav);
254 double geodist(
const double *rs,
const double *rr,
double *e);
255 double satazel(
const double *pos,
const double *e,
double *azel);
257 void dops(
int ns,
const double *azel,
double elmin,
double *dop);
258 double ionmodel(
gtime_t t,
const double *ion,
const double *pos,
260 double ionmapf(
const double *pos,
const double *azel);
261 double ionppp(
const double *pos,
const double *azel,
double re,
262 double hion,
double *posp);
263 double tropmodel(
gtime_t time,
const double *pos,
const double *azel,
265 double interpc(
const double coef[],
double lat);
266 double mapf(
double el,
double a,
double b,
double c);
267 double nmf(
gtime_t time,
const double pos[],
const double azel[],
269 double tropmapf(
gtime_t time,
const double pos[],
const double azel[],
271 double interpvar(
double ang,
const double *var);
273 void antmodel(
const pcv_t *pcv,
const double *del,
const double *azel,
274 int opt,
double *dant);
276 void antmodel_s(
const pcv_t *pcv,
double nadir,
double *dant);
277 void sunmoonpos_eci(
gtime_t tut,
double *rsun,
double *rmoon);
278 void sunmoonpos(
gtime_t tutc,
const double *erpv,
double *rsun,
279 double *rmoon,
double *gmst);
280 void csmooth(
obs_t *obs,
int ns);
281 int rtk_uncompress(
const char *file,
char *uncfile);
282 int expath(
const char *path,
char *paths[],
int nmax);
283 void windupcorr(
gtime_t time,
const double *rs,
const double *rr,
double *phw);
285 #endif // GNSS_SDR_RTKLIB_RTKCMN_H
main header file for the rtklib library