📄 novatel.h
字号:
#include <stdio.h>
/* HEADER FILE for NOVATEL binary data */
typedef struct /* Header & structure for binary files */
{
/* variables used by software */
char fname[40]; /* file name */
FILE *f; /* file pointer */
short vbufsize; /* size of file buffer (internal) */
void *vbuf; /* pointer to vbuf (allocated in open) */
} nov_bin_file_type;
/* structrues */
typedef struct /* binary header (all records) */
{
char sync[3]; /* should be 0xAA4411 */
unsigned char checksum;
unsigned long id_word; /* pben=01... */
unsigned long size; /* pben=88... */
} binary_header_type;
typedef struct /* measurement (header) record (RNGB) */
{
binary_header_type bh;
unsigned long weeknum;
double rcv_time; /* seconds of the week */
unsigned long num_sats; /* number of satellites */
long self_test; /* self test status , see table 5 (page 60) */
} mben_header_nov_type;
typedef struct /* measurement (data) record (RNGB) */
{
long prn;
double ca_range;
double ca_range_sd;
double phase_l1;
double phase_l1_sd;
double phase_rate_l1;
double phase_rate_l1_sd;
double dop_acc;
double snr;
double locktime;
long channel_status; /* see table 6, page 64 */
} mben_data_nov_type;
typedef struct /* position record (POSB) */
{
binary_header_type bh;
long weeknum;
double rcv_time; /* seconds of the week */
double phi; /* degrees */
double lamda;
double ht; /* m */
double undulation;
long datum_id; /* see table 9 appendix A */
double phi_sd; /* standard deviation (m) */
double lamda_sd;
double ht_sd;
long solution_status; /* 0 - solution computed */
/* 1 - insufficient # of obs. */
/* 2 - No convergence */
/* 3 - Singular normal matrix */
/* 4 - Cx trace exceeds (1000 m) */
/* 5 - test distance exceeded */
} pben_nov_type;
typedef struct /* Ephemeris (REPB) */
{
binary_header_type bh;
long prn;
unsigned char data[90];
char filler_bytes[2];
} snav_nov_type;
typedef struct /* Elev/az of satellites: header (SATB) */
{
binary_header_type bh;
long weeknum;
double rcv_time;
long solution_status;
long num_sats;
} satb_header_nov_type;
typedef struct /* Elev/az of satellites: data (SATB) */
{
long prn;
double azimuth; /* degrees */
double elevation; /* degrees */
double residual;
long reject_code; /* see table 7 (page 68) */
} satb_data_nov_type;
typedef struct /* Speed and heading (SPHB) */
{
binary_header_type bh;
long weeknum;
double rcv_time;
double horiz_speed; /* m/s */
double heading; /* degrees */
double vert_speed; /* m/s */
long solution_status; /* table 4 (page 56) -- see pben above */
} sphb_nov_type;
typedef struct /* Waypoint navigation record (NAVB) */
{
binary_header_type bh;
long weeknum;
double rcv_time;
double dist_to; /* m */
double az_to; /* degrees */
double along_track; /* m */
double across_track; /* m */
long eta_week;
double eta_seconds; /* m */
long nav_status;
long solution_status; /* 0 - solution computed */
/* 1 - insufficient # of obs. */
/* 2 - No convergence */
/* 3 - Singular normal matrix */
/* 4 - Cx trace exceeds (1000 m) */
/* 5 - test distance exceeded */
} navb_nov_type;
typedef struct /* Clock offset record */
{
binary_header_type bh;
long weeknum;
double rcv_time;
double clock_offset; /* seconds */
double clock_drift; /* seconds per second */
double clock_drift_rate; /* seconds per second squared */
double clock_offset_sd; /* seconds */
double clock_drift_sd; /* seconds per second */
long clock_model; /* 0-good, -1 to -20 bad */
} clkb_nov_type;
typedef struct /* Receiver self test status */
{
binary_header_type bh;
char version[80]; /* software version number */
char num_channels;
char cpu_idle_time; /* percent */
char filler[2];
long status; /* self-test status (see RCS above) */
} rcsb_nov_type;
typedef struct /* holds satellite ranges */
{
char prn;
char locktime; /* satellite locktime truncated */
double phase_l1; /* phase: cycles */
float phase_rate_l1; /* doppler: cycles */
long ca_compress; /* =(ca_range-23000000.0)*100.0 */
} rtp_data_type;
typedef struct /* header for RTP record */
{
binary_header_type bh; /* (id_word = 999) */
double gps_time; /* gps_time of epoch */
char num_sats; /* number of sats to follow */
char status[3]; /* status of logger tba */
float clock_shift; /* clock shift in metres */
double corr_time; /* corrected gps_time time */
/* rtp_data_type*num_sats */
} rtp_header_type;
/* additional structures for embedded system */
typedef struct
{
char prn;
char elev; /* degrees */
short azimuth; /* degrees */
short ambiguity; /* last three digits of ambiguity*20 */
} satinfo_type;
typedef struct
{
binary_header_type bh; /* binary header */
double gps_time; /* gps_time of calculations */
double pred_time; /* predicted gps_time of reception of */
/* this record (not supported yet) */
long num_epochs; /* number of epochs processed */
double phi,lamda; /* latitude and longitude (degrees) */
float ht; /* height (m) (for lat,long) */
double north,east; /* horizontal coords (m) */
float proj_ht; /* projection height (m) */
float ve,vn,vu; /* velocity components */
float l1_rms,ca_rms; /* measurement rms values */
char status; /* status, bit0: 1-position valid */
/* bit1: 0-static, 1-kinematic */
/* bit23: 0-float soln */
/* 1-fixed soln */
/* : */
/* bit4: position fixed */
char quality; /* quality factor 1-6 */
short dd_dop; /* PDOP*100 */
float amb_drift; /* ambiguity drift */
short num_sats; /* number of valid satellites to follow */
satinfo_type satinfo[12];
char extra[32];
} solution_type;
typedef struct
{
binary_header_type bh;
double gps_time;
short type; /* 0 - general */
/* 1 - important */
/* 2 - fatal */
char message[80]; /* message string */
} message_type;
typedef struct
{
binary_header_type bh;
long status; /* 32 bit status */
/* BIT NAME (0) (1) */
/* 0 STATIC/KIN S K */
/* 1 PROCESS_MODE START SET */
/* 2 MASTER RECEIVED N Y */
/* 3 RADIO O.K. N Y */
/* 4 REMOTE_POS_STATUS BAD VALID */
long num_master_records; /* number of master records received */
long num_remote_records; /* number of remote records received */
char num_master_sats; /* number of sats from master station */
char num_remote_sats; /* number of sats from remote station */
char num_sats; /* number of matching sats over elev. mask */
char num_without_eph; /* number of sats without eph records */
long num_eph_received; /* number of ephemeris records received */
long num_eph_unique; /* number of ephemeris records different */
/* from the others */
long num_good_meas; /* number of good measurements */
long num_bad_meas; /* number of bad measurements */
float age; /* number of seconds since last radio contact */
unsigned short num_bad_checksum;
/* number of radio records with bad checksum */
unsigned short num_less_than_4;
/* number of ephochs with less than 4 sats */
char extra[16];
} output_status_type;
typedef struct /* header for MPOS record*/
{ /* master station position */
binary_header_type bh; /* (id_word = 998) */
double phi,lamda; /* lat+long in degrees */
float ht,ant_ht; /* height + antenna height in metres */
char extra[60]; /* do this to make radio work */
} master_pos_type;
int Novatel2Rinex(char *SourceFile,char *RinexFile,char *RinexNavFile);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -