Porting GBX to other Applications
Learn the basics of parsing GBX output streams for use in other applications.
Overview
A common use case of PpRx output is to provide GNSS measurements and full PNT solutions to external applications. This is typically accomplished by streaming the GBX output to a parsing application through a POSIX pipe.
This tutorial provides a guide for running the example gbx_parser.py on a GBX stream
produced by PpRx in either the GUI or CLI. The gbx_parser.py example comes pre-packaged
within the locus-lock folder.
GUI Instructions
Set up PpRx to output a GBX stream to a named pipe:
- Configure PpRx
.optand.configfiles within the GUI. - Configure PpRx for
Post-Processingmode and enableSimulate Realtime. - Select a pre-recorded
.binfile as the data input. - Configure PpRx to output to a Named Pipe (for example
gbx_pipe) in the configured output folder. - In a terminal window, navigate to the output folder and create the named pipe with
mkfifo gbx_pipe.
Set up gbx_parser.py in a terminal window:
cd <locus-lock directory>/utilities/gbx_parser- Build the python virtual environment with
setup_venv.sh - Source the virtual environment with
source venv/bin/activate - Run the parser with
python3 gbx_parser.py --verbose --pipe_path '<output-folder-path>/gbx_pipe' --output_path '<output-folder-path>/parser_output.gbx'
The --output_path argument sets the file path to which parsed data is logged.
The parser will wait until data is published to the pipe.
To run PpRx and verify outputs:
- In the GUI, press the
Run PpRxbutton. - In the terminal window running
gbx_parser.py, observe the parsed message contents printed to the terminal.
CLI Instructions
Set up PpRx for CLI use:
- Create PpRx
.optand.configfiles (for exampleexample.optandexample.config) for post-processing a pre-recorded.bindataset. - Create a POSIX pipe with
mkfifo gbx_pipe. - Ensure PpRx is configured to write GBX data to the POSIX pipe with the
.optfile argument-o gbx_pipe.
Set up gbx_parser.py in a terminal window:
cd <locus-lock directory>/utilities/gbx_parser- Build the python virtual environment with
setup_venv.sh - Source the virtual environment with
source venv/bin/activate - Run the parser with
python3 gbx_parser.py --verbose --pipe_path '<path-to-gbx_pipe>' --output_path '<output-path-to-parser_output.gbx>'
To run PpRx from the CLI and verify outputs:
- In a terminal window, run PpRx with
pprx -f example.opt - In the terminal window running
gbx_parser.py, observe the parsed message contents printed to the terminal.
Expected Result
If configured correctly with --verbose, the gbx_parser.py application should print parsed
GBX message data while PpRx is running.
Additional Reading
gbx_parser.py is an example. For reduced overhead in high-performance applications, optimized
parsing applications are recommended. See GBX Protocol Description
for useful information when creating a GBX parsing application.