|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
MRTKLIB SBAS Module — SBAS message decoding and corrections. More...
#include "mrtklib/mrtk_sbas.h"#include <math.h>#include <stdlib.h>#include <string.h>#include "mrtklib/mrtk_atmos.h"#include "mrtklib/mrtk_bits.h"#include "mrtklib/mrtk_sys.h"#include "mrtklib/mrtk_trace.h"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_QZS 0x10 |
| #define | P2_11 4.882812500000000E-04 /* 2^-11 */ |
| #define | P2_31 4.656612873077393E-10 /* 2^-31 */ |
| #define | P2_39 1.818989403545856E-12 /* 2^-39 */ |
| #define | MAXSBSAGEF 30.0 /* max age of SBAS fast correction (s) */ |
| #define | MAXSBSAGEL 1800.0 /* max age of SBAS long term corr (s) */ |
| #define | WEEKOFFSET 1024 /* gps week offset for NovAtel OEM-3 */ |
Functions | |
| static char * | getfield (char *p, int pos) |
| static double | varfcorr (int udre) |
| static double | varicorr (int give) |
| static double | degfcorr (int ai) |
| static int | decode_sbstype1 (const sbsmsg_t *msg, sbssat_t *sbssat) |
| static int | decode_sbstype2 (const sbsmsg_t *msg, sbssat_t *sbssat) |
| static int | decode_sbstype6 (const sbsmsg_t *msg, sbssat_t *sbssat) |
| static int | decode_sbstype7 (const sbsmsg_t *msg, sbssat_t *sbssat) |
| static int | decode_sbstype9 (const sbsmsg_t *msg, nav_t *nav) |
| static int | decode_sbstype18 (const sbsmsg_t *msg, sbsion_t *sbsion) |
| static int | decode_longcorr0 (const sbsmsg_t *msg, int p, sbssat_t *sbssat) |
| static int | decode_longcorr1 (const sbsmsg_t *msg, int p, sbssat_t *sbssat) |
| static int | decode_longcorrh (const sbsmsg_t *msg, int p, sbssat_t *sbssat) |
| static int | decode_sbstype24 (const sbsmsg_t *msg, sbssat_t *sbssat) |
| static int | decode_sbstype25 (const sbsmsg_t *msg, sbssat_t *sbssat) |
| static int | decode_sbstype26 (const sbsmsg_t *msg, sbsion_t *sbsion) |
| int | sbsupdatecorr (const sbsmsg_t *msg, nav_t *nav) |
| Update SBAS corrections in navigation data. | |
| static void | readmsgs (const char *file, int sel, gtime_t ts, gtime_t te, sbs_t *sbs) |
| static int | cmpmsgs (const void *p1, const void *p2) |
| int | sbsreadmsgt (const char *file, int sel, gtime_t ts, gtime_t te, sbs_t *sbs) |
| Read SBAS message file with time span. | |
| int | sbsreadmsg (const char *file, int sel, sbs_t *sbs) |
| Read SBAS message file. | |
| void | sbsoutmsg (FILE *fp, sbsmsg_t *sbsmsg) |
| Output SBAS message record. | |
| static void | searchigp (gtime_t time, const double *pos, const sbsion_t *ion, const sbsigp_t **igp, double *x, double *y) |
| int | sbsioncorr (gtime_t time, const nav_t *nav, const double *pos, const double *azel, double *delay, double *var) |
| SBAS ionospheric delay correction. | |
| static void | getmet (double lat, double *met) |
| double | sbstropcorr (gtime_t time, const double *pos, const double *azel, double *var) |
| SBAS tropospheric delay correction. | |
| static int | sbslongcorr (gtime_t time, int sat, const sbssat_t *sbssat, double *drs, double *ddts) |
| static int | sbsfastcorr (gtime_t time, int sat, const sbssat_t *sbssat, double *prc, double *var) |
| int | sbssatcorr (gtime_t time, int sat, const nav_t *nav, double *rs, double *dts, double *var) |
| SBAS satellite ephemeris and clock correction. | |
| int | sbsdecodemsg (gtime_t time, int prn, const uint32_t *words, sbsmsg_t *sbsmsg) |
| Decode SBAS message frame words. | |
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 | CLIGHT = 299792458.0 |
| static const double | RE_WGS84 = 6378137.0 |
| static const int16_t | x1 [] |
| static const int16_t | x2 [] |
| static const int16_t | x3 [] |
| static const int16_t | x4 [] |
| static const int16_t | x5 [] |
| static const int16_t | x6 [] |
| static const int16_t | x7 [] = {-180, -150, -120, -90, -60, -30, 0, 30, 60, 90, 120, 150} |
| static const int16_t | x8 [] = {-170, -140, -110, -80, -50, -20, 10, 40, 70, 100, 130, 160} |
| const sbsigpband_t | igpband1 [9][8] |
| const sbsigpband_t | igpband2 [2][5] |
MRTKLIB SBAS Module — SBAS message decoding and corrections.
option : -DRRCENA enable rrc correction
references : [1] RTCA/DO-229C, Minimum operational performanc standards for global positioning system/wide area augmentation system airborne equipment, RTCA inc, November 28, 2001 [2] IS-QZSS v.1.1, Quasi-Zenith Satellite System Navigation Service Interface Specification for QZSS, Japan Aerospace Exploration Agency, July 31, 2009
Definition in file mrtk_sbas.c.
| #define MAXSBSAGEF 30.0 /* max age of SBAS fast correction (s) */ |
Definition at line 57 of file mrtk_sbas.c.
Referenced by sbsfastcorr().
| #define MAXSBSAGEL 1800.0 /* max age of SBAS long term corr (s) */ |
Definition at line 58 of file mrtk_sbas.c.
Referenced by sbslongcorr().
| #define P2_11 4.882812500000000E-04 /* 2^-11 */ |
Definition at line 54 of file mrtk_sbas.c.
| #define P2_31 4.656612873077393E-10 /* 2^-31 */ |
Definition at line 55 of file mrtk_sbas.c.
| #define P2_39 1.818989403545856E-12 /* 2^-39 */ |
Definition at line 56 of file mrtk_sbas.c.
Referenced by decode_longcorr1(), and decode_sbstype9().
| #define SYS_GLO 0x04 |
Definition at line 45 of file mrtk_sbas.c.
| #define SYS_GPS 0x01 |
Definition at line 43 of file mrtk_sbas.c.
| #define SYS_NONE 0x00 |
Definition at line 42 of file mrtk_sbas.c.
| #define SYS_QZS 0x10 |
Definition at line 46 of file mrtk_sbas.c.
| #define SYS_SBS 0x02 |
Definition at line 44 of file mrtk_sbas.c.
| #define WEEKOFFSET 1024 /* gps week offset for NovAtel OEM-3 */ |
Definition at line 64 of file mrtk_sbas.c.
Referenced by readmsgs().
|
static |
Definition at line 662 of file mrtk_sbas.c.
References sbsmsg_t::prn, sbsmsg_t::tow, and sbsmsg_t::week.
Referenced by sbsreadmsgt().
Definition at line 382 of file mrtk_sbas.c.
References sbslcorr_t::daf0, sbslcorr_t::daf1, sbslcorr_t::dpos, sbslcorr_t::dvel, getbits(), getbitu(), gpst2time(), sbslcorr_t::iode, sbssatp_t::lcorr, MAXSAT, sbsmsg_t::msg, P2_31, sbssat_t::sat, sbssatp_t::sat, sbslcorr_t::t0, sbsmsg_t::tow, trace(), and sbsmsg_t::week.
Referenced by decode_longcorrh().
Definition at line 405 of file mrtk_sbas.c.
References sbslcorr_t::daf0, sbslcorr_t::daf1, sbslcorr_t::dpos, sbslcorr_t::dvel, getbits(), getbitu(), gpst2time(), sbslcorr_t::iode, sbssatp_t::lcorr, MAXSAT, sbsmsg_t::msg, P2_11, P2_31, P2_39, sbssat_t::sat, sbssatp_t::sat, sbslcorr_t::t0, sbsmsg_t::tow, trace(), and sbsmsg_t::week.
Referenced by decode_longcorrh().
Definition at line 434 of file mrtk_sbas.c.
References decode_longcorr0(), decode_longcorr1(), getbitu(), sbssat_t::iodp, sbsmsg_t::msg, and trace().
Referenced by decode_sbstype24(), and decode_sbstype25().
Definition at line 191 of file mrtk_sbas.c.
References getbitu(), sbssat_t::iodp, MAXSAT, sbsmsg_t::msg, sbssat_t::nsat, sbssat_t::sat, sbssatp_t::sat, satno(), SYS_GLO, SYS_GPS, SYS_QZS, SYS_SBS, and trace().
Referenced by sbsupdatecorr().
Definition at line 345 of file mrtk_sbas.c.
References sbsigpband_t::bits, getbitu(), sbsion_t::igp, igpband1, igpband2, sbsion_t::iodi, sbsigp_t::lat, sbsigp_t::lon, sbsmsg_t::msg, sbsion_t::nigp, trace(), sbsigpband_t::x, and sbsigpband_t::y.
Referenced by sbsupdatecorr().
Definition at line 225 of file mrtk_sbas.c.
References sbsfcorr_t::ai, sbsfcorr_t::dt, sbssatp_t::fcorr, getbits(), getbitu(), gpst2time(), sbsfcorr_t::iodf, sbssat_t::iodp, sbsmsg_t::msg, sbssat_t::nsat, sbsfcorr_t::prc, sbsfcorr_t::rrc, sbssat_t::sat, sbsfcorr_t::t0, gtime_t::time, timediff(), sbsmsg_t::tow, trace(), sbsfcorr_t::udre, and sbsmsg_t::week.
Referenced by sbsupdatecorr().
Definition at line 447 of file mrtk_sbas.c.
References decode_longcorrh(), sbssatp_t::fcorr, getbits(), getbitu(), gpst2time(), sbsfcorr_t::iodf, sbssat_t::iodp, sbsmsg_t::msg, sbssat_t::nsat, sbsfcorr_t::prc, sbssat_t::sat, sbsfcorr_t::t0, sbsmsg_t::tow, trace(), sbsfcorr_t::udre, and sbsmsg_t::week.
Referenced by sbsupdatecorr().
Definition at line 473 of file mrtk_sbas.c.
References decode_longcorrh(), and trace().
Referenced by sbsupdatecorr().
Definition at line 479 of file mrtk_sbas.c.
References sbsigp_t::delay, getbitu(), sbsigp_t::give, gpst2time(), sbsion_t::igp, MAXBAND, sbsmsg_t::msg, sbsigp_t::t0, sbsmsg_t::tow, trace(), and sbsmsg_t::week.
Referenced by sbsupdatecorr().
Definition at line 263 of file mrtk_sbas.c.
References sbssatp_t::fcorr, getbitu(), sbsfcorr_t::iodf, MAXSAT, sbsmsg_t::msg, sbssat_t::nsat, sbssat_t::sat, trace(), and sbsfcorr_t::udre.
Referenced by sbsupdatecorr().
Definition at line 282 of file mrtk_sbas.c.
References sbsfcorr_t::ai, sbssatp_t::fcorr, getbitu(), sbssat_t::iodp, MAXSAT, sbsmsg_t::msg, sbssat_t::nsat, sbssat_t::sat, sbssat_t::tlat, and trace().
Referenced by sbsupdatecorr().
Definition at line 299 of file mrtk_sbas.c.
References seph_t::acc, seph_t::af0, seph_t::af1, getbits(), getbitu(), gpst2time(), MINPRNSBS, sbsmsg_t::msg, NSATSBS, P2_31, P2_39, seph_t::pos, sbsmsg_t::prn, seph_t::sat, satno(), nav_s::seph, seph_t::sva, seph_t::svh, SYS_SBS, seph_t::t0, timediff(), seph_t::tof, sbsmsg_t::tow, trace(), seph_t::vel, and sbsmsg_t::week.
Referenced by sbsupdatecorr().
|
static |
Definition at line 185 of file mrtk_sbas.c.
Referenced by sbsfastcorr().
|
static |
Definition at line 164 of file mrtk_sbas.c.
Referenced by readmsgs().
|
static |
Definition at line 896 of file mrtk_sbas.c.
Referenced by sbstropcorr().
Definition at line 568 of file mrtk_sbas.c.
References epoch2time(), free, getfield(), gpst2time(), sbsmsg_t::msg, sbs_t::msgs, sbs_t::n, sbs_t::nmax, sbsmsg_t::prn, screent(), time2gpst(), sbsmsg_t::tow, trace(), sbsmsg_t::week, and WEEKOFFSET.
Referenced by sbsreadmsgt().
Decode SBAS message frame words.
| [in] | time | Reception time |
| [in] | prn | SBAS satellite PRN number |
| [in] | words | SBAS message frame words (9 words) |
| [out] | sbsmsg | SBAS message |
Definition at line 1080 of file mrtk_sbas.c.
References DTTOL, sbsmsg_t::msg, sbsmsg_t::prn, rtk_crc24q(), gtime_t::time, time2gpst(), sbsmsg_t::tow, trace(), and sbsmsg_t::week.
Referenced by decode_rxmsfrb(), and decode_xe5bit().
|
static |
Definition at line 997 of file mrtk_sbas.c.
References sbsfcorr_t::ai, degfcorr(), sbsfcorr_t::dt, sbssatp_t::fcorr, MAXSBSAGEF, sbssat_t::nsat, sbsfcorr_t::prc, sbsfcorr_t::rrc, sbssat_t::sat, sbssatp_t::sat, sbsfcorr_t::t0, gtime_t::time, time_str(), timediff(), sbssat_t::tlat, trace(), sbsfcorr_t::udre, and varfcorr().
Referenced by sbssatcorr().
| int sbsioncorr | ( | gtime_t | time, |
| const nav_t * | nav, | ||
| const double * | pos, | ||
| const double * | azel, | ||
| double * | delay, | ||
| double * | var ) |
SBAS ionospheric delay correction.
| [in] | time | Reception time |
| [in] | nav | Navigation data |
| [in] | pos | Receiver position {lat, lon, h} (rad, m) |
| [in] | azel | Azimuth/elevation angle {az, el} (rad) |
| [out] | delay | Ionospheric delay (L1) (m) |
| [out] | var | Variance of ionospheric delay (m^2) |
Definition at line 823 of file mrtk_sbas.c.
References sbsigp_t::delay, ionppp(), R2D, nav_s::sbsion, searchigp(), timediff(), trace(), and varicorr().
Referenced by ionocorr(), and model_iono().
|
static |
Definition at line 962 of file mrtk_sbas.c.
References CLIGHT, sbslcorr_t::daf0, sbslcorr_t::daf1, sbslcorr_t::dpos, sbslcorr_t::dvel, sbssatp_t::lcorr, MAXSBSAGEL, sbssat_t::nsat, sbssat_t::sat, sbssatp_t::sat, satsys(), SYS_SBS, sbslcorr_t::t0, gtime_t::time, time_str(), timediff(), and trace().
Referenced by sbssatcorr().
| void sbsoutmsg | ( | FILE * | fp, |
| sbsmsg_t * | sbsmsg ) |
Output SBAS message record.
| [in] | fp | Output file pointer |
| [in] | sbsmsg | SBAS message |
Definition at line 732 of file mrtk_sbas.c.
References sbsmsg_t::msg, sbsmsg_t::prn, sbsmsg_t::tow, trace(), and sbsmsg_t::week.
Referenced by convsbs().
| int sbsreadmsg | ( | const char * | file, |
| int | sel, | ||
| sbs_t * | sbs ) |
Read SBAS message file.
| [in] | file | SBAS message file path |
| [in] | sel | SBAS satellite selection (0:all) |
| [in,out] | sbs | SBAS messages |
Definition at line 719 of file mrtk_sbas.c.
References sbsreadmsgt(), and trace().
Referenced by readpreceph().
Read SBAS message file with time span.
| [in] | file | SBAS message file path |
| [in] | sel | SBAS satellite selection (0:all) |
| [in] | ts | Time start (ts.time==0: no limit) |
| [in] | te | Time end (te.time==0: no limit) |
| [in,out] | sbs | SBAS messages |
Definition at line 682 of file mrtk_sbas.c.
References cmpmsgs(), expath(), free, malloc, MAXEXFILE, sbs_t::msgs, sbs_t::n, readmsgs(), and trace().
Referenced by sbsreadmsg().
| int sbssatcorr | ( | gtime_t | time, |
| int | sat, | ||
| const nav_t * | nav, | ||
| double * | rs, | ||
| double * | dts, | ||
| double * | var ) |
SBAS satellite ephemeris and clock correction.
| [in] | time | Reception time |
| [in] | sat | Satellite number |
| [in] | nav | Navigation data |
| [in,out] | rs | Satellite position/velocity (corrected) |
| [out] | dts | Satellite clock correction |
| [out] | var | Variance of correction |
Definition at line 1047 of file mrtk_sbas.c.
References CLIGHT, sbsfastcorr(), sbslongcorr(), nav_s::sbssat, and trace().
Referenced by satpos_sbas().
| double sbstropcorr | ( | gtime_t | time, |
| const double * | pos, | ||
| const double * | azel, | ||
| double * | var ) |
SBAS tropospheric delay correction.
| [in] | time | Reception time |
| [in] | pos | Receiver position {lat, lon, h} (rad, m) |
| [in] | azel | Azimuth/elevation angle {az, el} (rad) |
| [out] | var | Variance of tropospheric delay (m^2) |
Definition at line 930 of file mrtk_sbas.c.
References getmet(), PI, R2D, time2doy(), and trace().
Referenced by model_trop(), tropcorr(), and udtrop_ppp().
Update SBAS corrections in navigation data.
| [in] | msg | SBAS message |
| [in,out] | nav | Navigation data |
Definition at line 517 of file mrtk_sbas.c.
References decode_sbstype1(), decode_sbstype18(), decode_sbstype2(), decode_sbstype24(), decode_sbstype25(), decode_sbstype26(), decode_sbstype6(), decode_sbstype7(), decode_sbstype9(), getbitu(), sbsmsg_t::msg, nav_s::sbsion, nav_s::sbssat, trace(), and sbsmsg_t::week.
Referenced by convsbs(), inputobs(), and update_sbs().
|
static |
Definition at line 744 of file mrtk_sbas.c.
References sbsigp_t::give, sbsion_t::igp, sbsigp_t::lat, sbsigp_t::lon, MAXBAND, sbsion_t::nigp, R2D, sbsigp_t::t0, gtime_t::time, and trace().
Referenced by sbsioncorr().
|
static |
Definition at line 173 of file mrtk_sbas.c.
Referenced by sbsfastcorr().
|
static |
Definition at line 179 of file mrtk_sbas.c.
Referenced by sbsioncorr().
|
static |
Definition at line 51 of file mrtk_sbas.c.
|
static |
Definition at line 49 of file mrtk_sbas.c.
| const sbsigpband_t igpband1[9][8] |
Definition at line 86 of file mrtk_sbas.c.
Referenced by decode_sbstype18().
| const sbsigpband_t igpband2[2][5] |
Definition at line 159 of file mrtk_sbas.c.
Referenced by decode_sbstype18().
|
static |
Definition at line 48 of file mrtk_sbas.c.
|
static |
Definition at line 50 of file mrtk_sbas.c.
|
static |
Definition at line 52 of file mrtk_sbas.c.
|
static |
Definition at line 67 of file mrtk_sbas.c.
|
static |
Definition at line 69 of file mrtk_sbas.c.
|
static |
Definition at line 71 of file mrtk_sbas.c.
|
static |
Definition at line 73 of file mrtk_sbas.c.
|
static |
Definition at line 75 of file mrtk_sbas.c.
|
static |
Definition at line 80 of file mrtk_sbas.c.
|
static |
Definition at line 83 of file mrtk_sbas.c.
|
static |
Definition at line 84 of file mrtk_sbas.c.