2017-05-12 10:17:42 +00:00
|
|
|
/*!
|
|
|
|
* \file rtklib_solution.h
|
|
|
|
* \brief solution functions headers
|
|
|
|
* \authors <ul>
|
|
|
|
* <li> 2007-2013, T. Takasu
|
|
|
|
* <li> 2017, Javier Arribas
|
|
|
|
* <li> 2017, Carles Fernandez
|
|
|
|
* </ul>
|
|
|
|
*
|
|
|
|
* This is a derived work from RTKLIB http://www.rtklib.com/
|
|
|
|
* The original source code at https://github.com/tomojitakasu/RTKLIB is
|
|
|
|
* released under the BSD 2-clause license with an additional exclusive clause
|
|
|
|
* that does not apply here. This additional clause is reproduced below:
|
|
|
|
*
|
|
|
|
* " The software package includes some companion executive binaries or shared
|
|
|
|
* libraries necessary to execute APs on Windows. These licenses succeed to the
|
|
|
|
* original ones of these software. "
|
|
|
|
*
|
|
|
|
* Neither the executive binaries nor the shared libraries are required by, used
|
|
|
|
* or included in GNSS-SDR.
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2017-05-12 10:17:42 +00:00
|
|
|
* Copyright (C) 2007-2013, T. Takasu
|
|
|
|
* Copyright (C) 2017, Javier Arribas
|
|
|
|
* Copyright (C) 2017, Carles Fernandez
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-12-30 12:35:06 +00:00
|
|
|
*------------------------------------------------------------------------------
|
|
|
|
*/
|
2017-05-12 10:17:42 +00:00
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_RTKLIB_SOLUTION_H
|
|
|
|
#define GNSS_SDR_RTKLIB_SOLUTION_H
|
2017-05-12 10:17:42 +00:00
|
|
|
|
|
|
|
#include "rtklib.h"
|
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
/** \addtogroup PVT
|
|
|
|
* \{ */
|
|
|
|
/** \addtogroup RTKLIB_Library
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
|
2018-03-03 01:03:39 +00:00
|
|
|
#define COMMENTH "%" /* comment line indicator for solution */
|
|
|
|
#define MSG_DISCONN "$_DISCONNECT\r\n" /* disconnect message */
|
2017-05-12 15:47:09 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
const char *opt2sep(const solopt_t *opt);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int tonum(char *buff, const char *sep, double *v);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
double sqvar(double covar);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
double dmm2deg(double dmm);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
void septime(double t, double *t1, double *t2, double *t3);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
void soltocov(const sol_t *sol, double *P);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
void covtosol(const double *P, sol_t *sol);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int decode_nmearmc(char **val, int n, sol_t *sol);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int decode_nmeagga(char **val, int n, sol_t *sol);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int decode_nmea(char *buff, sol_t *sol);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
char *decode_soltime(char *buff, const solopt_t *opt, gtime_t *time);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int decode_solxyz(char *buff, const solopt_t *opt, sol_t *sol);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int decode_solllh(char *buff, const solopt_t *opt, sol_t *sol);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int decode_solenu(char *buff, const solopt_t *opt, sol_t *sol);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int decode_solgsi(char *buff, const solopt_t *opt, sol_t *sol);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int decode_solpos(char *buff, const solopt_t *opt, sol_t *sol);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
void decode_refpos(char *buff, const solopt_t *opt, double *rb);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int decode_sol(char *buff, const solopt_t *opt, sol_t *sol, double *rb);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
void decode_solopt(char *buff, solopt_t *opt);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
void readsolopt(FILE *fp, solopt_t *opt);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int inputsol(unsigned char data, gtime_t ts, gtime_t te, double tint,
|
2018-03-03 01:03:39 +00:00
|
|
|
int qflag, const solopt_t *opt, solbuf_t *solbuf);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int readsoldata(FILE *fp, gtime_t ts, gtime_t te, double tint, int qflag,
|
2018-03-03 01:03:39 +00:00
|
|
|
const solopt_t *opt, solbuf_t *solbuf);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int cmpsol(const void *p1, const void *p2);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int sort_solbuf(solbuf_t *solbuf);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int readsolt(char *files[], int nfile, gtime_t ts, gtime_t te,
|
2018-03-03 01:03:39 +00:00
|
|
|
double tint, int qflag, solbuf_t *solbuf);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int readsol(char *files[], int nfile, solbuf_t *sol);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int addsol(solbuf_t *solbuf, const sol_t *sol);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
sol_t *getsol(solbuf_t *solbuf, int index);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
void initsolbuf(solbuf_t *solbuf, int cyclic, int nmax);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
void freesolbuf(solbuf_t *solbuf);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
void freesolstatbuf(solstatbuf_t *solstatbuf);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int cmpsolstat(const void *p1, const void *p2);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int sort_solstat(solstatbuf_t *statbuf);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int decode_solstat(char *buff, solstat_t *stat);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
void addsolstat(solstatbuf_t *statbuf, const solstat_t *stat);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int readsolstatdata(FILE *fp, gtime_t ts, gtime_t te, double tint,
|
2018-03-03 01:03:39 +00:00
|
|
|
solstatbuf_t *statbuf);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int readsolstatt(char *files[], int nfile, gtime_t ts, gtime_t te,
|
2018-03-03 01:03:39 +00:00
|
|
|
double tint, solstatbuf_t *statbuf);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int readsolstat(char *files[], int nfile, solstatbuf_t *statbuf);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int outecef(unsigned char *buff, const char *s, const sol_t *sol,
|
2018-03-03 01:03:39 +00:00
|
|
|
const solopt_t *opt);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int outpos(unsigned char *buff, const char *s, const sol_t *sol, const solopt_t *opt);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int outenu(unsigned char *buff, const char *s, const sol_t *sol,
|
2018-03-03 01:03:39 +00:00
|
|
|
const double *rb, const solopt_t *opt);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int outnmea_rmc(unsigned char *buff, const sol_t *sol);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int outnmea_gga(unsigned char *buff, const sol_t *sol);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int outnmea_gsa(unsigned char *buff, const sol_t *sol,
|
2018-03-03 01:03:39 +00:00
|
|
|
const ssat_t *ssat);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int outnmea_gsv(unsigned char *buff, const sol_t *sol,
|
2018-03-03 01:03:39 +00:00
|
|
|
const ssat_t *ssat);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int outprcopts(unsigned char *buff, const prcopt_t *opt);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int outsolheads(unsigned char *buff, const solopt_t *opt);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int outsols(unsigned char *buff, const sol_t *sol, const double *rb,
|
2018-03-03 01:03:39 +00:00
|
|
|
const solopt_t *opt);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
int outsolexs(unsigned char *buff, const sol_t *sol, const ssat_t *ssat,
|
2018-03-03 01:03:39 +00:00
|
|
|
const solopt_t *opt);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
void outprcopt(FILE *fp, const prcopt_t *opt);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
void outsolhead(FILE *fp, const solopt_t *opt);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
void outsol(FILE *fp, const sol_t *sol, const double *rb,
|
2018-03-03 01:03:39 +00:00
|
|
|
const solopt_t *opt);
|
2017-05-12 17:22:57 +00:00
|
|
|
|
2017-05-12 10:17:42 +00:00
|
|
|
void outsolex(FILE *fp, const sol_t *sol, const ssat_t *ssat,
|
2018-03-03 01:03:39 +00:00
|
|
|
const solopt_t *opt);
|
2017-05-12 10:17:42 +00:00
|
|
|
|
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
/** \} */
|
|
|
|
/** \} */
|
|
|
|
#endif // GNSS_SDR_RTKLIB_SOLUTION_H
|