MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_sol.c File Reference
#include "mrtklib/mrtk_sol.h"
#include <ctype.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "mrtklib/mrtk_coords.h"
#include "mrtklib/mrtk_sys.h"
#include "mrtklib/mrtk_trace.h"
Include dependency graph for mrtk_sol.c:

Go to the source code of this file.

Macros

#define SYS_NONE   0x00
#define SYS_GPS   0x01
#define SYS_SBS   0x02
#define SYS_GLO   0x04
#define SYS_GAL   0x08
#define SYS_QZS   0x10
#define SYS_CMP   0x20
#define SYS_IRN   0x40
#define COMMENTH   "%"
#define MSG_DISCONN   "$DISCONNECT"
#define SQR(x)
#define SQRT(x)
#define NMEA_TID   "GN" /* NMEA talker ID for RMC and GGA sentences */
#define MAXFIELD   64 /* max number of fields in a record */
#define MAXNMEA   256 /* max length of nmea sentence */
#define KNOT2M   0.514444444 /* m/knot */

Functions

double dms2deg (const double *dms)
void deg2dms (double deg, double *dms, int ndec)
double norm (const double *a, int n)
void covecef (const double *pos, const double *Q, double *P)
void enu2ecef (const double *pos, const double *e, double *r)
gtime_t gpst2time (int week, double sec)
double geoidh (const double *pos)
static const char * opt2sep (const solopt_t *opt)
static int tonum (char *buff, const char *sep, double *v)
static double sqvar (double covar)
static double dmm2deg (double dmm)
static void septime (double t, double *t1, double *t2, double *t3)
static void soltocov (const sol_t *sol, double *P)
static void covtosol (const double *P, sol_t *sol)
static void soltocov_vel (const sol_t *sol, double *P)
static void covtosol_vel (const double *P, sol_t *sol)
static int decode_nmearmc (char **val, int n, sol_t *sol)
static int decode_nmeazda (char **val, int n, sol_t *sol)
static int decode_nmeagga (char **val, int n, sol_t *sol)
static int test_nmea (const char *buff)
static int test_solstat (const char *buff)
static int decode_nmea (char *buff, sol_t *sol)
static char * decode_soltime (char *buff, const solopt_t *opt, gtime_t *time)
static int decode_solxyz (char *buff, const solopt_t *opt, sol_t *sol)
static int decode_solllh (char *buff, const solopt_t *opt, sol_t *sol)
static int decode_solenu (char *buff, const solopt_t *opt, sol_t *sol)
static int decode_solsss (char *buff, sol_t *sol)
static int decode_solgsi (char *buff, const solopt_t *opt, sol_t *sol)
static int decode_solpos (char *buff, const solopt_t *opt, sol_t *sol)
static void decode_refpos (char *buff, const solopt_t *opt, double *rb)
static int decode_sol (char *buff, const solopt_t *opt, sol_t *sol, double *rb)
static void decode_solopt (char *buff, solopt_t *opt)
static void readsolopt (FILE *fp, solopt_t *opt)
int inputsol (uint8_t data, gtime_t ts, gtime_t te, double tint, int qflag, const solopt_t *opt, solbuf_t *solbuf)
 Input solution data from stream.
static int readsoldata (FILE *fp, gtime_t ts, gtime_t te, double tint, int qflag, const solopt_t *opt, solbuf_t *solbuf)
static int cmpsol (const void *p1, const void *p2)
static int sort_solbuf (solbuf_t *solbuf)
int readsolt (char *files[], int nfile, gtime_t ts, gtime_t te, double tint, int qflag, solbuf_t *solbuf)
 Read solutions from files with time filter.
int readsol (char *files[], int nfile, solbuf_t *sol)
 Read solutions from files.
int addsol (solbuf_t *solbuf, const sol_t *sol)
 Add solution to buffer.
sol_t * getsol (solbuf_t *solbuf, int index)
 Get solution from buffer.
void initsolbuf (solbuf_t *solbuf, int cyclic, int nmax)
 Initialize solution buffer.
void freesolbuf (solbuf_t *solbuf)
 Free solution buffer memory.
void freesolstatbuf (solstatbuf_t *solstatbuf)
 Free solution status buffer memory.
static int cmpsolstat (const void *p1, const void *p2)
static int sort_solstat (solstatbuf_t *statbuf)
static int decode_solstat (char *buff, solstat_t *stat)
static void addsolstat (solstatbuf_t *statbuf, const solstat_t *stat)
static int readsolstatdata (FILE *fp, gtime_t ts, gtime_t te, double tint, solstatbuf_t *statbuf)
int readsolstatt (char *files[], int nfile, gtime_t ts, gtime_t te, double tint, solstatbuf_t *statbuf)
 Read solution status from files with time filter.
int readsolstat (char *files[], int nfile, solstatbuf_t *statbuf)
 Read solution status from files.
static int outecef (uint8_t *buff, const char *s, const sol_t *sol, const solopt_t *opt)
static int outpos (uint8_t *buff, const char *s, const sol_t *sol, const solopt_t *opt)
static int outenu (uint8_t *buff, const char *s, const sol_t *sol, const double *rb, const solopt_t *opt)
int outnmea_rmc (uint8_t *buff, const sol_t *sol)
 Output NMEA RMC sentence.
int outnmea_gga (uint8_t *buff, const sol_t *sol)
 Output NMEA GGA sentence.
int outnmea_gsa (uint8_t *buff, const sol_t *sol, const ssat_t *ssat)
 Output NMEA GSA sentence.
int outnmea_gsv (uint8_t *buff, const sol_t *sol, const ssat_t *ssat)
 Output NMEA GSV sentence.
int outprcopts (uint8_t *buff, const prcopt_t *opt)
 Output processing options to buffer.
int outsolheads (uint8_t *buff, const solopt_t *opt)
 Output solution header to buffer.
static double sol_std (const sol_t *sol)
int outsols (uint8_t *buff, const sol_t *sol, const double *rb, const solopt_t *opt)
 Output solution to buffer.
int outsolexs (uint8_t *buff, const sol_t *sol, const ssat_t *ssat, const solopt_t *opt)
 Output solution extended data to buffer.
void outprcopt (FILE *fp, const prcopt_t *opt)
 Output processing options to file.
void outsolhead (FILE *fp, const solopt_t *opt)
 Output solution header to file.
void outsol (FILE *fp, const sol_t *sol, const double *rb, const solopt_t *opt)
 Output solution to file.
void outsolex (FILE *fp, const sol_t *sol, const ssat_t *ssat, const solopt_t *opt)
 Output solution extended data to file.

Variables

static const double PI = 3.1415926535897932
static const double D2R = 3.1415926535897932 / 180.0
static const double R2D = 180.0 / 3.1415926535897932
static const double RE_WGS84 = 6378137.0
static const double FE_WGS84 = 1.0 / 298.257223563
static const int nmea_sys []
static const char * nmea_tid []
static const int nmea_sid []
static const int nmea_solq []

Macro Definition Documentation

◆ COMMENTH

#define COMMENTH   "%"

Definition at line 43 of file mrtk_sol.c.

◆ KNOT2M

#define KNOT2M   0.514444444 /* m/knot */

Definition at line 64 of file mrtk_sol.c.

Referenced by outnmea_rmc().

◆ MAXFIELD

#define MAXFIELD   64 /* max number of fields in a record */

◆ MAXNMEA

#define MAXNMEA   256 /* max length of nmea sentence */

Definition at line 62 of file mrtk_sol.c.

◆ MSG_DISCONN

#define MSG_DISCONN   "$DISCONNECT"

Definition at line 44 of file mrtk_sol.c.

Referenced by inputsol().

◆ NMEA_TID

#define NMEA_TID   "GN" /* NMEA talker ID for RMC and GGA sentences */

Definition at line 60 of file mrtk_sol.c.

Referenced by outnmea_gga(), and outnmea_rmc().

◆ SQR

#define SQR ( x)
Value:
((x) < 0.0 ? -(x) * (x) : (x) * (x))

Definition at line 57 of file mrtk_sol.c.

Referenced by decode_solenu(), decode_solllh(), decode_solsss(), and decode_solxyz().

◆ SQRT

#define SQRT ( x)
Value:
((x) < 0.0 || (x) != (x) ? 0.0 : sqrt(x))

Definition at line 58 of file mrtk_sol.c.

Referenced by outenu(), outpos(), and sol_std().

◆ SYS_CMP

#define SYS_CMP   0x20

Definition at line 34 of file mrtk_sol.c.

◆ SYS_GAL

#define SYS_GAL   0x08

Definition at line 32 of file mrtk_sol.c.

◆ SYS_GLO

#define SYS_GLO   0x04

Definition at line 31 of file mrtk_sol.c.

◆ SYS_GPS

#define SYS_GPS   0x01

Definition at line 29 of file mrtk_sol.c.

◆ SYS_IRN

#define SYS_IRN   0x40

Definition at line 35 of file mrtk_sol.c.

◆ SYS_NONE

#define SYS_NONE   0x00

Definition at line 28 of file mrtk_sol.c.

◆ SYS_QZS

#define SYS_QZS   0x10

Definition at line 33 of file mrtk_sol.c.

◆ SYS_SBS

#define SYS_SBS   0x02

Definition at line 30 of file mrtk_sol.c.

Function Documentation

◆ addsol()

int addsol ( solbuf_t * solbuf,
const sol_t * sol )

Add solution to buffer.

Parameters
[in,out]solbufSolution buffer
[in]solSolution data
Returns
Status (1:ok, 0:error)

Definition at line 1017 of file mrtk_sol.c.

References solbuf_t::cyclic, solbuf_t::data, solbuf_t::end, free, solbuf_t::n, solbuf_t::nmax, solbuf_t::start, and trace().

Referenced by inputsol().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addsolstat()

void addsolstat ( solstatbuf_t * statbuf,
const solstat_t * stat )
static

Definition at line 1213 of file mrtk_sol.c.

References solstatbuf_t::data, free, solstatbuf_t::n, solstatbuf_t::nmax, and trace().

Referenced by readsolstatdata().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmpsol()

int cmpsol ( const void * p1,
const void * p2 )
static

Definition at line 930 of file mrtk_sol.c.

References gtime_t::time, sol_t::time, and timediff().

Referenced by sort_solbuf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmpsolstat()

int cmpsolstat ( const void * p1,
const void * p2 )
static

Definition at line 1131 of file mrtk_sol.c.

References gtime_t::time, solstat_t::time, and timediff().

Referenced by sort_solstat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ covecef()

void covecef ( const double * pos,
const double * Q,
double * P )
extern

Definition at line 202 of file mrtk_coords.c.

Referenced by decode_solllh().

Here is the caller graph for this function:

◆ covtosol()

void covtosol ( const double * P,
sol_t * sol )
static

Definition at line 132 of file mrtk_sol.c.

References sol_t::qr.

Referenced by decode_solenu(), decode_solllh(), and decode_solxyz().

Here is the caller graph for this function:

◆ covtosol_vel()

void covtosol_vel ( const double * P,
sol_t * sol )
static

Definition at line 150 of file mrtk_sol.c.

References sol_t::qv.

Referenced by decode_solllh(), and decode_solxyz().

Here is the caller graph for this function:

◆ decode_nmea()

int decode_nmea ( char * buff,
sol_t * sol )
static

Definition at line 369 of file mrtk_sol.c.

References decode_nmeagga(), decode_nmearmc(), decode_nmeazda(), MAXFIELD, and trace().

Referenced by decode_sol().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_nmeagga()

int decode_nmeagga ( char ** val,
int n,
sol_t * sol )
static

Definition at line 262 of file mrtk_sol.c.

References sol_t::age, D2R, dmm2deg(), epoch2time(), nmea_solq, sol_t::ns, pos2ecef(), sol_t::rr, septime(), SOLQ_NONE, sol_t::stat, gtime_t::time, sol_t::time, time2epoch(), time_str(), timeadd(), timediff(), trace(), sol_t::type, and utc2gpst().

Referenced by decode_nmea().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_nmearmc()

int decode_nmearmc ( char ** val,
int n,
sol_t * sol )
static

Definition at line 159 of file mrtk_sol.c.

References D2R, dmm2deg(), epoch2time(), sol_t::ns, pos2ecef(), sol_t::rr, septime(), SOLQ_DGPS, SOLQ_SINGLE, sol_t::stat, sol_t::time, time_str(), trace(), sol_t::type, and utc2gpst().

Referenced by decode_nmea().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_nmeazda()

int decode_nmeazda ( char ** val,
int n,
sol_t * sol )
static

Definition at line 231 of file mrtk_sol.c.

References epoch2time(), sol_t::ns, septime(), sol_t::time, time_str(), trace(), and utc2gpst().

Referenced by decode_nmea().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_refpos()

void decode_refpos ( char * buff,
const solopt_t * opt,
double * rb )
static

Definition at line 755 of file mrtk_sol.c.

References D2R, solopt_t::degf, dms2deg(), MAXFIELD, opt2sep(), pos2ecef(), solopt_t::posf, SOLF_XYZ, tonum(), and trace().

Referenced by decode_sol().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_sol()

int decode_sol ( char * buff,
const solopt_t * opt,
sol_t * sol,
double * rb )
static

Definition at line 783 of file mrtk_sol.c.

References COMMENTH, decode_nmea(), decode_refpos(), decode_solpos(), decode_solsss(), test_nmea(), test_solstat(), and trace().

Referenced by inputsol().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_solenu()

int decode_solenu ( char * buff,
const solopt_t * opt,
sol_t * sol )
static

Definition at line 634 of file mrtk_sol.c.

References sol_t::age, covtosol(), MAXFIELD, MAXSOLQ, sol_t::ns, opt2sep(), sol_t::ratio, sol_t::rr, SOLQ_NONE, SQR, sol_t::stat, tonum(), trace(), and sol_t::type.

Referenced by decode_solpos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_solgsi()

int decode_solgsi ( char * buff,
const solopt_t * opt,
sol_t * sol )
static

Definition at line 712 of file mrtk_sol.c.

References MAXFIELD, sol_t::rr, SOLQ_FIX, sol_t::stat, tonum(), and trace().

Referenced by decode_solpos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_solllh()

int decode_solllh ( char * buff,
const solopt_t * opt,
sol_t * sol )
static

Definition at line 542 of file mrtk_sol.c.

References sol_t::age, covecef(), covtosol(), covtosol_vel(), D2R, solopt_t::degf, dms2deg(), enu2ecef(), MAXFIELD, MAXSOLQ, sol_t::ns, opt2sep(), pos2ecef(), sol_t::ratio, sol_t::rr, SOLQ_NONE, SQR, sol_t::stat, tonum(), trace(), and sol_t::type.

Referenced by decode_solpos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_solopt()

void decode_solopt ( char * buff,
solopt_t * opt )
static

Definition at line 807 of file mrtk_sol.c.

References COMMENTH, solopt_t::degf, solopt_t::posf, solopt_t::sep, SOLF_ENU, SOLF_GSIF, SOLF_LLH, SOLF_XYZ, solopt_t::times, TIMES_GPST, TIMES_JST, TIMES_UTC, and trace().

Referenced by readsolopt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_solpos()

int decode_solpos ( char * buff,
const solopt_t * opt,
sol_t * sol )
static

Definition at line 729 of file mrtk_sol.c.

References decode_solenu(), decode_solgsi(), decode_solllh(), decode_soltime(), decode_solxyz(), solopt_t::posf, SOLF_ENU, SOLF_GSIF, SOLF_LLH, SOLF_XYZ, sol_t::time, and trace().

Referenced by decode_sol().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_solsss()

int decode_solsss ( char * buff,
sol_t * sol )
static

Definition at line 686 of file mrtk_sol.c.

References sol_t::age, sol_t::dtr, gpst2time(), norm(), sol_t::ns, sol_t::qr, sol_t::ratio, sol_t::rr, SOLQ_NONE, SQR, sol_t::stat, sol_t::thres, sol_t::time, trace(), and sol_t::type.

Referenced by decode_sol().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_solstat()

int decode_solstat ( char * buff,
solstat_t * stat )
static

Definition at line 1167 of file mrtk_sol.c.

References solstat_t::az, D2R, solstat_t::el, solstat_t::flag, solstat_t::frq, gpst2time(), solstat_t::lock, solstat_t::outc, solstat_t::rejc, solstat_t::resc, solstat_t::resp, solstat_t::sat, satid2no(), solstat_t::slipc, solstat_t::snr, SNR_UNIT, solstat_t::time, and trace().

Referenced by readsolstatdata().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_soltime()

char * decode_soltime ( char * buff,
const solopt_t * opt,
gtime_t * time )
static

Definition at line 397 of file mrtk_sol.c.

References epoch2time(), gpst2time(), MAXFIELD, solopt_t::posf, solopt_t::sep, SOLF_GSIF, SOLF_STAT, timeadd(), solopt_t::times, TIMES_JST, TIMES_UTC, trace(), and utc2gpst().

Referenced by decode_solpos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_solxyz()

int decode_solxyz ( char * buff,
const solopt_t * opt,
sol_t * sol )
static

Definition at line 465 of file mrtk_sol.c.

References sol_t::age, covtosol(), covtosol_vel(), MAXFIELD, MAXSOLQ, sol_t::ns, opt2sep(), sol_t::ratio, sol_t::rr, SOLQ_NONE, SQR, sol_t::stat, tonum(), trace(), and sol_t::type.

Referenced by decode_solpos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deg2dms()

void deg2dms ( double deg,
double * dms,
int ndec )
extern

Definition at line 63 of file mrtk_coords.c.

Referenced by outnmea_gga(), outnmea_rmc(), and outpos().

Here is the caller graph for this function:

◆ dmm2deg()

double dmm2deg ( double dmm)
static

Definition at line 114 of file mrtk_sol.c.

Referenced by decode_nmeagga(), and decode_nmearmc().

Here is the caller graph for this function:

◆ dms2deg()

double dms2deg ( const double * dms)
extern

Definition at line 86 of file mrtk_coords.c.

Referenced by decode_refpos(), and decode_solllh().

Here is the caller graph for this function:

◆ enu2ecef()

void enu2ecef ( const double * pos,
const double * e,
double * r )
extern

Definition at line 175 of file mrtk_coords.c.

Referenced by decode_solllh().

Here is the caller graph for this function:

◆ freesolbuf()

void freesolbuf ( solbuf_t * solbuf)

Free solution buffer memory.

Parameters
[in,out]solbufSolution buffer

Definition at line 1111 of file mrtk_sol.c.

References solbuf_t::data, solbuf_t::end, free, solbuf_t::n, solbuf_t::nb, solbuf_t::nmax, solbuf_t::rb, solbuf_t::start, and trace().

Here is the call graph for this function:

◆ freesolstatbuf()

void freesolstatbuf ( solstatbuf_t * solstatbuf)

Free solution status buffer memory.

Parameters
[in,out]solstatbufSolution status buffer

Definition at line 1123 of file mrtk_sol.c.

References solstatbuf_t::data, free, solstatbuf_t::n, solstatbuf_t::nmax, and trace().

Here is the call graph for this function:

◆ geoidh()

double geoidh ( const double * pos)
extern

Definition at line 268 of file mrtk_geoid.c.

Referenced by outnmea_gga(), and outpos().

Here is the caller graph for this function:

◆ getsol()

sol_t * getsol ( solbuf_t * solbuf,
int index )

Get solution from buffer.

Parameters
[in,out]solbufSolution buffer
[in]indexSolution index (0 to n-1)
Returns
Solution data pointer (NULL: out of range)

Definition at line 1060 of file mrtk_sol.c.

References solbuf_t::data, solbuf_t::nmax, solbuf_t::start, and trace().

Here is the call graph for this function:

◆ gpst2time()

gtime_t gpst2time ( int week,
double sec )
extern

Definition at line 165 of file mrtk_time.c.

Referenced by decode_solsss(), decode_solstat(), and decode_soltime().

Here is the caller graph for this function:

◆ initsolbuf()

void initsolbuf ( solbuf_t * solbuf,
int cyclic,
int nmax )

Initialize solution buffer.

Parameters
[out]solbufSolution buffer
[in]cyclicCyclic buffer flag (0:off, 1:on)
[in]nmaxMax number of solutions (0:default)

Definition at line 1078 of file mrtk_sol.c.

References solbuf_t::cyclic, solbuf_t::data, solbuf_t::end, malloc, solbuf_t::n, solbuf_t::nb, solbuf_t::nmax, solbuf_t::rb, solbuf_t::start, solbuf_t::time, and trace().

Referenced by readsolt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ inputsol()

int inputsol ( uint8_t data,
gtime_t ts,
gtime_t te,
double tint,
int qflag,
const solopt_t * opt,
solbuf_t * solbuf )

Input solution data from stream.

Parameters
[in]dataStream data byte
[in]tsStart time (GPST)
[in]teEnd time (GPST)
[in]tintTime interval (s)
[in]qflagQuality flag (0:all)
[in]optSolution options
[in,out]solbufSolution buffer
Returns
Status (0:no data, 1:new solution)

Definition at line 874 of file mrtk_sol.c.

References addsol(), solbuf_t::buff, decode_sol(), MAXSOLMSG, MSG_DISCONN, solbuf_t::nb, solbuf_t::rb, screent(), sol_t::stat, sol_t::time, solbuf_t::time, and trace().

Referenced by readsoldata().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ norm()

double norm ( const double * a,
int n )
extern

Definition at line 165 of file mrtk_mat.c.

Referenced by decode_solsss(), and outnmea_rmc().

Here is the caller graph for this function:

◆ opt2sep()

const char * opt2sep ( const solopt_t * opt)
static

Definition at line 85 of file mrtk_sol.c.

References solopt_t::sep.

Referenced by decode_refpos(), decode_solenu(), decode_solllh(), decode_solxyz(), outecef(), outenu(), outpos(), outsolheads(), and outsols().

Here is the caller graph for this function:

◆ outecef()

int outecef ( uint8_t * buff,
const char * s,
const sol_t * sol,
const solopt_t * opt )
static

Definition at line 1301 of file mrtk_sol.c.

References sol_t::age, sol_t::ns, opt2sep(), solopt_t::outvel, sol_t::qr, sol_t::qv, sol_t::ratio, sol_t::rr, SQRT, sqvar(), sol_t::stat, and trace().

Referenced by outsols().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ outenu()

int outenu ( uint8_t * buff,
const char * s,
const sol_t * sol,
const double * rb,
const solopt_t * opt )
static

Definition at line 1366 of file mrtk_sol.c.

References sol_t::age, covenu(), ecef2enu(), ecef2pos(), sol_t::ns, opt2sep(), sol_t::ratio, sol_t::rr, soltocov(), SQRT, sqvar(), sol_t::stat, and trace().

Referenced by outsols().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ outnmea_gga()

int outnmea_gga ( uint8_t * buff,
const sol_t * sol )

Output NMEA GGA sentence.

Parameters
[out]buffOutput buffer
[in]solSolution data
Returns
Number of output bytes

Definition at line 1447 of file mrtk_sol.c.

References sol_t::age, deg2dms(), ecef2pos(), geoidh(), gpst2utc(), nmea_solq, NMEA_TID, sol_t::ns, R2D, sol_t::rr, gtime_t::sec, SOLQ_NONE, sol_t::stat, gtime_t::time, sol_t::time, time2epoch(), and trace().

Referenced by outsols(), and strsendnmea().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ outnmea_gsa()

int outnmea_gsa ( uint8_t * buff,
const sol_t * sol,
const ssat_t * ssat )

Output NMEA GSA sentence.

Parameters
[out]buffOutput buffer
[in]solSolution data
[in]ssatSatellite status
Returns
Number of output bytes

Definition at line 1493 of file mrtk_sol.c.

References ssat_t::azel, dops(), MAXSAT, nmea_sid, nmea_sys, nmea_tid, satsys(), sol_t::stat, SYS_GLO, SYS_QZS, SYS_SBS, and trace().

Referenced by outsolexs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ outnmea_gsv()

int outnmea_gsv ( uint8_t * buff,
const sol_t * sol,
const ssat_t * ssat )

Output NMEA GSV sentence.

Parameters
[out]buffOutput buffer
[in]solSolution data
[in]ssatSatellite status
Returns
Number of output bytes

Definition at line 1552 of file mrtk_sol.c.

References ssat_t::azel, MAXSAT, nmea_sys, nmea_tid, R2D, satsys(), ssat_t::snr, SNR_UNIT, SYS_GLO, SYS_QZS, SYS_SBS, and trace().

Referenced by outsolexs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ outnmea_rmc()

int outnmea_rmc ( uint8_t * buff,
const sol_t * sol )

Output NMEA RMC sentence.

Parameters
[out]buffOutput buffer
[in]solSolution data
Returns
Number of output bytes

Definition at line 1390 of file mrtk_sol.c.

References deg2dms(), ecef2enu(), ecef2pos(), gpst2utc(), KNOT2M, NMEA_TID, norm(), R2D, sol_t::rr, gtime_t::sec, SOLQ_DGPS, SOLQ_FIX, SOLQ_FLOAT, SOLQ_NONE, SOLQ_PPP, SOLQ_SBAS, sol_t::stat, gtime_t::time, sol_t::time, time2epoch(), and trace().

Referenced by outsols().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ outpos()

int outpos ( uint8_t * buff,
const char * s,
const sol_t * sol,
const solopt_t * opt )
static

Definition at line 1325 of file mrtk_sol.c.

References sol_t::age, covenu(), deg2dms(), solopt_t::degf, ecef2enu(), ecef2pos(), geoidh(), solopt_t::height, sol_t::ns, opt2sep(), solopt_t::outvel, R2D, sol_t::ratio, sol_t::rr, soltocov(), soltocov_vel(), SQRT, sqvar(), sol_t::stat, and trace().

Referenced by outsols().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ outprcopt()

void outprcopt ( FILE * fp,
const prcopt_t * opt )

Output processing options to file.

Parameters
[in]fpOutput file pointer
[in]optProcessing options

Definition at line 1871 of file mrtk_sol.c.

References MAXSOLMSG, outprcopts(), and trace().

Referenced by outheader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ outprcopts()

int outprcopts ( uint8_t * buff,
const prcopt_t * opt )

Output processing options to buffer.

Parameters
[out]buffOutput buffer
[in]optProcessing options
Returns
Number of output bytes

Definition at line 1609 of file mrtk_sol.c.

References prcopt_t::antdel, prcopt_t::anttype, prcopt_t::arsys, prcopt_t::baseline, COMMENTH, prcopt_t::dynamics, prcopt_t::elmin, prcopt_t::ionoopt, prcopt_t::mode, prcopt_t::modear, prcopt_t::navsys, prcopt_t::nf, PMODE_DGPS, PMODE_FIXED, PMODE_KINEMA, PMODE_MOVEB, PMODE_PPP_FIXED, PMODE_SINGLE, R2D, prcopt_t::sateph, prcopt_t::soltype, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_QZS, SYS_SBS, prcopt_t::thresar, prcopt_t::tidecorr, trace(), and prcopt_t::tropopt.

Referenced by outprcopt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ outsol()

void outsol ( FILE * fp,
const sol_t * sol,
const double * rb,
const solopt_t * opt )

Output solution to file.

Parameters
[in]fpOutput file pointer
[in]solSolution data
[in]rbReference position (ecef) (m)
[in]optSolution options

Definition at line 1905 of file mrtk_sol.c.

References MAXSOLMSG, outsols(), and trace().

Referenced by combres(), and procpos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ outsolex()

void outsolex ( FILE * fp,
const sol_t * sol,
const ssat_t * ssat,
const solopt_t * opt )

Output solution extended data to file.

Parameters
[in]fpOutput file pointer
[in]solSolution data
[in]ssatSatellite status
[in]optSolution options

Definition at line 1924 of file mrtk_sol.c.

References MAXSOLMSG, outsolexs(), and trace().

Here is the call graph for this function:

◆ outsolexs()

int outsolexs ( uint8_t * buff,
const sol_t * sol,
const ssat_t * ssat,
const solopt_t * opt )

Output solution extended data to buffer.

Parameters
[out]buffOutput buffer
[in]solSolution data
[in]ssatSatellite status
[in]optSolution options
Returns
Number of output bytes

Definition at line 1841 of file mrtk_sol.c.

References solopt_t::maxsolstd, solopt_t::nmeaintv, outnmea_gsa(), outnmea_gsv(), solopt_t::posf, screent(), sol_std(), SOLF_NMEA, sol_t::time, and trace().

Referenced by outsolex(), and writesol().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ outsolhead()

void outsolhead ( FILE * fp,
const solopt_t * opt )

Output solution header to file.

Parameters
[in]fpOutput file pointer
[in]optSolution options

Definition at line 1887 of file mrtk_sol.c.

References MAXSOLMSG, outsolheads(), and trace().

Referenced by outheader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ outsolheads()

int outsolheads ( uint8_t * buff,
const solopt_t * opt )

Output solution header to buffer.

Parameters
[out]buffOutput buffer
[in]optSolution options
Returns
Number of output bytes

Definition at line 1683 of file mrtk_sol.c.

References COMMENTH, solopt_t::datum, solopt_t::degf, solopt_t::height, opt2sep(), solopt_t::outhead, solopt_t::outvel, solopt_t::posf, SOLF_ENU, SOLF_GSIF, SOLF_LLH, SOLF_NMEA, SOLF_STAT, SOLF_XYZ, solopt_t::timef, solopt_t::times, solopt_t::timeu, and trace().

Referenced by outsolhead(), and writesolhead().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ outsols()

int outsols ( uint8_t * buff,
const sol_t * sol,
const double * rb,
const solopt_t * opt )

Output solution to buffer.

Parameters
[out]buffOutput buffer
[in]solSolution data
[in]rbReference position (ecef) (m)
[in]optSolution options
Returns
Number of output bytes

Definition at line 1770 of file mrtk_sol.c.

References gpst2utc(), solopt_t::maxsolstd, solopt_t::nmeaintv, norm(), opt2sep(), outecef(), outenu(), outnmea_gga(), outnmea_rmc(), outpos(), solopt_t::posf, screent(), sol_std(), SOLF_ENU, SOLF_LLH, SOLF_NMEA, SOLF_XYZ, SOLQ_NONE, sol_t::stat, sol_t::time, time2gpst(), time2str(), timeadd(), solopt_t::timef, solopt_t::times, TIMES_JST, TIMES_UTC, solopt_t::timeu, and trace().

Referenced by outsol(), and writesol().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readsol()

int readsol ( char * files[],
int nfile,
solbuf_t * sol )

Read solutions from files.

Parameters
[in]filesSolution file paths
[in]nfileNumber of files
[out]solSolution buffer
Returns
Status (1:ok, 0:error)

Definition at line 1004 of file mrtk_sol.c.

References readsolt(), and trace().

Here is the call graph for this function:

◆ readsoldata()

int readsoldata ( FILE * fp,
gtime_t ts,
gtime_t te,
double tint,
int qflag,
const solopt_t * opt,
solbuf_t * solbuf )
static

Definition at line 917 of file mrtk_sol.c.

References inputsol(), solbuf_t::n, and trace().

Referenced by readsolt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readsolopt()

void readsolopt ( FILE * fp,
solopt_t * opt )
static

Definition at line 852 of file mrtk_sol.c.

References decode_solopt(), MAXSOLMSG, and trace().

Referenced by readsolt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readsolstat()

int readsolstat ( char * files[],
int nfile,
solstatbuf_t * statbuf )

Read solution status from files.

Parameters
[in]filesSolution status file paths
[in]nfileNumber of files
[out]statbufSolution status buffer
Returns
Status (1:ok, 0:error)

Definition at line 1293 of file mrtk_sol.c.

References readsolstatt(), and trace().

Here is the call graph for this function:

◆ readsolstatdata()

int readsolstatdata ( FILE * fp,
gtime_t ts,
gtime_t te,
double tint,
solstatbuf_t * statbuf )
static

Definition at line 1232 of file mrtk_sol.c.

References addsolstat(), decode_solstat(), MAXSOLMSG, solstatbuf_t::n, screent(), solstat_t::time, and trace().

Referenced by readsolstatt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readsolstatt()

int readsolstatt ( char * files[],
int nfile,
gtime_t ts,
gtime_t te,
double tint,
solstatbuf_t * statbuf )

Read solution status from files with time filter.

Parameters
[in]filesSolution status file paths
[in]nfileNumber of files
[in]tsStart time (GPST)
[in]teEnd time (GPST)
[in]tintTime interval (s)
[out]statbufSolution status buffer
Returns
Status (1:ok, 0:error)

Definition at line 1261 of file mrtk_sol.c.

References solstatbuf_t::data, solstatbuf_t::n, solstatbuf_t::nmax, readsolstatdata(), sort_solstat(), and trace().

Referenced by readsolstat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readsolt()

int readsolt ( char * files[],
int nfile,
gtime_t ts,
gtime_t te,
double tint,
int qflag,
solbuf_t * sol )

Read solutions from files with time filter.

Parameters
[in]filesSolution file paths
[in]nfileNumber of files
[in]tsStart time (GPST) (ts.time==0: no limit)
[in]teEnd time (GPST) (te.time==0: no limit)
[in]tintTime interval (s) (0.0: no limit)
[in]qflagQuality flag (0:all)
[out]solSolution buffer
Returns
Status (1:ok, 0:error)

Definition at line 978 of file mrtk_sol.c.

References initsolbuf(), readsoldata(), readsolopt(), solopt_default, sort_solbuf(), and trace().

Referenced by readsol().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ septime()

void septime ( double t,
double * t1,
double * t2,
double * t3 )
static

Definition at line 116 of file mrtk_sol.c.

Referenced by decode_nmeagga(), decode_nmearmc(), and decode_nmeazda().

Here is the caller graph for this function:

◆ sol_std()

double sol_std ( const sol_t * sol)
static

Definition at line 1752 of file mrtk_sol.c.

References sol_t::qr, and SQRT.

Referenced by outsolexs(), and outsols().

Here is the caller graph for this function:

◆ soltocov()

void soltocov ( const sol_t * sol,
double * P )
static

Definition at line 123 of file mrtk_sol.c.

References sol_t::qr.

Referenced by outenu(), and outpos().

Here is the caller graph for this function:

◆ soltocov_vel()

void soltocov_vel ( const sol_t * sol,
double * P )
static

Definition at line 141 of file mrtk_sol.c.

References sol_t::qv.

Referenced by outpos().

Here is the caller graph for this function:

◆ sort_solbuf()

int sort_solbuf ( solbuf_t * solbuf)
static

Definition at line 936 of file mrtk_sol.c.

References cmpsol(), solbuf_t::data, solbuf_t::end, free, solbuf_t::n, solbuf_t::nmax, solbuf_t::start, sol_t::time, timediff(), and trace().

Referenced by readsolt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sort_solstat()

int sort_solstat ( solstatbuf_t * statbuf)
static

Definition at line 1137 of file mrtk_sol.c.

References cmpsolstat(), solstatbuf_t::data, free, solstatbuf_t::n, solstatbuf_t::nmax, solstat_t::time, timediff(), and trace().

Referenced by readsolstatt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sqvar()

double sqvar ( double covar)
static

Definition at line 112 of file mrtk_sol.c.

Referenced by outecef(), outenu(), and outpos().

Here is the caller graph for this function:

◆ test_nmea()

int test_nmea ( const char * buff)
static

Definition at line 350 of file mrtk_sol.c.

Referenced by decode_sol().

Here is the caller graph for this function:

◆ test_solstat()

int test_solstat ( const char * buff)
static

Definition at line 360 of file mrtk_sol.c.

Referenced by decode_sol().

Here is the caller graph for this function:

◆ tonum()

int tonum ( char * buff,
const char * sep,
double * v )
static

Definition at line 94 of file mrtk_sol.c.

References MAXFIELD.

Referenced by decode_refpos(), decode_solenu(), decode_solgsi(), decode_solllh(), and decode_solxyz().

Here is the caller graph for this function:

Variable Documentation

◆ D2R

const double D2R = 3.1415926535897932 / 180.0
static

Definition at line 38 of file mrtk_sol.c.

◆ FE_WGS84

const double FE_WGS84 = 1.0 / 298.257223563
static

Definition at line 41 of file mrtk_sol.c.

◆ nmea_sid

const int nmea_sid[]
static
Initial value:
= {
1, 2, 3, 4, 5, 6, 0}

Definition at line 70 of file mrtk_sol.c.

Referenced by outnmea_gsa().

◆ nmea_solq

const int nmea_solq[]
static
Initial value:
= {
#define SOLQ_DR
Definition mrtk_opt.h:77
#define SOLQ_SINGLE
Definition mrtk_opt.h:75
#define SOLQ_FLOAT
Definition mrtk_opt.h:72
#define SOLQ_DGPS
Definition mrtk_opt.h:74
#define SOLQ_NONE
Definition mrtk_opt.h:70
#define SOLQ_PPP
Definition mrtk_opt.h:76
#define SOLQ_FIX
Definition mrtk_opt.h:71

Definition at line 72 of file mrtk_sol.c.

Referenced by decode_nmeagga(), and outnmea_gga().

◆ nmea_sys

const int nmea_sys[]
static
Initial value:
= {
0x01 | 0x02 , 0x04 , 0x08 , 0x20 , 0x10 , 0x40 , 0}

Definition at line 66 of file mrtk_sol.c.

Referenced by outnmea_gsa(), and outnmea_gsv().

◆ nmea_tid

const char* nmea_tid[]
static
Initial value:
= {
"GP", "GL", "GA", "GB", "GQ", "GI", ""}

Definition at line 68 of file mrtk_sol.c.

Referenced by outnmea_gsa(), and outnmea_gsv().

◆ PI

const double PI = 3.1415926535897932
static

Definition at line 37 of file mrtk_sol.c.

◆ R2D

const double R2D = 180.0 / 3.1415926535897932
static

Definition at line 39 of file mrtk_sol.c.

◆ RE_WGS84

const double RE_WGS84 = 6378137.0
static

Definition at line 40 of file mrtk_sol.c.