RXtoRINEX
V2.1
RXtoRINEX provides tools to collect data from GPS / GNSS receivers in mobile devices, convert them to RINEX or RTK formats, and process RINEX files.
|
#include <GNSSdataFromOSP.h>
Public Member Functions | |
GNSSdataFromOSP (string rcv, int minxfix, bool bias, FILE *f, Logger *pl) | |
GNSSdataFromOSP (string rcv, int minxfix, bool bias, FILE *f) | |
~GNSSdataFromOSP (void) | |
bool | acqHeaderData (RinexData &) |
bool | acqHeaderData (RTKobservation &) |
bool | acqEpochData (RinexData &, bool, bool) |
bool | acqEpochData (RTKobservation &) |
bool | acqGLOparams () |
GNSSdataFromOSP class defines data and methods used to acquire RINEX or RTK header and epoch data from a binary OSP file containing receiver messages. Such header and epoch data can be used to generate and print RINEX or RTK files.
A program using GNSSdataFromOSP would perform the following steps:
This version implements acquisition from binary files containing OSP messages collected from SiRFIV receivers. Each OSP message starts with the payload length (2 bytes) and follows the n bytes of the message payload.
A detailed definition of OSP messages can be found in the document "SiRFstarIV (TM) One Socket Protocol Interface Control Document Issue 9".
Note that messages recorded in the OSP binary file have the structure described in this ICD for the receiver message packets, except that the start sequence (A0 A3), the checksum, and the end sequence (B0 B3) have been removed from the packet.
GNSSdataFromOSP::GNSSdataFromOSP | ( | string | rcv, |
int | minxfix, | ||
bool | applBias, | ||
FILE * | f, | ||
Logger * | pl | ||
) |
Constructs a GNSSdataFromOSP object using parameters passed.
rcv | the receiver name |
minxfix | the minimum of satellites required for a fix to be considered valid |
applBias | when true, apply clock bias obtained by receiver to correct observables, when false, do not apply them. |
f | the FILE pointer to the already open input OSP binary file |
pl | a pointer to the Logger to be used to record logging messages |
GNSSdataFromOSP::GNSSdataFromOSP | ( | string | rcv, |
int | minxfix, | ||
bool | applBias, | ||
FILE * | f | ||
) |
Constructs a GNSSdataFromOSP object using parameters passed, and logging data into the stderr.
rcv | the receiver name |
minxfix | the minimum of satellites required for a fix to be considered |
applBias | when true, apply clock bias obtained by receiver to correct observables, when false, do not apply them. |
f | the FILE pointer to the the already open input OSP binary file |
GNSSdataFromOSP::~GNSSdataFromOSP | ( | void | ) |
Destroys a GNSSdataFromOSP object
bool GNSSdataFromOSP::acqEpochData | ( | RinexData & | rinex, |
bool | useMID8G, | ||
bool | useMID8R | ||
) |
acqEpochData extracts observation and time data from binary OSP file messages for a RINEX epoch.
Epoch RINEX data are contained in a sequence of {MID28} [MID2] [MID7] messages.
Each MID28 contains observables for a given satellite. Successive MID28 messages belong to the same epoch if they have the same receiver time. In each epoch the receiver sends a MID28 message for each satellite being tracked.
After sending the epoch MID28 messages, the receiver would send a MID2 message containing the computed position solution data.
The epoch finishes with a MID7 message. It contains clock data for the current epoch, including its GPS time. An unexpected end of epoch occurs when a MID28 message shows different receiver time from former received messages. This event would be logged at info level. Former message data are discarded because no time solution for this epoch can be computed, and the receiver time is unknown.
The method acquires data reading messages recorded in the binary file according to the above sequence. Epoch data are stored in the RINEX data structure for further generation/printing of RINEX observation records. Method returns when it is read the last message (MID2 or MID7) of the current epoch.
Ephemeris data messages (MID15, MID8, MID70) can appear in any place of the input message sequence. Their data would be stored for further generation of the RINEX navigation file.
Other messages in the input binary file are ignored.
rinex | the RinexObsData object where data got from receiver will be placed |
useMID8G | when true GPS navigation data will be acquired from MID8 messages, when false these data would be acquired from MID15 |
useMID8R | when true GLONASS navigation data will be acquired from MID8 messages , when false these data would be acquired from MID70 |
bool GNSSdataFromOSP::acqEpochData | ( | RTKobservation & | rtko | ) |
acqEpochData acquires epoch position data from binary OSP file messages for RTK observation files.
Epoch RTK data are contained in a MID2 message.
The method skips messages from the input binary file until a MID2 message is read. When this happens, it stores MID2 data in the RTKobservation object passed and returns.
rtko | the RTKobservation object where data acquired will be placed |
bool GNSSdataFromOSP::acqGLOparams | ( | ) |
acqGLOparams acquires some relevant parameters from GLONASS navigation data in MID8 messages
GLONASS navigation data contains:
Such parameters are needed to stablish correpondence between data provided by receiver and used in the GNSS data processing.
bool GNSSdataFromOSP::acqHeaderData | ( | RinexData & | rinex | ) |
acqHeaderData extracts data from the binary OSP file for RINEX file header. The RINEX header data to be extracted from the binary file are:
The method iterates over the input file extracting messages until above describe data are acquired or it reaches the end of file.
It logs at FINE level a message stating which header data have been acquired or not.
rinex | the RinexData object where data got from receiver will be placed |
bool GNSSdataFromOSP::acqHeaderData | ( | RTKobservation & | rtko | ) |
acqHeaderData extracts data from the binary OSP file for a RTK file header. The RTK header data to be extracted from the binary file are:
The method iterates over the input file extracting messages until above describe data are acquired or it reaches the end of file.
It logs at FINE level a message stating which header data have been acquired or not.
rtko | the RTKobservation object where data got from receiver will be placed |