MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_sol.h File Reference

MRTKLIB Solution Module — Solution data types and I/O functions. More...

#include <stdint.h>
#include <stdio.h>
#include "mrtklib/mrtk_foundation.h"
#include "mrtklib/mrtk_opt.h"
#include "mrtklib/mrtk_time.h"
Include dependency graph for mrtk_sol.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sol_t
struct  solbuf_t
struct  solstat_t
struct  solstatbuf_t
struct  ssat_t

Functions

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.
sol_t * getsol (solbuf_t *solbuf, int index)
 Get solution from buffer.
int addsol (solbuf_t *solbuf, const sol_t *sol)
 Add solution to buffer.
int readsol (char *files[], int nfile, solbuf_t *sol)
 Read solutions from files.
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.
int readsolstat (char *files[], int nfile, solstatbuf_t *statbuf)
 Read solution status from files.
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 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.
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.
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.
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.

Detailed Description

MRTKLIB Solution Module — Solution data types and I/O functions.

This header provides the solution data structures (sol_t, solbuf_t, solstat_t, solstatbuf_t, ssat_t) and solution I/O functions extracted from rtklib.h/solution.c with zero algorithmic changes.

Note
Functions declared here are implemented in mrtk_sol.c.

Definition in file mrtk_sol.h.

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:

◆ 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:

◆ 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:

◆ 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:

◆ 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:

◆ 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:

◆ 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:

◆ 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: