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.
Classes | Public Member Functions | List of all members
GNSSdataFromOSP Class Reference

#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 ()
 

Detailed Description

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:

  1. Declare a GNSSdataFromOSP object stating the receiver, the file name with the binary messages containing the data to be acquired, and optionally the logger to be used
  2. Acquire header data and save them into an object of RinexData or RTKobservation class using acqHeaderData methods
  3. Header data acquired can be used to generate / print RINEX or RTK files (see available methods in RinexData and RTKobservation classes for that)
  4. As header data may be sparse among the binary file, rewind it before performing any other data acquisition
  5. Acquire an epoch data and save them into an object of RinexData or RTKobservation class using acqEpochData methods
  6. Epoch data acquired can be used to generate / print RINEX or RTK file epoch (see available methods in RinexData and RTKobservation classes)
  7. Repeat above steps 5 and 6 while epoch data are available in the input file.

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.

Constructor & Destructor Documentation

GNSSdataFromOSP::GNSSdataFromOSP ( string  rcv,
int  minxfix,
bool  applBias,
FILE *  f,
Logger pl 
)

Constructs a GNSSdataFromOSP object using parameters passed.

Parameters
rcvthe receiver name
minxfixthe minimum of satellites required for a fix to be considered valid
applBiaswhen true, apply clock bias obtained by receiver to correct observables, when false, do not apply them.
fthe FILE pointer to the already open input OSP binary file
pla 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.

Parameters
rcvthe receiver name
minxfixthe minimum of satellites required for a fix to be considered
applBiaswhen true, apply clock bias obtained by receiver to correct observables, when false, do not apply them.
fthe FILE pointer to the the already open input OSP binary file
GNSSdataFromOSP::~GNSSdataFromOSP ( void  )

Destroys a GNSSdataFromOSP object

Member Function Documentation

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.

Parameters
rinexthe RinexObsData object where data got from receiver will be placed
useMID8Gwhen true GPS navigation data will be acquired from MID8 messages, when false these data would be acquired from MID15
useMID8Rwhen true GLONASS navigation data will be acquired from MID8 messages , when false these data would be acquired from MID70
Returns
true when observation data from an epoch messages have been acquired, false otherwise (End Of File reached)
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.

Parameters
rtkothe RTKobservation object where data acquired will be placed
Returns
true if epoch position data properly extracted, false otherwise (End Of File reached)
bool GNSSdataFromOSP::acqGLOparams ( )

acqGLOparams acquires some relevant parameters from GLONASS navigation data in MID8 messages

GLONASS navigation data contains:

  • the slot number of the satellite being tracked in a given receiver channel
  • the carrier frequency number for each slot

Such parameters are needed to stablish correpondence between data provided by receiver and used in the GNSS data processing.

Returns
true if data properly extracted, false otherwise (End Of File reached)
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 receiver identification contained in the first MID6 message
  • the initial X,Y,Z position contained in the first MID2 message
  • the time of first epoch contained in the first valid MID7 message
  • the measurement interval, computed as the time difference between two consecutive valid MID7

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.

Parameters
rinexthe RinexData object where data got from receiver will be placed
Returns
true if all above described header data are properly extracted, false otherwise
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 time of first computed solution contained in the first valid MID2 message
  • the time of last computed solution contained in the last valid MID2 message
  • the elevation and SNR masks used by the receiver contained in the first valid MID19 message

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.

Parameters
rtkothe RTKobservation object where data got from receiver will be placed
Returns
true if all above described header data are properly extracted, false otherwise

The documentation for this class was generated from the following files: