### Install GNSS-SDR Monitoring Dependencies (Shell) Source: https://gnss-sdr.org/docs/tutorials/monitoring-software-receiver-internal-status Installs essential build tools and libraries required for the GNSS-SDR monitoring client, including GCC, CMake, Protocol Buffers, Boost, and ncurses. ```Shell sudo apt install build-essential cmake libboost-dev libboost-system-dev \n libprotobuf-dev protobuf-compiler libncurses5-dev libncursesw5-dev wget ``` -------------------------------- ### GNSS-SDR Installation with DESTDIR Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time This example demonstrates how to use the DESTDIR environment variable to stage GNSS-SDR installations in an intermediate directory before final deployment. This is useful for creating package installers or relocating installations without altering the default install prefix. ```bash $DESTDIR=/home/carles install # This command installs GNSS-SDR to /home/carles/usr/local/bin (assuming CMAKE_INSTALL_PREFIX=/usr/local) ``` -------------------------------- ### GNSS-SDR Coldstart Command Source: https://gnss-sdr.org/docs/sp-blocks/global-parameters This example shows how to perform a cold start on the GNSS receiver using the `coldstart` command. A cold start typically requires the receiver to reacquire satellite signals from scratch. ```Shell user@ubuntu:~$\nTrying receiver_ip...\nConnected to receiver_ip.\nEscape character is '^]'.\nstandby\nOK\ncoldstart\nOK\n ``` -------------------------------- ### Install MathJax Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time Installs the MathJax library on Debian and Ubuntu systems using apt. MathJax is used for rendering mathematical equations in the generated HTML documentation. ```Shell $sudo apt install libjs-mathjax ``` -------------------------------- ### Example GNSS-SDR Test Execution Output Source: https://gnss-sdr.org/docs/tutorials/testing-software-receiver-2 This snippet displays a typical output from running the GNSS-SDR test executable. It indicates the start of the test environment setup, the number of tests being run, and the overall success or failure of the tests. ```text Running GNSS-SDR Tests... [==========] Running 217 tests from 57 test suites. [----------] Global test environment set-up. ... [----------] Global test environment tear-down [==========] 217 tests from 57 test suites ran. (64845 ms total) [ PASSED ] 217 tests. ``` -------------------------------- ### Install bmaptool and Copy Image using bmaptool Source: https://gnss-sdr.org/docs/tutorials/cross-compiling This snippet covers installing `bmaptool` via its setup script and then using it to copy a GNSS-SDR root filesystem image to an SD card, with an option to skip the .bmap file. ```bash cd bmap-tools sudo python setup.py install sudo bmaptool copy gnss-sdr-dev-image-zedboard-zynq7-20170103150322.rootfs.tar.gz /dev/sdX --nobmap ``` -------------------------------- ### Install Dependencies and Build gr-iio Source: https://gnss-sdr.org/docs/sp-blocks/signal-source This snippet shows the shell commands required to install necessary development libraries (libxml2-dev, bison, flex) and build the gr-iio library from source. It involves navigating to specific directories, configuring with CMake, compiling, and installing. ```Shell $sudo apt install libxml2-dev bison flex $$cd libiio $mkdir build && cd build && cmake .. && make && sudo make install $cd ../.. $$cd libad9361-iio $mkdir build && cd build && cmake .. && make && sudo make install $cd ../.. $$cd gr-iio $mkdir build && cd build && cmake .. && make && sudo make install $cd ../.. ``` -------------------------------- ### Install Repo Tool Source: https://gnss-sdr.org/docs/tutorials/cross-compiling Installs the 'repo' tool, a Python script used to manage multiple Git repositories, by downloading it, making it executable, and moving it to a system-wide binary directory. ```bash $> repo $chmod a+x repo $sudo mv repo /usr/local/bin/ ``` -------------------------------- ### Build SDK Installer Source: https://gnss-sdr.org/docs/tutorials/cross-compiling Builds the SDK installer for the 'gnss-sdr-dev-image' using BitBake. This process downloads source code and compiles packages for the host and target, generating a toolchain installer script. ```bash $$-c populate_sdk gnss-sdr-dev-image ``` -------------------------------- ### Start GNSS-SDR Receiver Source: https://gnss-sdr.org/docs/tutorials/monitoring-software-receiver-internal-status This bash command starts the GNSS-SDR receiver using a specified configuration file, enabling the monitoring functionality to stream data to the client. ```bash $-c ./my-first-GNSS-SDR-receiver.conf ``` -------------------------------- ### Install SDK Prerequisites Source: https://gnss-sdr.org/docs/tutorials/cross-compiling Installs essential packages required for the GNSS-SDR SDK, specifically 'xz-utils' for compression and 'python3' for scripting, using the apt package manager. ```bash $sudo apt install xz-utils python3 ``` -------------------------------- ### Start Monitoring Client Source: https://gnss-sdr.org/docs/tutorials/monitoring-software-receiver-internal-status This bash command initiates the monitoring client, which listens on a specified UDP port for internal parameters streamed from the GNSS-SDR receiver. ```bash $ # Start monitoring client on port 1234 $ # (The actual command is missing in the provided text, represented by '$') ``` -------------------------------- ### Create Monitoring Client Directory (Shell) Source: https://gnss-sdr.org/docs/tutorials/monitoring-software-receiver-internal-status Creates a new directory named 'monitoring-client' in the home folder and navigates into it, preparing the workspace for the monitoring client source files. ```Shell mkdir monitoring-client cd monitoring-client ``` -------------------------------- ### Create Work Directory and Download Signal Data Source: https://gnss-sdr.org/docs/tutorials/monitoring-software-receiver-internal-status This snippet demonstrates the bash commands to create a working directory and download the necessary GNSS raw signal samples for the GNSS-SDR project. ```bash cd ~ mkdir work cd work tar -zxvf 2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.tar.gz ``` -------------------------------- ### Install clang-tidy Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time Installs the clang and clang-tidy tools on Debian and Ubuntu systems using the apt package manager. These tools are essential for static code analysis. ```Shell $sudo apt install clang clang-tidy ``` -------------------------------- ### Setup Cross-Compiling Environment Source: https://gnss-sdr.org/docs/tutorials/cross-compiling Sources the environment setup script for the GNSS-SDR SDK to configure the necessary environmental variables for cross-compiling, such as PATH, CC, and CXX. ```bash $. /usr/local/oecore-x86_64/environment-setup-armv7ahf-neon-geniux-linux-gnueabi ``` -------------------------------- ### Run GNSS-SDR Client Source: https://gnss-sdr.org/docs/tutorials/monitoring-software-receiver-internal-status This command executes the compiled 'monitoring-client' executable. When run without arguments, it is expected to print its usage instructions, indicating it's ready for input. ```Shell $Usage: monitoring-client ``` -------------------------------- ### GNSS-SDR CMake: Enable Benchmarks and Test Installation Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time Enables the building of performance benchmarks using the Benchmark library, requiring CMake version 3.5.1 or higher. ENABLE_INSTALL_TESTS controls whether test binaries are installed system-wide or kept in a local folder. ```CMake cmake .. -DENABLE_BENCHMARKS=ON cmake .. -DENABLE_INSTALL_TESTS=ON ``` -------------------------------- ### Configure GNSS-SDR Build Options Source: https://gnss-sdr.org/docs/tutorials Details the various configuration options available when building GNSS-SDR. This guide helps users customize their build for specific needs and platforms. -------------------------------- ### Test GNSS-SDR: Execution Source: https://gnss-sdr.org/docs/tutorials Provides documentation on the process of building and running the testing code for GNSS-SDR. This guide focuses on the practical aspects of test execution. -------------------------------- ### Cross-compile and Install GNSS-SDR Source: https://gnss-sdr.org/docs/tutorials/cross-compiling This snippet shows how to cross-compile GNSS-SDR using a specific toolchain file and install it to a target filesystem using `make install` with `DESTDIR`. ```bash cd gnss-sdr cd build cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchains/oe-sdk_cross.cmake -DCMAKE_INSTALL_PREFIX=/usr .. sudo make install DESTDIR=/usr/local/oecore-x86_64/sysroots/armv7ahf-neon-geniux-linux-gnueabi/ ``` -------------------------------- ### Complete GNSS-SDR Configuration File Source: https://gnss-sdr.org/docs/tutorials/monitoring-software-receiver-internal-status This INI configuration file provides a comprehensive setup for GNSS-SDR, including global options, signal source, signal conditioner, data type adapter, filters, resamplers, channel configurations, acquisition, tracking, telemetry decoder, observables, PVT, and the monitor block. ```ini [GNSS-SDR] ;######### GLOBAL OPTIONS ################## GNSS-SDR.internal_fs_sps=2000000 ;######### SIGNAL_SOURCE CONFIG ############ SignalSource.implementation=File_Signal_Source SignalSource.filename=/home/your-username/work/data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat SignalSource.item_type=ishort SignalSource.sampling_frequency=4000000 SignalSource.samples=0 ;######### SIGNAL_CONDITIONER CONFIG ############ SignalConditioner.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER CONFIG ############ DataTypeAdapter.implementation=Ishort_To_Complex ;######### INPUT_FILTER CONFIG ############ InputFilter.implementation=Pass_Through InputFilter.item_type=gr_complex ;######### RESAMPLER CONFIG ############ Resampler.implementation=Direct_Resampler Resampler.sample_freq_in=4000000 Resampler.sample_freq_out=2000000 Resampler.item_type=gr_complex ;######### CHANNELS GLOBAL CONFIG ############ Channels_1C.count=8 Channels.in_acquisition=1 Channel.signal=1C ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition Acquisition_1C.item_type=gr_complex Acquisition_1C.threshold=0.008 Acquisition_1C.doppler_max=10000 Acquisition_1C.doppler_step=250 ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking Tracking_1C.item_type=gr_complex Tracking_1C.pll_bw_hz=40.0; Tracking_1C.dll_bw_hz=4.0; ;######### TELEMETRY DECODER GPS CONFIG ############ TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables ;######### PVT CONFIG ############ PVT.implementation=RTKLIB_PVT PVT.averaging_depth=100 PVT.flag_averaging=true PVT.output_rate_ms=10 PVT.display_rate_ms=500 ;######### MONITOR CONFIG ############ Monitor.enable_monitor=true Monitor.decimator_factor=50 Monitor.client_addresses=127.0.0.1 Monitor.udp_port=1234 ``` -------------------------------- ### Install Dependencies (Debian/Ubuntu) Source: https://gnss-sdr.org/docs/sp-blocks/signal-source Installs necessary software dependencies for GNSS-SDR on Debian Buster or Ubuntu Cosmic using apt. ```bash sudo apt install libiio-dev gr-iio ``` -------------------------------- ### GNSS-SDR Alternative Build Process Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time This snippet shows an alternative method for building GNSS-SDR using CMake commands. It includes checking out the branch, specifying the build directory, building the project, and then installing it. ```Shell $cd gnss-sdr && git checkout next $-S . -B build $--build build $sudo cmake --install build ``` -------------------------------- ### Cross-compile GNSS-SDR for Embedded Platforms Source: https://gnss-sdr.org/docs/tutorials A guide to cross-compiling GNSS-SDR for embedded platforms. It outlines the steps and considerations necessary for successful compilation on different architectures. -------------------------------- ### Install gr-limesdr on Debian Source: https://gnss-sdr.org/docs/sp-blocks/signal-source Installs the necessary gr-limesdr library on Debian-based systems to enable LimeSDR support in GNSS-SDR. ```bash sudo apt install gr-limesdr ``` -------------------------------- ### Install GNSS-SDR to Network-Mounted Device Source: https://gnss-sdr.org/docs/tutorials/cross-compiling After mounting the remote device using `sshfs`, this command shows how to install GNSS-SDR directly to the mounted filesystem on the target device. ```bash sudo make install DESTDIR=~/mydevice ``` -------------------------------- ### GNSS-SDR Default Build Process Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time This snippet outlines the default steps to build GNSS-SDR using CMake and make. It involves navigating to the project directory, checking out a specific branch, creating a build directory, and then installing the project. ```Shell $cd gnss-sdr && git checkout next $mkdir -p build && cd build $$$sudo make install ``` -------------------------------- ### Navigate to Build Directory Source: https://gnss-sdr.org/docs/tutorials/monitoring-software-receiver-internal-status This command changes the current working directory to the newly created 'build' folder. Subsequent build commands will be executed from within this directory. ```Shell cd build ``` -------------------------------- ### GNSS-SDR Telecommand Examples Source: https://gnss-sdr.org/docs/sp-blocks/global-parameters These examples illustrate how to interact with the GNSS-SDR telecommand interface using a telnet client. They show sending commands like 'status' and the expected output, demonstrating the receiver's current state. ```text user@ubuntu:~\$Trying receiver_ip... Connected to receiver_ip. Escape character is '^]'. status --------------------------------------------------------- ch | sys | sig | mode | Tlm | Eph | Doppler | CN0 | | | | | | | [Hz] | [dB-Hz] | --------------------------------------------------------- 0 | GPS | L1CA | TRK | YES | YES | 23412.4 | 44.3 | 1 | GPS | L1CA | TRK | YES | YES | -14725.4 | 45.4 | 2 | GPS | L1CA | TRK | YES | YES | 4562.1 | 41.0 | 3 | GPS | L1CA | TRK | YES | YES | 15223.4 | 38.2 | 4 | GPS | L1CA | TRK | YES | NO |-8456.0 | 40.5 | 5 | GPS | L1CA | ACQ | NO | NO | -------- | ---- | 6 | GPS | L1CA | STBY | NO | NO | -------- | ---- | --------------------------------------------------------- ``` -------------------------------- ### Project Directory Structure Source: https://gnss-sdr.org/docs/tutorials/monitoring-software-receiver-internal-status This output from the 'tree' command shows the expected file and directory structure of the GNSS-SDR project after creating the build folder and placing the CMakeLists.txt file. ```Shell $ ├── build ├── CMakeLists.txt ├── gnss_synchro.proto ├── gnss_synchro_udp_source.cc ├── gnss_synchro_udp_source.h └── main.cc 1 directory, 5 files ``` -------------------------------- ### Implement Gnss_Synchro_Udp_Source Constructor Source: https://gnss-sdr.org/docs/tutorials/monitoring-software-receiver-internal-status Implements the constructor for the Gnss_Synchro_Udp_Source class. This function initializes the UDP socket, binds it to the specified local endpoint, and prepares it for receiving data. ```C++ #include "gnss_synchro_udp_source.h" #include "gnss_synchro.pb.h" #include #include Gnss_Synchro_Udp_Source::Gnss_Synchro_Udp_Source(const unsigned short port) : socket{io_service}, endpoint{boost::asio::ip::udp::v4(), port} { socket.open(endpoint.protocol(), error); // Open socket. socket.bind(endpoint, error); // Bind the socket to the given local endpoint. } ``` -------------------------------- ### CMakeLists.txt for GNSS-SDR Source: https://gnss-sdr.org/docs/tutorials/monitoring-software-receiver-internal-status This CMakeLists.txt file defines the build process for the GNSS-SDR project. It specifies C++ standard, finds required libraries (Boost, Curses, Protobuf), generates C++ code from Protocol Buffers definitions, and links them to create a library and an executable. ```C++ cmake_minimum_required (VERSION 3.9) project (monitoring-client CXX) set(CMAKE_CXX_STANDARD 11) set(Boost_USE_STATIC_LIBS OFF) find_package(Boost components system REQUIRED) set(CURSES_NEED_NCURSES TRUE) find_package(Curses REQUIRED) find_package(Protobuf REQUIRED) if(${Protobuf_VERSION} VERSION_LESS "3.0.0") message(FATAL_ERROR "Fatal error: Protocol Buffers >= v3.0.0 required.") endif() protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${CMAKE_SOURCE_DIR}/gnss_synchro.proto) add_library(monitoring_lib ${CMAKE_SOURCE_DIR}/gnss_synchro_udp_source.cc ${PROTO_SRCS}) target_link_libraries(monitoring_lib PUBLIC Boost::boost Boost::system ${CURSES_LIBRARIES} protobuf::libprotobuf pthread ) target_include_directories(monitoring_lib PUBLIC ${CURSES_INCLUDE_DIRS} ${CMAKE_BINARY_DIR} ) add_executable(monitoring-client ${CMAKE_SOURCE_DIR}/main.cc) target_link_libraries(monitoring-client PUBLIC monitoring_lib) ``` -------------------------------- ### GNSS-SDR CMake: Enable/Disable System Testing Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time Manages the building of system tests. ENABLE_SYSTEM_TESTING generates the 'ttff' binary for Time-To-First-Fix measurements. ENABLE_SYSTEM_TESTING_EXTRA downloads additional tools and builds extra system tests, copying binaries to the install folder. ```CMake cmake .. -DENABLE_SYSTEM_TESTING=ON cmake .. -DENABLE_SYSTEM_TESTING_EXTRA=ON ``` -------------------------------- ### Create Build Directory Source: https://gnss-sdr.org/docs/tutorials/monitoring-software-receiver-internal-status This command creates a new directory named 'build' in the current project folder. This directory will be used to store build artifacts and compiled code, keeping the source directory clean. ```Shell mkdir build ``` -------------------------------- ### Setting CMAKE_BUILD_TYPE to Debug Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time An example of setting the CMAKE_BUILD_TYPE variable to 'Debug' via the command line to configure the build for debugging purposes. ```Shell $-DCMAKE_BUILD_TYPE=Debug .. ``` -------------------------------- ### Main Function for GNSS Monitoring Client (C++) Source: https://gnss-sdr.org/docs/tutorials/monitoring-software-receiver-internal-status The main function initializes the ncurses interface, parses the UDP port from command-line arguments, and creates an instance of `Gnss_Synchro_Udp_Source`. It then enters an infinite loop to continuously read and display GNSS synchronization data. ```C++ #include "gnss_synchro_udp_source.h" #include #include #include #include #include int main(int argc, char* argv[]) { try { // Check command line arguments. if (argc != 2) { // Print help. std::cerr << "Usage: monitoring-client \n"; return 1; } unsigned short port = boost::lexical_cast(argv[1]); Gnss_Synchro_Udp_Source udp_source(port); initscr(); // Initialize ncurses. printw("Listening on port %d UDP...\n", port); refresh(); // Update the screen. while (true) { udp_source.print_table(); } } catch (std::exception& e) { std::cerr << e.what() << '\n'; } return 0; } ``` -------------------------------- ### Use Realtek RTL2832U Dongle with GNSS-SDR Source: https://gnss-sdr.org/docs/tutorials This tutorial describes one of the most affordable methods for experimenting with real-life signals using GNSS-SDR and a Realtek RTL2832U USB dongle. It covers setup and basic usage. -------------------------------- ### Mount Remote Filesystem using sshfs Source: https://gnss-sdr.org/docs/tutorials/cross-compiling This snippet shows how to install `sshfs`, add the user to the `fuse` group, and mount a remote device's filesystem locally for transferring files over the network. ```bash sudo apt install sshfs sudo gpasswd -a $USER fuse cd mkdir mydevice -o allow_root root@192.168.2.2:/ mydevice ``` -------------------------------- ### Run TTFF Test with Configuration Source: https://gnss-sdr.org/docs/tutorials/testing-software-receiver-2 Example command to run the TTFF test program with a specified configuration file and number of measurements. This demonstrates how to invoke the test with custom parameters. ```bash $--config_file_ttff=my_GPS_rx.conf --num_measurements=50 ``` -------------------------------- ### Initialize Repo and Build Environment Source: https://gnss-sdr.org/docs/tutorials/cross-compiling Initializes the 'repo' client with a specific manifest repository and branch, synchronizes the repositories, and sets up the OpenEmbedded build environment by sourcing configuration files and running BitBake. ```bash $-u https://github.com/carlesfernandez/oe-gnss-sdr-manifest.git -b thud $sync $TEMPLATECONF=`pwd`/meta-gnss-sdr/conf source ./oe-core/oe-init-build-env ./build ./bitbake ``` -------------------------------- ### Configure Limesdr_Signal_Source Parameters Source: https://gnss-sdr.org/docs/sp-blocks/signal-source Example configuration settings for the `Limesdr_Signal_Source` in a properties file, specifying parameters like implementation type, sampling frequency, RF center frequency, gain, and antenna. ```properties SignalSource.implementation=Limesdr_Signal_Source SignalSource.item_type=gr_complex SignalSource.sampling_frequency=5000000 SignalSource.freq=1575420000 SignalSource.gain=50 SignalSource.antenna=2 SignalSource.ext_clock_MHz=0 SignalSource.limechannel_mode=0 SignalSource.samples=0 SignalSource.dump=false SignalSource.dump_filename=./captured_signal.dat ``` -------------------------------- ### Initialize Repo with Sumo Branch Source: https://gnss-sdr.org/docs/tutorials/cross-compiling Initializes the 'repo' client to download the manifest for the 'sumo' release of the SDK, which determines the version of the SDK to be built. ```bash $-u https://github.com/carlesfernandez/oe-gnss-sdr-manifest.git -b sumo ``` -------------------------------- ### GNSS-SDR CMake: Enable Performance Profiling Tools Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time Options for integrating performance analysis tools. ENABLE_GPERFTOOLS links to gperftools libraries (tcmalloc, profiler) and requires gperftools to be installed. ENABLE_GPROF enables the GNU profiler by adding the '-pg' flag during compilation. ```CMake cmake .. -DENABLE_GPERFTOOLS=ON cmake .. -DENABLE_GPROF=ON ``` -------------------------------- ### TrackingPullInTest Execution Example Source: https://gnss-sdr.org/docs/tutorials/testing-software-receiver-2 This snippet demonstrates how to execute the TrackingPullInTest with specific parameters. It utilizes shell commands to filter tests and set configuration values like duration and CN0 levels. ```Shell --gtest_filter=TrackingPullInTest* --plot_detail_level=0 --duration=4 --CN0_dBHz_start=45 CN0_dBHz_stop=35 ``` -------------------------------- ### Build GNSS-SDR with PlutoSDR Support Source: https://gnss-sdr.org/docs/sp-blocks/signal-source This snippet outlines the process to build the GNSS-SDR software with PlutoSDR support enabled. It involves navigating to the GNSS-SDR source directory, creating a build directory, configuring the build with a specific flag, and then installing. ```Shell $cd gnss-sdr && mkdir build && cd build $$$-DENABLE_PLUTOSDR=ON .. $&& sudo make install ``` -------------------------------- ### Configure GPS L1 Telemetry Decoder Source: https://gnss-sdr.org/docs/sp-blocks/telemetry-decoder Configuration example for the GPS L1 C/A Telemetry Decoder, specifying the implementation and enabling/disabling data dumping. This setup is part of a larger receiver configuration. ```configuration ;######### TELEMETRY DECODER CONFIG FOR GPS L1 CHANNELS ############ TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ``` -------------------------------- ### C++ Listener for Navigation Messages (C++) Source: https://gnss-sdr.org/docs/sp-blocks/telemetry-decoder A C++ example application that listens for decoded navigation messages on a specified UDP port and prints them to the terminal. It utilizes the nav_message.proto file and Boost libraries (Boost Asio) for UDP communication. ```C++ // Example C++ code for a UDP listener using Boost Asio // This code would typically involve setting up a UDP socket, // receiving data, and parsing it using Protocol Buffers. // Specific implementation details depend on the nav_message.proto definition. #include #include // Assume nav_message.pb.h is generated from nav_message.proto // #include "nav_message.pb.h" int main() { try { boost::asio::io_context io_context; boost::asio::ip::udp::socket socket(io_context, boost::asio::ip::udp::endpoint(boost::asio::ip::udp::v4(), 1237)); std::cout << "Listening on UDP port 1237..." << std::endl; while (true) { char data[1024]; boost::asio::ip::udp::endpoint sender_endpoint; size_t length = socket.receive_from(boost::asio::buffer(data, 1024), sender_endpoint); // Assuming data contains serialized protobuf messages // NavigationMessage nav_message; // if (nav_message.ParseFromArray(data, length)) { // std::cout << "Received message from " << sender_endpoint.address() << ":\n"; // // Process and print message details from nav_message object // // std::cout << nav_message.DebugString(); // } else { // std::cerr << "Failed to parse message from " << sender_endpoint.address() << std::endl; // } std::cout << "Received " << length << " bytes." << std::endl; } } catch (std::exception& e) { std::cerr << "Exception: " << e.what() << std::endl; } return 0; } ``` -------------------------------- ### Run GPS L1CA PCPS Acquisition Test with Plotting Source: https://gnss-sdr.org/docs/tutorials/testing-software-receiver-2 This test suite is for GPS L1CA PCPS acquisition. If Gnuplot is installed, the `--plot_acq_grid` flag can be used to visualize the acquisition grid. The example demonstrates running the test and enabling the grid plotting. ```Shell $--gtest_filter=GpsL1CaPcpsAcquisitionTest* --plot_acq_grid ``` -------------------------------- ### Run Galileo E1 PCPS Ambiguous Acquisition Test with Plotting Source: https://gnss-sdr.org/docs/tutorials/testing-software-receiver-2 This test suite is for Galileo E1 PCPS ambiguous acquisition. If Gnuplot is installed, the `--plot_acq_grid` flag can be used to visualize the acquisition grid. The example demonstrates running the test and enabling the grid plotting. ```Shell $--gtest_filter=GalileoE1PcpsAmbiguousAcquisitionTest* --plot_acq_grid ``` -------------------------------- ### ControlThread Instantiation and Configuration Source: https://gnss-sdr.org/docs/control-plane Demonstrates how to instantiate the ControlThread and pass the configuration file path as a command-line argument. ```C++ auto control_thread = std::make_unique(); $--config_file=/path/to/my_receiver.conf ``` -------------------------------- ### Use Git with GNSS-SDR Source: https://gnss-sdr.org/docs/tutorials A brief overview of using Git in the context of GNSS-SDR development and collaboration. It covers essential Git commands and workflows. -------------------------------- ### Run FFT Length Test with Custom Iterations and Plotting Source: https://gnss-sdr.org/docs/tutorials/testing-software-receiver-2 This test suite measures the execution time for several FFT lengths. It accepts `--fft_iterations_test` to set the number of averaged iterations and `--plot_fft_length_test` to generate plots if Gnuplot is installed. The example runs the test with 10,000 iterations and enables plotting. ```Shell $--gtest_filter=FFT* --fft_iterations_test=10000 --plot_fft_length_test ``` -------------------------------- ### GNSS-SDR CMake Build Configuration Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time This snippet outlines common CMake variables used to configure the build process for GNSS-SDR. These variables control aspects like build type, installation paths, compiler selection, and search paths for dependencies. ```cmake CMAKE_BUILD_TYPE: Specifies the build type (e.g., Debug, Release). CMAKE_INSTALL_PREFIX: Sets the installation directory. CMAKE_CXX_COMPILER: Defines the C++ compiler. CMAKE_C_COMPILER: Defines the C compiler. CMAKE_INCLUDE_PATH: Adds directories for header files. CMAKE_LIBRARY_PATH: Adds directories for libraries. CMAKE_PREFIX_PATH: Specifies paths for finding packages, headers, binaries, and libraries. CMAKE_TOOLCHAIN_FILE: Points to a toolchain file for cross-compilation. -GNinja: Generates build files for the Ninja build system. -GXcode: Generates an Xcode project file. PYTHON_EXECUTABLE: Specifies the Python interpreter path. ``` -------------------------------- ### Copy Bootable Image using bmaptool Source: https://gnss-sdr.org/docs/tutorials/cross-compiling This demonstrates using `bmaptool` to copy bootable images from `.wic.xz` and `.bmap` files to an SD card, which is a more recent method for flashing images. ```bash sudo bmaptool copy gnss-sdr-demo-image-zedboard-zynq7-20170103150322.rootfs.wic.xz \ --bmap gnss-sdr-demo-image-zedboard-zynq7-20170103150322.rootfs.wic.bmap \ /dev/sdX ``` -------------------------------- ### Build and Run GNSS-SDR Tests Source: https://gnss-sdr.org/docs/tutorials/testing-software-receiver-2 This snippet demonstrates the basic steps to build GNSS-SDR and execute its test suite. It involves navigating to the source directory, creating a build directory, and then running the compiled test executable. The output shows the test execution progress and results. ```bash cd gnss-sdr $$mkdir build && cd build $$$# THIS STEP IS OPTIONAL. It builds and runs a subset of tests. $cd ../install $ ``` -------------------------------- ### Enable Binary Packaging Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time Enables software packaging flags to reduce binary size and potentially improve performance by removing inessential information. ```bash cmake -DENABLE_PACKAGING=ON .. ``` -------------------------------- ### Example XML Report Structure Source: https://gnss-sdr.org/docs/tutorials/testing-software-receiver-2 This is an example of the XML report structure generated by Google Test. It includes test suite and test case information, along with potential failure details. ```xml ``` -------------------------------- ### Start rtl_tcp Server Source: https://gnss-sdr.org/docs/sp-blocks/signal-source This command starts the rtl_tcp I/Q server, which is necessary for remote operation of RTL2832 based DVB-T receivers with GNSS-SDR. It specifies the server address, center frequency, gain, and sampling rate. ```Shell rtl_tcp -a 127.0.0.1 -f 1575420000 -g 0 -s 2000000 ``` -------------------------------- ### C++ Acquisition Block Implementation Example Source: https://gnss-sdr.org/docs/fundamentals Provides an example of an Acquisition block implementation in C++, named GPS_L1_CA_PCPS_Acquisition. It highlights the use of an adapter inheriting from AcquisitionInterface and a GNU Radio block inheriting from gr::block for the actual processing. ```text GPS_L1_CA_PCPS_Acquisition ``` -------------------------------- ### C++ Typedef Example Source: https://gnss-sdr.org/docs/tutorials/understanding-data-types Demonstrates the use of the `typedef` keyword in C++ to create an alias for an existing data type. This example shows how to define `ulong` as a synonym for `unsigned long` and then declares two variables of the same type using both the original and the aliased names. ```C++ // simple typedef typedef unsigned long ulong; // the following two objects have the same type unsigned long l1; ulong l2; ``` -------------------------------- ### Enable DMA Proxy for FPGA Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time Enables the DMA proxy driver for controlling DMA in the FPGA. Requires the DMA proxy driver and `-DENABLE_FPGA=ON`. ```bash cmake -DENABLE_FPGA=ON -DENABLE_DMA_PROXY=ON .. ``` -------------------------------- ### Example ION GNSS SDR Metadata File Source: https://gnss-sdr.org/docs/sp-blocks/signal-source An example XML metadata file conforming to the ION's GNSS Software Defined Receiver Metadata Standard. It defines system properties, band information, file details, and stream configurations for GNSS data. ```XML 4.0000000000000000e+00 1.5754200000000000e+00 0.0000000000000000e+00 2.4000000000000000e+01 2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat 04-Apr-2013 00:00:00 0 2 2 Little None Left 1 16 32 Right Left IQ TC ``` -------------------------------- ### Create Build Directory Source: https://gnss-sdr.org/docs/tutorials/cross-compiling Creates a new directory named 'oe-repo' and changes the current working directory into it, preparing the environment for the Yocto build process. ```bash $mkdir oe-repo $cd oe-repo ``` -------------------------------- ### GNSS-SDR Unit Test Example: Rtcm::hex_to_int Source: https://gnss-sdr.org/docs/tutorials/testing-software-receiver-2 This example shows a practical unit test for the Rtcm class's hex_to_int method. It includes necessary headers, creates an instance of the Rtcm class, calls the method with test data, and uses EXPECT_EQ to assert the correctness of the output. ```C++ #include #include "rtcm.h" TEST(RtcmTest, HexToInt) { auto rtcm = std::make_shared(); std::string test1 = "2A"; long int test1_int = rtcm->hex_to_int(test1); long int expected1 = 42; EXPECT_EQ(expected1, test1_int); } ``` -------------------------------- ### Enable SIMD Profiling Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time Enables automatic execution of `volk_gnsssdr_profile` to test and optimize SIMD kernels for the host machine's architecture. ```bash cmake -DENABLE_PROFILING=ON .. ``` -------------------------------- ### Comment Syntax in Configuration Files Source: https://gnss-sdr.org/docs/control-plane Shows the comment syntax in GNSS-SDR configuration files, where lines starting with a semicolon (;) are treated as comments. ```INI ; THIS IS A COMMENT SignalConditioner.implementation=Pass_Through ; THIS IS ANOTHER COMMENT ``` -------------------------------- ### Enable MAX2771 RF Front-end Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time Enables support for the Analog Devices MAX2771 RF front-end connected to an FPGA. Requires the SPIdev driver and `-DENABLE_FPGA=ON`. ```bash cmake -DENABLE_FPGA=ON -DENABLE_MAX2771=ON .. ``` -------------------------------- ### ControlThread::run() Method Implementation Source: https://gnss-sdr.org/docs/control-plane The core implementation of the ControlThread's run method, which connects, starts, and manages the GNSSFlowgraph, including processing control messages and handling shutdown. ```C++ int ControlThread::run() { // Connect the flowgraph flowgraph_->connect(); // Start the flowgraph flowgraph_->start(); // Launch the GNSS assistance process assist_GNSS(); // Main loop to read and process the control messages while (flowgraph_->running() && !stop_) { read_control_messages(); if (control_messages_ != 0) process_control_messages(); } std::cout << "Stopping GNSS-SDR, please wait!\n"; flowgraph_->stop(); flowgraph_->disconnect(); return 0; } ``` -------------------------------- ### Enable Stripped Binaries Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time Activates the generation of stripped binaries (without debugging information) for smaller size and potentially better performance. Only valid in Release mode and when `ENABLE_PACKAGING` is OFF. ```bash cmake -DENABLE_STRIP=ON .. ``` -------------------------------- ### Create New Feature Branch Source: https://gnss-sdr.org/docs/tutorials/using-git Creates a new branch named 'my_feature' based on the current branch (e.g., 'next') to start working on new features. ```git git checkout -b my_feature ``` -------------------------------- ### Enable AD9361 RF Front-end Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time Enables support for Analog Devices AD9361 RF front-ends connected to an FPGA. Requires libiio (>= 0.14) and `-DENABLE_FPGA=ON`. ```bash cmake -DENABLE_FPGA=ON -DENABLE_AD9361=ON .. ``` -------------------------------- ### GNSS-SDR Main Method Initialization and Execution Source: https://gnss-sdr.org/docs/overview This C++ code snippet illustrates the entry point of the GNSS-SDR application. It handles command-line argument parsing using gflags, initializes the Google Logging library, sets up a ControlThread object for managing the software receiver's operation, and includes basic error handling for the main execution loop. It also measures and reports the total execution time. ```C++ int main(int argc, char** argv) { // Parse command line flags gflags::ParseCommandLineFlags(&argc, &argv, true); // Say hello std::cout << "Initializing GNSS-SDR v" << GNSS_SDR_VERSION << " ... Please wait.\n"; // Logging library initialization google::InitGoogleLogging(argv[0]); // Smart pointer to a ControlThread object auto control_thread = std::make_unique(); // record startup time std::chrono::time_point start, end; start = std::chrono::system_clock::now(); // run the software receiver until it stops try { control_thread->run(); } catch( ... ) { // ... } // report the elapsed time end = std::chrono::system_clock::now(); std::chrono::duration elapsed_seconds = end - start; std::cout << "Total GNSS-SDR run time: " << elapsed_seconds.count() << " [seconds]\n"; // Say goodbye gflags::ShutDownCommandLineFlags(); std::cout << "GNSS-SDR program ended.\n"; return 0; } ``` -------------------------------- ### Galileo E5b Pcps Acquisition Configuration Source: https://gnss-sdr.org/docs/sp-blocks/acquisition Configuration example for the Galileo_E5b_Pcps_Acquisition block, specifying implementation, data type, Probability of False Alarm (PFA), blocking behavior, and maximum Doppler frequency. ```INI ;######### ACQUISITION CONFIG FOR GALILEO E5a CHANNELS ############ Acquisition_7X.implementation=Galileo_E5b_PCPS_Acquisition Acquisition_7X.item_type=gr_complex Acquisition_7X.pfa=0.01 Acquisition_7X.blocking=true Acquisition_7X.doppler_max=5000 ``` -------------------------------- ### Force Local glog Build Source: https://gnss-sdr.org/docs/tutorials/configuration-options-building-time Forces the download, build, and linking of a local glog version. Also attempts to build gflags if not found. ```bash cmake -DENABLE_OWN_GLOG=ON .. ``` -------------------------------- ### Configure GLONASS L2 CA DLL PLL Tracking Source: https://gnss-sdr.org/docs/sp-blocks/tracking Configuration example for the GLONASS_L2_CA_DLL_PLL_Tracking implementation. This sets the implementation type and specific PLL/DLL bandwidths and correlator spacing. ```INI ;######### TRACKING CONFIG FOR GLONASS L2 CHANNELS ############ Tracking_2G.implementation=GLONASS_L2_CA_DLL_PLL_Tracking Tracking_2G.pll_bw_hz=30.0 Tracking_2G.dll_bw_hz=4.0 Tracking_2G.early_late_space_chips=0.5 ```