Merge branch 'release0011'

This commit is contained in:
Carles Fernandez 2019-08-04 23:11:32 +02:00
commit 1b8d8bfe85
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
1209 changed files with 60100 additions and 32251 deletions

View File

@ -51,7 +51,7 @@ IncludeBlocks: Merge
IncludeCategories:
- Regex: '^.*.h"'
Priority: 1
- Regex: '^.*(boost|gflags|glog|gnsssdr|gpstk|gtest|gnuradio|pmt|uhd|volk)/'
- Regex: '^.*(boost|gflags|glog|gnsssdr|gnuradio|gpstk|gsl|gtest|pmt|uhd|volk)/'
Priority: 2
- Regex: '^.*(armadillo|matio|pugixml)'
Priority: 2

View File

@ -1,3 +1,141 @@
---
Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-inefficient-algorithm,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-container-size-empty,readability-named-parameter,readability-non-const-parameter,readability-string-compare'
HeaderFilterRegex: '.*'
Checks: '-*,
boost-use-to-string,
cert-dcl21-cpp,
cert-dcl58-cpp,
cert-env33-c,
cert-err52-cpp,
cert-err60-cpp,
cert-flp30-c,
clang-analyzer-cplusplus*,
cppcoreguidelines-pro-type-cstyle-cast,
cppcoreguidelines-pro-type-static-cast-downcast,
cppcoreguidelines-slicing,
cppcoreguidelines-special-member-functions,
google-build-namespaces,
google-runtime-int,
hicpp-exception-baseclass,
hicpp-explicit-conversions,
misc-misplaced-const,
misc-new-delete-overloads,
misc-non-copyable-objects,
misc-static-assert,
misc-throw-by-value-catch-by-reference,
misc-uniqueptr-reset-release,
misc-unused-using-decls,
modernize-loop-convert,
modernize-pass-by-value,
modernize-raw-string-literal,
modernize-use-auto,
modernize-use-bool-literals,
modernize-use-emplace,
modernize-use-equals-default,
modernize-use-equals-delete,
modernize-use-noexcept,
modernize-use-nullptr,
performance-faster-string-find,
performance-for-range-copy,
performance-implicit-conversion-in-loop,
performance-inefficient-algorithm,
performance-inefficient-string-concatenation,
performance-inefficient-vector-operation,
performance-move-const-arg,
performance-move-constructor-init,
performance-noexcept-move-constructor,
performance-type-promotion-in-math-fn,
performance-unnecessary-copy-initialization,
performance-unnecessary-value-param,
readability-container-size-empty,
readability-identifier-naming,
readability-inconsistent-declaration-parameter-name,
readability-named-parameter,
readability-non-const-parameter,
readability-string-compare'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: 'file'
CheckOptions:
- key: google-build-namespaces.HeaderFileExtensions
value: ',h'
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
- key: google-readability-function-size.StatementThreshold
value: '800'
- key: google-readability-namespace-comments.ShortNamespaceLines
value: '10'
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
- key: google-runtime-int.SignedTypePrefix
value: int
- key: google-runtime-int.TypeSuffix
value: _t
- key: google-runtime-int.UnsignedTypePrefix
value: uint
- key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries
value: '1'
- key: modernize-loop-convert.MaxCopySize
value: '16'
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: modernize-loop-convert.NamingStyle
value: CamelCase
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: modernize-pass-by-value.ValuesOnly
value: '0'
- key: modernize-raw-string-literal.ReplaceShorterLiterals
value: '0'
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: modernize-use-auto.MinTypeNameLength
value: '5'
- key: modernize-use-auto.RemoveStars
value: '0'
- key: modernize-use-equals-default.IgnoreMacros
value: '1'
- key: modernize-use-noexcept.ReplacementString
value: ''
- key: modernize-use-noexcept.UseNoexceptFalse
value: '1'
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
- key: performance-faster-string-find.StringLikeClasses
value: 'std::basic_string'
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: '1'
- key: performance-type-promotion-in-math-fn.IncludeStyle
value: llvm
- key: performance-unnecessary-value-param.IncludeStyle
value: llvm
- key: readability-identifier-naming.AbstractClassCase
value: CamelCase
- key: readability-identifier-naming.AbstractClassPrefix
value: ''
- key: readability-identifier-naming.AbstractClassSuffix
value: ''
- key: readability-identifier-naming.ClassCase
value: Camel_Snake_Case
- key: readability-identifier-naming.ClassPrefix
value: ''
- key: readability-identifier-naming.ClassSuffix
value: ''
- key: readability-identifier-naming.GlobalConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.GlobalConstantPrefix
value: ''
- key: readability-identifier-naming.GlobalConstantSuffix
value: ''
- key: readability-identifier-naming.IgnoreFailedSplit
value: '0'
- key: readability-identifier-naming.StructCase
value: aNy_CasE
- key: readability-identifier-naming.StructPrefix
value: ''
- key: readability-identifier-naming.StructSuffix
value: ''
- key: readability-inconsistent-declaration-parameter-name.IgnoreMacros
value: '1'
- key: readability-inconsistent-declaration-parameter-name.Strict
value: '0'
...

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ thirdparty/
cmake-build-debug/
/install
.DS_Store
.pydevproject

File diff suppressed because it is too large Load Diff

186
README.md
View File

@ -2,18 +2,21 @@
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
**Welcome to GNSS-SDR!**
This program is a software-defined receiver which is able to process (that is, to perform detection, synchronization, demodulation and decoding of the navigation message, computation of observables and, finally, computation of position fixes) the following Global Navigation Satellite System's signals:
In the L1 band:
- 🛰 GPS L1 C/A (centered at 1575.42 MHz) :white_check_mark:
- 🛰 Galileo E1b/c (centered at 1575.42 MHz) :white_check_mark:
- 🛰 GLONASS L1 C/A (centered at 1601.72 MHz) :white_check_mark:
- 🛰 GLONASS L1 C/A (centered at 1602.00 MHz) :white_check_mark:
- 🛰 GPS L1 C/A (centered at 1575.42 MHz) :white_check_mark:
- 🛰 Galileo E1b/c (centered at 1575.42 MHz) :white_check_mark:
- 🛰 BeiDou B1I (centered at 1561.098 MHz) :white_check_mark:
In the L2 band:
- 🛰 BeiDou B3I (centered at 1268.520 MHz) :white_check_mark:
- 🛰 GLONASS L2 C/A (centered at 1246.00 MHz) :white_check_mark:
- 🛰 GPS L2C (centered at 1227.60 MHz) :white_check_mark:
- 🛰 GLONASS L2 C/A (centered at 1246 MHz) :white_check_mark:
In the L5 band:
- 🛰 GPS L5 (centered at 1176.45 MHz) :white_check_mark:
@ -32,7 +35,7 @@ This section describes how to set up the compilation environment in GNU/Linux or
GNU/Linux
----------
* Tested distributions: Ubuntu 14.04 LTS and above; Debian 8.0 "jessie" and above; Fedora 26 and above; CentOS 7; Arch Linux.
* Tested distributions: Ubuntu 14.04 LTS and above; Debian 8.0 "jessie" and above; Arch Linux; CentOS 7; Fedora 26 and above; OpenSUSE 42.3 and above.
* Supported microprocessor architectures:
* i386: Intel x86 instruction set (32-bit microprocessors).
* amd64: also known as x86-64, the 64-bit version of the x86 instruction set, originally created by AMD and implemented by AMD, Intel, VIA and others.
@ -65,10 +68,10 @@ $ sudo apt-get install build-essential cmake git libboost-dev libboost-date-time
libboost-serialization-dev liblog4cpp5-dev libuhd-dev gnuradio-dev gr-osmosdr \
libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev \
libgnutls-openssl-dev libpcap-dev python-mako python-six libmatio-dev libpugixml-dev \
libgtest-dev
libgtest-dev libprotobuf-dev protobuf-compiler
~~~~~~
Please note that the required files from `libgtest-dev` were moved to `googletest` in Debian 9 "stretch" and Ubuntu 18.04 "bionic", and moved back again to `libgtest-dev` in Debian 10 "buster" and Ubuntu 18.10 "cosmic".
Please note that the required files from `libgtest-dev` were moved to `googletest` in Debian 9 "stretch" and Ubuntu 18.04 "bionic", and moved back again to `libgtest-dev` in Debian 10 "buster" and Ubuntu 18.10 "cosmic" (and above).
**Note for Ubuntu 14.04 LTS "trusty" users:** you will need to build from source and install GNU Radio manually, as explained below, since GNSS-SDR requires `gnuradio-dev` >= 3.7.3, and Ubuntu 14.04 came with 3.7.2. Install all the packages above BUT EXCEPT `libuhd-dev`, `gnuradio-dev` and `gr-osmosdr` (and remove them if they are already installed in your machine), and install those dependencies using PyBOMBS. The same applies to `libmatio-dev`: Ubuntu 14.04 came with 1.5.2 and the minimum required version is 1.5.3. Please do not install the `libmatio-dev` package and install `libtool`, `automake` and `libhdf5-dev` instead. A recent version of the library will be downloaded and built automatically if CMake does not find it installed.
@ -76,21 +79,19 @@ Please note that the required files from `libgtest-dev` were moved to `googletes
Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux).
#### Arch Linux
#### Fedora
If you are using Fedora 26 or above, the required software dependencies can be installed by doing:
If you are using Arch Linux:
~~~~~~
$ sudo yum install make automake gcc gcc-c++ kernel-devel cmake git boost-devel \
boost-date-time boost-system boost-filesystem boost-thread boost-chrono \
boost-serialization log4cpp-devel gnuradio-devel gr-osmosdr-devel \
blas-devel lapack-devel matio-devel armadillo-devel gflags-devel \
glog-devel openssl-devel libpcap-devel python-mako python-six pugixml-devel
$ pacman -S gcc make cmake git boost boost-libs log4cpp libvolk gnuradio \
gnuradio-osmosdr blas lapack gflags google-glog openssl pugixml \
python-mako python-six libmatio libpcap gtest protobuf
~~~~~~
Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux).
#### CentOS
If you are using CentOS 7, you can install the dependencies via Extra Packages for Enterprise Linux ([EPEL](https://fedoraproject.org/wiki/EPEL)):
@ -108,18 +109,50 @@ $ sudo yum install make automake gcc gcc-c++ kernel-devel libtool \
Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux).
#### Arch Linux
If you are using Arch Linux (with base-devel group installed):
#### Fedora
If you are using Fedora 26 or above, the required software dependencies can be installed by doing:
~~~~~~
$ pacman -S cmake git boost boost-libs log4cpp libvolk gnuradio gnuradio-osmosdr \
blas lapack gflags google-glog openssl pugixml python-mako python-six \
libmatio libpcap gtest
$ sudo yum install make automake gcc gcc-c++ kernel-devel cmake git boost-devel \
boost-date-time boost-system boost-filesystem boost-thread boost-chrono \
boost-serialization log4cpp-devel gnuradio-devel gr-osmosdr-devel \
blas-devel lapack-devel matio-devel armadillo-devel gflags-devel \
glog-devel openssl-devel libpcap-devel python-mako python-six \
pugixml-devel protobuf-devel protobuf-compiler
~~~~~~
Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux).
#### openSUSE
If you are using openSUSE Leap:
~~~~~~
zypper install cmake git gcc-c++ boost-devel libboost_atomic-devel \
libboost_system-devel libboost_filesystem-devel libboost_chrono-devel \
libboost_thread-devel libboost_serialization-devel log4cpp-devel \
gnuradio-devel pugixml-devel libpcap-devel armadillo-devel libtool \
automake hdf5-devel openssl-devel python-Mako python-six protobuf-devel
~~~~~~
If you are using openSUSE Tumbleweed:
~~~~~~
zypper install cmake git gcc-c++ boost-devel libboost_atomic-devel \
libboost_system-devel libboost_filesystem-devel libboost_date_time-devel \
libboost_thread-devel libboost_chrono-devel libboost_serialization-devel \
log4cpp-devel gtest gnuradio-devel pugixml-devel libpcap-devel \
armadillo-devel libtool automake hdf5-devel libopenssl-devel \
python3-Mako python3-six protobuf-devel
~~~~~~
Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux).
### Alternative 2: Install dependencies using PyBOMBS
This option is adequate if you are interested in development, in working with the most recent versions of software dependencies, want more fine tuning on the installed versions, or simply in building everything from the scratch just for the fun of it. In such cases, we recommend to use [PyBOMBS](https://github.com/gnuradio/pybombs "Python Build Overlay Managed Bundle System") (Python Build Overlay Managed Bundle System), GNU Radio's meta-package manager tool that installs software from source, or whatever the local package manager is, that automatically does all the work for you. Please take a look at the configuration options and general PyBOMBS usage at https://github.com/gnuradio/pybombs. Here we provide a quick step-by-step tutorial.
@ -187,9 +220,9 @@ $ sudo apt-get install libblas-dev liblapack-dev # For Debian/Ubuntu/Linux
$ sudo yum install lapack-devel blas-devel # For Fedora/CentOS/RHEL
$ sudo zypper install lapack-devel blas-devel # For OpenSUSE
$ sudo pacman -S blas lapack # For Arch Linux
$ wget https://sourceforge.net/projects/arma/files/armadillo-9.100.5.tar.xz
$ tar xvfz armadillo-9.100.5.tar.xz
$ cd armadillo-9.100.5
$ wget http://sourceforge.net/projects/arma/files/armadillo-9.600.4.tar.xz
$ tar xvfz armadillo-9.600.4.tar.xz
$ cd armadillo-9.600.4
$ cmake .
$ make
$ sudo make install
@ -216,9 +249,10 @@ $ sudo ldconfig
#### Install [Glog](https://github.com/google/glog "Glog's Homepage"), a library that implements application-level logging:
~~~~~~
$ wget https://github.com/google/glog/archive/v0.3.5.tar.gz
$ tar xvfz v0.3.5.tar.gz
$ cd glog-0.3.5
$ wget https://github.com/google/glog/archive/v0.4.0.tar.gz
$ tar xvfz v0.4.0.tar.gz
$ cd glog-0.4.0
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
@ -260,6 +294,29 @@ In case the GnuTLS library with openssl extensions package is not available in y
#### Install [Protocol Buffers](https://developers.google.com/protocol-buffers/ "Protocol Buffers' Homepage"), a portable mechanism for serialization of structured data:
GNSS-SDR requires Protocol Buffers v3.0.0 or later. If the packages that come with your distribution are older than that (_e.g._, Ubuntu 16.04 Xenial and Debian 8 Jessie came with older versions), then you will need to install it manually. First, install the dependencies:
~~~~~~
$ sudo apt-get install autoconf automake libtool curl make g++ unzip
~~~~~~
and then:
~~~~~~
$ wget https://github.com/protocolbuffers/protobuf/releases/download/v3.8.0/protobuf-cpp-3.8.0.tar.gz
$ tar xvfz protobuf-cpp-3.8.0.tar.gz
$ cd protobuf-3.8.0
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
$ sudo ldconfig
~~~~~~
### <a name="download-and-build-linux">Clone GNSS-SDR's Git repository</a>:
~~~~~~
@ -284,7 +341,7 @@ Cloning the GNSS-SDR repository as in the line above will create a folder named
|-----utils <- some utilities (e.g. Matlab scripts).
~~~~~~
By default, you will be in the 'master' branch of the Git repository, which corresponds to the lastest stable release. If you want to try the latest developments, you can use the 'next' branch by going to the newly created gnss-sdr folder doing:
By default, you will be in the 'master' branch of the Git repository, which corresponds to the latest stable release. If you want to try the latest developments, you can use the 'next' branch by going to the newly created gnss-sdr folder doing:
~~~~~~
$ git checkout next
@ -304,14 +361,14 @@ $ cd gnss-sdr/build
Configure and build the application:
~~~~~~
$ cmake ../
$ cmake ..
$ make
~~~~~~
By default, CMake will build the Release version, meaning that the compiler will generate a fast, optimized executable. This is the recommended build type when using an RF front-end and you need to attain real time. If working with a file (and thus without real-time constraints), you may want to obtain more information about the internals of the receiver, as well as more fine-grained logging. This can be done by building the Debug version, by doing:
~~~~~~
$ cmake -DCMAKE_BUILD_TYPE=Debug ../
$ cmake -DCMAKE_BUILD_TYPE=Debug ..
$ make
~~~~~~
@ -369,7 +426,7 @@ Install the GNU Radio module:
~~~~~~
$ git clone https://github.com/gnss-sdr/gr-gn3s
$ cd gr-gn3s/build
$ cmake ../
$ cmake ..
$ make
$ sudo make install
$ sudo ldconfig
@ -379,7 +436,7 @@ Then configure GNSS-SDR to build the `GN3S_Signal_Source` by:
~~~~~~
$ cd gnss-sdr/build
$ cmake -DENABLE_GN3S=ON ../
$ cmake -DENABLE_GN3S=ON ..
$ make
$ sudo make install
~~~~~~
@ -402,16 +459,16 @@ $ git clone git://git.osmocom.org/osmo-sdr.git
$ cd osmo-sdr/software/libosmosdr
$ mkdir build
$ cd build/
$ cmake ../
$ cmake ..
$ make
$ sudo make install
$ sudo ldconfig
$ cd ../../
$ cd ../..
$ git clone git://git.osmocom.org/gr-osmosdr
$ cd gr-osmosdr
$ mkdir build
$ cd build
$ cmake ../ -Wno-dev
$ cmake .. -Wno-dev
$ make
$ sudo make install
$ sudo ldconfig
@ -421,7 +478,7 @@ $ sudo ldconfig
Then, configure GNSS-SDR to build the `Osmosdr_Signal_Source` by:
~~~~~~
$ cmake -DENABLE_OSMOSDR=ON ../
$ cmake -DENABLE_OSMOSDR=ON ..
$ make
$ sudo make install
~~~~~~
@ -461,14 +518,14 @@ Then configure GNSS-SDR to build the `Fmcomms2_Signal_Source` implementation:
~~~~~~
$ cd gnss-sdr/build
$ cmake -DENABLE_FMCOMMS2=ON ../
$ cmake -DENABLE_FMCOMMS2=ON ..
$ make
$ sudo make install
~~~~~~
or configure it to build `Plutosdr_Signal_Source`:
~~~~~~
$ cmake -DENABLE_PLUTOSDR=ON ../
$ cmake -DENABLE_PLUTOSDR=ON ..
$ make
$ sudo make install
~~~~~~
@ -480,7 +537,7 @@ With `Fmcomms2_Signal_Source` you can use any SDR hardware based on [FMCOMMS2](h
In order to enable the building of blocks that use OpenCL, type:
~~~~~~
$ cmake -DENABLE_OPENCL=ON ../
$ cmake -DENABLE_OPENCL=ON ..
$ make
$ sudo make install
~~~~~~
@ -491,7 +548,7 @@ $ sudo make install
In order to enable the building of blocks that use CUDA, NVIDIA's parallel programming model that enables graphics processing unit (GPU) acceleration for data-parallel computations, first you need to install the CUDA Toolkit from [NVIDIA Developers Download page](https://developer.nvidia.com/cuda-downloads "CUDA Downloads"). Make sure that the SDK samples build well. Then, build GNSS-SDR by doing:
~~~~~~
$ cmake -DENABLE_CUDA=ON ../
$ cmake -DENABLE_CUDA=ON ..
$ make
$ sudo make install
~~~~~~
@ -504,7 +561,7 @@ Of course, you will also need a GPU that [supports CUDA](https://developer.nvidi
In order to build an executable that not depends on the specific SIMD instruction set that is present in the processor of the compiling machine, so other users can execute it in other machines without those particular sets, use:
~~~~~~
$ cmake -DENABLE_GENERIC_ARCH=ON ../
$ cmake -DENABLE_GENERIC_ARCH=ON ..
$ make
$ sudo make install
~~~~~~
@ -540,21 +597,23 @@ In a terminal, type:
~~~~~~
$ sudo port selfupdate
$ sudo port upgrade outdated
$ sudo port install doxygen +latex
$ sudo port install gnuradio
$ sudo port install lapack
$ sudo port install armadillo
$ sudo port install gnutls
$ sudo port install google-glog +gflags
$ sudo port install py27-mako
$ sudo port install py27-six
$ sudo port install matio
$ sudo port install pugixml
$ sudo port install protobuf3-cpp
$ sudo port install py27-mako
$ sudo port install py27-six
$ sudo port install doxygen +docs
~~~~~~
You also might need to activate a Python installation. The list of installed versions can be retrieved with:
~~~~~~
$ port select list python
$ port select --list python
~~~~~~
and you can activate a certain version by typing:
@ -571,7 +630,7 @@ First, install [Homebrew](https://brew.sh/). Paste this in a terminal prompt:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
~~~~~~
The script explains what it will do and then pauses before it does it. There are more installation options [here](https://docs.brew.sh/Installation.html).
The script explains what it will do, and then it pauses before doing it. There are more installation options [here](https://docs.brew.sh/Installation.html).
Install pip:
@ -582,17 +641,24 @@ $ sudo easy_install pip
Install the required dependencies:
~~~~~~
$ brew tap homebrew/science
$ brew install cmake hdf5 arpack superlu
$ brew install cmake
$ brew install hdf5
$ brew install lapack
$ brew install armadillo
$ brew install glog gflags gnutls
$ brew install gflags
$ brew install glog
$ brew install gnuradio
$ brew install libmatio
$ brew install log4cpp
$ brew install openssl
$ brew install pugixml
$ brew install protobuf
$ pip install mako
$ pip install six
~~~~~~
#### Build GNSS-SDR
Finally, you are ready to clone the GNSS-SDR repository, configure and build the software:
@ -600,7 +666,7 @@ Finally, you are ready to clone the GNSS-SDR repository, configure and build the
~~~~~~
$ git clone https://github.com/gnss-sdr/gnss-sdr
$ cd gnss-sdr/build
$ cmake ../
$ cmake ..
$ make
~~~~~~
@ -631,25 +697,29 @@ GNSS-SDR comes with a library which is a module of the Vector-Optimized Library
GNU Radio and other dependencies can also be installed using other package managers than Macports, such as [Fink](http://www.finkproject.org/ "Fink") or [Homebrew](https://brew.sh/ "Homebrew"). Since the version of Python that ships with OS X is great for learning but it is not good for development, you could have another Python executable in a non-standard location. If that is the case, you need to inform GNSS-SDR's configuration system by defining the `PYTHON_EXECUTABLE` variable as:
~~~~~~
cmake -DPYTHON_EXECUTABLE=/path/to/bin/python ../
cmake -DPYTHON_EXECUTABLE=/path/to/bin/python ..
~~~~~~
In case you have installed Macports in a non-standard location, you can use:
~~~~~~
$ cmake -DCMAKE_PREFIX_PATH=/opt/local -DUSE_MACPORTS_PYTHON=/opt/local/bin/python ../
$ cmake -DCMAKE_PREFIX_PATH=/opt/local -DUSE_MACPORTS_PYTHON=/opt/local/bin/python ..
~~~~~~
changing ```/opt/local``` by the base directory in which your software is installed.
The CMake script will create Makefiles that download, build and link Armadillo, Gflags, Glog and Google Test on the fly at compile time if they are not detected in your machine.
The CMake script will create Makefiles that download, build and link Armadillo, Gflags, Glog, Matio, Protocol Buffers, PugiXML and Google Test on the fly at compile time if they are not detected in your machine.
Other builds
---------
* **Docker container**: A technology providing operating-system-level virtualization to build, ship, and run distributed applications, whether on laptops, data center VMs, or the cloud. Visit [https://github.com/carlesfernandez/docker-gnsssdr](https://github.com/carlesfernandez/docker-gnsssdr) or [https://github.com/carlesfernandez/docker-pybombs-gnsssdr](https://github.com/carlesfernandez/docker-pybombs-gnsssdr) for instructions.
* **Docker image**: A technology providing operating-system-level virtualization to build, ship, and run distributed applications, whether on laptops, data center VMs, or the cloud. Visit [https://github.com/carlesfernandez/docker-gnsssdr](https://github.com/carlesfernandez/docker-gnsssdr) or [https://github.com/carlesfernandez/docker-pybombs-gnsssdr](https://github.com/carlesfernandez/docker-pybombs-gnsssdr) for instructions.
* **Snap packages**: [Snaps](https://snapcraft.io) are universal Linux packages aimed to work on any distribution or device, from IoT devices to servers, desktops to mobile devices. Visit [https://github.com/carlesfernandez/snapcraft-sandbox](https://github.com/carlesfernandez/snapcraft-sandbox) for instructions.
* **Snap package**: [Snaps](https://snapcraft.io) are universal Linux packages aimed to work on any distribution or device, from IoT devices to servers, desktops to mobile devices. Visit [https://github.com/carlesfernandez/snapcraft-sandbox](https://github.com/carlesfernandez/snapcraft-sandbox) for instructions, or directly [get the software from the Snap Store](https://snapcraft.io/gnss-sdr-next):
<p align="center">
<a href="https://snapcraft.io/gnss-sdr-next"><img src="https://snapcraft.io/static/images/badges/en/snap-store-white.svg" alt="Get GNSS-SDR from the Snap Store"></a>
</p>
* **GNSS-SDR in embedded platforms**: we provide a Software Development Kit (SDK) based on [OpenEmbedded](http://www.openembedded.org/wiki/Main_Page) for cross-compiling GNSS-SDR in your desktop computer and for producing executables that can run in embedded platforms, such as a Zedboard or a Raspberry Pi 3. Visit [Cross-compiling GNSS-SDR](https://gnss-sdr.org/docs/tutorials/cross-compiling/) for instructions.
@ -1116,6 +1186,8 @@ Each channel must be assigned to a GNSS signal, according to the following ident
| GPS L1 C/A | 1C |
| Galileo E1b/c | 1B |
| Glonass L1 C/A | 1G |
| Beidou B1I | B1 |
| Beidou B3I | B3 |
| GPS L2 L2C(M) | 2S |
| Glonass L2 C/A | 2G |
| GPS L5 | L5 |
@ -1231,7 +1303,8 @@ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=gr_complex
Tracking_1C.pll_bw_hz=50.0 ; PLL loop filter bandwidth [Hz]
Tracking_1C.dll_bw_hz=2.0 ; DLL loop filter bandwidth [Hz]
Tracking_1C.order=3 ; PLL/DLL loop filter order [2] or [3]
Tracking_1C.pll_filter_order=3 ; PLL loop filter order [2] or [3]
Tracking_1C.dll_filter_order=2 ; DLL loop filter order [1], [2] or [3]
Tracking_1C.early_late_space_chips=0.5 ; correlator early-late space [chips].
Tracking_1C.dump=false ; Enable internal binary data file logging [true] or [false]
Tracking_1C.dump_filename=./tracking_ch_ ; Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
@ -1245,7 +1318,8 @@ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking
Tracking_1B.item_type=gr_complex
Tracking_1B.pll_bw_hz=15.0;
Tracking_1B.dll_bw_hz=2.0;
Tracking_1B.order=3;
Tracking_1B.pll_filter_order=3 ; PLL loop filter order [2] or [3]
Tracking_1B.dll_filter_order=2 ; DLL loop filter order [1], [2] or [3]
Tracking_1B.early_late_space_chips=0.15;
Tracking_1B.very_early_late_space_chips=0.6;
Tracking_1B.dump=false

View File

@ -0,0 +1,58 @@
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
# GNSS-SDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNSS-SDR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
# Avoid using the BLAS and LAPACK implementations that comes with the Accelerate
# framework, which causes a bug when the BeiDou constellation is enabled
find_library(BLAS_LIBRARIES
libblas.dylib
PATHS
/opt/local/lib/lapack
/usr/local/opt/lapack/lib
/usr/local/lib
${BLAS_ROOT}/lib
$ENV{BLAS_ROOT}/lib
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH
)
if(BLAS_LIBRARIES)
set(BLAS_FOUND TRUE)
endif()
find_library(LAPACK_LIBRARIES
liblapack.dylib
PATHS
/opt/local/lib/lapack
/usr/local/opt/lapack/lib
/usr/local/lib
${BLAS_ROOT}/lib
$ENV{BLAS_ROOT}/lib
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH
)
if(LAPACK_LIBRARIES)
set(LAPACK_FOUND TRUE)
endif()

View File

@ -0,0 +1,260 @@
# Copyright (C) 2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
# GNSS-SDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNSS-SDR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
# Original Source: https://github.com/vector-of-bool/CMakeCM
# Modified by C. Fernandez-Prades.
#[=======================================================================[.rst:
FindFILESYSTEM
##############
This module supports the C++17 standard library's filesystem utilities. Use the
:imp-target:`std::filesystem` imported target to
Options
*******
The ``COMPONENTS`` argument to this module supports the following values:
.. find-component:: Experimental
:name: fs.Experimental
Allows the module to find the "experimental" Filesystem TS version of the
Filesystem library. This is the library that should be used with the
``std::experimental::filesystem`` namespace.
.. find-component:: Final
:name: fs.Final
Finds the final C++17 standard version of the filesystem library.
If no components are provided, behaves as if the
:find-component:`fs.Final` component was specified.
If both :find-component:`fs.Experimental` and :find-component:`fs.Final` are
provided, first looks for ``Final``, and falls back to ``Experimental`` in case
of failure. If ``Final`` is found, :imp-target:`std::filesystem` and all
:ref:`variables <fs.variables>` will refer to the ``Final`` version.
Imported Targets
****************
.. imp-target:: std::filesystem
The ``std::filesystem`` imported target is defined when any requested
version of the C++ filesystem library has been found, whether it is
*Experimental* or *Final*.
If no version of the filesystem library is available, this target will not
be defined.
.. note::
This target has ``cxx_std_17`` as an ``INTERFACE``
:ref:`compile language standard feature <req-lang-standards>`. Linking
to this target will automatically enable C++17 if no later standard
version is already required on the linking target.
.. _fs.variables:
Variables
*********
.. variable:: CXX_FILESYSTEM_IS_EXPERIMENTAL
Set to ``TRUE`` when the :find-component:`fs.Experimental` version of C++
filesystem library was found, otherwise ``FALSE``.
.. variable:: CXX_FILESYSTEM_HAVE_FS
Set to ``TRUE`` when a filesystem header was found.
.. variable:: CXX_FILESYSTEM_HEADER
Set to either ``filesystem`` or ``experimental/filesystem`` depending on
whether :find-component:`fs.Final` or :find-component:`fs.Experimental` was
found.
.. variable:: CXX_FILESYSTEM_NAMESPACE
Set to either ``std::filesystem`` or ``std::experimental::filesystem``
depending on whether :find-component:`fs.Final` or
:find-component:`fs.Experimental` was found.
Examples
********
Using `find_package(FILESYSTEM)` with no component arguments:
.. code-block:: cmake
find_package(FILESYSTEM REQUIRED)
add_executable(my-program main.cpp)
target_link_libraries(my-program PRIVATE std::filesystem)
#]=======================================================================]
if(TARGET std::filesystem)
# This module has already been processed. Don't do it again.
return()
endif()
include(CMakePushCheckState)
include(CheckIncludeFileCXX)
include(CheckCXXSourceCompiles)
cmake_push_check_state()
set(CMAKE_REQUIRED_QUIET ${FILESYSTEM_FIND_QUIETLY})
# All of our tests require C++17 or later
set(OLD_CMAKE_CXX_STANDARD ${CMAKE_CXX_STANDARD})
set(CMAKE_CXX_STANDARD 17)
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "9.0.0"))
set(CMAKE_REQUIRED_FLAGS "-std=c++17")
endif()
if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.99"))
set(CMAKE_REQUIRED_FLAGS "-std=c++17")
endif()
# Normalize and check the component list we were given
set(want_components ${FILESYSTEM_FIND_COMPONENTS})
if(FILESYSTEM_FIND_COMPONENTS STREQUAL "")
set(want_components Final)
endif()
# Warn on any unrecognized components
set(extra_components ${want_components})
list(REMOVE_ITEM extra_components Final Experimental)
foreach(component IN LISTS extra_components)
message(WARNING "Extraneous find_package component for FILESYSTEM: ${component}")
endforeach()
# Detect which of Experimental and Final we should look for
set(find_experimental TRUE)
set(find_final TRUE)
if(NOT "Final" IN_LIST want_components)
set(find_final FALSE)
endif()
if(NOT "Experimental" IN_LIST want_components)
set(find_experimental FALSE)
endif()
if(find_final)
check_include_file_cxx("filesystem" _CXX_FILESYSTEM_HAVE_HEADER)
mark_as_advanced(_CXX_FILESYSTEM_HAVE_HEADER)
if(_CXX_FILESYSTEM_HAVE_HEADER)
# We found the non-experimental header. Don't bother looking for the
# experimental one.
set(find_experimental FALSE)
endif()
else()
set(_CXX_FILESYSTEM_HAVE_HEADER FALSE)
endif()
if(find_experimental)
check_include_file_cxx("experimental/filesystem" _CXX_FILESYSTEM_HAVE_EXPERIMENTAL_HEADER)
mark_as_advanced(_CXX_FILESYSTEM_HAVE_EXPERIMENTAL_HEADER)
else()
set(_CXX_FILESYSTEM_HAVE_EXPERIMENTAL_HEADER FALSE)
endif()
if(_CXX_FILESYSTEM_HAVE_HEADER)
set(_have_fs TRUE)
set(_fs_header filesystem)
set(_fs_namespace std::filesystem)
elseif(_CXX_FILESYSTEM_HAVE_EXPERIMENTAL_HEADER)
set(_have_fs TRUE)
set(_fs_header experimental/filesystem)
set(_fs_namespace std::experimental::filesystem)
else()
set(_have_fs FALSE)
endif()
set(CXX_FILESYSTEM_HAVE_FS ${_have_fs} CACHE BOOL "TRUE if we have the C++ filesystem headers")
set(CXX_FILESYSTEM_HEADER ${_fs_header} CACHE STRING "The header that should be included to obtain the filesystem APIs")
set(CXX_FILESYSTEM_NAMESPACE ${_fs_namespace} CACHE STRING "The C++ namespace that contains the filesystem APIs")
set(_found FALSE)
if(CXX_FILESYSTEM_HAVE_FS)
# We have some filesystem library available. Do link checks
string(CONFIGURE [[
#include <@CXX_FILESYSTEM_HEADER@>
int main() {
auto cwd = @CXX_FILESYSTEM_NAMESPACE@::current_path();
return static_cast<int>(cwd.string().size());
}
]] code @ONLY)
# Try to compile a simple filesystem program without any linker flags
check_cxx_source_compiles("${code}" CXX_FILESYSTEM_NO_LINK_NEEDED)
set(can_link ${CXX_FILESYSTEM_NO_LINK_NEEDED})
if(NOT CXX_FILESYSTEM_NO_LINK_NEEDED)
set(prev_libraries ${CMAKE_REQUIRED_LIBRARIES})
set(CMAKE_REQUIRED_FLAGS "-std=c++17")
# Add the libstdc++ flag
set(CMAKE_REQUIRED_LIBRARIES ${prev_libraries} -lstdc++fs)
check_cxx_source_compiles("${code}" CXX_FILESYSTEM_STDCPPFS_NEEDED)
set(can_link ${CXX_FILESYSTEM_STDCPPFS_NEEDED})
if(NOT CXX_FILESYSTEM_STDCPPFS_NEEDED)
# Try the libc++ flag
set(CMAKE_REQUIRED_LIBRARIES ${prev_libraries} -lc++fs)
check_cxx_source_compiles("${code}" CXX_FILESYSTEM_CPPFS_NEEDED)
set(can_link ${CXX_FILESYSTEM_CPPFS_NEEDED})
endif()
endif()
if(can_link)
if(CMAKE_VERSION VERSION_LESS 3.12)
add_library(std::filesystem INTERFACE IMPORTED GLOBAL)
else()
add_library(std::filesystem INTERFACE IMPORTED)
target_compile_features(std::filesystem INTERFACE cxx_std_17)
endif()
set(_found TRUE)
if(CXX_FILESYSTEM_NO_LINK_NEEDED)
# Nothing to add...
elseif(CXX_FILESYSTEM_STDCPPFS_NEEDED)
target_link_libraries(std::filesystem INTERFACE -lstdc++fs)
elseif(CXX_FILESYSTEM_CPPFS_NEEDED)
target_link_libraries(std::filesystem INTERFACE -lc++fs)
endif()
endif()
endif()
if(NOT ${_found})
set(CMAKE_CXX_STANDARD ${OLD_CMAKE_CXX_STANDARD})
endif()
cmake_pop_check_state()
set(FILESYSTEM_FOUND ${_found} CACHE BOOL "TRUE if we can compile and link a program using std::filesystem" FORCE)
if(FILESYSTEM_FIND_REQUIRED AND NOT FILESYSTEM_FOUND)
message(FATAL_ERROR "Cannot compile a simple program using std::filesystem")
endif()

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -26,6 +26,15 @@
# GFlags_INCLUDE_DIRS
# GFlags_LIBS
# GFlags_LIBRARY_DIRS
#
# Provides the following imported target:
# Gflags::gflags
#
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
if(APPLE)
find_path(GFlags_ROOT_DIR
@ -95,9 +104,6 @@ if(GFlags_ROOT_DIR)
else()
set(GFLAGS_GREATER_20 FALSE)
endif()
# set up include and link directory
include_directories(${GFlags_INCLUDE_DIRS})
link_directories(${GFlags_LIBRARY_DIRS})
message(STATUS "gflags library found at ${GFlags_lib}")
set(GFlags_LIBS ${GFlags_lib})
set(GFlags_FOUND true)
@ -109,3 +115,42 @@ endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GFLAGS DEFAULT_MSG GFlags_LIBS GFlags_INCLUDE_DIRS)
if(GFLAGS_FOUND)
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
unset(PACKAGE_VERSION)
list(GET GFlags_LIBS 0 FIRST_DIR)
get_filename_component(GFlags_LIBS_DIR ${FIRST_DIR} DIRECTORY)
if(EXISTS ${GFlags_LIBS_DIR}/cmake/gflags/gflags-config-version.cmake)
include(${GFlags_LIBS_DIR}/cmake/gflags/gflags-config-version.cmake)
endif()
if(PACKAGE_VERSION)
set(GFLAGS_VERSION ${PACKAGE_VERSION})
set_package_properties(GFLAGS PROPERTIES
DESCRIPTION "C++ library that implements commandline flags processing (found: v${GFLAGS_VERSION})"
)
else()
set_package_properties(GFLAGS PROPERTIES
DESCRIPTION "C++ library that implements commandline flags processing"
)
endif()
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
else()
set_package_properties(GFLAGS PROPERTIES
DESCRIPTION "C++ library that implements commandline flags processing"
)
endif()
set_package_properties(GFLAGS PROPERTIES
URL "https://github.com/gflags/gflags"
)
if(GFLAGS_FOUND AND NOT TARGET Gflags::gflags)
add_library(Gflags::gflags SHARED IMPORTED)
set_target_properties(Gflags::gflags PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GFlags_LIBS}"
INTERFACE_INCLUDE_DIRECTORIES "${GFlags_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${GFlags_LIBS}"
)
endif()

View File

@ -15,6 +15,10 @@
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
find_library(GFORTRAN NAMES gfortran
PATHS /usr/lib
/usr/lib64
@ -45,12 +49,37 @@ find_library(GFORTRAN NAMES gfortran
/usr/lib/gcc/i686-redhat-linux/4.8.2
/usr/lib/gcc/x86_64-redhat-linux/7
/usr/lib/gcc/i686-redhat-linux/7
/usr/lib/gcc/x86_64-redhat-linux/8
/usr/lib/gcc/i686-redhat-linux/8
/usr/lib/gcc/x86_64-redhat-linux/9
/usr/lib/gcc/i686-redhat-linux/9
/usr/lib64/gcc/x86_64-redhat-linux/7
/usr/lib64/gcc/x86_64-redhat-linux/8
/usr/lib64/gcc/x86_64-redhat-linux/9
/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/7
/usr/lib/gcc/aarch64-redhat-linux/7
/usr/lib/gcc/i586-suse-linux/4.8 # OpenSUSE 13.1
/usr/lib/gcc/i586-suse-linux/4.9
/usr/lib/gcc/i586-suse-linux/7
/usr/lib/gcc/i586-suse-linux/8
/usr/lib/gcc/i586-suse-linux/9
/usr/lib/gcc/x86_64-suse-linux/4.8
/usr/lib/gcc/x86_64-suse-linux/4.9
/usr/lib64/gcc/x86_64-suse-linux/7
/usr/lib64/gcc/x86_64-suse-linux/8
/usr/lib64/gcc/x86_64-suse-linux/9
/usr/lib/gcc/armv7hl-suse-linux-gnueabi/7
/usr/lib/gcc/armv7hl-suse-linux-gnueabi/8
/usr/lib/gcc/armv7hl-suse-linux-gnueabi/9
/usr/lib64/gcc/aarch64-suse-linux/7
/usr/lib64/gcc/aarch64-suse-linux/8
/usr/lib64/gcc/aarch64-suse-linux/9
/usr/lib64/gcc/powerpc64-suse-linux/7
/usr/lib64/gcc/powerpc64-suse-linux/8
/usr/lib64/gcc/powerpc64-suse-linux/9
/usr/lib64/gcc/powerpc64le-suse-linux/7
/usr/lib64/gcc/powerpc64le-suse-linux/8
/usr/lib64/gcc/powerpc64le-suse-linux/9
/usr/lib/gcc/i486-linux-gnu # Debian 7
/usr/lib/gcc/i486-linux-gnu/4.4
/usr/lib/gcc/i486-linux-gnu/4.6
@ -142,9 +171,32 @@ find_library(GFORTRAN NAMES gfortran
/usr/lib/gcc/powerpc64le-linux-gnu/8
/usr/lib/gcc/s390x-linux-gnu/8
/usr/lib/gcc/alpha-linux-gnu/8
/usr/lib/gcc/x86_64-linux-gnu/9
/usr/lib/gcc/aarch64-linux-gnu/9
/usr/lib/gcc/arm-linux-gnueabi/9
/usr/lib/gcc/arm-linux-gnueabihf/9
/usr/lib/gcc/i686-linux-gnu/9
/usr/lib/gcc/powerpc64le-linux-gnu/9
/usr/lib/gcc/powerpc64-linux-gnu/9/
/usr/lib/gcc/s390x-linux-gnu/9
/usr/lib/gcc/alpha-linux-gnu/9
/usr/lib/gcc/hppa-linux-gnu/9
/usr/lib/gcc/m68k-linux-gnu/9
/usr/lib/gcc/mips-linux-gnu/9
/usr/lib/gcc/mips64el-linux-gnuabi64/9
/usr/lib/gcc/mipsel-linux-gnu/9
/usr/lib/gcc/riscv64-linux-gnu/9
/usr/lib/gcc/sh4-linux-gnu/9
/usr/lib/gcc/sparc64-linux-gnu/9
/usr/lib/gcc/x86_64-linux-gnux32/9
${GFORTRAN_ROOT}/lib
$ENV{GFORTRAN_ROOT}/lib
)
set_package_properties(GFORTRAN PROPERTIES
URL "http://gcc.gnu.org/wiki/GFortran"
DESCRIPTION "GNU Fortran library"
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GFORTRAN DEFAULT_MSG GFORTRAN)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -27,6 +27,13 @@
#
# GLOG_ROOT - Can be set to Glog install path or Windows build path
#
# Provides the following imported target:
# Glog::glog
#
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
if(NOT DEFINED GLOG_ROOT)
set(GLOG_ROOT /usr /usr/local)
@ -38,6 +45,10 @@ else()
set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/lib)
endif()
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
pkg_check_modules(PC_GLOG libglog)
macro(_FIND_GLOG_LIBRARIES _var)
find_library(${_var}
NAMES ${ARGN}
@ -72,6 +83,7 @@ macro(_FIND_GLOG_LIBRARIES _var)
$ENV{GLOG_ROOT}/lib
${GLOG_ROOT}/lib64
$ENV{GLOG_ROOT}/lib64
${PC_GLOG_LIBDIR}
PATH_SUFFIXES lib
)
mark_as_advanced(${_var})
@ -91,6 +103,7 @@ if(MSVC)
PATHS
${GLOG_ROOT}/src/windows
${GLOG_ROOT}/src/windows/glog
${PC_GLOG_INCLUDEDIR}
)
else()
# Linux/OS X builds
@ -99,6 +112,7 @@ else()
${GLOG_ROOT}/include/glog
/usr/include/glog
/opt/local/include/glog # default location in Macports
${PC_GLOG_INCLUDEDIR}
)
endif()
@ -115,15 +129,18 @@ else()
endif()
endif()
if(GLOG_FOUND)
message(STATUS "glog library found at ${GLOG_LIBRARIES}")
endif()
# handle the QUIETLY and REQUIRED arguments and set GLOG_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLOG DEFAULT_MSG GLOG_LIBRARIES)
if(GLOG_FOUND)
message(STATUS "glog library found at ${GLOG_LIBRARIES}")
if(PC_GLOG_VERSION)
set(GLOG_VERSION ${PC_GLOG_VERSION})
endif()
endif()
if(MSVC)
string(REGEX REPLACE "/glog$" "" VAR_WITHOUT ${GLOG_INCLUDE_DIR})
string(REGEX REPLACE "/windows$" "" VAR_WITHOUT ${VAR_WITHOUT})
@ -135,6 +152,26 @@ else()
string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES})
endif()
if(GLOG_FOUND)
# _GLOG_APPEND_LIBRARIES(GLOG GLOG_LIBRARIES)
if(GLOG_FOUND AND GLOG_VERSION)
set_package_properties(GLOG PROPERTIES
DESCRIPTION "C++ implementation of the Google logging module (found: v${GLOG_VERSION})"
)
else()
set_package_properties(GLOG PROPERTIES
DESCRIPTION "C++ implementation of the Google logging module"
)
endif()
set_package_properties(GLOG PROPERTIES
URL "https://github.com/google/glog"
)
if(GLOG_FOUND AND NOT TARGET Glog::glog)
add_library(Glog::glog SHARED IMPORTED)
set_target_properties(Glog::glog PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GLOG_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${GLOG_LIBRARIES}"
)
endif()

View File

@ -19,12 +19,17 @@
# Find GNU Radio
########################################################################
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
include(FindPackageHandleStandardArgs)
# if GR_REQUIRED_COMPONENTS is not defined, it will be set to the following list
if(NOT GR_REQUIRED_COMPONENTS)
set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS DIGITAL FFT FILTER PMT FEC TRELLIS UHD)
set(GR_REQUIRED_COMPONENTS RUNTIME PMT BLOCKS FFT FILTER ANALOG)
endif()
# Allows us to use all .cmake files in this directory
@ -53,7 +58,7 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE)
message(STATUS "Checking for GNU Radio Module: ${EXTVAR}")
# check for .pc hints
pkg_check_modules(PC_GNURADIO_${EXTVAR} ${PCNAME})
pkg_check_modules(PC_GNURADIO_${EXTVAR} QUIET ${PCNAME})
if(NOT PC_GNURADIO_${EXTVAR}_FOUND)
set(PC_GNURADIO_${EXTVAR}_LIBRARIES ${LIBFILE})
@ -140,63 +145,132 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE)
# generate an error if the module is missing
if(NOT GNURADIO_${EXTVAR}_FOUND)
message(STATUS "Required GNU Radio Component: ${EXTVAR} missing!")
set(GNURADIO_FOUND FALSE) # Trick for feature_summary
endif()
# Create imported target
string(TOLOWER ${EXTVAR} gnuradio_component)
if(NOT TARGET Gnuradio::${gnuradio_component})
add_library(Gnuradio::${gnuradio_component} SHARED IMPORTED)
set(GNURADIO_LIBRARY ${GNURADIO_${EXTVAR}_LIBRARIES})
list(GET GNURADIO_LIBRARY 0 FIRST_DIR)
get_filename_component(GNURADIO_DIR ${FIRST_DIR} ABSOLUTE)
set_target_properties(Gnuradio::${gnuradio_component} PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GNURADIO_DIR}"
INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_${EXTVAR}_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${GNURADIO_LIBRARY}"
)
endif()
mark_as_advanced(GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS)
endfunction()
gr_module(RUNTIME gnuradio-runtime gnuradio/top_block.h gnuradio-runtime)
gr_module(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog)
gr_module(AUDIO gnuradio-audio gnuradio/audio/api.h gnuradio-audio)
gr_module(PMT gnuradio-runtime pmt/pmt.h gnuradio-pmt)
gr_module(BLOCKS gnuradio-blocks gnuradio/blocks/api.h gnuradio-blocks)
gr_module(CHANNELS gnuradio-channels gnuradio/channels/api.h gnuradio-channels)
gr_module(DIGITAL gnuradio-digital gnuradio/digital/api.h gnuradio-digital)
gr_module(FCD gnuradio-fcd gnuradio/fcd_api.h gnuradio-fcd)
gr_module(FEC gnuradio-fec gnuradio/fec/api.h gnuradio-fec)
gr_module(FFT gnuradio-fft gnuradio/fft/api.h gnuradio-fft)
gr_module(FILTER gnuradio-filter gnuradio/filter/api.h gnuradio-filter)
gr_module(NOAA gnuradio-noaa gnuradio/noaa/api.h gnuradio-noaa)
gr_module(PAGER gnuradio-pager gnuradio/pager/api.h gnuradio-pager)
gr_module(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog)
gr_module(DIGITAL gnuradio-digital gnuradio/digital/api.h gnuradio-digital)
gr_module(AUDIO gnuradio-audio gnuradio/audio/api.h gnuradio-audio)
gr_module(CHANNELS gnuradio-channels gnuradio/channels/api.h gnuradio-channels)
gr_module(QTGUI gnuradio-qtgui gnuradio/qtgui/api.h gnuradio-qtgui)
gr_module(TRELLIS gnuradio-trellis gnuradio/trellis/api.h gnuradio-trellis)
gr_module(UHD gnuradio-uhd gnuradio/uhd/api.h gnuradio-uhd)
gr_module(VOCODER gnuradio-vocoder gnuradio/vocoder/api.h gnuradio-vocoder)
gr_module(WAVELET gnuradio-wavelet gnuradio/wavelet/api.h gnuradio-wavelet)
gr_module(WXGUI gnuradio-wxgui gnuradio/wxgui/api.h gnuradio-wxgui)
gr_module(PMT gnuradio-runtime pmt/pmt.h gnuradio-pmt)
list(REMOVE_DUPLICATES GNURADIO_ALL_INCLUDE_DIRS)
list(REMOVE_DUPLICATES GNURADIO_ALL_LIBRARIES)
if(NOT PC_GNURADIO_RUNTIME_VERSION)
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
unset(PACKAGE_VERSION)
list(GET GNURADIO_BLOCKS_LIBRARIES 0 FIRST_DIR)
get_filename_component(GNURADIO_BLOCKS_DIR ${FIRST_DIR} DIRECTORY)
if(EXISTS ${GNURADIO_BLOCKS_DIR}/cmake/gnuradio/GnuradioConfigVersion.cmake)
set(PACKAGE_FIND_VERSION_MAJOR 3)
set(PACKAGE_FIND_VERSION_MINOR 7)
set(PACKAGE_FIND_VERSION_PATCH 4)
include(${GNURADIO_BLOCKS_DIR}/cmake/gnuradio/GnuradioConfigVersion.cmake)
endif()
if(PACKAGE_VERSION)
set(PC_GNURADIO_RUNTIME_VERSION ${PACKAGE_VERSION})
endif()
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
endif()
# Trick to find out that GNU Radio is >= 3.7.4 if pkgconfig is not present
if(NOT PC_GNURADIO_RUNTIME_VERSION)
find_file(GNURADIO_VERSION_GREATER_THAN_373
NAMES gnuradio/blocks/tsb_vector_sink_f.h
HINTS $ENV{GNURADIO_RUNTIME_DIR}/include
${CMAKE_INSTALL_PREFIX}/include
${GNURADIO_INSTALL_PREFIX}/include
PATHS /usr/local/include
/usr/include
${GNURADIO_INSTALL_PREFIX}/include
${GNURADIO_ROOT}/include
$ENV{GNURADIO_ROOT}/include
)
NAMES gnuradio/blocks/tsb_vector_sink_f.h
HINTS $ENV{GNURADIO_RUNTIME_DIR}/include
${CMAKE_INSTALL_PREFIX}/include
${GNURADIO_INSTALL_PREFIX}/include
PATHS /usr/local/include
/usr/include
${GNURADIO_INSTALL_PREFIX}/include
${GNURADIO_ROOT}/include
$ENV{GNURADIO_ROOT}/include
)
if(GNURADIO_VERSION_GREATER_THAN_373)
set(PC_GNURADIO_RUNTIME_VERSION "3.7.4+")
endif()
find_file(GNURADIO_VERSION_GREATER_THAN_38
NAMES gnuradio/filter/mmse_resampler_cc.h
HINTS $ENV{GNURADIO_RUNTIME_DIR}/include
${CMAKE_INSTALL_PREFIX}/include
${GNURADIO_INSTALL_PREFIX}/include
PATHS /usr/local/include
/usr/include
${GNURADIO_INSTALL_PREFIX}/include
${GNURADIO_ROOT}/include
$ENV{GNURADIO_ROOT}/include
)
NAMES gnuradio/filter/mmse_resampler_cc.h
HINTS $ENV{GNURADIO_RUNTIME_DIR}/include
${CMAKE_INSTALL_PREFIX}/include
${GNURADIO_INSTALL_PREFIX}/include
PATHS /usr/local/include
/usr/include
${GNURADIO_INSTALL_PREFIX}/include
${GNURADIO_ROOT}/include
$ENV{GNURADIO_ROOT}/include
)
if(GNURADIO_VERSION_GREATER_THAN_38)
set(PC_GNURADIO_RUNTIME_VERSION "3.8.0+")
endif()
endif()
# Trick for feature_summary
if(NOT DEFINED GNURADIO_FOUND)
set(GNURADIO_FOUND TRUE)
endif()
set(GNURADIO_VERSION ${PC_GNURADIO_RUNTIME_VERSION})
if(NOT GNSSSDR_GNURADIO_MIN_VERSION)
set(GNSSSDR_GNURADIO_MIN_VERSION "3.7.3")
endif()
if(GNURADIO_VERSION)
if(GNURADIO_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION})
unset(GNURADIO_RUNTIME_FOUND)
message(STATUS "The GNU Radio version installed in your system (v${GNURADIO_VERSION}) is too old.")
if(OS_IS_LINUX)
message("Go to https://github.com/gnuradio/pybombs")
message("and follow the instructions to install GNU Radio in your system.")
endif()
if(OS_IS_MACOSX)
message("You can install it easily via Macports:")
message(" sudo port install gnuradio ")
message("Alternatively, you can use homebrew:")
message(" brew install gnuradio")
endif()
message(FATAL_ERROR "GNU Radio v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr.")
endif()
set_package_properties(GNURADIO PROPERTIES
DESCRIPTION "The free and open software radio ecosystem (found: v${GNURADIO_VERSION})"
)
else()
set_package_properties(GNURADIO PROPERTIES
DESCRIPTION "The free and open software radio ecosystem"
)
endif()
set_package_properties(GNURADIO PROPERTIES
URL "https://www.gnuradio.org/"
)

View File

@ -0,0 +1,76 @@
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
# GNSS-SDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNSS-SDR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
# - Try to find Googletest source code
#
# The following environment variable is optionally searched for:
# GTEST_DIR: Base directory where Googletest source code is found.
#
# The following are set after configuration is done:
# GOOGLETEST_FOUND
# LIBGTEST_DEV_DIR
# GTEST_INCLUDE_DIRS
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
pkg_check_modules(PC_GTEST gtest)
find_path(LIBGTEST_DEV_DIR
NAMES src/gtest-all.cc
PATHS
${GTEST_DIR}
${GTEST_DIR}/googletest
/usr/src/googletest/googletest
/usr/local/src/googletest/googletest
/usr/src/gtest
/usr/include/gtest
/opt/local/src/gtest-1.7.0
)
find_path(GTEST_INCLUDE_DIRS
NAMES gtest/gtest.h
PATHS
${GTEST_DIR}/googletest/include
/usr/include
/opt/local/src/gtest-1.7.0/include
${PC_GTEST_INCLUDEDIR}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GOOGLETEST DEFAULT_MSG LIBGTEST_DEV_DIR GTEST_INCLUDE_DIRS)
if(GOOGLETEST_FOUND AND PC_GTEST_VERSION)
set(GOOGLETEST_VERSION ${PC_GTEST_VERSION})
set_package_properties(GOOGLETEST PROPERTIES
DESCRIPTION "Source code of Google's Testing Framework (found: v${GOOGLETEST_VERSION})"
)
else()
set_package_properties(GOOGLETEST PROPERTIES
DESCRIPTION "Source code of Google's Testing Framework"
)
endif()
set_package_properties(GOOGLETEST PROPERTIES
URL "https://github.com/google/googletest"
)
mark_as_advanced(LIBGTEST_DEV_DIR GTEST_INCLUDE_DIRS)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -33,6 +33,16 @@
# GPERFTOOLS_FOUND System has Gperftools libs/headers
# GPERFTOOLS_LIBRARIES The Gperftools libraries (tcmalloc & profiler)
# GPERFTOOLS_INCLUDE_DIR The location of Gperftools headers
#
# Provides the following imported targets:
# Gperftools::tcmalloc
# Gperftools::profiler
# Gperftools::gperftools
#
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
find_library(GPERFTOOLS_TCMALLOC
NAMES tcmalloc
@ -41,6 +51,8 @@ find_library(GPERFTOOLS_TCMALLOC
$ENV{GPERFTOOLS_ROOT}/lib
${GPERFTOOLS_ROOT}/lib64
$ENV{GPERFTOOLS_ROOT}/lib64
/usr/lib
/usr/lib64
)
find_library(GPERFTOOLS_PROFILER
@ -50,6 +62,8 @@ find_library(GPERFTOOLS_PROFILER
$ENV{GPERFTOOLS_ROOT}/lib
${GPERFTOOLS_ROOT}/lib64
$ENV{GPERFTOOLS_ROOT}/lib64
/usr/lib
/usr/lib64
)
find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER
@ -59,6 +73,8 @@ find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER
$ENV{GPERFTOOLS_ROOT}/lib
${GPERFTOOLS_ROOT}/lib64
$ENV{GPERFTOOLS_ROOT}/lib64
/usr/lib
/usr/lib64
)
find_path(GPERFTOOLS_INCLUDE_DIR
@ -66,6 +82,7 @@ find_path(GPERFTOOLS_INCLUDE_DIR
HINTS ${Gperftools_ROOT_DIR}/include
${GPERFTOOLS_ROOT}/include
$ENV{GPERFTOOLS_ROOT}/include
/usr/include
)
set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER})
@ -76,10 +93,47 @@ find_package_handle_standard_args(
DEFAULT_MSG
GPERFTOOLS_LIBRARIES
GPERFTOOLS_INCLUDE_DIR
GPERFTOOLS_TCMALLOC
GPERFTOOLS_PROFILER
)
if(GPERFTOOLS_FOUND AND NOT TARGET Gperftools::tcmalloc)
add_library(Gperftools::tcmalloc SHARED IMPORTED)
set_target_properties(Gperftools::tcmalloc PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GPERFTOOLS_TCMALLOC}"
INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${GPERFTOOLS_TCMALLOC}"
)
endif()
if(GPERFTOOLS_FOUND AND NOT TARGET Gperftools::profiler)
add_library(Gperftools::profiler SHARED IMPORTED)
set_target_properties(Gperftools::profiler PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GPERFTOOLS_PROFILER}"
INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${GPERFTOOLS_PROFILER}"
)
endif()
if(GPERFTOOLS_FOUND AND NOT TARGET Gperftools::gperftools)
add_library(Gperftools::gperftools SHARED IMPORTED)
set_target_properties(Gperftools::gperftools PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GPERFTOOLS_TCMALLOC_AND_PROFILER}"
INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${GPERFTOOLS_TCMALLOC_AND_PROFILER}"
)
endif()
set_package_properties(GPERFTOOLS PROPERTIES
URL "https://github.com/gperftools/gperftools"
DESCRIPTION "Collection of performance analysis tools"
)
mark_as_advanced(
Gperftools_ROOT_DIR
GPERFTOOLS_TCMALLOC
GPERFTOOLS_PROFILER
GPERFTOOLS_TCMALLOC_AND_PROFILER

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -22,6 +22,10 @@
# GPSTK_FOUND, If false, do not try to use GPSTK.
# GPSTK_LIBRARY, where to find the GPSTK library.
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
find_path(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp
HINTS /usr/include
/usr/local/include
@ -32,18 +36,57 @@ find_path(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp
set(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk)
include(GNUInstallDirs)
find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES}
HINTS /usr/lib
/usr/local/lib
/usr/${CMAKE_INSTALL_LIBDIR}
/usr/local/${CMAKE_INSTALL_LIBDIR}
/opt/local/lib
${GPSTK_ROOT}/lib
$ENV{GPSTK_ROOT}/lib
${GPSTK_ROOT}/lib64
$ENV{GPSTK_ROOT}/lib64
${GPSTK_ROOT}/${CMAKE_INSTALL_LIBDIR}
$ENV{GPSTK_ROOT}/${CMAKE_INSTALL_LIBDIR}
)
# handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if
# handle the QUIET and REQUIRED arguments and set GPSTK_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR)
mark_as_advanced(GPSTK_INCLUDE_DIR GPSTK_LIBRARY GPSTK_INCLUDE_DIR)
if(GPSTK_FOUND)
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
unset(PACKAGE_VERSION)
if(EXISTS ${CMAKE_INSTALL_FULL_DATADIR}/cmake/GPSTK/GPSTKConfigVersion.cmake)
include(${CMAKE_INSTALL_FULL_DATADIR}/cmake/GPSTK/GPSTKConfigVersion.cmake)
endif()
if(PACKAGE_VERSION)
set(GPSTK_VERSION ${PACKAGE_VERSION})
endif()
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
endif()
if(GPSTK_FOUND AND GPSTK_VERSION)
set_package_properties(GPSTK PROPERTIES
DESCRIPTION "Library and suite of applications for satellite navigation (found: v${GPSTK_VERSION})"
)
else()
set_package_properties(GPSTK PROPERTIES
DESCRIPTION "Library and suite of applications for satellite navigation"
)
endif()
set_package_properties(GPSTK PROPERTIES
URL "http://www.gpstk.org"
)
mark_as_advanced(GPSTK_LIBRARY GPSTK_INCLUDE_DIR)
if(GPSTK_FOUND AND NOT TARGET Gpstk::gpstk)
add_library(Gpstk::gpstk SHARED IMPORTED)
set_target_properties(Gpstk::gpstk PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GPSTK_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GPSTK_INCLUDE_DIR};${GPSTK_INCLUDE_DIR}/gpstk"
INTERFACE_LINK_LIBRARIES "${GPSTK_LIBRARY}"
)
endif()

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -19,6 +19,7 @@
# Find GR-DBFCTTC Module
########################################################################
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
pkg_check_modules(PC_GR_DBFCTTC gr-dbfcttc)
@ -53,4 +54,15 @@ find_library(
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GRDBFCTTC DEFAULT_MSG GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS)
if(GRDBFCTTC_FOUND AND NOT TARGET Gnuradio::dbfcttc)
add_library(Gnuradio::dbfcttc SHARED IMPORTED)
set_target_properties(Gnuradio::dbfcttc PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GR_DBFCTTC_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${GR_DBFCTTC_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${GR_DBFCTTC_LIBRARIES}"
)
endif()
mark_as_advanced(GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -19,6 +19,7 @@
# Find GR-GN3S Module
########################################################################
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
pkg_check_modules(PC_GR_GN3S gr-gn3s)
@ -53,4 +54,15 @@ find_library(
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GRGN3S DEFAULT_MSG GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS)
if(GRGN3S_FOUND AND NOT TARGET Gnuradio::gn3s)
add_library(Gnuradio::gn3s SHARED IMPORTED)
set_target_properties(Gnuradio::gn3s PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GR_GN3S_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${GR_GN3S_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${GR_GN3S_LIBRARIES}"
)
endif()
mark_as_advanced(GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -15,6 +15,16 @@
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
# Provides the following imported target:
# Gnuradio::iio
#
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
pkg_check_modules(PC_IIO gnuradio-iio)
@ -29,6 +39,22 @@ find_path(IIO_INCLUDE_DIRS
$ENV{GRIIO_ROOT}/include
)
if(IIO_INCLUDE_DIRS)
set(GR_IIO_INCLUDE_HAS_GNURADIO TRUE)
else()
find_path(IIO_INCLUDE_DIRS
NAMES iio/api.h
HINTS $ENV{IIO_DIR}/include
${PC_IIO_INCLUDEDIR}
PATHS ${CMAKE_INSTALL_PREFIX}/include
/usr/local/include
/usr/include
${GRIIO_ROOT}/include
$ENV{GRIIO_ROOT}/include
)
set(GR_IIO_INCLUDE_HAS_GNURADIO FALSE)
endif()
find_library(IIO_LIBRARIES
NAMES gnuradio-iio
HINTS $ENV{IIO_DIR}/lib
@ -69,4 +95,32 @@ find_library(IIO_LIBRARIES
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GRIIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS)
mark_as_advanced(IIO_LIBRARIES IIO_INCLUDE_DIRS)
if(PC_IIO_VERSION)
set(GRIIO_VERSION ${PC_IIO_VERSION})
endif()
set_package_properties(GRIIO PROPERTIES
URL "https://github.com/analogdevicesinc/gr-iio"
)
if(GRIIO_FOUND AND GRIIO_VERSION)
set_package_properties(GRIIO PROPERTIES
DESCRIPTION "IIO blocks for GNU Radio (found: v${GRIIO_VERSION})"
)
else()
set_package_properties(GRIIO PROPERTIES
DESCRIPTION "IIO blocks for GNU Radio"
)
endif()
if(GRIIO_FOUND AND NOT TARGET Gnuradio::iio)
add_library(Gnuradio::iio SHARED IMPORTED)
set_target_properties(Gnuradio::iio PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${IIO_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${IIO_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${IIO_LIBRARIES}"
)
endif()
mark_as_advanced(IIO_LIBRARIES IIO_INCLUDE_DIRS GR_IIO_INCLUDE_HAS_GNURADIO)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -33,7 +33,16 @@
# GROSMOSDR_FOUND System has gr-osmosdr libs/headers
# GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr)
# GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers
#
# Provides the following imported target:
# Gnuradio::osmosdr
#
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr)
@ -42,18 +51,17 @@ find_path(GROSMOSDR_INCLUDE_DIR
osmosdr/source.h
osmosdr/api.h
PATHS
${GROSMOSDR_PKG_INCLUDE_DIRS}
/usr/include
/usr/local/include
/opt/local/include
${GROSMOSDR_ROOT}/include
$ENV{GROSMOSDR_ROOT}/include
${GROSMOSDR_PKG_INCLUDEDIR}
)
find_library(GROSMOSDR_LIBRARIES
NAMES gnuradio-osmosdr
PATHS
${GROSMOSDR_PKG_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
/opt/local/lib
@ -85,8 +93,39 @@ find_library(GROSMOSDR_LIBRARIES
$ENV{GROSMOSDR_ROOT}/lib
${GROSMOSDR_ROOT}/lib64
$ENV{GROSMOSDR_ROOT}/lib64
${GROSMOSDR_PKG_LIBDIR}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GROSMOSDR DEFAULT_MSG GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR)
if(GROSMOSDR_PKG_VERSION)
set(GROSMOSDR_VERSION_AUX ${GROSMOSDR_PKG_VERSION})
string(REGEX REPLACE "^v" "" GROSMOSDR_VERSION ${GROSMOSDR_VERSION_AUX})
endif()
set_package_properties(GROSMOSDR PROPERTIES
URL "https://osmocom.org/projects/gr-osmosdr/wiki"
)
if(GROSMOSDR_FOUND AND GROSMOSDR_VERSION)
set_package_properties(GROSMOSDR PROPERTIES
DESCRIPTION "osmocom GNU Radio blocks (found: v${GROSMOSDR_VERSION})"
)
else()
set_package_properties(GROSMOSDR PROPERTIES
DESCRIPTION "osmocom GNU Radio blocks"
)
endif()
if(GROSMOSDR_FOUND AND NOT TARGET Gnuradio::osmosdr)
add_library(Gnuradio::osmosdr SHARED IMPORTED)
set_target_properties(Gnuradio::osmosdr PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GROSMOSDR_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${GROSMOSDR_INCLUDE_DIR};${GROSMOSDR_INCLUDE_DIR}/osmosdr"
INTERFACE_LINK_LIBRARIES "${GROSMOSDR_LIBRARIES}"
)
endif()
mark_as_advanced(GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -15,6 +15,16 @@
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
# Provides the following imported target:
# Iio::iio
#
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
pkg_check_modules(PC_LIBIIO libiio)
@ -71,6 +81,41 @@ find_library(
$ENV{LIBIIO_ROOT}/lib64
)
if(LIBIIO_LIBRARIES AND APPLE)
if(LIBIIO_LIBRARIES MATCHES "framework")
set(LIBIIO_LIBRARIES ${LIBIIO_LIBRARIES}/iio)
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBIIO DEFAULT_MSG LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS)
if(PC_LIBIIO_VERSION)
set(LIBIIO_VERSION ${PC_LIBIIO_VERSION})
endif()
if(LIBIIO_FOUND AND LIBIIO_VERSION)
set_package_properties(LIBIIO PROPERTIES
DESCRIPTION "A library for interfacing with Linux IIO devices (found: v${LIBIIO_VERSION})"
)
else()
set_package_properties(LIBIIO PROPERTIES
DESCRIPTION "A library for interfacing with Linux IIO devices"
)
endif()
set_package_properties(LIBIIO PROPERTIES
URL "https://github.com/analogdevicesinc/libiio"
)
if(LIBIIO_FOUND AND NOT TARGET Iio::iio)
add_library(Iio::iio SHARED IMPORTED)
set_target_properties(Iio::iio PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${LIBIIO_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${LIBIIO_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${LIBIIO_LIBRARIES}"
)
endif()
mark_as_advanced(LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS)

View File

@ -1,80 +0,0 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
# GNSS-SDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNSS-SDR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
# Tries to find libosmosdr.
#
# Usage of this module as follows:
#
# find_package(LIBOSMOSDR)
#
#
# Variables defined by this module:
#
# LIBOSMOSDR_FOUND System has libosmosdr libs/headers
# LIBOSMOSDR_LIBRARIES The libosmosdr libraries
# LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers
include(FindPkgConfig)
pkg_check_modules(LIBOSMOSDR_PKG libosmosdr)
find_path(LIBOSMOSDR_INCLUDE_DIR NAMES osmosdr.h
PATHS
${LIBOSMOSDR_PKG_INCLUDE_DIRS}
/usr/include
/usr/local/include
${LIBOSMOSDR_ROOT}/include
$ENV{LIBOSMOSDR_ROOT}/include
)
find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr
PATHS
${LIBOSMOSDR_PKG_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/i386-linux-gnu
/usr/lib/arm-linux-gnueabihf
/usr/lib/arm-linux-gnueabi
/usr/lib/aarch64-linux-gnu
/usr/lib/mipsel-linux-gnu
/usr/lib/mips-linux-gnu
/usr/lib/mips64el-linux-gnuabi64
/usr/lib/powerpc-linux-gnu
/usr/lib/powerpc64-linux-gnu
/usr/lib/powerpc64le-linux-gnu
/usr/lib/powerpc-linux-gnuspe
/usr/lib/hppa-linux-gnu
/usr/lib/s390x-linux-gnu
/usr/lib/i386-gnu
/usr/lib/hppa-linux-gnu
/usr/lib/x86_64-kfreebsd-gnu
/usr/lib/i386-kfreebsd-gnu
/usr/lib/m68k-linux-gnu
/usr/lib/sh4-linux-gnu
/usr/lib/sparc64-linux-gnu
/usr/lib/x86_64-linux-gnux32
/usr/lib/alpha-linux-gnu
/usr/lib64
${LIBOSMOSDR_ROOT}/lib
$ENV{LIBOSMOSDR_ROOT}/lib
${LIBOSMOSDR_ROOT}/lib64
$ENV{LIBOSMOSDR_ROOT}/lib64
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBOSMOSDR DEFAULT_MSG LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES)
mark_as_advanced(LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -21,7 +21,18 @@
# LOG4CPP_INCLUDE_DIR - where to find LOG4CPP.h, etc.
# LOG4CPP_LIBRARIES - List of libraries when using LOG4CPP.
# LOG4CPP_FOUND - True if LOG4CPP found.
#
# Provides the following imported target:
# Log4cpp::log4cpp
#
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
pkg_check_modules(PC_LOG4CPP log4cpp QUIET)
if(LOG4CPP_INCLUDE_DIR)
# Already in cache, be silent
@ -34,13 +45,28 @@ find_path(LOG4CPP_INCLUDE_DIR log4cpp/Category.hh
/usr/include
${LOG4CPP_ROOT}/include
$ENV{LOG4CPP_ROOT}/include
${PC_LOG4CPP_INCLUDEDIR}
)
if(LOG4CPP_INCLUDE_DIR)
file(STRINGS ${LOG4CPP_INCLUDE_DIR}/log4cpp/Priority.hh _log4cpp_Priority)
set(_log4cpp_cxx17 TRUE)
foreach(_loop_var IN LISTS _log4cpp_Priority)
string(STRIP "${_loop_var}" _file_line)
if("throw(std::invalid_argument);" STREQUAL "${_file_line}")
set(_log4cpp_cxx17 FALSE)
endif()
endforeach()
if(${_log4cpp_cxx17})
set(LOG4CPP_READY_FOR_CXX17 TRUE)
endif()
endif()
set(LOG4CPP_NAMES log4cpp)
find_library(LOG4CPP_LIBRARY
NAMES ${LOG4CPP_NAMES}
HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib
${PC_LIBDIR}
${PC_LOG4CPP_LIBDIR}
${CMAKE_INSTALL_PREFIX}/lib/
PATHS /usr/local/lib
/usr/lib/x86_64-linux-gnu
@ -68,7 +94,6 @@ find_library(LOG4CPP_LIBRARY
/usr/lib/alpha-linux-gnu
/usr/lib64
/usr/lib
/usr/local/lib
/opt/local/lib
${LOG4CPP_ROOT}/lib
$ENV{LOG4CPP_ROOT}/lib
@ -90,3 +115,42 @@ endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LOG4CPP DEFAULT_MSG LOG4CPP_INCLUDE_DIRS LOG4CPP_LIBRARIES)
set_package_properties(LOG4CPP PROPERTIES
URL "http://log4cpp.sourceforge.net/"
)
if(LOG4CPP_FOUND AND PC_LOG4CPP_VERSION)
set(LOG4CPP_VERSION ${PC_LOG4CPP_VERSION})
endif()
if(LOG4CPP_FOUND AND LOG4CPP_VERSION)
if(LOG4CPP_READY_FOR_CXX17)
set_package_properties(LOG4CPP PROPERTIES
DESCRIPTION "Library of C++ classes for flexible logging (found: v${LOG4CPP_VERSION}, C++17-ready)"
)
else()
set_package_properties(LOG4CPP PROPERTIES
DESCRIPTION "Library of C++ classes for flexible logging (found: v${LOG4CPP_VERSION})"
)
endif()
else()
set_package_properties(LOG4CPP PROPERTIES
DESCRIPTION "Library of C++ classes for flexible logging"
)
endif()
if (LOG4CPP_FOUND AND NOT TARGET Log4cpp::log4cpp)
add_library(Log4cpp::log4cpp SHARED IMPORTED)
set_target_properties(Log4cpp::log4cpp PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${LOG4CPP_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${LOG4CPP_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${LOG4CPP_LIBRARIES}"
)
endif()
mark_as_advanced(
LOG4CPP_LIBRARIES
LOG4CPP_INCLUDE_DIRS
)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -26,6 +26,9 @@
# MATIO_INCLUDE_DIRS - where to find matio.h, etc..
# MATIO_VERSION_STRING - version number as a string (e.g.: "1.3.4")
#
# Provides the following imported target:
# Matio::matio
#
#=============================================================================
# Copyright 2015 Avtech Scientific <http://avtechscientific.com>
#
@ -59,6 +62,10 @@
#=============================================================================
#
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
# Look for the header file.
find_path(MATIO_INCLUDE_DIR
NAMES matio.h
@ -97,7 +104,6 @@ if(MATIO_INCLUDE_DIR)
endif()
if(MATIO_CONFIG_FILE)
# Read and parse MATIO config header file for version number
file(STRINGS "${MATIO_INCLUDE_DIR}/${MATIO_CONFIG_FILE}" _matio_HEADER_CONTENTS REGEX "#define MATIO_((MAJOR|MINOR)_VERSION)|(RELEASE_LEVEL) ")
@ -127,3 +133,27 @@ else()
set(MATIO_LIBRARIES)
set(MATIO_INCLUDE_DIRS)
endif()
if(MATIO_FOUND AND MATIO_VERSION_STRING)
set_package_properties(MATIO PROPERTIES
DESCRIPTION "MATLAB MAT File I/O Library (found: v${MATIO_VERSION_STRING})"
)
else()
set_package_properties(MATIO PROPERTIES
DESCRIPTION "MATLAB MAT File I/O Library"
)
endif()
set_package_properties(MATIO PROPERTIES
URL "https://github.com/tbeu/matio"
)
if(MATIO_FOUND AND NOT TARGET Matio::matio)
add_library(Matio::matio SHARED IMPORTED)
set_target_properties(Matio::matio PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${MATIO_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${MATIO_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${MATIO_LIBRARY}"
)
endif()

View File

@ -1,49 +0,0 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
# GNSS-SDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNSS-SDR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
# - Try to find OpenBLAS library (not headers!)
#
# The following environment variable is optionally searched
# OPENBLAS_HOME: Base directory where all OpenBlas components are found
set(OPEN_BLAS_SEARCH_PATHS
/lib
/lib64/
/usr/lib
/usr/lib64
/usr/local/lib
/usr/local/lib64
/opt/OpenBLAS/lib
/opt/local/lib
/usr/lib/openblas-base
$ENV{OPENBLAS_HOME}/lib
${OPENBLAS_ROOT}/lib
$ENV{OPENBLAS_ROOT}/lib
${OPENBLAS_ROOT}/lib64
$ENV{OPENBLAS_ROOT}/lib64
)
find_library(OPENBLAS NAMES openblas PATHS ${OPEN_BLAS_SEARCH_PATHS})
if(OPENBLAS)
set(OPENBLAS_FOUND ON)
message(STATUS "Found OpenBLAS")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OPENBLAS DEFAULT_MSG OPENBLAS)
mark_as_advanced(OPENBLAS)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -20,7 +20,7 @@
#
# - Try to find OpenCL
# This module tries to find an OpenCL implementation on your system. It supports
# AMD / ATI, Apple and NVIDIA implementations, but shoudl work, too.
# AMD / ATI, Apple and NVIDIA implementations.
#
# Once done this will define
# OPENCL_FOUND - system has OpenCL
@ -29,82 +29,195 @@
#
# WIN32 should work, but is untested
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
include(FindPackageHandleStandardArgs)
set(OPENCL_VERSION_STRING "0.1.0")
set(OPENCL_VERSION_MAJOR 0)
set(OPENCL_VERSION_MINOR 1)
set(OPENCL_VERSION_PATCH 0)
function(_FIND_OPENCL_VERSION)
include(CheckSymbolExists)
include(CMakePushCheckState)
set(CMAKE_REQUIRED_QUIET ${OPENCL_FIND_QUIETLY})
if(APPLE)
find_library(OPENCL_LIBRARIES OpenCL DOC "OpenCL lib for OSX")
find_path(OPENCL_INCLUDE_DIRS OpenCL/cl.h DOC "Include for OpenCL on OSX")
find_path(_OPENCL_CPP_INCLUDE_DIRS OpenCL/cl.hpp DOC "Include for OpenCL CPP bindings on OSX")
cmake_push_check_state()
foreach(VERSION "2_2" "2_1" "2_0" "1_2" "1_1" "1_0")
set(CMAKE_REQUIRED_INCLUDES "${OPENCL_INCLUDE_DIR}")
else()
if(WIN32)
find_path(OPENCL_INCLUDE_DIRS CL/cl.h)
find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp)
if(APPLE)
check_symbol_exists(
CL_VERSION_${VERSION}
"${OPENCL_INCLUDE_DIR}/Headers/cl.h"
OPENCL_VERSION_${VERSION}
)
else()
check_symbol_exists(
CL_VERSION_${VERSION}
"${OPENCL_INCLUDE_DIR}/CL/cl.h"
OPENCL_VERSION_${VERSION}
)
endif()
# The AMD SDK currently installs both x86 and x86_64 libraries
# This is only a hack to find out architecture
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64")
set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86_64")
set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86_64")
else()
set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86")
set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86")
endif()
if(OPENCL_VERSION_${VERSION})
string(REPLACE "_" "." VERSION "${VERSION}")
set(OPENCL_VERSION_STRING ${VERSION} PARENT_SCOPE)
string(REGEX MATCHALL "[0-9]+" version_components "${VERSION}")
list(GET version_components 0 major_version)
list(GET version_components 1 minor_version)
set(OPENCL_VERSION_MAJOR ${major_version} PARENT_SCOPE)
set(OPENCL_VERSION_MINOR ${minor_version} PARENT_SCOPE)
break()
endif()
endforeach()
cmake_pop_check_state()
endfunction()
# find out if the user asked for a 64-bit build, and use the corresponding
# 64 or 32 bit NVIDIA library paths to the search:
string(REGEX MATCH "Win64" ISWIN64 ${CMAKE_GENERATOR})
if("${ISWIN64}" STREQUAL "Win64")
find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/x64)
else()
find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/Win32)
endif()
find_path(OPENCL_INCLUDE_DIR
NAMES
CL/cl.h OpenCL/cl.h
PATHS
ENV "PROGRAMFILES(X86)"
ENV AMDAPPSDKROOT
ENV INTELOCLSDKROOT
ENV NVSDKCOMPUTE_ROOT
ENV CUDA_PATH
ENV ATISTREAMSDKROOT
ENV OCL_ROOT
/usr/local/cuda/include
PATH_SUFFIXES
include
OpenCL/common/inc
"AMD APP/include"
)
get_filename_component(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE)
find_path(_OPENCL_CPP_INCLUDE_DIRS
NAMES
CL/cl.hpp OpenCL/cl.hpp
PATHS
ENV "PROGRAMFILES(X86)"
ENV AMDAPPSDKROOT
ENV INTELOCLSDKROOT
ENV NVSDKCOMPUTE_ROOT
ENV CUDA_PATH
ENV ATISTREAMSDKROOT
ENV OCL_ROOT
/usr/local/cuda/include
PATH_SUFFIXES
include
OpenCL/common/inc
"AMD APP/include"
)
# On Win32 search relative to the library
find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include)
find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include)
else()
# Unix style platforms
find_library(OPENCL_LIBRARIES OpenCL
ENV LD_LIBRARY_PATH
)
get_filename_component(OPENCL_LIB_DIR ${OPENCL_LIBRARIES} PATH)
get_filename_component(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE)
# The AMD SDK currently does not place its headers
# in /usr/include, therefore also search relative
# to the library
find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include")
find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include")
endif()
set(OPENCL_INCLUDE_DIRS ${OPENCL_INCLUDE_DIR})
if(_OPENCL_CPP_INCLUDE_DIRS)
set(OPENCL_HAS_CPP_BINDINGS TRUE)
list(APPEND OPENCL_INCLUDE_DIRS ${_OPENCL_CPP_INCLUDE_DIRS})
# This is often the same, so clean up
list(REMOVE_DUPLICATES OPENCL_INCLUDE_DIRS)
endif()
_FIND_OPENCL_VERSION()
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
find_library(OPENCL_LIBRARY
NAMES OpenCL
PATHS
ENV "PROGRAMFILES(X86)"
ENV AMDAPPSDKROOT
ENV INTELOCLSDKROOT
ENV CUDA_PATH
ENV NVSDKCOMPUTE_ROOT
ENV ATISTREAMSDKROOT
ENV OCL_ROOT
PATH_SUFFIXES
"AMD APP/lib/x86"
lib/x86
lib/Win32
OpenCL/common/lib/Win32
)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
find_library(OPENCL_LIBRARY
NAMES OpenCL
PATHS
ENV "PROGRAMFILES(X86)"
ENV AMDAPPSDKROOT
ENV INTELOCLSDKROOT
ENV CUDA_PATH
ENV NVSDKCOMPUTE_ROOT
ENV ATISTREAMSDKROOT
ENV OCL_ROOT
PATH_SUFFIXES
"AMD APP/lib/x86_64"
lib/x86_64
lib/x64
OpenCL/common/lib/x64
)
endif()
else()
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
find_library(OPENCL_LIBRARY
NAMES OpenCL
PATHS
ENV AMDAPPSDKROOT
ENV CUDA_PATH
ENV LD_LIBRARY_PATH
PATH_SUFFIXES
lib/x86
lib
)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
find_library(OPENCL_LIBRARY
NAMES OpenCL
PATHS
ENV AMDAPPSDKROOT
ENV CUDA_PATH
ENV LD_LIBRARY_PATH
PATH_SUFFIXES
lib/x86_64
lib/x64
lib
lib64
)
endif()
endif()
set(OPENCL_LIBRARIES ${OPENCL_LIBRARY})
find_package_handle_standard_args(OPENCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS)
if(_OPENCL_CPP_INCLUDE_DIRS)
set(OPENCL_HAS_CPP_BINDINGS TRUE)
list(APPEND OPENCL_INCLUDE_DIRS ${_OPENCL_CPP_INCLUDE_DIRS})
# This is often the same, so clean up
list(REMOVE_DUPLICATES OPENCL_INCLUDE_DIRS)
endif()
mark_as_advanced(
OPENCL_INCLUDE_DIRS
OPENCL_LIBRARIES
)
if(OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES)
set( OPENCL_FOUND TRUE )
add_definitions( -DOPENCL=1 )
set_package_properties(OPENCL PROPERTIES
URL "https://www.khronos.org/opencl/"
)
if(OPENCL_FOUND AND OPENCL_VERSION_STRING)
set_package_properties(OPENCL PROPERTIES
DESCRIPTION "Library for parallel programming (found: v${OPENCL_VERSION_STRING})"
)
else()
set( OPENCL_FOUND FALSE )
add_definitions( -DOPENCL=0 )
set_package_properties(OPENCL PROPERTIES
DESCRIPTION "Library for parallel programming"
)
endif()
if(OPENCL_FOUND AND NOT TARGET OpenCL::OpenCL)
if(OPENCL_LIBRARY MATCHES "/([^/]+)\\.framework$")
add_library(OpenCL::OpenCL INTERFACE IMPORTED)
set_target_properties(OpenCL::OpenCL PROPERTIES
INTERFACE_LINK_LIBRARIES "${OPENCL_LIBRARY}"
)
else()
add_library(OpenCL::OpenCL UNKNOWN IMPORTED)
set_target_properties(OpenCL::OpenCL PROPERTIES
IMPORTED_LOCATION "${OPENCL_LIBRARY}"
)
endif()
set_target_properties(OpenCL::OpenCL PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OPENCL_INCLUDE_DIRS}"
)
endif()

View File

@ -15,7 +15,12 @@
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
find_package(PkgConfig)
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
pkg_check_modules(PC_ORC "orc-0.4 > 0.4.22")
find_program(ORCC_EXECUTABLE orcc
@ -63,6 +68,10 @@ find_library(ORC_LIB orc-0.4
${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
)
if(PC_ORC_VERSION)
set(ORC_VERSION ${PC_ORC_VERSION})
endif()
list(APPEND ORC_LIBRARY ${ORC_LIB})
set(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR})
@ -72,4 +81,18 @@ set(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE)
set_package_properties(ORC PROPERTIES
URL "https://gstreamer.freedesktop.org/modules/orc.html"
)
if(ORC_FOUND AND ORC_VERSION)
set_package_properties(ORC PROPERTIES
DESCRIPTION "The Optimized Inner Loops Runtime Compiler (found: v${ORC_VERSION})"
)
else()
set_package_properties(ORC PROPERTIES
DESCRIPTION "The Optimized Inner Loops Runtime Compiler"
)
endif()
mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE)

View File

@ -43,7 +43,18 @@
# PCAP_INCLUDE_DIRS - where to find pcap.h, etc.
# PCAP_LIBRARIES - List of libraries when using pcap.
# PCAP_FOUND - True if pcap found.
#
# Provides the following imported target:
# Pcap::pcap
#
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
pkg_check_modules(PC_PCAP libpcap QUIET)
if(EXISTS $ENV{PCAPDIR})
find_path(PCAP_INCLUDE_DIR
@ -54,6 +65,7 @@ if(EXISTS $ENV{PCAPDIR})
$ENV{PCAPDIR}
${PCAP_ROOT}/include
$ENV{PCAP_ROOT}/include
${PC_PCAP_INCLUDEDIR}
NO_DEFAULT_PATH
)
find_library(PCAP_LIBRARY
@ -63,6 +75,7 @@ if(EXISTS $ENV{PCAPDIR})
$ENV{PCAPDIR}
${PCAP_ROOT}/lib
$ENV{PCAP_ROOT}/lib
${PC_PCAP_LIBDIR}
NO_DEFAULT_PATH
)
else()
@ -73,6 +86,7 @@ else()
HINTS
${PCAP_ROOT}/include
$ENV{PCAP_ROOT}/include
${PC_PCAP_INCLUDEDIR}
)
find_library(PCAP_LIBRARY
NAMES
@ -80,6 +94,7 @@ else()
HINTS
${PCAP_ROOT}/lib
$ENV{PCAP_ROOT}/lib
${PC_PCAP_LIBDIR}
)
endif()
@ -89,17 +104,20 @@ set(PCAP_LIBRARIES ${PCAP_LIBRARY})
if(PCAP_INCLUDE_DIRS)
message(STATUS "Pcap include dirs set to ${PCAP_INCLUDE_DIRS}")
else()
message(FATAL " Pcap include dirs cannot be found")
message(STATUS "Pcap include dirs cannot be found.")
endif()
if(PCAP_LIBRARIES)
message(STATUS "Pcap library set to ${PCAP_LIBRARIES}")
else()
message(FATAL "Pcap library cannot be found")
message(STATUS "Pcap library cannot be found.")
endif()
#Functions
include(CheckFunctionExists)
set(OLD_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES})
set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
set(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES})
check_function_exists("pcap_breakloop" HAVE_PCAP_BREAKLOOP)
@ -112,11 +130,41 @@ check_function_exists("pcap_lib_version" HAVE_PCAP_LIB_VERSION)
check_function_exists("pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS)
check_function_exists("pcap_open_dead" HAVE_PCAP_OPEN_DEAD)
check_function_exists("pcap_set_datalink" HAVE_PCAP_SET_DATALINK)
set(CMAKE_REQUIRED_INCLUDES ${OLD_CMAKE_REQUIRED_INCLUDES})
set(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES)
if(PCAP_FOUND AND PC_PCAP_VERSION)
set(PCAP_VERSION ${PC_PCAP_VERSION})
endif()
set_package_properties(PCAP PROPERTIES
URL "https://www.tcpdump.org"
)
if(PCAP_FOUND AND PCAP_VERSION)
set_package_properties(PCAP PROPERTIES
DESCRIPTION "A portable C/C++ library for network traffic capture (found: v${PCAP_VERSION})"
)
else()
set_package_properties(PCAP PROPERTIES
DESCRIPTION "A portable C/C++ library for network traffic capture"
)
endif()
if(PCAP_FOUND AND NOT TARGET Pcap::pcap)
add_library(Pcap::pcap SHARED IMPORTED)
set_target_properties(Pcap::pcap PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${PCAP_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${PCAP_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${PCAP_LIBRARIES}"
)
endif()
mark_as_advanced(
PCAP_LIBRARIES
PCAP_INCLUDE_DIRS
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -22,15 +22,34 @@
# PUGIXML_INCLUDE_DIR - header location
# PUGIXML_LIBRARIES - library to link against
# PUGIXML_FOUND - true if pugixml was found.
#
# Provides the following imported target:
# Pugixml::pugixml
#
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
pkg_check_modules(PC_PUGIXML pugixml QUIET)
find_path(PUGIXML_INCLUDE_DIR
NAMES pugixml.hpp
PATHS ${PUGIXML_HOME}/include
/usr/include
/usr/local/include
/usr/local/include/pugixml-1.9
/usr/local/include/pugixml-${PC_PUGIXML_VERSION}
/opt/local/include
${PUGIXML_ROOT}/include
$ENV{PUGIXML_ROOT}/include
${PUGIXML_ROOT}/include/pugixml-1.9
$ENV{PUGIXML_ROOT}/include/pugixml-1.9
${PUGIXML_ROOT}/include/pugixml-${PC_PUGIXML_VERSION}
$ENV{PUGIXML_ROOT}/include/pugixml-${PC_PUGIXML_VERSION}
${PC_PUGIXML_INCLUDEDIR}
)
find_library(PUGIXML_LIBRARY
@ -47,6 +66,8 @@ find_library(PUGIXML_LIBRARY
/usr/lib/powerpc64le-linux-gnu
/usr/lib/s390x-linux-gnu
/usr/local/lib
/usr/local/lib/pugixml-1.9
/usr/local/lib/pugixml-${PC_PUGIXML_VERSION}
/opt/local/lib
/usr/lib
/usr/lib64
@ -55,6 +76,15 @@ find_library(PUGIXML_LIBRARY
$ENV{PUGIXML_ROOT}/lib
${PUGIXML_ROOT}/lib64
$ENV{PUGIXML_ROOT}/lib64
${PUGIXML_ROOT}/lib/pugixml-1.9
$ENV{PUGIXML_ROOT}/lib/pugixml-1.9
${PUGIXML_ROOT}/lib64/pugixml-1.9
$ENV{PUGIXML_ROOT}/lib64/pugixml-1.9
${PUGIXML_ROOT}/lib/pugixml-${PC_PUGIXML_VERSION}
$ENV{PUGIXML_ROOT}/lib/pugixml-${PC_PUGIXML_VERSION}
${PUGIXML_ROOT}/lib64/pugixml-${PC_PUGIXML_VERSION}
$ENV{PUGIXML_ROOT}/lib64/pugixml-${PC_PUGIXML_VERSION}
${PC_PUGIXML_LIBDIR}
)
# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found.
@ -68,8 +98,35 @@ if(PUGIXML_FOUND)
message(STATUS "PugiXML include = ${PUGIXML_INCLUDE_DIR}")
message(STATUS "PugiXML library = ${PUGIXML_LIBRARY}")
endif()
if(PC_PUGIXML_VERSION)
set(PUGIXML_VERSION ${PC_PUGIXML_VERSION})
endif()
else()
message(STATUS "PugiXML not found.")
endif()
set_package_properties(PUGIXML PROPERTIES
URL "https://pugixml.org/"
)
if(PUGIXML_FOUND AND PUGIXML_VERSION)
set_package_properties(PUGIXML PROPERTIES
DESCRIPTION "Light-weight, simple and fast XML parser for C++ (found: v${PUGIXML_VERSION})"
)
else()
set_package_properties(PUGIXML PROPERTIES
DESCRIPTION "Light-weight, simple and fast XML parser for C++"
)
endif()
mark_as_advanced(PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)
if(PUGIXML_FOUND AND NOT TARGET Pugixml::pugixml)
add_library(Pugixml::pugixml SHARED IMPORTED)
set_target_properties(Pugixml::pugixml PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${PUGIXML_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${PUGIXML_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${PUGIXML_LIBRARY}"
)
endif()

View File

@ -15,8 +15,13 @@
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
pkg_check_modules(PC_TELEORBIT teleorbit)
pkg_check_modules(PC_TELEORBIT teleorbit QUIET)
find_path(TELEORBIT_INCLUDE_DIRS
NAMES teleorbit/api.h
@ -25,6 +30,7 @@ find_path(TELEORBIT_INCLUDE_DIRS
PATHS ${CMAKE_INSTALL_PREFIX}/include
/usr/local/include
/usr/include
/opt/local/include
${TELEORBIT_ROOT}/include
$ENV{TELEORBIT_ROOT}/include
)
@ -39,6 +45,7 @@ find_library(TELEORBIT_LIBRARIES
/usr/local/lib64
/usr/lib
/usr/lib64
/opt/local/lib
${TELEORBIT_ROOT}/lib
$ENV{TELEORBIT_ROOT}/lib
${TELEORBIT_ROOT}/lib64
@ -47,4 +54,43 @@ find_library(TELEORBIT_LIBRARIES
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TELEORBIT DEFAULT_MSG TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS)
if(PC_TELEORBIT_VERSION)
set(TELEORBIT_VERSION ${PC_TELEORBIT_VERSION})
endif()
if(NOT TELEORBIT_VERSION)
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
unset(PACKAGE_VERSION)
list(GET TELEORBIT_LIBRARIES 0 FIRST_DIR)
get_filename_component(TELEORBIT_LIBRARIES_DIR ${FIRST_DIR} DIRECTORY)
if(EXISTS ${TELEORBIT_LIBRARIES_DIR}/cmake/teleorbit/TeleorbitConfigVersion.cmake)
include(${TELEORBIT_LIBRARIES_DIR}/cmake/teleorbit/TeleorbitConfigVersion.cmake)
endif()
if(PACKAGE_VERSION)
set(TELEORBIT_VERSION ${PACKAGE_VERSION})
endif()
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
endif()
if(TELEORBIT_FOUND AND TELEORBIT_VERSION)
set_package_properties(TELEORBIT PROPERTIES
DESCRIPTION "The Teleorbit's Flexiband GNU Radio block (found: v${TELEORBIT_VERSION})"
)
else()
set_package_properties(TELEORBIT PROPERTIES
DESCRIPTION "The Teleorbit's Flexiband GNU Radio block."
)
endif()
if(TELEORBIT_FOUND AND NOT TARGET Gnuradio::teleorbit)
add_library(Gnuradio::teleorbit SHARED IMPORTED)
set_target_properties(Gnuradio::teleorbit PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${TELEORBIT_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${TELEORBIT_INCLUDE_DIRS};${TELEORBIT_INCLUDE_DIRS}/teleorbit"
INTERFACE_LINK_LIBRARIES "${TELEORBIT_LIBRARIES}"
)
endif()
mark_as_advanced(TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -15,10 +15,19 @@
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
# Provides the following imported target:
# Iio::iio
#
########################################################################
# Find the library for the USRP Hardware Driver
########################################################################
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
pkg_check_modules(PC_UHD uhd)
@ -72,4 +81,46 @@ find_library(UHD_LIBRARIES
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS)
if(PC_UHD_VERSION)
set(UHD_VERSION ${PC_UHD_VERSION})
endif()
if(NOT PC_UHD_VERSION)
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
unset(PACKAGE_VERSION)
list(GET UHD_LIBRARIES 0 FIRST_DIR)
get_filename_component(UHD_LIBRARIES_DIR ${FIRST_DIR} DIRECTORY)
if(EXISTS ${UHD_LIBRARIES_DIR}/cmake/uhd/UHDConfigVersion.cmake)
include(${UHD_LIBRARIES_DIR}/cmake/uhd/UHDConfigVersion.cmake)
endif()
if(PACKAGE_VERSION)
set(UHD_VERSION ${PACKAGE_VERSION})
endif()
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
endif()
set_package_properties(UHD PROPERTIES
URL "https://www.ettus.com/sdr-software/detail/usrp-hardware-driver"
)
if(UHD_FOUND AND UHD_VERSION)
set_package_properties(UHD PROPERTIES
DESCRIPTION "USRP Hardware Driver (found: v${UHD_VERSION})"
)
else()
set_package_properties(UHD PROPERTIES
DESCRIPTION "USRP Hardware Driver"
)
endif()
if(UHD_FOUND AND NOT TARGET Uhd::uhd)
add_library(Uhd::uhd SHARED IMPORTED)
set_target_properties(Uhd::uhd PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${UHD_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${UHD_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${UHD_LIBRARIES}"
)
endif()
mark_as_advanced(UHD_LIBRARIES UHD_INCLUDE_DIRS)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -15,12 +15,21 @@
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
# Provides the following imported target:
# Volk::volk
#
########################################################################
# Find VOLK (Vector-Optimized Library of Kernels)
########################################################################
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
pkg_check_modules(PC_VOLK volk)
pkg_check_modules(PC_VOLK volk QUIET)
find_path(VOLK_INCLUDE_DIRS
NAMES volk/volk.h
@ -73,4 +82,47 @@ find_library(VOLK_LIBRARIES
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS)
if(PC_VOLK_VERSION)
set(VOLK_VERSION ${PC_VOLK_VERSION})
endif()
if(NOT VOLK_VERSION)
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
unset(PACKAGE_VERSION)
list(GET VOLK_LIBRARIES 0 FIRST_DIR)
get_filename_component(VOLK_LIB_DIR ${FIRST_DIR} DIRECTORY)
if(EXISTS ${VOLK_LIB_DIR}/cmake/volk/VolkConfigVersion.cmake)
include(${VOLK_LIB_DIR}/cmake/volk/VolkConfigVersion.cmake)
endif()
if(PACKAGE_VERSION)
set(VOLK_VERSION ${PACKAGE_VERSION})
endif()
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
endif()
set_package_properties(VOLK PROPERTIES
URL "http://libvolk.org"
)
if(VOLK_FOUND AND VOLK_VERSION)
set_package_properties(VOLK PROPERTIES
DESCRIPTION "Vector-Optimized Library of Kernels (found: v${VOLK_VERSION})"
)
else()
set_package_properties(VOLK PROPERTIES
DESCRIPTION "Vector-Optimized Library of Kernels"
)
endif()
mark_as_advanced(VOLK_LIBRARIES VOLK_INCLUDE_DIRS VOLK_VERSION)
if(VOLK_FOUND AND NOT TARGET Volk::volk)
add_library(Volk::volk SHARED IMPORTED)
set_target_properties(Volk::volk PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${VOLK_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${VOLK_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${VOLK_LIBRARIES}"
)
endif()

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -15,12 +15,22 @@
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
# Provides the following imported target:
# Volkgnsssdr::volkgnsssdr
#
########################################################################
# Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library
########################################################################
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr)
pkg_check_modules(PC_VOLK_GNSSSDR QUIET volk_gnsssdr)
find_path(VOLK_GNSSSDR_INCLUDE_DIRS
NAMES volk_gnsssdr/volk_gnsssdr.h
@ -51,3 +61,27 @@ find_library(VOLK_GNSSSDR_LIBRARIES
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS)
mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS)
if(PC_VOLK_GNSSSDR_VERSION)
set(VOLKGNSSSDR_VERSION ${PC_VOLK_GNSSSDR_VERSION})
endif()
if(VOLKGNSSSDR_FOUND AND VOLKGNSSSDR_VERSION)
set_package_properties(VOLKGNSSSDR PROPERTIES
DESCRIPTION "Vector-Optimized Library of Kernels for GNSS-SDR (found: v${VOLKGNSSSDR_VERSION})."
)
else()
set_package_properties(VOLKGNSSSDR PROPERTIES
DESCRIPTION "Vector-Optimized Library of Kernels for GNSS-SDR."
)
endif()
if(VOLKGNSSSDR_FOUND AND NOT TARGET Volkgnsssdr::volkgnsssdr)
add_library(Volkgnsssdr::volkgnsssdr SHARED IMPORTED)
set_target_properties(Volkgnsssdr::volkgnsssdr PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${VOLK_GNSSSDR_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${VOLK_GNSSSDR_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${VOLK_GNSSSDR_LIBRARIES}"
)
endif()

View File

@ -48,7 +48,7 @@ list(APPEND AVAIL_BUILDTYPES
# known build types in AVAIL_BUILDTYPES. If the build type is found,
# the function exits immediately. If nothing is found by the end of
# checking all available build types, we exit with an error and list
# the avialable build types.
# the available build types.
########################################################################
function(GNSSSDR_CHECK_BUILD_TYPE settype)
string(TOUPPER ${settype} _settype)

View File

@ -82,7 +82,6 @@ if(CMAKE_VERSION VERSION_LESS 3.12)
gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
endif()
find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT)
else()
find_package(Python3 COMPONENTS Interpreter)
if(Python3_FOUND)
@ -101,6 +100,13 @@ else()
gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
endif()
if(NOT MAKO_FOUND OR NOT SIX_FOUND)
unset(PYTHON_EXECUTABLE)
find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION})
gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
endif()
endif()
endif()

View File

@ -1,55 +0,0 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
# GNSS-SDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNSS-SDR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
###############################################################################
# Test for availability of SSE
#
# - Anthony Arnold
###############################################################################
function(test_for_sse h_file result_var name)
if(NOT DEFINED ${result_var})
execute_process(COMMAND echo "#include <${h_file}>"
COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -c -x c++ -
RESULT_VARIABLE COMPILE_RESULT
OUTPUT_QUIET ERROR_QUIET)
set(detected 0)
if(COMPILE_RESULT EQUAL 0)
message(STATUS "Detected ${name}")
set(detected 1)
endif()
set(${result_var} ${detected} CACHE INTERNAL "${name} Available")
endif()
endfunction()
message(STATUS "Testing for SIMD extensions")
enable_language(C)
test_for_sse("ammintrin.h" SSE4A_AVAILABLE "SSE4A")
test_for_sse("nmmintrin.h" SSE4_2_AVAILABLE "SSE4.2")
test_for_sse("smmintrin.h" SSE4_1_AVAILABLE "SSE4.1")
test_for_sse("tmmintrin.h" SSSE3_AVAILABLE "SSSE3")
test_for_sse("pmmintrin.h" SSE3_AVAILABLE "SSE3")
test_for_sse("emmintrin.h" SSE2_AVAILABLE "SSE2")
test_for_sse("xmmintrin.h" SSE_AVAILABLE "SSE1")
test_for_sse("mmintrin.h" MMX_AVAILABLE "MMX")
test_for_sse("wmmintrin.h" AES_AVAILABLE "AES")
test_for_sse("immintrin.h" AVX_AVAILABLE "AVX")
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/-.o")

View File

@ -0,0 +1,126 @@
; This is a GNSS-SDR configuration file
; The configuration API is described at https://gnss-sdr.org/docs/sp-blocks/
; You can define your own receiver and invoke it by doing
; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf
;
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=25000000
;######### CONTROL_THREAD CONFIG ############
ControlThread.wait_for_flowgraph=false
;######### SIGNAL_SOURCE CONFIG ############
SignalSource.implementation=File_Signal_Source
SignalSource.filename=/archive/BDS3_datasets/BdsB1IStr01.dat
SignalSource.item_type=byte
SignalSource.sampling_frequency=25000000
SignalSource.samples=0
SignalSource.repeat=false
SignalSource.dump=false
SignalSource.enable_throttle_control=false
;######### SIGNAL_CONDITIONER CONFIG ############
SignalConditioner.implementation=Signal_Conditioner
DataTypeAdapter.implementation=Byte_To_Short
InputFilter.implementation=Freq_Xlating_Fir_Filter
InputFilter.input_item_type=short
InputFilter.output_item_type=gr_complex
InputFilter.taps_item_type=float
InputFilter.number_of_taps=5
InputFilter.number_of_bands=2
InputFilter.band1_begin=0.0
InputFilter.band1_end=0.70
InputFilter.band2_begin=0.80
InputFilter.band2_end=1.0
InputFilter.ampl1_begin=1.0
InputFilter.ampl1_end=1.0
InputFilter.ampl2_begin=0.0
InputFilter.ampl2_end=0.0
InputFilter.band1_error=1.0
InputFilter.band2_error=1.0
InputFilter.filter_type=bandpass
InputFilter.grid_density=16
InputFilter.sampling_frequency=25000000
InputFilter.IF=6250000
InputFilter.dump = false
InputFilter.dump_filename=/home/dmiralles/Documents/gnss-sdr/src/tests/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat
Resampler.implementation=Pass_Through
Resampler.sample_freq_in=25000000
Resampler.sample_freq_out=25000000
Resampler.item_type=gr_complex
;######### CHANNELS GLOBAL CONFIG ############
Channels_B1.count=10
Channels.in_acquisition=1
Channel.signal=B1
Channel0.satellite = 6;
Channel1.satellite = 8;
Channel2.satellite = 9;
Channel3.satellite = 13;
Channel4.satellite = 17;
Channel5.satellite = 1;
Channel6.satellite = 2;
Channel7.satellite = 3;
Channel8.satellite = 4;
Channel9.satellite = 5;
;######### ACQUISITION GLOBAL CONFIG ############
Acquisition_B1.implementation=BEIDOU_B1I_PCPS_Acquisition
Acquisition_B1.item_type=gr_complex
Acquisition_B1.coherent_integration_time_ms=1
Acquisition_B1.threshold=0.0038
;Acquisition_B1.pfa=0.0000001;
Acquisition_B1.doppler_max=10000
Acquisition_B1.doppler_step=100
Acquisition_B1.dump=true
Acquisition_B1.dump_filename=./bds_acq
Acquisition_B1.blocking=false;
Acquisition_B1.use_CFAR_algorithm=true;
Acquisition_B1.bit_transition_flag = false;
;######### TRACKING GLOBAL CONFIG ############
Tracking_B1.implementation=BEIDOU_B1I_DLL_PLL_Tracking
Tracking_B1.item_type=gr_complex
Tracking_B1.pll_bw_hz=25.0;
Tracking_B1.dll_bw_hz=2.50;
Tracking_B1.dump=false;
Tracking_B1.dump_filename=./epl_tracking_ch_
;######### TELEMETRY DECODER GPS CONFIG ############
TelemetryDecoder_B1.implementation=BEIDOU_B1I_Telemetry_Decoder
TelemetryDecoder_B1.dump=false
;######### OBSERVABLES CONFIG ############
Observables.implementation=Hybrid_Observables
Observables.dump=false
Observables.dump_filename=./observables.dat
;######### PVT CONFIG ############
PVT.implementation=RTKLIB_PVT
PVT.positioning_mode=Single ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic
PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX
PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad
PVT.output_rate_ms=100
PVT.display_rate_ms=500
PVT.dump_filename=./PVT
PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea;
PVT.flag_nmea_tty_port=false;
PVT.nmea_dump_devname=/dev/pts/4
PVT.flag_rtcm_server=false
PVT.flag_rtcm_tty_port=false
PVT.rtcm_dump_devname=/dev/pts/1
PVT.dump=true
PVT.rinex_version=3
PVT.rinex_output_enabled=true
PVT.gpx_output_enabled=true

View File

@ -0,0 +1,210 @@
; This is a GNSS-SDR configuration file
; The configuration API is described at https://gnss-sdr.org/docs/sp-blocks/
; You can define your own receiver and invoke it by doing
; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf
;
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=30000000
Receiver.sources_count=2
;######### CONTROL_THREAD CONFIG ############
ControlThread.wait_for_flowgraph=false
;######### SIGNAL_SOURCE CONFIG ############
;# Signal Source config for GPS, Galileo signals
SignalSource0.implementation=File_Signal_Source
SignalSource0.filename=/archive/BDS3_datasets/long/20180713_211400_3.dat
SignalSource0.item_type=ibyte
SignalSource0.sampling_frequency=10000000
SignalSource0.samples=0
SignalSource0.repeat=false
SignalSource0.dump=false
SignalSource0.enable_throttle_control=false
;# Signal Source config for BDS signals
SignalSource1.implementation=File_Signal_Source
SignalSource1.filename=/archive/BDS3_datasets/long/20180713_211400_2.dat
SignalSource1.item_type=ibyte
SignalSource1.sampling_frequency=30000000
SignalSource1.samples=0
SignalSource1.repeat=false
SignalSource1.dump=false
SignalSource1.enable_throttle_control=false
;######### SIGNAL_CONDITIONER CONFIG ############
;# Signal Conditioner config for GPS, Galileo signals
SignalConditioner0.implementation=Signal_Conditioner
DataTypeAdapter0.implementation=Ibyte_To_Complex
InputFilter0.implementation=Freq_Xlating_Fir_Filter
InputFilter0.input_item_type=gr_complex
InputFilter0.output_item_type=gr_complex
InputFilter0.taps_item_type=float
InputFilter0.number_of_taps=5
InputFilter0.number_of_bands=2
InputFilter0.band1_begin=0.0
InputFilter0.band1_end=0.70
InputFilter0.band2_begin=0.80
InputFilter0.band2_end=1.0
InputFilter0.ampl1_begin=1.0
InputFilter0.ampl1_end=1.0
InputFilter0.ampl2_begin=0.0
InputFilter0.ampl2_end=0.0
InputFilter0.band1_error=1.0
InputFilter0.band2_error=1.0
InputFilter0.filter_type=bandpass
InputFilter0.grid_density=16
InputFilter0.sampling_frequency=10000000
InputFilter0.IF=420000
Resampler0.implementation=Direct_Resampler
Resampler0.sample_freq_in=10000000
Resampler0.sample_freq_out=30000000
Resampler0.item_type=gr_complex
;# Signal Conditioner config for BDS signals
SignalConditioner1.implementation=Signal_Conditioner
DataTypeAdapter1.implementation=Ibyte_To_Complex
InputFilter1.implementation=Freq_Xlating_Fir_Filter
InputFilter1.input_item_type=gr_complex
InputFilter1.output_item_type=gr_complex
InputFilter1.taps_item_type=float
InputFilter1.number_of_taps=5
InputFilter1.number_of_bands=2
InputFilter1.band1_begin=0.0
InputFilter1.band1_end=0.70
InputFilter1.band2_begin=0.80
InputFilter1.band2_end=1.0
InputFilter1.ampl1_begin=1.0
InputFilter1.ampl1_end=1.0
InputFilter1.ampl2_begin=0.0
InputFilter1.ampl2_end=0.0
InputFilter1.band1_error=1.0
InputFilter1.band2_error=1.0
InputFilter1.filter_type=bandpass
InputFilter1.grid_density=16
InputFilter1.sampling_frequency=10000000
InputFilter1.IF=1020000
Resampler1.implementation=Pass_Through
Resampler1.sample_freq_in=30000000
Resampler1.sample_freq_out=30000000
Resampler1.item_type=gr_complex
;######### CHANNELS GLOBAL CONFIG ############
Channels_1C.count=7
Channels_B3.count=4
Channels.in_acquisition=11
;# Preparing collection for GPS satellites
Channel0.RF_channel_ID=0
Channel1.RF_channel_ID=0
Channel2.RF_channel_ID=0
Channel3.RF_channel_ID=0
Channel4.RF_channel_ID=0
Channel5.RF_channel_ID=0
Channel6.RF_channel_ID=0
Channel0.signal=1C
Channel0.satellite = 2
Channel1.signal=1C
Channel1.satellite = 5
Channel2.signal=1C
Channel2.satellite = 25
Channel3.signal=1C
Channel3.satellite = 31
Channel4.signal=1C
Channel4.satellite = 24
Channel5.signal=1C
Channel5.satellite = 6
Channel6.signal=1C
Channel6.satellite = 29
;# Preparing collection for BDS satellites
Channel7.RF_channel_ID=1
Channel8.RF_channel_ID=1
Channel9.RF_channel_ID=1
Channel10.RF_channel_ID=1
Channel7.signal=B3
Channel7.satellite = 29
Channel8.signal=B3
Channel8.satellite = 19
Channel9.signal=B3
Channel9.satellite = 20
Channel10.signal=B3
Channel10.satellite = 30
;######### ACQUISITION GLOBAL CONFIG ############
;# Acquisition config for BDS signals
Acquisition_B3.implementation=BEIDOU_B3I_PCPS_Acquisition
Acquisition_B3.item_type=gr_complex
Acquisition_B3.coherent_integration_time_ms=1
Acquisition_B3.threshold=0.00025
Acquisition_B3.doppler_max=15000
Acquisition_B3.doppler_step=50
Acquisition_B3.dump=false
Acquisition_B3.dump_filename=/home/dmiralles/Documents/Research/Publications/INSIDE_GNSS/bds_leg_pvt/Data/bds_b1i_acq
Acquisition_B3.blocking=false;
Acquisition_B3.use_CFAR_algorithm=true;
Acquisition_B3.bit_transition_flag = false;
;# Acquisition config for GPS signals
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition_1C.item_type=gr_complex
Acquisition_1C.coherent_integration_time_ms=1
Acquisition_1C.threshold=0.001
Acquisition_1C.doppler_max=15000
Acquisition_1C.doppler_step=50
Acquisition_1C.dump=true
Acquisition_1C.dump_filename=/home/dmiralles/Documents/Research/Publications/INSIDE_GNSS/bds_leg_pvt/Data/gps_l1ca_acq
Acquisition_1C.blocking=false;
Acquisition_1C.use_CFAR_algorithm=true;
Acquisition_1C.bit_transition_flag = false;
;######### TRACKING GLOBAL CONFIG ############
Tracking_B3.implementation=BEIDOU_B3I_DLL_PLL_Tracking
Tracking_B3.item_type=gr_complex
Tracking_B3.pll_bw_hz=25.0;
Tracking_B3.dll_bw_hz=2.50;
Tracking_B3.dump=true;
Tracking_B3.dump_filename=/home/dmiralles/Documents/Research/Publications/INSIDE_GNSS/bds_leg_pvt/Data/bds_b1i_trk_ch_
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=gr_complex
Tracking_1C.pll_bw_hz=25.0;
Tracking_1C.dll_bw_hz=2.50;
Tracking_1C.dump=true;
Tracking_1C.dump_filename=/home/dmiralles/Documents/Research/Publications/INSIDE_GNSS/bds_leg_pvt/Data/gps_l1ca_trk_ch_
;######### TELEMETRY DECODER GPS CONFIG ############
TelemetryDecoder_B3.implementation=BEIDOU_B3I_Telemetry_Decoder
TelemetryDecoder_B3.dump=false
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
TelemetryDecoder_1C.dump=false
;######### OBSERVABLES CONFIG ############
Observables.implementation=Hybrid_Observables
Observables.dump=true
Observables.dump_filename=./observables.dat
;######### PVT CONFIG ############
PVT.implementation=RTKLIB_PVT
PVT.positioning_mode=Single ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic
PVT.iono_model=OFF ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX
PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad
PVT.output_rate_ms=100
PVT.display_rate_ms=500
PVT.dump=true
PVT.dump_filename = /home/dmiralles/Documents/Research/Publications/INSIDE_GNSS/bds_leg_pvt/Data/pvt_l1
PVT.kml_output_enabled = false;
PVT.xml_output_enabled = false;
PVT.gpx_output_enabled = false;
PVT.rinex_output_enabled = false;
PVT.rtcm_output_enabled = false;
PVT.nmea_output_enabled = false;
PVT.geojson_output_enabled = false;

View File

@ -0,0 +1,121 @@
; This is a GNSS-SDR configuration file
; The configuration API is described at https://gnss-sdr.org/docs/sp-blocks/
; You can define your own receiver and invoke it by doing
; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf
;
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=50000000
;######### CONTROL_THREAD CONFIG ############
ControlThread.wait_for_flowgraph=false
;######### SIGNAL_SOURCE CONFIG ############
SignalSource.implementation=File_Signal_Source
SignalSource.filename=/archive/BDS3_datasets/BdsB3IStr01.dat
SignalSource.item_type=byte
SignalSource.sampling_frequency=50000000
SignalSource.samples=0
SignalSource.repeat=false
SignalSource.dump=false
SignalSource.enable_throttle_control=false
;SignalSource.samples=200000
;######### SIGNAL_CONDITIONER CONFIG ############
SignalConditioner.implementation=Signal_Conditioner
DataTypeAdapter.implementation=Byte_To_Short
InputFilter.implementation=Freq_Xlating_Fir_Filter
InputFilter.input_item_type=short
InputFilter.output_item_type=gr_complex
InputFilter.taps_item_type=float
InputFilter.number_of_taps=5
InputFilter.number_of_bands=2
InputFilter.band1_begin=0.0
InputFilter.band1_end=0.70
InputFilter.band2_begin=0.80
InputFilter.band2_end=1.0
InputFilter.ampl1_begin=1.0
InputFilter.ampl1_end=1.0
InputFilter.ampl2_begin=0.0
InputFilter.ampl2_end=0.0
InputFilter.band1_error=1.0
InputFilter.band2_error=1.0
InputFilter.filter_type=bandpass
InputFilter.grid_density=16
InputFilter.sampling_frequency=50000000
InputFilter.IF=12500000
InputFilter.dump = false
InputFilter.dump_filename=/home/dmiralles/Documents/gnss-sdr/src/tests/signal_samples/BdsB3IStr01_fs50e6_if0_4ms.dat
Resampler.implementation=Pass_Through
Resampler.sample_freq_in=50000000
Resampler.sample_freq_out=50000000
Resampler.item_type=gr_complex
;######### CHANNELS GLOBAL CONFIG ############
Channels_B3.count=10
Channels.in_acquisition=1
Channel.signal=B3
Channel0.satellite = 6;
Channel1.satellite = 23;
Channel2.satellite = 16;
Channel3.satellite = 18;
Channel4.satellite = 7;
Channel5.satellite = 1;
Channel6.satellite = 2;
Channel7.satellite = 3;
Channel8.satellite = 4;
Channel9.satellite = 5;
;######### ACQUISITION GLOBAL CONFIG ############
Acquisition_B3.implementation=BEIDOU_B3I_PCPS_Acquisition
Acquisition_B3.item_type=gr_complex
Acquisition_B3.coherent_integration_time_ms=3
Acquisition_B3.max_dwells = 2
Acquisition_B3.threshold=0.0005
Acquisition_B3.doppler_max=10000
Acquisition_B3.doppler_step=100
Acquisition_B3.dump=false
Acquisition_B3.dump_filename=./bds_acq
;######### TRACKING GLOBAL CONFIG ############
Tracking_B3.implementation=BEIDOU_B3I_DLL_PLL_Tracking
Tracking_B3.item_type=gr_complex
Tracking_B3.pll_bw_hz=40.0;
Tracking_B3.dll_bw_hz=4.0;
Tracking_B3.pll_bw_narrow_hz=20.0;
Tracking_B3.dll_bw_narrow_hz=3.0;
Tracking_B3.dump=false;
Tracking_B3.dump_filename=./epl_tracking_ch_
;######### TELEMETRY DECODER GPS CONFIG ############
TelemetryDecoder_B3.implementation=BEIDOU_B3I_Telemetry_Decoder
TelemetryDecoder_B3.dump=false
;######### OBSERVABLES CONFIG ############
Observables.implementation=Hybrid_Observables
Observables.dump=false
Observables.dump_filename=./observables.dat
;######### PVT CONFIG ############
PVT.implementation=RTKLIB_PVT
PVT.positioning_mode=Single ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic
PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX
PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad
PVT.output_rate_ms=100
PVT.display_rate_ms=500
PVT.dump_filename=./PVT
PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea;
PVT.flag_nmea_tty_port=false;
PVT.nmea_dump_devname=/dev/pts/4
PVT.flag_rtcm_server=false
PVT.flag_rtcm_tty_port=false
PVT.rtcm_dump_devname=/dev/pts/1
PVT.dump=true

View File

@ -0,0 +1,131 @@
; This is a GNSS-SDR configuration file
; The configuration API is described at https://gnss-sdr.org/docs/sp-blocks/
; You can define your own receiver and invoke it by doing
; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf
;
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=30000000
;######### CONTROL_THREAD CONFIG ############
ControlThread.wait_for_flowgraph=false
;######### SIGNAL_SOURCE CONFIG ############
SignalSource.implementation=File_Signal_Source
SignalSource.filename=/archive/BDS3_datasets/long/20180713_211400_2.dat
SignalSource.item_type=ibyte
SignalSource.sampling_frequency=30000000
SignalSource.samples=0
SignalSource.repeat=false
SignalSource.dump=false
SignalSource.enable_throttle_control=false
;######### SIGNAL_CONDITIONER CONFIG ############
SignalConditioner.implementation=Signal_Conditioner
DataTypeAdapter.implementation=Ibyte_To_Complex
InputFilter.implementation=Freq_Xlating_Fir_Filter
InputFilter.input_item_type=gr_complex
InputFilter.output_item_type=gr_complex
InputFilter.taps_item_type=float
InputFilter.number_of_taps=5
InputFilter.number_of_bands=2
InputFilter.band1_begin=0.0
InputFilter.band1_end=0.70
InputFilter.band2_begin=0.80
InputFilter.band2_end=1.0
InputFilter.ampl1_begin=1.0
InputFilter.ampl1_end=1.0
InputFilter.ampl2_begin=0.0
InputFilter.ampl2_end=0.0
InputFilter.band1_error=1.0
InputFilter.band2_error=1.0
InputFilter.filter_type=bandpass
InputFilter.grid_density=16
InputFilter.sampling_frequency=30000000
InputFilter.IF=1020000
Resampler.implementation=Pass_Through
Resampler.sample_freq_in=30000000
Resampler.sample_freq_out=30000000
Resampler.item_type=gr_complex
;######### CHANNELS GLOBAL CONFIG ############
Channels_B3.count=4
Channels.in_acquisition=1
Channel.signal=B3
Channel0.satellite = 29;
Channel1.satellite = 19;
Channel2.satellite = 20;
Channel3.satellite = 30;
;Channel0.satellite = 6;
;Channel1.satellite = 7;
;Channel2.satellite = 9;
;Channel3.satellite = 16;
;Channel4.satellite = 18;
;Channel5.satellite = 1;
;Channel6.satellite = 2;
;Channel7.satellite = 3;
;Channel8.satellite = 4;
;Channel9.satellite = 5;
;Channel10.satellite = 23;
;Channel11.satellite = 25;
;Channel12.satellite = 32;
;######### ACQUISITION GLOBAL CONFIG ############
Acquisition_B3.implementation=BEIDOU_B3I_PCPS_Acquisition
Acquisition_B3.item_type=gr_complex
Acquisition_B3.coherent_integration_time_ms=1
Acquisition_B3.max_dwells = 1
Acquisition_B3.threshold=0.0004
;Acquisition_B3.pfa=0.0000001;
Acquisition_B3.doppler_max=10000
Acquisition_B3.doppler_step=50
Acquisition_B3.dump=false
Acquisition_B3.dump_filename=./bds_acq
Acquisition_B3.blocking=false;
Acquisition_B3.use_CFAR_algorithm=true;
Acquisition_B3.bit_transition_flag = false;
;######### TRACKING GLOBAL CONFIG ############
Tracking_B3.implementation=BEIDOU_B3I_DLL_PLL_Tracking
Tracking_B3.item_type=gr_complex
Tracking_B3.pll_bw_hz=25.0;
Tracking_B3.dll_bw_hz=2.50;
Tracking_B3.dump=false;
Tracking_B3.dump_filename=./epl_tracking_ch_
;######### TELEMETRY DECODER GPS CONFIG ############
TelemetryDecoder_B3.implementation=BEIDOU_B3I_Telemetry_Decoder
TelemetryDecoder_B3.dump=false
;######### OBSERVABLES CONFIG ############
Observables.implementation=Hybrid_Observables
Observables.dump=false
Observables.dump_filename=./observables.dat
;######### PVT CONFIG ############
PVT.implementation=RTKLIB_PVT
PVT.positioning_mode=Single ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic
PVT.iono_model=OFF ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX
PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad
PVT.output_rate_ms=100
PVT.display_rate_ms=500
PVT.dump_filename=./PVT
PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea;
PVT.flag_nmea_tty_port=false;
PVT.nmea_dump_devname=/dev/pts/4
PVT.flag_rtcm_server=false
PVT.flag_rtcm_tty_port=false
PVT.rtcm_dump_devname=/dev/pts/1
PVT.dump=true

View File

@ -0,0 +1,83 @@
; This is a GNSS-SDR configuration file
; The configuration API is described at https://gnss-sdr.org/docs/sp-blocks/
; 5C is the channel identifier for BeiDou B2a, both the data signal and the pilot signal
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=30000000
;######### SIGNAL_SOURCE CONFIG ############
SignalSource.implementation=File_Signal_Source
;SignalSource.filename=/home/dmiralles/Documents/gnss-sdr/src/tests/signal_samples/USRP_BDS_B2a_201805171115_fs_25e6_if0e3_ishort_200ms.bin
SignalSource.filename=/archive/USRP_BDS_B3I_201805171118_fs_25e6_if0e3_ishort.bin
SignalSource.item_type=ishort
SignalSource.sampling_frequency=30000000
SignalSource.samples=0
SignalSource.repeat=false
SignalSource.enable_throttle_control=false
;######### SIGNAL_CONDITIONER CONFIG ############
SignalConditioner.implementation=Signal_Conditioner
InputFilter.implementation=Pass_Through
DataTypeAdapter.implementation=Ishort_To_Complex
Resampler.implementation=Direct_Resampler
Resampler.sample_freq_in=30000000
Resampler.sample_freq_out=30000000
Resampler.item_type=gr_complex
;######### CHANNELS GLOBAL CONFIG ############
Channel.signal=B3
Channels.in_acquisition=1
Channels_B3.count=5;
Channel0.satellite = 27;
Channel1.satellite = 22;
Channel2.satellite = 21;
Channel3.satellite = 28;
Channel4.satellite = 30;
;######### ACQUISITION GLOBAL CONFIG ############
Acquisition_B3.implementation=BEIDOU_B3I_PCPS_Acquisition
Acquisition_B3.item_type=gr_complex
Acquisition_B3.coherent_integration_time_ms = 1
Acquisition_B3.max_dwells = 1
Acquisition_B3.threshold=0.0010
Acquisition_B3.doppler_max=10000
Acquisition_B3.doppler_step=50
Acquisition_B3.dump=true
Acquisition_B3.dump_channel = 0;
Acquisition_B3.dump_filename=/archive/bds_b3i_acq
Acquisition_B3.blocking=false;
Acquisition_B3.use_CFAR_algorithm=true;
Acquisition_B3.bit_transition_flag = false;
;######### TRACKING GLOBAL CONFIG ############
Tracking_B3.implementation= BEIDOU_B3I_DLL_PLL_Tracking;
Tracking_B3.item_type=gr_complex
Tracking_B3.early_late_space_chips=0.5
Tracking_B3.pll_bw_hz=25.0;
Tracking_B3.dll_bw_hz=2.0;
Tracking_B3.dump=true;
Tracking_B3.dump_filename=/archive/bds_b3i_trk_ch_
;######### TELEMETRY DECODER GPS CONFIG ############
TelemetryDecoder_B3.implementation=BEIDOU_B3I_Telemetry_Decoder
TelemetryDecoder_B3.dump=true
TelemetryDecoder_B3.dump_filename=/archive/bds_b3i_tel_dec.dat
;######### OBSERVABLES CONFIG ############
Observables.implementation=Hybrid_Observables
Observables.dump=true;
Observables.dump_filename=/archive/bds_b3i_observables.dat
;######### PVT CONFIG ############
PVT.implementation=RTKLIB_PVT
PVT.averaging_depth=100
PVT.flag_averaging=true
PVT.output_rate_ms=10
PVT.display_rate_ms=500

View File

@ -0,0 +1,100 @@
; You can define your own receiver and invoke it by doing
; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf
;
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_sps=6625000
;######### CONTROL_THREAD CONFIG ############
ControlThread.wait_for_flowgraph=false
;######### SIGNAL_SOURCE CONFIG ############
SignalSource.implementation=File_Signal_Source
SignalSource.filename=/home/dmiralles/Documents/GSOC/GSOC2017/gnss-sdr/data/dmirallesNT1065_L2_20160831_fs6625e6_60e3_schar_1H.bin
SignalSource.item_type=ibyte
SignalSource.sampling_frequency=6625000
SignalSource.freq=1602000000
SignalSource.samples=0
SignalSource.repeat=false
SignalSource.sample_type=iq
SignalSource.seconds_to_skip=0
SignalSource.dump=false
SignalSource.dump_filename=../data/signal_source.dat
SignalSource.enable_throttle_control=false
;######### SIGNAL_CONDITIONER CONFIG ############
SignalConditioner.implementation=Signal_Conditioner
;DataTypeAdapter.implementation=Ishort_To_Complex
DataTypeAdapter.implementation=Ibyte_To_Complex
InputFilter.implementation=Pass_Through
;InputFilter.input_item_type=gr_complex
;InputFilter.output_item_type=gr_complex
InputFilter.item_type=gr_complex
;Resampler.implementation=Pass_Through
;Resampler.item_type=gr_complex
Resampler.implementation=Pass_Through
;Resampler.sample_freq_in=4000000
;Resampler.sample_freq_out=2000000
;Resampler.item_type=gr_complex
Resampler.item_type=gr_complex
;######### CHANNELS GLOBAL CONFIG ############
Channels_1R.count=8 ;Assuming here that identifier `1r=R` defines GLONASS SP signals
Channels.in_acquisition=1
Channel.signal=1R
;Channel.item_type=cshort
;######### ACQUISITION GLOBAL CONFIG ############
Acquisition_1R.dump=false
Acquisition_1R.dump_filename=./acq_dump.dat
Acquisition_1R.item_type=cshort
Acquisition_1R.sampled_ms=1
Acquisition_1R.implementation=GLONASS_L1_CA_PCPS_Acquisition
Acquisition_1R.threshold=0.008
;Acquisition_1C.pfa=0.000001
Acquisition_1R.doppler_max=10000
Acquisition_1R.doppler_step=250
Acquisition_1R.tong_init_val=2
Acquisition_1R.tong_max_val=10
Acquisition_1R.tong_max_dwells=20
;######### TRACKING GLOBAL CONFIG ############
Tracking_1R.implementation=GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking
Tracking_1R.item_type=cshort
Tracking_1R.dump=false
Tracking_1R.dump_filename=../data/epl_tracking_ch_
Tracking_1R.pll_bw_hz=40.0;
Tracking_1R.dll_bw_hz=4.0;
Tracking_1R.order=3;
;######### TELEMETRY DECODER GPS CONFIG ############
TelemetryDecoder_1R.implementation=GLONASS_L1_CA_Telemetry_Decoder
TelemetryDecoder_1R.dump=false
;######### OBSERVABLES CONFIG ############
Observables.implementation=Hybrid_Observables
Observables.dump=false
Observables.dump_filename=./observables.dat
;######### PVT CONFIG ############
PVT.implementation=RTKLIB_PVT
PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic
PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX
PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad
PVT.output_rate_ms=100
PVT.display_rate_ms=500
PVT.dump_filename=./PVT
PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea;
PVT.flag_nmea_tty_port=false;
PVT.nmea_dump_devname=/dev/pts/4
PVT.flag_rtcm_server=false
PVT.flag_rtcm_tty_port=false
PVT.rtcm_dump_devname=/dev/pts/1
PVT.dump=false

View File

@ -50,7 +50,7 @@ Acquisition_1C.doppler_max=10000
Acquisition_1C.doppler_step=500
;######### TRACKING GLOBAL CONFIG ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking_Fpga
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking_Fpga
Tracking_1C.item_type=cshort
Tracking_1C.dump=false
Tracking_1C.dump_filename=../data/epl_tracking_ch_

View File

@ -57,7 +57,7 @@ Acquisition_1C.dump_filename=./acq_dump.dat
;######### TRACKING GLOBAL CONFIG ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=gr_complex
Tracking_1C.dump=true
Tracking_1C.dump_filename=epl_tracking_ch_

View File

@ -56,7 +56,7 @@ Acquisition_1C.dump_filename=./acq_dump.dat
Acquisition_1C.blocking=false;
;######### TRACKING GLOBAL CONFIG ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=cshort
Tracking_1C.pll_bw_hz=40.0;
Tracking_1C.dll_bw_hz=4.0;

View File

@ -69,7 +69,7 @@ Acquisition_1C.dump_filename=./acq_dump.dat
;######### TRACKING GPS CONFIG ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=gr_complex
Tracking_1C.extend_correlation_ms=10
Tracking_1C.pll_bw_hz=35;

View File

@ -104,7 +104,7 @@ Acquisition_1B.dump=false
Acquisition_1B.dump_filename=./acq_dump.dat
;######### TRACKING GPS CONFIG ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=gr_complex
Tracking_1C.extend_correlation_ms=1
Tracking_1C.pll_bw_hz=40;

View File

@ -75,7 +75,7 @@ Acquisition_1B.dump_filename=./acq_dump.dat
;######### TRACKING GPS CONFIG ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=gr_complex
Tracking_1C.extend_correlation_ms=10
Tracking_1C.pll_bw_hz=40;

View File

@ -103,7 +103,7 @@ Acquisition_1B.dump_filename=./acq_dump.dat
;######### TRACKING GPS CONFIG ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=gr_complex
Tracking_1C.pll_bw_hz=50.0;
Tracking_1C.dll_bw_hz=5.0;

View File

@ -120,7 +120,7 @@ Acquisition_1B.dump=false
Acquisition_1B.dump_filename=./acq_dump.dat
;######### TRACKING GPS CONFIG ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=gr_complex
Tracking_1C.extend_correlation_ms=1
Tracking_1C.pll_bw_hz=40;

View File

@ -143,7 +143,7 @@ Acquisition_1C.dump_filename=./acq_dump.dat
;######### TRACKING GLOBAL CONFIG ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=gr_complex
Tracking_1C.extend_correlation_ms=10
Tracking_1C.pll_bw_hz=40.0;

View File

@ -1,3 +1,98 @@
## [0.0.11](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.11)
This release has several improvements in different dimensions, addition of new features and bug fixes:
### Improvements in Accuracy
- Local clock correction based on PVT solution, allowing the delivery of continuous observables.
- Fix a bug in broadcast ionospheric parameters usage.
### Improvements in Availability
- Improved mechanism for false lock detection in the Tracking loops.
- Fixed bug in Galileo INAV/FNAV message decoding when PLL is locked at 180 degrees, which prevented from correct navigation message decoding in some situations.
- Fixed bug that caused a random deadlock in the Observables block, preventing the computation of PVT fixes.
- Fixed PVT computation continuity through the TOW rollover.
- Improved signal acquisition and tracking mechanisms in high dynamic scenarios.
### Improvements in Efficiency
- Added mechanism for assisted acquisition of signals on a secondary band when the primary has already been acquired. This allows a great reduction of the computational load in multi-frequency configurations.
- Tracking loops now perform bit synchronization, simplifying the decoding process in Telemetry blocks and FPGA-offloading.
- Improved preamble detection implementation in the decoding of navigation messages (acceleration by x1.6 on average per channel).
- Shortened Acquisition to Tracking transition time.
- Applied clang-tidy checks and fixes related to performance: performance-faster-string-find, performance-for-range-copy, performance-implicit-conversion-in-loop, performance-inefficient-algorithm, performance-inefficient-string-concatenation, performance-inefficient-vector-operation, performance-move-const-arg, performance-move-constructor-init, performance-noexcept-move-constructor, performance-type-promotion-in-math-fn, performance-unnecessary-copy-initialization, performance-unnecessary-value-param, readability-string-compare.
### Improvements in Flexibility:
- Rewritten Control Thread and GNSS flow graph for increased control of channels' status and smarter assignation of satellites in multi-band configurations.
- New Tracking parameters allow the configuration of PLL and DLL filters order.
- Added parameter to enable FLL during pull-in time.
- Configurable pull-in time in the Tracking loops.
### Improvements in Interoperability:
- Added the BeiDou B1I and B3I receiver chains.
- Fix bug in GLONASS dual frequency receiver.
- Added a custom UDP/IP output for PVT data streaming.
- Improved Monitor block with UDP/IP output for internal receiver's data streaming.
- Custom output formats described with .proto files, making easier to other applications reading them in a forward and backward-compatible fashion upon future format changes. New dependency: Protocol Buffers >= 3.0.0
- Fixes in RINEX generation: week rollover, annotations are not repeated anymore in navigation files. Parameter rinexnav_rate_ms has been removed, annotations are made as new ephemeris arrive.
- Fixes in RTCM messages generation: week rollover.
### Improvements in Maintainability:
- The internal communication mechanism based on gr::msg_queue has been replaced by a thread-safe, built-in asynchronous message passing system based on GNU Radio's Polymorphic Types. This change is backwards-compatible and prevents from a failure in case of a possible future deprecation or removal of the gr::msg_queue API.
- Deprecated boost::asio::io_service replaced by boost::asio::io_context if Boost > 1.65
- CMake turns all policies to ON according to the running version up to version 3.15.
- Usage of clang-tidy integrated into CMake scripts. New option -DENABLE_CLANG_TIDY=ON executes clang-tidy along with compilation. Requires clang compiler.
- Applied clang-tidy checks and fixes related to readability: readability-container-size-empty, readability-identifier-naming, readability-inconsistent-declaration-parameter-name, readability-named-parameter, readability-non-const-parameter, readability-string-compare.
- Improved includes selection following suggestions by include-what-you-use (see https://include-what-you-use.org/), allowing faster compiles, fewer recompiles and making refactoring easier.
- Massive reduction of warnings triggered by clang-tidy checks.
- Throughout code cleaning and formatting performed with automated tools in order to reduce future commit noise.
### Improvements in Portability:
- Added interfaces for FPGA off-loading in GPS L1 C/A, Galileo E1b/c, GPS L2C, GPS L5 and Galileo E5a receiver chains.
- CMake scripts now follow a modern approach (targets and properties) but still work with 2.8.12.
- Improvements for macOS users using Homebrew.
- The software builds against GNU Radio >= 3.7.3, including 3.8.0. Automatically detected, no user intervention is required.
- The volk_gnsssdr library can now be built without requiring Boost if the compiler supports C++17 or higher.
- The Boost Filesystem library is not anymore a required dependency in cases where it can be replaced by std::filesystem. Automatically detected, no user intervention is required.
- CMake scripts automatically select among C++11, C++14, C++17 or C++20 standards, the most recent as possible, depending on compiler and dependencies versions.
- Drawback in portability: Protocol Buffers >= 3.0.0 is a new required dependency.
### Improvements in Reliability
- Included the Guidelines Support Library. General improvement of memory management, replacement of raw pointers by containers or smart pointers.
- Applied clang-tidy checks and fixes related to High Integrity C++: performance-move-const-arg, modernize-use-auto, modernize-use-equals-default, modernize-use-equals-delete, modernize-use-noexcept, modernize-use-nullptr, cert-dcl21-cpp, misc-new-delete-overloads, cert-dcl58-cpp, cert-err52-cpp, cert-err60-cpp, hicpp-exception-baseclass, hicpp-explicit-conversions.
- Fixed a number of defects detected by Coverity Scan (version June 2019).
### Improvements in Usability
- The receiver now admits FPGA off-loading, allowing for real time operation in embedded systems at high sampling rates and high number of signals and channels per signal in multiple bands.
- Fixed program termination (avoiding hangs and segfaults in some platforms/configurations).
- The Labsat_Signal_Source now terminates the receiver's execution when the end of file(s) is reached. It now accepts LabSat 2 filenames and series of LabSat 3 files.
- Added configuration parameters to set the annotation rate in KML, GPX, GeoJSON and NMEA outputs, set by default to 1 s.
- New parameter PVT.show_local_time_zone displays time in the local time zone. Subject to the proper system configuration of the machine running the software receiver. This feature is not available in old compilers.
- CMake now generates a summary of required/optional dependency packages found and enabled/disabled features. This info is also stored in a file called features.log in the building directory.
- Improved information provided to the user in case of building configuration and runtime failures.
See the definitions of concepts and metrics at https://gnss-sdr.org/design-forces/
## [0.0.10](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.10)
This release has several improvements in different dimensions, addition of new features and bug fixes:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View File

@ -1,6 +1,6 @@
.\" Manpage for gnss\-sdr.
.\" Contact carles.fernandez@cttc.es to correct errors or typos.
.TH gnss\-sdr 1 "12 Dec 2018" "0.0.10" "gnss\-sdr man page"
.TH gnss\-sdr 1 "29 Jul 2019" "0.0.11" "gnss\-sdr man page"
.SH NAME
\fBgnss\-sdr\fR \- GNSS Software Defined Receiver.
.SH SYNOPSIS

19
docs/protobuf/README.md Normal file
View File

@ -0,0 +1,19 @@
# Custom structured data format definitions
Files in this folder describe structured data formats that are generated by
GNSS-SDR. They use [Protocol Buffers](https://developers.google.com/protocol-buffers/)'
[proto3](https://developers.google.com/protocol-buffers/docs/proto3) syntax.
From those files, the protocol buffer compiler creates classes that implement
automatic encoding and parsing of the protocol buffer data with an efficient
binary format. The generated classes provide getters and setters for the fields
that make up a protocol buffer and take care of the details of reading and
writing it as a unit. Importantly, the protocol buffer format supports the idea
of extending the format over time in such a way that the code can still read
data encoded with the old format.
Just grab these files if you are developing a client application for GNSS-SDR.
You are free to use C++, Java, Python, C#, Dart, Go or Ruby, among other
languages. A tutorial to create a simple application using Protocol Buffers and
a `.proto` file in C++ is available at
https://gnss-sdr.org/docs/tutorials/monitoring-software-receiver-internal-status/

View File

@ -0,0 +1,42 @@
syntax = "proto3";
package gnss_sdr;
/* GnssSynchro represents the processing measurements at a given time taken by a given processing channel */
message GnssSynchro {
string system = 1; // GNSS constellation: "G" for GPS, "R" for Glonass, "S" for SBAS, "E" for Galileo and "C" for Beidou.
string signal = 2; // GNSS signal: "1C" for GPS L1 C/A, "1B" for Galileo E1b/c, "1G" for Glonass L1 C/A, "2S" for GPS L2 L2C(M), "2G" for Glonass L2 C/A, "L5" for GPS L5 and "5X" for Galileo E5a
uint32 prn = 3; // PRN number
int32 channel_id = 4; // Channel number
double acq_delay_samples = 5; // Coarse code delay estimation, in samples
double acq_doppler_hz = 6; // Coarse Doppler estimation in each channel, in Hz
uint64 acq_samplestamp_samples = 7; // Number of samples at signal SampleStamp
uint32 acq_doppler_step = 8; // Step of the frequency bin in the search grid, in Hz
bool flag_valid_acquisition = 9; // Acquisition status
int64 fs = 10; // Sampling frequency, in samples per second
double prompt_i = 11; // In-phase (real) component of the prompt correlator output
double prompt_q = 12; // Quadrature (imaginary) component of the prompt correlator output
double cn0_db_hz = 13; // Carrier-to-Noise density ratio, in dB-Hz
double carrier_doppler_hz = 14; // Doppler estimation, in [Hz].
double carrier_phase_rads = 15; // Carrier phase estimation, in rad
double code_phase_samples = 16; // Code phase in samples
uint64 tracking_sample_counter = 17; // Sample counter indicating the number of processed samples
bool flag_valid_symbol_output = 18; // Indicates the validity of signal tracking
int32 correlation_length_ms = 19; // Time duration of coherent correlation integration, in ms
bool flag_valid_word = 20; // Indicates the validity of the decoded navigation message word
uint32 tow_at_current_symbol_ms = 21; // Time of week of the current symbol, in ms
double pseudorange_m = 22; // Pseudorange computation, in m
double rx_time = 23; // Receiving time after the start of the week, in s
bool flag_valid_pseudorange = 24; // Pseudorange computation status
double interp_tow_ms = 25; // Interpolated time of week, in ms
}
/* Observables represents a collection of GnssSynchro annotations */
message Observables {
repeated GnssSynchro observable = 1;
}

View File

@ -0,0 +1,41 @@
syntax = "proto3";
package gnss_sdr;
/* MonitorPvt represents a search query, with pagination options to
* indicate which results to include in the response. */
message MonitorPvt {
uint32 tow_at_current_symbol_ms = 1; // Time of week of the current symbol, in ms
uint32 week = 2; // PVT GPS week
double rx_time = 3; // PVT GPS time
double user_clk_offset = 4; // User clock offset, in s
double pos_x = 5; // Position X component in ECEF, expressed in m
double pos_y = 6; // Position Y component in ECEF, expressed in m
double pos_z = 7; // Position Z component in ECEF, expressed in m
double vel_x = 8; // Velocity X component in ECEF, in m/s
double vel_y = 9; // Velocity Y component in ECEF, in m/s
double vel_z = 10; // Velocity Z component in ECEF, in m/s
double cov_xx = 11; // Position variance in the Y component, in m2
double cov_yy = 12; // Position variance in the Y component, in m2
double cov_zz = 13; // Position variance in the Z component, in m2
double cov_xy = 14; // Position XY covariance, in m2
double cov_yz = 15; // Position YZ covariance, in m2
double cov_zx = 16; // Position ZX covariance, in m2
double latitude = 17; // Latitude, in deg. Positive: North
double longitude = 18; // Longitude, in deg. Positive: East
double height = 19; // Height, in m
uint32 valid_sats = 20; // Number of valid satellites
uint32 solution_status = 21; // RTKLIB solution status
uint32 solution_type = 22; // RTKLIB solution type (0: xyz-ecef, 1: enu-baseline)
float ar_ratio_factor = 23; // Ambiguity resolution ratio factor for validation
float ar_ratio_threshold = 24; // Ambiguity resolution ratio threshold for validation
double gdop = 25; // Geometric Dilution of Precision
double pdop = 26; // Position (3D) Dilution of Precision
double hdop = 27; // Horizontal Dilution of Precision
double vdop = 28; // Vertical Dilution of Precision
}

View File

@ -1,4 +1,4 @@
# Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -17,10 +17,6 @@
#
if(Boost_VERSION LESS 105800)
add_definitions(-DOLD_BOOST=1)
endif()
set(PVT_ADAPTER_SOURCES
rtklib_pvt.cc
)
@ -29,28 +25,39 @@ set(PVT_ADAPTER_HEADERS
rtklib_pvt.h
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/core/system_parameters
${CMAKE_SOURCE_DIR}/src/core/interfaces
${CMAKE_SOURCE_DIR}/src/core/receiver
${CMAKE_SOURCE_DIR}/src/algorithms/PVT/gnuradio_blocks
${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs
${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib
${CMAKE_SOURCE_DIR}/src/algorithms/libs
${ARMADILLO_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
)
source_group(Headers FILES ${PVT_ADAPTER_HEADERS})
add_library(pvt_adapters ${PVT_ADAPTER_SOURCES} ${PVT_ADAPTER_HEADERS})
source_group(Headers FILES ${PVT_ADAPTER_HEADERS})
target_link_libraries(pvt_adapters
pvt_gr_blocks
${ARMADILLO_LIBRARIES}
${GNURADIO_RUNTIME_LIBRARIES}
PUBLIC
pvt_gr_blocks
algorithms_libs_rtklib
core_system_parameters
PRIVATE
gnss_sdr_flags
pvt_libs
)
target_include_directories(pvt_adapters
PUBLIC
${CMAKE_SOURCE_DIR}/src/core/interfaces
)
if(Boost_VERSION_STRING VERSION_LESS 1.58.0)
target_compile_definitions(pvt_adapters PRIVATE -DOLD_BOOST=1)
endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(pvt_adapters
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
set_property(TARGET pvt_adapters
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

View File

@ -5,7 +5,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -30,13 +30,17 @@
#include "rtklib_pvt.h"
#include "configuration_interface.h"
#include "gnss_sdr_flags.h"
#include "pvt_conf.h"
#include <boost/archive/xml_iarchive.hpp>
#include <boost/archive/xml_oarchive.hpp>
#include <boost/serialization/map.hpp>
#include <glog/logging.h>
#include "MATH_CONSTANTS.h" // for D2R
#include "configuration_interface.h" // for ConfigurationInterface
#include "galileo_almanac.h" // for Galileo_Almanac
#include "galileo_ephemeris.h" // for Galileo_Ephemeris
#include "gnss_sdr_flags.h" // for FLAGS_RINEX_version
#include "gps_almanac.h" // for Gps_Almanac
#include "gps_ephemeris.h" // for Gps_Ephemeris
#include "pvt_conf.h" // for Pvt_Conf
#include "rtklib_rtkpos.h" // for rtkfree, rtkinit
#include <glog/logging.h> // for LOG
#include <iostream> // for operator<<
#if OLD_BOOST
#include <boost/math/common_factor_rt.hpp>
namespace bc = boost::math;
@ -46,13 +50,10 @@ namespace bc = boost::integer;
#endif
using google::LogMessage;
RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : role_(std::move(role)),
unsigned int out_streams) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams)
{
@ -68,10 +69,10 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
pvt_output_parameters.dump_mat = configuration->property(role + ".dump_mat", true);
// output rate
pvt_output_parameters.output_rate_ms = configuration->property(role + ".output_rate_ms", 500);
pvt_output_parameters.output_rate_ms = bc::lcm(20, configuration->property(role + ".output_rate_ms", 500));
// display rate
pvt_output_parameters.display_rate_ms = configuration->property(role + ".display_rate_ms", 500);
pvt_output_parameters.display_rate_ms = bc::lcm(pvt_output_parameters.output_rate_ms, configuration->property(role + ".display_rate_ms", 500));
// NMEA Printer settings
pvt_output_parameters.flag_nmea_tty_port = configuration->property(role + ".flag_nmea_tty_port", false);
@ -105,7 +106,6 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
pvt_output_parameters.rinex_version = 2;
}
pvt_output_parameters.rinexobs_rate_ms = bc::lcm(configuration->property(role + ".rinexobs_rate_ms", 1000), pvt_output_parameters.output_rate_ms);
pvt_output_parameters.rinexnav_rate_ms = bc::lcm(configuration->property(role + ".rinexnav_rate_ms", 6000), pvt_output_parameters.output_rate_ms);
// RTCM Printer settings
pvt_output_parameters.flag_rtcm_tty_port = configuration->property(role + ".flag_rtcm_tty_port", false);
@ -121,7 +121,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
int rtcm_MT1077_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1077_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms);
int rtcm_MT1087_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1087_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms);
int rtcm_MT1097_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1097_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms);
//std::map<int, int> rtcm_msg_rate_ms;
pvt_output_parameters.rtcm_msg_rate_ms[1019] = rtcm_MT1019_rate_ms;
pvt_output_parameters.rtcm_msg_rate_ms[1020] = rtcm_MT1020_rate_ms;
pvt_output_parameters.rtcm_msg_rate_ms[1045] = rtcm_MT1045_rate_ms;
@ -138,6 +138,11 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
pvt_output_parameters.rtcm_msg_rate_ms[k] = rtcm_MT1097_rate_ms;
}
pvt_output_parameters.kml_rate_ms = bc::lcm(configuration->property(role + ".kml_rate_ms", pvt_output_parameters.kml_rate_ms), pvt_output_parameters.output_rate_ms);
pvt_output_parameters.gpx_rate_ms = bc::lcm(configuration->property(role + ".gpx_rate_ms", pvt_output_parameters.gpx_rate_ms), pvt_output_parameters.output_rate_ms);
pvt_output_parameters.geojson_rate_ms = bc::lcm(configuration->property(role + ".geojson_rate_ms", pvt_output_parameters.geojson_rate_ms), pvt_output_parameters.output_rate_ms);
pvt_output_parameters.nmea_rate_ms = bc::lcm(configuration->property(role + ".nmea_rate_ms", pvt_output_parameters.nmea_rate_ms), pvt_output_parameters.output_rate_ms);
// Infer the type of receiver
/*
* TYPE | RECEIVER
@ -154,13 +159,11 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
* 10 | GPS L1 C/A + Galileo E5a
* 11 | GPS L1 C/A + Galileo E5b
* 12 | Galileo E1B + GPS L2C
* 13 | Galileo E1B + GPS L5
* 13 | Galileo E5a + GPS L5
* 14 | Galileo E1B + Galileo E5a
* 15 | Galileo E1B + Galileo E5b
* 16 | GPS L2C + GPS L5
* 17 | GPS L2C + Galileo E5a
* 18 | GPS L2C + Galileo E5b
* 19 | GPS L5 + Galileo E5a
* 20 | GPS L5 + Galileo E5b
* 21 | GPS L1 C/A + Galileo E1B + GPS L2C
* 22 | GPS L1 C/A + Galileo E1B + GPS L5
@ -170,6 +173,32 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
* 26 | GPS L1 C/A + GLONASS L1 C/A
* 27 | Galileo E1B + GLONASS L1 C/A
* 28 | GPS L2C + GLONASS L1 C/A
* 29 | GPS L1 C/A + GLONASS L2 C/A
* 30 | Galileo E1B + GLONASS L2 C/A
* 31 | GPS L2C + GLONASS L2 C/A
* 32 | GPS L1 C/A + Galileo E1B + GPS L5 + Galileo E5a
*
*
* Skipped previous values to avoid overlapping
* 500 | BeiDou B1I
* 501 | BeiDou B1I + GPS L1 C/A
* 502 | BeiDou B1I + Galileo E1B
* 503 | BeiDou B1I + GLONASS L1 C/A
* 504 | BeiDou B1I + GPS L1 C/A + Galileo E1B
* 505 | BeiDou B1I + GPS L1 C/A + GLONASS L1 C/A + Galileo E1B
* 506 | BeiDou B1I + Beidou B3I
* Skipped previous values to avoid overlapping
* 600 | BeiDou B3I
* 601 | BeiDou B3I + GPS L2C
* 602 | BeiDou B3I + GLONASS L2 C/A
* 603 | BeiDou B3I + GPS L2C + GLONASS L2 C/A
* 604 | BeiDou B3I + GPS L1 C/A
* 605 | BeiDou B3I + Galileo E1B
* 606 | BeiDou B3I + GLONASS L1 C/A
* 607 | BeiDou B3I + GPS L1 C/A + Galileo E1B
* 608 | BeiDou B3I + GPS L1 C/A + Galileo E1B + BeiDou B1I
* 609 | BeiDou B3I + GPS L1 C/A + Galileo E1B + GLONASS L1 C/A
* 610 | BeiDou B3I + GPS L1 C/A + Galileo E1B + GLONASS L1 C/A + BeiDou B1I
*/
int gps_1C_count = configuration->property("Channels_1C.count", 0);
int gps_2S_count = configuration->property("Channels_2S.count", 0);
@ -179,57 +208,208 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
int gal_E5b_count = configuration->property("Channels_7X.count", 0);
int glo_1G_count = configuration->property("Channels_1G.count", 0);
int glo_2G_count = configuration->property("Channels_2G.count", 0);
int bds_B1_count = configuration->property("Channels_B1.count", 0);
int bds_B3_count = configuration->property("Channels_B3.count", 0);
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 1; // L1
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 2;
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 3; // L5
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 4; // E1
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 5; // E5a
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 6;
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 7;
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 8; // L1+L5
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 9; // L1+E1
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 10;
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 11;
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 12;
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 13; // L5+E5a
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 14;
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 15;
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 16;
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 17;
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 18;
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 1; // L1
}
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 2; // GPS L2C
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 3; // L5
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 4; // E1
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 5; // E5a
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 6;
}
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 7; // GPS L1 C/A + GPS L2C
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 8; // L1+L5
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 9; // L1+E1
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 10; // GPS L1 C/A + Galileo E5a
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 11;
}
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 12; // Galileo E1B + GPS L2C
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 13; // L5+E5a
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 14; // Galileo E1B + Galileo E5a
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 15;
}
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 16; // GPS L2C + GPS L5
}
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 17; // GPS L2C + Galileo E5a
}
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 18;
}
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 19;
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 20;
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 21;
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count = 0)) pvt_output_parameters.type_of_receiver = 22;
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) pvt_output_parameters.type_of_receiver = 23;
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 24;
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 25;
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 26;
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 27;
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 28;
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 29;
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 30;
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 31;
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 21; // GPS L1 C/A + Galileo E1B + GPS L2C
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 22; // GPS L1 C/A + Galileo E1B + GPS L5
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 23; // GLONASS L1 C/A
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 24; // GLONASS L2 C/A
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 25; // GLONASS L1 C/A + GLONASS L2 C/A
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 26; // GPS L1 C/A + GLONASS L1 C/A
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 27; // Galileo E1B + GLONASS L1 C/A
}
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 28; // GPS L2C + GLONASS L1 C/A
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 29; // GPS L1 C/A + GLONASS L2 C/A
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 30; // Galileo E1B + GLONASS L2 C/A
}
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 31; // GPS L2C + GLONASS L2 C/A
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 32; // L1+E1+L5+E5a
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 33; // L1+E1+E5a
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 32; // L1+E1+L5+E5a
}
// BeiDou B1I Receiver
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 500; // Beidou B1I
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 501; // Beidou B1I + GPS L1 C/A
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 502; // Beidou B1I + Galileo E1B
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 503; // Beidou B1I + GLONASS L1 C/A
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 504; // Beidou B1I + GPS L1 C/A + Galileo E1B
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0))
{
pvt_output_parameters.type_of_receiver = 505; // Beidou B1I + GPS L1 C/A + GLONASS L1 C/A + Galileo E1B
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count != 0))
{
pvt_output_parameters.type_of_receiver = 506; // Beidou B1I + Beidou B3I
}
// BeiDou B3I Receiver
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count != 0))
{
pvt_output_parameters.type_of_receiver = 600; // Beidou B3I
}
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count != 0))
{
pvt_output_parameters.type_of_receiver = 601; // Beidou B3I + GPS L2C
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count != 0))
{
pvt_output_parameters.type_of_receiver = 602; // Beidou B3I + GLONASS L2 C/A
}
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count != 0))
{
pvt_output_parameters.type_of_receiver = 603; // Beidou B3I + GPS L2C + GLONASS L2 C/A
}
// RTKLIB PVT solver options
// Settings 1
int positioning_mode = -1;
std::string default_pos_mode("Single");
std::string positioning_mode_str = configuration->property(role + ".positioning_mode", default_pos_mode); // (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h
if (positioning_mode_str == "Single") positioning_mode = PMODE_SINGLE;
if (positioning_mode_str == "Static") positioning_mode = PMODE_STATIC;
if (positioning_mode_str == "Kinematic") positioning_mode = PMODE_KINEMA;
if (positioning_mode_str == "PPP_Static") positioning_mode = PMODE_PPP_STATIC;
if (positioning_mode_str == "PPP_Kinematic") positioning_mode = PMODE_PPP_KINEMA;
if (positioning_mode_str == "Single")
{
positioning_mode = PMODE_SINGLE;
}
if (positioning_mode_str == "Static")
{
positioning_mode = PMODE_STATIC;
}
if (positioning_mode_str == "Kinematic")
{
positioning_mode = PMODE_KINEMA;
}
if (positioning_mode_str == "PPP_Static")
{
positioning_mode = PMODE_PPP_STATIC;
}
if (positioning_mode_str == "PPP_Kinematic")
{
positioning_mode = PMODE_PPP_KINEMA;
}
if (positioning_mode == -1)
{
//warn user and set the default
// warn user and set the default
std::cout << "WARNING: Bad specification of positioning mode." << std::endl;
std::cout << "positioning_mode possible values: Single / Static / Kinematic / PPP_Static / PPP_Kinematic" << std::endl;
std::cout << "positioning_mode specified value: " << positioning_mode_str << std::endl;
@ -239,22 +419,34 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
int num_bands = 0;
if ((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) num_bands = 1;
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0))) num_bands = 2;
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 2;
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 3;
if ((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0) || (bds_B1_count > 0))
{
num_bands = 1;
}
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0) || (bds_B1_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0) || (bds_B3_count > 0)))
{
num_bands = 2;
}
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0) || (bds_B1_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0)))
{
num_bands = 2;
}
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0) || (bds_B1_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0) || (bds_B3_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0)))
{
num_bands = 3;
}
int number_of_frequencies = configuration->property(role + ".num_bands", num_bands); /* (1:L1, 2:L1+L2, 3:L1+L2+L5) */
if ((number_of_frequencies < 1) || (number_of_frequencies > 3))
{
//warn user and set the default
// warn user and set the default
number_of_frequencies = num_bands;
}
double elevation_mask = configuration->property(role + ".elevation_mask", 15.0);
if ((elevation_mask < 0.0) || (elevation_mask > 90.0))
{
//warn user and set the default
// warn user and set the default
LOG(WARNING) << "Erroneous Elevation Mask. Setting to default value of 15.0 degrees";
elevation_mask = 15.0;
}
@ -262,7 +454,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
int dynamics_model = configuration->property(role + ".dynamics_model", 0); /* dynamics model (0:none, 1:velocity, 2:accel) */
if ((dynamics_model < 0) || (dynamics_model > 2))
{
//warn user and set the default
// warn user and set the default
LOG(WARNING) << "Erroneous Dynamics Model configuration. Setting to default value of (0:none)";
dynamics_model = 0;
}
@ -270,15 +462,33 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
std::string default_iono_model("OFF");
std::string iono_model_str = configuration->property(role + ".iono_model", default_iono_model); /* (IONOOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */
int iono_model = -1;
if (iono_model_str == "OFF") iono_model = IONOOPT_OFF;
if (iono_model_str == "Broadcast") iono_model = IONOOPT_BRDC;
if (iono_model_str == "SBAS") iono_model = IONOOPT_SBAS;
if (iono_model_str == "Iono-Free-LC") iono_model = IONOOPT_IFLC;
if (iono_model_str == "Estimate_STEC") iono_model = IONOOPT_EST;
if (iono_model_str == "IONEX") iono_model = IONOOPT_TEC;
if (iono_model_str == "OFF")
{
iono_model = IONOOPT_OFF;
}
if (iono_model_str == "Broadcast")
{
iono_model = IONOOPT_BRDC;
}
if (iono_model_str == "SBAS")
{
iono_model = IONOOPT_SBAS;
}
if (iono_model_str == "Iono-Free-LC")
{
iono_model = IONOOPT_IFLC;
}
if (iono_model_str == "Estimate_STEC")
{
iono_model = IONOOPT_EST;
}
if (iono_model_str == "IONEX")
{
iono_model = IONOOPT_TEC;
}
if (iono_model == -1)
{
//warn user and set the default
// warn user and set the default
std::cout << "WARNING: Bad specification of ionospheric model." << std::endl;
std::cout << "iono_model possible values: OFF / Broadcast / SBAS / Iono-Free-LC / Estimate_STEC / IONEX" << std::endl;
std::cout << "iono_model specified value: " << iono_model_str << std::endl;
@ -289,14 +499,29 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
std::string default_trop_model("OFF");
int trop_model = -1;
std::string trop_model_str = configuration->property(role + ".trop_model", default_trop_model); /* (TROPOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */
if (trop_model_str == "OFF") trop_model = TROPOPT_OFF;
if (trop_model_str == "Saastamoinen") trop_model = TROPOPT_SAAS;
if (trop_model_str == "SBAS") trop_model = TROPOPT_SBAS;
if (trop_model_str == "Estimate_ZTD") trop_model = TROPOPT_EST;
if (trop_model_str == "Estimate_ZTD_Grad") trop_model = TROPOPT_ESTG;
if (trop_model_str == "OFF")
{
trop_model = TROPOPT_OFF;
}
if (trop_model_str == "Saastamoinen")
{
trop_model = TROPOPT_SAAS;
}
if (trop_model_str == "SBAS")
{
trop_model = TROPOPT_SBAS;
}
if (trop_model_str == "Estimate_ZTD")
{
trop_model = TROPOPT_EST;
}
if (trop_model_str == "Estimate_ZTD_Grad")
{
trop_model = TROPOPT_ESTG;
}
if (trop_model == -1)
{
//warn user and set the default
// warn user and set the default
std::cout << "WARNING: Bad specification of tropospheric model." << std::endl;
std::cout << "trop_model possible values: OFF / Saastamoinen / SBAS / Estimate_ZTD / Estimate_ZTD_Grad" << std::endl;
std::cout << "trop_model specified value: " << trop_model_str << std::endl;
@ -323,13 +548,27 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
int earth_tide = configuration->property(role + ".earth_tide", 0);
int nsys = 0;
if ((gps_1C_count > 0) || (gps_2S_count > 0) || (gps_L5_count > 0)) nsys += SYS_GPS;
if ((gal_1B_count > 0) || (gal_E5a_count > 0) || (gal_E5b_count > 0)) nsys += SYS_GAL;
if ((glo_1G_count > 0) || (glo_2G_count > 0)) nsys += SYS_GLO;
if ((gps_1C_count > 0) || (gps_2S_count > 0) || (gps_L5_count > 0))
{
nsys += SYS_GPS;
}
if ((gal_1B_count > 0) || (gal_E5a_count > 0) || (gal_E5b_count > 0))
{
nsys += SYS_GAL;
}
if ((glo_1G_count > 0) || (glo_2G_count > 0))
{
nsys += SYS_GLO;
}
if ((bds_B1_count > 0) || (bds_B3_count > 0))
{
nsys += SYS_BDS;
}
int navigation_system = configuration->property(role + ".navigation_system", nsys); /* (SYS_XXX) see src/algorithms/libs/rtklib/rtklib.h */
if ((navigation_system < 1) || (navigation_system > 255)) /* GPS: 1 SBAS: 2 GPS+SBAS: 3 Galileo: 8 Galileo+GPS: 9 GPS+SBAS+Galileo: 11 All: 255 */
{
//warn user and set the default
// warn user and set the default
LOG(WARNING) << "Erroneous Navigation System. Setting to default value of (0:none)";
navigation_system = nsys;
}
@ -338,14 +577,29 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
std::string default_gps_ar("Continuous");
std::string integer_ambiguity_resolution_gps_str = configuration->property(role + ".AR_GPS", default_gps_ar); /* Integer Ambiguity Resolution mode for GPS (0:off,1:continuous,2:instantaneous,3:fix and hold,4:ppp-ar) */
int integer_ambiguity_resolution_gps = -1;
if (integer_ambiguity_resolution_gps_str == "OFF") integer_ambiguity_resolution_gps = ARMODE_OFF;
if (integer_ambiguity_resolution_gps_str == "Continuous") integer_ambiguity_resolution_gps = ARMODE_CONT;
if (integer_ambiguity_resolution_gps_str == "Instantaneous") integer_ambiguity_resolution_gps = ARMODE_INST;
if (integer_ambiguity_resolution_gps_str == "Fix-and-Hold") integer_ambiguity_resolution_gps = ARMODE_FIXHOLD;
if (integer_ambiguity_resolution_gps_str == "PPP-AR") integer_ambiguity_resolution_gps = ARMODE_PPPAR;
if (integer_ambiguity_resolution_gps_str == "OFF")
{
integer_ambiguity_resolution_gps = ARMODE_OFF;
}
if (integer_ambiguity_resolution_gps_str == "Continuous")
{
integer_ambiguity_resolution_gps = ARMODE_CONT;
}
if (integer_ambiguity_resolution_gps_str == "Instantaneous")
{
integer_ambiguity_resolution_gps = ARMODE_INST;
}
if (integer_ambiguity_resolution_gps_str == "Fix-and-Hold")
{
integer_ambiguity_resolution_gps = ARMODE_FIXHOLD;
}
if (integer_ambiguity_resolution_gps_str == "PPP-AR")
{
integer_ambiguity_resolution_gps = ARMODE_PPPAR;
}
if (integer_ambiguity_resolution_gps == -1)
{
//warn user and set the default
// warn user and set the default
std::cout << "WARNING: Bad specification of GPS ambiguity resolution method." << std::endl;
std::cout << "AR_GPS possible values: OFF / Continuous / Instantaneous / Fix-and-Hold / PPP-AR" << std::endl;
std::cout << "AR_GPS specified value: " << integer_ambiguity_resolution_gps_str << std::endl;
@ -356,7 +610,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
int integer_ambiguity_resolution_glo = configuration->property(role + ".AR_GLO", 1); /* Integer Ambiguity Resolution mode for GLONASS (0:off,1:on,2:auto cal,3:ext cal) */
if ((integer_ambiguity_resolution_glo < 0) || (integer_ambiguity_resolution_glo > 3))
{
//warn user and set the default
// warn user and set the default
LOG(WARNING) << "Erroneous Integer Ambiguity Resolution for GLONASS . Setting to default value of (1:on)";
integer_ambiguity_resolution_glo = 1;
}
@ -364,7 +618,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
int integer_ambiguity_resolution_bds = configuration->property(role + ".AR_DBS", 1); /* Integer Ambiguity Resolution mode for BEIDOU (0:off,1:on) */
if ((integer_ambiguity_resolution_bds < 0) || (integer_ambiguity_resolution_bds > 1))
{
//warn user and set the default
// warn user and set the default
LOG(WARNING) << "Erroneous Integer Ambiguity Resolution for BEIDOU . Setting to default value of (1:on)";
integer_ambiguity_resolution_bds = 1;
}
@ -390,7 +644,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
If the baseline length is very short like 1 m, the iteration may be effective to handle
the nonlinearity of measurement equation. */
/// Statistics
// Statistics
double bias_0 = configuration->property(role + ".bias_0", 30.0);
double iono_0 = configuration->property(role + ".iono_0", 0.03);
@ -490,7 +744,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
pvt_output_parameters.kml_output_enabled = configuration->property(role + ".kml_output_enabled", default_output_enabled);
pvt_output_parameters.xml_output_enabled = configuration->property(role + ".xml_output_enabled", default_output_enabled);
pvt_output_parameters.nmea_output_file_enabled = configuration->property(role + ".nmea_output_file_enabled", default_output_enabled);
pvt_output_parameters.rtcm_output_file_enabled = configuration->property(role + ".rtcm_output_file_enabled", default_output_enabled);
pvt_output_parameters.rtcm_output_file_enabled = configuration->property(role + ".rtcm_output_file_enabled", false);
std::string default_output_path = configuration->property(role + ".output_path", std::string("."));
pvt_output_parameters.output_path = default_output_path;
@ -502,8 +756,21 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
pvt_output_parameters.nmea_output_file_path = configuration->property(role + ".nmea_output_file_path", default_output_path);
pvt_output_parameters.rtcm_output_file_path = configuration->property(role + ".rtcm_output_file_path", default_output_path);
// Read PVT MONITOR Configuration
pvt_output_parameters.monitor_enabled = configuration->property(role + ".enable_monitor", false);
pvt_output_parameters.udp_addresses = configuration->property(role + ".monitor_client_addresses", std::string("127.0.0.1"));
pvt_output_parameters.udp_port = configuration->property(role + ".monitor_udp_port", 1234);
pvt_output_parameters.protobuf_enabled = configuration->property(role + ".enable_protobuf", true);
if (configuration->property("Monitor.enable_protobuf", false) == true)
{
pvt_output_parameters.protobuf_enabled = true;
}
// Show time in local zone
pvt_output_parameters.show_local_time_zone = configuration->property(role + ".show_local_time_zone", false);
// make PVT object
pvt_ = rtklib_make_pvt_cc(in_streams_, pvt_output_parameters, rtk);
pvt_ = rtklib_make_pvt_gs(in_streams_, pvt_output_parameters, rtk);
DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")";
if (out_streams_ > 0)
{
@ -512,13 +779,13 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
}
RtklibPvt::~RtklibPvt()
Rtklib_Pvt::~Rtklib_Pvt()
{
rtkfree(&rtk);
}
bool RtklibPvt::get_latest_PVT(double* longitude_deg,
bool Rtklib_Pvt::get_latest_PVT(double* longitude_deg,
double* latitude_deg,
double* height_m,
double* ground_speed_kmh,
@ -534,37 +801,37 @@ bool RtklibPvt::get_latest_PVT(double* longitude_deg,
}
void RtklibPvt::clear_ephemeris()
void Rtklib_Pvt::clear_ephemeris()
{
pvt_->clear_ephemeris();
}
std::map<int, Gps_Ephemeris> RtklibPvt::get_gps_ephemeris() const
std::map<int, Gps_Ephemeris> Rtklib_Pvt::get_gps_ephemeris() const
{
return pvt_->get_gps_ephemeris_map();
}
std::map<int, Galileo_Ephemeris> RtklibPvt::get_galileo_ephemeris() const
std::map<int, Galileo_Ephemeris> Rtklib_Pvt::get_galileo_ephemeris() const
{
return pvt_->get_galileo_ephemeris_map();
}
std::map<int, Gps_Almanac> RtklibPvt::get_gps_almanac() const
std::map<int, Gps_Almanac> Rtklib_Pvt::get_gps_almanac() const
{
return pvt_->get_gps_almanac_map();
}
std::map<int, Galileo_Almanac> RtklibPvt::get_galileo_almanac() const
std::map<int, Galileo_Almanac> Rtklib_Pvt::get_galileo_almanac() const
{
return pvt_->get_galileo_almanac_map();
}
void RtklibPvt::connect(gr::top_block_sptr top_block)
void Rtklib_Pvt::connect(gr::top_block_sptr top_block)
{
if (top_block)
{ /* top_block is not null */
@ -574,7 +841,7 @@ void RtklibPvt::connect(gr::top_block_sptr top_block)
}
void RtklibPvt::disconnect(gr::top_block_sptr top_block)
void Rtklib_Pvt::disconnect(gr::top_block_sptr top_block)
{
if (top_block)
{ /* top_block is not null */
@ -583,13 +850,13 @@ void RtklibPvt::disconnect(gr::top_block_sptr top_block)
}
gr::basic_block_sptr RtklibPvt::get_left_block()
gr::basic_block_sptr Rtklib_Pvt::get_left_block()
{
return pvt_;
}
gr::basic_block_sptr RtklibPvt::get_right_block()
gr::basic_block_sptr Rtklib_Pvt::get_right_block()
{
return pvt_; // this is a sink, nothing downstream
return nullptr; // this is a sink, nothing downstream
}

View File

@ -5,7 +5,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -32,25 +32,34 @@
#ifndef GNSS_SDR_RTKLIB_PVT_H_
#define GNSS_SDR_RTKLIB_PVT_H_
#include "pvt_interface.h"
#include "rtklib_pvt_cc.h"
#include <string>
#include "pvt_interface.h" // for PvtInterface
#include "rtklib.h" // for rtk_t
#include "rtklib_pvt_gs.h" // for rtklib_pvt_gs_sptr
#include <gnuradio/gr_complex.h> // for gr_complex
#include <gnuradio/runtime_types.h> // for basic_block_sptr, top_block_sptr
#include <cstddef> // for size_t
#include <ctime> // for time_t
#include <map> // for map
#include <string> // for string
class ConfigurationInterface;
class Galileo_Almanac;
class Galileo_Ephemeris;
class Gps_Almanac;
class Gps_Ephemeris;
/*!
* \brief This class implements a PvtInterface for the RTKLIB PVT block
*/
class RtklibPvt : public PvtInterface
class Rtklib_Pvt : public PvtInterface
{
public:
RtklibPvt(ConfigurationInterface* configuration,
Rtklib_Pvt(ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams);
virtual ~RtklibPvt();
virtual ~Rtklib_Pvt();
inline std::string role() override
{
@ -93,7 +102,7 @@ public:
time_t* UTC_time) override;
private:
rtklib_pvt_cc_sptr pvt_;
rtklib_pvt_gs_sptr pvt_;
rtk_t rtk{};
std::string role_;
unsigned int in_streams_;

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -16,34 +16,69 @@
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
if(Boost_VERSION LESS 105800)
add_definitions(-DOLD_BOOST=1)
endif()
set(PVT_GR_BLOCKS_SOURCES
rtklib_pvt_cc.cc
rtklib_pvt_gs.cc
)
set(PVT_GR_BLOCKS_HEADERS
rtklib_pvt_cc.h
rtklib_pvt_gs.h
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/core/system_parameters
${CMAKE_SOURCE_DIR}/src/core/interfaces
${CMAKE_SOURCE_DIR}/src/core/receiver
${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs
${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib
${CMAKE_SOURCE_DIR}/src/algorithms/libs
${ARMADILLO_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
)
source_group(Headers FILES ${PVT_GR_BLOCKS_HEADERS})
add_library(pvt_gr_blocks ${PVT_GR_BLOCKS_SOURCES} ${PVT_GR_BLOCKS_HEADERS})
source_group(Headers FILES ${PVT_GR_BLOCKS_HEADERS})
target_link_libraries(pvt_gr_blocks pvt_lib ${ARMADILLO_LIBRARIES})
if(${FILESYSTEM_FOUND})
target_compile_definitions(pvt_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1)
if(${find_experimental})
target_compile_definitions(pvt_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
endif()
target_link_libraries(pvt_gr_blocks PRIVATE std::filesystem)
else()
target_link_libraries(pvt_gr_blocks PRIVATE Boost::filesystem Boost::system)
endif()
target_link_libraries(pvt_gr_blocks
PUBLIC
algorithms_libs_rtklib
core_system_parameters
Boost::date_time
Gnuradio::pmt
Gnuradio::runtime
PRIVATE
pvt_libs
algorithms_libs
Gflags::gflags
Glog::glog
Boost::serialization
)
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(pvt_gr_blocks
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
if(Boost_VERSION_STRING VERSION_LESS 1.58.0)
target_compile_definitions(pvt_gr_blocks PRIVATE -DOLD_BOOST=1)
endif()
# Check if we have std::put_time (Workaround for gcc < 5.0)
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
#include <iomanip>
int main()
{ std::put_time(nullptr, \"\"); }"
has_put_time
)
if(${has_put_time})
target_compile_definitions(pvt_gr_blocks PRIVATE -DHAS_PUT_TIME=1)
endif()
set_property(TARGET pvt_gr_blocks
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

File diff suppressed because it is too large Load Diff

View File

@ -1,186 +0,0 @@
/*!
* \file rtklib_pvt_cc.h
* \brief Interface of a Position Velocity and Time computation block
* \author Javier Arribas, 2017. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_RTKLIB_PVT_CC_H
#define GNSS_SDR_RTKLIB_PVT_CC_H
#include "geojson_printer.h"
#include "gps_ephemeris.h"
#include "gpx_printer.h"
#include "kml_printer.h"
#include "nmea_printer.h"
#include "pvt_conf.h"
#include "rinex_printer.h"
#include "rtcm_printer.h"
#include "rtklib_solver.h"
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <gnuradio/sync_block.h>
#include <chrono>
#include <cstdint>
#include <fstream>
#include <string>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/types.h>
#include <utility>
class rtklib_pvt_cc;
typedef boost::shared_ptr<rtklib_pvt_cc> rtklib_pvt_cc_sptr;
rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t n_channels,
const Pvt_Conf& conf_,
const rtk_t& rtk);
/*!
* \brief This class implements a block that computes the PVT solution using the RTKLIB integrated library
*/
class rtklib_pvt_cc : public gr::sync_block
{
private:
friend rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels,
const Pvt_Conf& conf_,
const rtk_t& rtk);
void msg_handler_telemetry(pmt::pmt_t msg);
bool d_dump;
bool d_dump_mat;
bool b_rinex_output_enabled;
bool b_rinex_header_written;
bool b_rinex_header_updated;
double d_rinex_version;
int32_t d_rinexobs_rate_ms;
int32_t d_rinexnav_rate_ms;
bool b_rtcm_writing_started;
bool b_rtcm_enabled;
int32_t d_rtcm_MT1045_rate_ms; //!< Galileo Broadcast Ephemeris
int32_t d_rtcm_MT1019_rate_ms; //!< GPS Broadcast Ephemeris (orbits)
int32_t d_rtcm_MT1020_rate_ms; //!< GLONASS Broadcast Ephemeris (orbits)
int32_t d_rtcm_MT1077_rate_ms; //!< The type 7 Multiple Signal Message format for the USAs GPS system, popular
int32_t d_rtcm_MT1087_rate_ms; //!< GLONASS MSM7. The type 7 Multiple Signal Message format for the Russian GLONASS system
int32_t d_rtcm_MT1097_rate_ms; //!< Galileo MSM7. The type 7 Multiple Signal Message format for Europes Galileo system
int32_t d_rtcm_MSM_rate_ms;
int32_t d_last_status_print_seg; //for status printer
uint32_t d_nchannels;
std::string d_dump_filename;
int32_t d_output_rate_ms;
int32_t d_display_rate_ms;
std::shared_ptr<Rinex_Printer> rp;
std::shared_ptr<Kml_Printer> d_kml_dump;
std::shared_ptr<Gpx_Printer> d_gpx_dump;
std::shared_ptr<Nmea_Printer> d_nmea_printer;
std::shared_ptr<GeoJSON_Printer> d_geojson_printer;
std::shared_ptr<Rtcm_Printer> d_rtcm_printer;
double d_rx_time;
bool d_geojson_output_enabled;
bool d_gpx_output_enabled;
bool d_kml_output_enabled;
bool d_nmea_output_file_enabled;
std::shared_ptr<rtklib_solver> d_pvt_solver;
std::map<int, Gnss_Synchro> gnss_observables_map;
bool observables_pairCompare_min(const std::pair<int, Gnss_Synchro>& a, const std::pair<int, Gnss_Synchro>& b);
uint32_t type_of_rx;
bool first_fix;
key_t sysv_msg_key;
int sysv_msqid;
typedef struct
{
long mtype; //required by sys v message
double ttff;
} ttff_msgbuf;
bool send_sys_v_ttff_msg(ttff_msgbuf ttff);
std::chrono::time_point<std::chrono::system_clock> start, end;
bool save_gnss_synchro_map_xml(const std::string& file_name); //debug helper function
bool load_gnss_synchro_map_xml(const std::string& file_name); //debug helper function
bool d_xml_storage;
std::string xml_base_path;
inline std::time_t to_time_t(boost::posix_time::ptime pt)
{
return (pt - boost::posix_time::ptime(boost::gregorian::date(1970, 1, 1))).total_seconds();
}
public:
rtklib_pvt_cc(uint32_t nchannels,
const Pvt_Conf& conf_,
const rtk_t& rtk);
/*!
* \brief Get latest set of ephemeris from PVT block
*
*/
std::map<int, Gps_Ephemeris> get_gps_ephemeris_map() const;
std::map<int, Gps_Almanac> get_gps_almanac_map() const;
std::map<int, Galileo_Ephemeris> get_galileo_ephemeris_map() const;
std::map<int, Galileo_Almanac> get_galileo_almanac_map() const;
/*!
* \brief Clear all ephemeris information and the almanacs for GPS and Galileo
*
*/
void clear_ephemeris();
/*!
* \brief Get the latest Position WGS84 [deg], Ground Velocity, Course over Ground, and UTC Time, if available
*/
bool get_latest_PVT(double* longitude_deg,
double* latitude_deg,
double* height_m,
double* ground_speed_kmh,
double* course_over_ground_deg,
time_t* UTC_time);
~rtklib_pvt_cc(); //!< Default destructor
int work(int noutput_items, gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items); //!< PVT Signal Processing
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,254 @@
/*!
* \file rtklib_pvt_gs.h
* \brief Interface of a Position Velocity and Time computation block
* \author Javier Arribas, 2017. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_RTKLIB_PVT_GS_H
#define GNSS_SDR_RTKLIB_PVT_GS_H
#include "gnss_synchro.h"
#include "rtklib.h"
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/shared_ptr.hpp> // for boost::shared_ptr
#include <gnuradio/sync_block.h> // for sync_block
#include <gnuradio/types.h> // for gr_vector_const_void_star
#include <pmt/pmt.h> // for pmt_t
#include <chrono> // for system_clock
#include <cstdint> // for int32_t
#include <ctime> // for time_t
#include <map> // for map
#include <memory> // for shared_ptr, unique_ptr
#include <string> // for string
#include <sys/types.h> // for key_t
#include <utility> // for pair
#include <vector> // for vector
class Beidou_Dnav_Almanac;
class Beidou_Dnav_Ephemeris;
class Galileo_Almanac;
class Galileo_Ephemeris;
class GeoJSON_Printer;
class Gps_Almanac;
class Gps_Ephemeris;
class Gpx_Printer;
class Kml_Printer;
class Monitor_Pvt_Udp_Sink;
class Nmea_Printer;
class Pvt_Conf;
class Rinex_Printer;
class Rtcm_Printer;
class Rtklib_Solver;
class rtklib_pvt_gs;
using rtklib_pvt_gs_sptr = boost::shared_ptr<rtklib_pvt_gs>;
rtklib_pvt_gs_sptr rtklib_make_pvt_gs(uint32_t nchannels,
const Pvt_Conf& conf_,
const rtk_t& rtk);
/*!
* \brief This class implements a block that computes the PVT solution using the RTKLIB integrated library
*/
class rtklib_pvt_gs : public gr::sync_block
{
public:
~rtklib_pvt_gs(); //!< Default destructor
/*!
* \brief Get latest set of GPS ephemeris from PVT block
*/
std::map<int, Gps_Ephemeris> get_gps_ephemeris_map() const;
/*!
* \brief Get latest set of GPS almanac from PVT block
*/
std::map<int, Gps_Almanac> get_gps_almanac_map() const;
/*!
* \brief Get latest set of Galileo ephemeris from PVT block
*/
std::map<int, Galileo_Ephemeris> get_galileo_ephemeris_map() const;
/*!
* \brief Get latest set of Galileo almanac from PVT block
*/
std::map<int, Galileo_Almanac> get_galileo_almanac_map() const;
/*!
* \brief Get latest set of BeiDou DNAV ephemeris from PVT block
*/
std::map<int, Beidou_Dnav_Ephemeris> get_beidou_dnav_ephemeris_map() const;
/*!
* \brief Get latest set of BeiDou DNAV almanac from PVT block
*/
std::map<int, Beidou_Dnav_Almanac> get_beidou_dnav_almanac_map() const;
/*!
* \brief Clear all ephemeris information and the almanacs for GPS and Galileo
*/
void clear_ephemeris();
/*!
* \brief Get the latest Position WGS84 [deg], Ground Velocity, Course over Ground, and UTC Time, if available
*/
bool get_latest_PVT(double* longitude_deg,
double* latitude_deg,
double* height_m,
double* ground_speed_kmh,
double* course_over_ground_deg,
time_t* UTC_time) const;
int work(int noutput_items, gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items); //!< PVT Signal Processing
private:
friend rtklib_pvt_gs_sptr rtklib_make_pvt_gs(uint32_t nchannels,
const Pvt_Conf& conf_,
const rtk_t& rtk);
rtklib_pvt_gs(uint32_t nchannels,
const Pvt_Conf& conf_,
const rtk_t& rtk);
void msg_handler_telemetry(const pmt::pmt_t& msg);
enum StringValue
{
evGPS_1C,
evGPS_2S,
evGPS_L5,
evSBAS_1C,
evGAL_1B,
evGAL_5X,
evGLO_1G,
evGLO_2G,
evBDS_B1,
evBDS_B2,
evBDS_B3
};
std::map<std::string, StringValue> mapStringValues_;
void apply_rx_clock_offset(std::map<int, Gnss_Synchro>& observables_map,
double rx_clock_offset_s);
std::map<int, Gnss_Synchro> interpolate_observables(std::map<int, Gnss_Synchro>& observables_map_t0,
std::map<int, Gnss_Synchro>& observables_map_t1,
double rx_time_s);
bool d_dump;
bool d_dump_mat;
bool b_rinex_output_enabled;
bool b_rinex_header_written;
bool b_rinex_header_updated;
double d_rinex_version;
int32_t d_rinexobs_rate_ms;
bool b_rtcm_writing_started;
bool b_rtcm_enabled;
int32_t d_rtcm_MT1045_rate_ms; // Galileo Broadcast Ephemeris
int32_t d_rtcm_MT1019_rate_ms; // GPS Broadcast Ephemeris (orbits)
int32_t d_rtcm_MT1020_rate_ms; // GLONASS Broadcast Ephemeris (orbits)
int32_t d_rtcm_MT1077_rate_ms; // The type 7 Multiple Signal Message format for the USAs GPS system, popular
int32_t d_rtcm_MT1087_rate_ms; // GLONASS MSM7. The type 7 Multiple Signal Message format for the Russian GLONASS system
int32_t d_rtcm_MT1097_rate_ms; // Galileo MSM7. The type 7 Multiple Signal Message format for Europes Galileo system
int32_t d_rtcm_MSM_rate_ms;
int32_t d_kml_rate_ms;
int32_t d_gpx_rate_ms;
int32_t d_geojson_rate_ms;
int32_t d_nmea_rate_ms;
int32_t d_last_status_print_seg; // for status printer
uint32_t d_nchannels;
std::string d_dump_filename;
int32_t d_output_rate_ms;
int32_t d_display_rate_ms;
int32_t d_report_rate_ms;
std::shared_ptr<Rinex_Printer> rp;
std::shared_ptr<Kml_Printer> d_kml_dump;
std::shared_ptr<Gpx_Printer> d_gpx_dump;
std::shared_ptr<Nmea_Printer> d_nmea_printer;
std::shared_ptr<GeoJSON_Printer> d_geojson_printer;
std::shared_ptr<Rtcm_Printer> d_rtcm_printer;
double d_rx_time;
bool d_geojson_output_enabled;
bool d_gpx_output_enabled;
bool d_kml_output_enabled;
bool d_nmea_output_file_enabled;
std::shared_ptr<Rtklib_Solver> d_internal_pvt_solver;
std::shared_ptr<Rtklib_Solver> d_user_pvt_solver;
int32_t max_obs_block_rx_clock_offset_ms;
bool d_waiting_obs_block_rx_clock_offset_correction_msg;
std::map<int, Gnss_Synchro> gnss_observables_map;
std::map<int, Gnss_Synchro> gnss_observables_map_t0;
std::map<int, Gnss_Synchro> gnss_observables_map_t1;
uint32_t type_of_rx;
bool first_fix;
key_t sysv_msg_key;
int sysv_msqid;
typedef struct
{
long mtype; // NOLINT(google-runtime-int) required by SysV queue messaging
double ttff;
} ttff_msgbuf;
bool send_sys_v_ttff_msg(ttff_msgbuf ttff);
std::chrono::time_point<std::chrono::system_clock> start, end;
bool save_gnss_synchro_map_xml(const std::string& file_name); // debug helper function
bool load_gnss_synchro_map_xml(const std::string& file_name); // debug helper function
bool d_xml_storage;
std::string xml_base_path;
inline std::time_t convert_to_time_t(const boost::posix_time::ptime pt) const
{
return (pt - boost::posix_time::ptime(boost::gregorian::date(1970, 1, 1))).total_seconds();
}
bool flag_monitor_pvt_enabled;
std::unique_ptr<Monitor_Pvt_Udp_Sink> udp_sink_ptr;
std::vector<std::string> split_string(const std::string& s, char delim) const;
bool d_show_local_time_zone;
std::string d_local_time_str;
boost::posix_time::time_duration d_utc_diff_time;
};
#endif

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -16,7 +16,7 @@
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
add_definitions(-DGNSS_SDR_VERSION="${VERSION}")
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${CMAKE_SOURCE_DIR}/docs/protobuf/monitor_pvt.proto)
set(PVT_LIB_SOURCES
pvt_solution.cc
@ -27,9 +27,12 @@ set(PVT_LIB_SOURCES
rinex_printer.cc
nmea_printer.cc
rtcm_printer.cc
rtcm.cc
geojson_printer.cc
rtklib_solver.cc
pvt_conf.cc
monitor_pvt_udp_sink.cc
${PROTO_SRCS}
)
set(PVT_LIB_HEADERS
@ -41,53 +44,99 @@ set(PVT_LIB_HEADERS
rinex_printer.h
nmea_printer.h
rtcm_printer.h
rtcm.h
geojson_printer.h
rtklib_solver.h
pvt_conf.h
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/core/system_parameters
${CMAKE_SOURCE_DIR}/src/core/interfaces
${CMAKE_SOURCE_DIR}/src/core/receiver
${CMAKE_SOURCE_DIR}/src/algorithms/PVT/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/libs
${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib
${Boost_INCLUDE_DIRS}
${ARMADILLO_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS}
${MATIO_INCLUDE_DIRS}
monitor_pvt_udp_sink.h
monitor_pvt.h
serdes_monitor_pvt.h
${PROTO_HDRS}
)
list(SORT PVT_LIB_HEADERS)
list(SORT PVT_LIB_SOURCES)
add_library(pvt_lib ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS})
source_group(Headers FILES ${PVT_LIB_HEADERS})
if(MATIO_FOUND)
add_dependencies(pvt_lib
glog-${glog_RELEASE}
armadillo-${armadillo_RELEASE}
)
add_library(pvt_libs ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS})
if(${FILESYSTEM_FOUND})
target_compile_definitions(pvt_libs PRIVATE -DHAS_STD_FILESYSTEM=1)
if(${find_experimental})
target_compile_definitions(pvt_libs PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
endif()
target_link_libraries(pvt_libs PRIVATE std::filesystem)
else()
add_dependencies(pvt_lib
glog-${glog_RELEASE}
armadillo-${armadillo_RELEASE}
matio-${GNSSSDR_MATIO_LOCAL_VERSION}
target_link_libraries(pvt_libs PRIVATE Boost::filesystem Boost::system)
endif()
target_link_libraries(pvt_libs
PUBLIC
Armadillo::armadillo
Boost::date_time
protobuf::libprotobuf
algorithms_libs_rtklib
core_system_parameters
PRIVATE
algorithms_libs
Gflags::gflags
Glog::glog
Matio::matio
)
get_filename_component(PROTO_INCLUDE_HEADERS ${PROTO_HDRS} DIRECTORY)
target_include_directories(pvt_libs
PUBLIC
${CMAKE_SOURCE_DIR}/src/core/receiver
${PROTO_INCLUDE_HEADERS}
)
target_compile_definitions(pvt_libs PRIVATE -DGNSS_SDR_VERSION="${VERSION}")
if(CMAKE_BUILD_TYPE MATCHES Rel)
target_compile_definitions(pvt_libs
PUBLIC -DARMA_NO_BOUND_CHECKING=1
)
endif()
target_link_libraries(pvt_lib
rtklib_lib
gnss_sdr_flags
gnss_sp_libs
${Boost_LIBRARIES}
${GLOG_LIBRARIES}
${ARMADILLO_LIBRARIES}
${BLAS}
${LAPACK}
${MATIO_LIBRARIES}
if(Boost_VERSION_STRING VERSION_GREATER 1.65.99)
target_compile_definitions(pvt_libs
PUBLIC
-DBOOST_GREATER_1_65
)
endif()
# Fix for Boost Asio < 1.70
if(OS_IS_MACOSX)
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (Boost_VERSION_STRING VERSION_LESS 1.70.0))
if(${has_string_view})
target_compile_definitions(pvt_libs
PUBLIC
-DBOOST_ASIO_HAS_STD_STRING_VIEW=1
)
else()
target_compile_definitions(pvt_libs
PUBLIC
-DBOOST_ASIO_HAS_STD_STRING_VIEW=0
)
endif()
endif()
endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(pvt_libs
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
set_property(TARGET pvt_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/algorithms/libs>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/core/system_parameters>
)

View File

@ -6,7 +6,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -31,37 +31,56 @@
#include "geojson_printer.h"
#include "pvt_solution.h"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <glog/logging.h>
#include <ctime> // for tm
#include <exception> // for exception
#include <iomanip> // for operator<<
#include <iostream> // for cout, cerr
#include <sstream> // for stringstream
#if HAS_STD_FILESYSTEM
#include <system_error>
namespace errorlib = std;
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
#else
#include <filesystem>
namespace fs = std::filesystem;
#endif
#else
#include <boost/filesystem/operations.hpp> // for create_directories, exists
#include <boost/filesystem/path.hpp> // for path, operator<<
#include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h>
#include <iomanip>
#include <sstream>
#include <boost/system/error_code.hpp> // for error_code
namespace fs = boost::filesystem;
namespace errorlib = boost::system;
#endif
GeoJSON_Printer::GeoJSON_Printer(const std::string& base_path)
{
first_pos = true;
geojson_base_path = base_path;
boost::filesystem::path full_path(boost::filesystem::current_path());
const boost::filesystem::path p(geojson_base_path);
if (!boost::filesystem::exists(p))
fs::path full_path(fs::current_path());
const fs::path p(geojson_base_path);
if (!fs::exists(p))
{
std::string new_folder;
for (auto& folder : boost::filesystem::path(geojson_base_path))
for (auto& folder : fs::path(geojson_base_path))
{
new_folder += folder.string();
boost::system::error_code ec;
if (!boost::filesystem::exists(new_folder))
errorlib::error_code ec;
if (!fs::exists(new_folder))
{
if (!boost::filesystem::create_directory(new_folder, ec))
if (!fs::create_directory(new_folder, ec))
{
std::cout << "Could not create the " << new_folder << " folder." << std::endl;
geojson_base_path = full_path.string();
}
}
new_folder += boost::filesystem::path::preferred_separator;
new_folder += fs::path::preferred_separator;
}
}
else
@ -73,13 +92,20 @@ GeoJSON_Printer::GeoJSON_Printer(const std::string& base_path)
std::cout << "GeoJSON files will be stored at " << geojson_base_path << std::endl;
}
geojson_base_path = geojson_base_path + boost::filesystem::path::preferred_separator;
geojson_base_path = geojson_base_path + fs::path::preferred_separator;
}
GeoJSON_Printer::~GeoJSON_Printer()
{
GeoJSON_Printer::close_file();
try
{
GeoJSON_Printer::close_file();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
}
@ -213,7 +239,11 @@ bool GeoJSON_Printer::close_file()
// if nothing is written, erase the file
if (first_pos == true)
{
if (remove(filename_.c_str()) != 0) LOG(INFO) << "Error deleting temporary file";
errorlib::error_code ec;
if (!fs::remove(fs::path(filename_), ec))
{
LOG(INFO) << "Error deleting temporary file";
}
}
return true;
}

View File

@ -6,7 +6,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -33,11 +33,12 @@
#ifndef GNSS_SDR_GEOJSON_PRINTER_H_
#define GNSS_SDR_GEOJSON_PRINTER_H_
#include "pvt_solution.h"
#include <fstream>
#include <memory>
#include <string>
class Pvt_Solution;
/*!
* \brief Prints PVT solutions in GeoJSON format file
@ -46,18 +47,18 @@
*/
class GeoJSON_Printer
{
private:
std::ofstream geojson_file;
bool first_pos;
std::string filename_;
std::string geojson_base_path;
public:
GeoJSON_Printer(const std::string& base_path = ".");
~GeoJSON_Printer();
bool set_headers(const std::string& filename, bool time_tag_name = true);
bool print_position(const std::shared_ptr<Pvt_Solution>& position, bool print_average_values);
bool close_file();
private:
std::ofstream geojson_file;
bool first_pos;
std::string filename_;
std::string geojson_base_path;
};
#endif

View File

@ -6,7 +6,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -31,14 +31,33 @@
#include "gpx_printer.h"
#include "rtklib_solver.h"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <glog/logging.h>
#include <ctime> // for tm
#include <exception> // for exception
#include <iomanip> // for operator<<
#include <iostream> // for cout, cerr
#include <sstream> // for stringstream
#if HAS_STD_FILESYSTEM
#include <system_error>
namespace errorlib = std;
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
#else
#include <filesystem>
namespace fs = std::filesystem;
#endif
#else
#include <boost/filesystem/operations.hpp> // for create_directories, exists
#include <boost/filesystem/path.hpp> // for path, operator<<
#include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h>
#include <sstream>
using google::LogMessage;
#include <boost/system/error_code.hpp> // for error_code
namespace fs = boost::filesystem;
namespace errorlib = boost::system;
#endif
Gpx_Printer::Gpx_Printer(const std::string& base_path)
@ -46,24 +65,24 @@ Gpx_Printer::Gpx_Printer(const std::string& base_path)
positions_printed = false;
indent = " ";
gpx_base_path = base_path;
boost::filesystem::path full_path(boost::filesystem::current_path());
const boost::filesystem::path p(gpx_base_path);
if (!boost::filesystem::exists(p))
fs::path full_path(fs::current_path());
const fs::path p(gpx_base_path);
if (!fs::exists(p))
{
std::string new_folder;
for (auto& folder : boost::filesystem::path(gpx_base_path))
for (auto& folder : fs::path(gpx_base_path))
{
new_folder += folder.string();
boost::system::error_code ec;
if (!boost::filesystem::exists(new_folder))
errorlib::error_code ec;
if (!fs::exists(new_folder))
{
if (!boost::filesystem::create_directory(new_folder, ec))
if (!fs::create_directory(new_folder, ec))
{
std::cout << "Could not create the " << new_folder << " folder." << std::endl;
gpx_base_path = full_path.string();
}
}
new_folder += boost::filesystem::path::preferred_separator;
new_folder += fs::path::preferred_separator;
}
}
else
@ -75,7 +94,7 @@ Gpx_Printer::Gpx_Printer(const std::string& base_path)
std::cout << "GPX files will be stored at " << gpx_base_path << std::endl;
}
gpx_base_path = gpx_base_path + boost::filesystem::path::preferred_separator;
gpx_base_path = gpx_base_path + fs::path::preferred_separator;
}
@ -154,14 +173,14 @@ bool Gpx_Printer::set_headers(const std::string& filename, bool time_tag_name)
}
bool Gpx_Printer::print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values)
bool Gpx_Printer::print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values)
{
double latitude;
double longitude;
double height;
positions_printed = true;
const std::shared_ptr<rtklib_solver>& position_ = position;
const std::shared_ptr<Rtklib_Solver>& position_ = position;
double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s
double course_over_ground = position_->get_course_over_ground(); // expressed in deg
@ -170,7 +189,10 @@ bool Gpx_Printer::print_position(const std::shared_ptr<rtklib_solver>& position,
double vdop = position_->get_vdop();
double pdop = position_->get_pdop();
std::string utc_time = to_iso_extended_string(position_->get_position_UTC_time());
if (utc_time.length() < 23) utc_time += ".";
if (utc_time.length() < 23)
{
utc_time += ".";
}
utc_time.resize(23, '0'); // time up to ms
utc_time.append("Z"); // UTC time zone
@ -218,9 +240,20 @@ bool Gpx_Printer::close_file()
Gpx_Printer::~Gpx_Printer()
{
close_file();
try
{
close_file();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
if (!positions_printed)
{
if (remove(gpx_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary GPX file";
errorlib::error_code ec;
if (!fs::remove(fs::path(gpx_filename), ec))
{
LOG(INFO) << "Error deleting temporary GPX file";
}
}
}

View File

@ -6,7 +6,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -33,12 +33,12 @@
#ifndef GNSS_SDR_GPX_PRINTER_H_
#define GNSS_SDR_GPX_PRINTER_H_
#include "pvt_solution.h"
#include "rtklib_solver.h"
#include <fstream>
#include <memory>
#include <string>
class Rtklib_Solver;
/*!
* \brief Prints PVT information to GPX format file
@ -47,19 +47,19 @@
*/
class Gpx_Printer
{
public:
Gpx_Printer(const std::string& base_path = ".");
~Gpx_Printer();
bool set_headers(const std::string& filename, bool time_tag_name = true);
bool print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values);
bool close_file();
private:
std::ofstream gpx_file;
bool positions_printed;
std::string gpx_filename;
std::string indent;
std::string gpx_base_path;
public:
Gpx_Printer(const std::string& base_path = ".");
~Gpx_Printer();
bool set_headers(const std::string& filename, bool time_tag_name = true);
bool print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values);
bool close_file();
};
#endif

View File

@ -1,12 +1,12 @@
/*!
* \file galileo_e1_ls_pvt.cc
* \file hybrid_ls_pvt.cc
* \brief Implementation of a Least Squares Position, Velocity, and Time
* (PVT) solver, based on K.Borre's Matlab receiver.
* \author Javier Arribas, 2011. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -38,16 +38,13 @@
#include <utility>
using google::LogMessage;
hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file) : Ls_Pvt()
Hybrid_Ls_Pvt::Hybrid_Ls_Pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file) : Ls_Pvt()
{
// init empty ephemeris for all the available GNSS channels
d_nchannels = nchannels;
d_dump_filename = std::move(dump_filename);
d_flag_dump_enabled = flag_dump_to_file;
d_galileo_current_time = 0;
count_valid_position = 0;
this->set_averaging_flag(false);
// ############# ENABLE DATA FILE LOG #################
if (d_flag_dump_enabled == true)
@ -69,7 +66,7 @@ hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag
}
hybrid_ls_pvt::~hybrid_ls_pvt()
Hybrid_Ls_Pvt::~Hybrid_Ls_Pvt()
{
if (d_dump_file.is_open() == true)
{
@ -85,7 +82,7 @@ hybrid_ls_pvt::~hybrid_ls_pvt()
}
bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, double hybrid_current_time, bool flag_averaging)
bool Hybrid_Ls_Pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, double hybrid_current_time, bool flag_averaging)
{
std::map<int, Gnss_Synchro>::iterator gnss_observables_iter;
std::map<int, Galileo_Ephemeris>::iterator galileo_ephemeris_iter;
@ -133,7 +130,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// COMMON RX TIME PVT ALGORITHM
double Rx_time = hybrid_current_time;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GALILEO_C_m_s;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GALILEO_C_M_S;
// 2- compute the clock drift using the clock model (broadcast) for this SV
SV_clock_bias_s = galileo_ephemeris_iter->second.sv_clock_drift(Tx_time);
@ -150,7 +147,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// 4- fill the observations vector with the corrected observables
obs.resize(valid_obs + 1, 1);
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_m_s - this->get_time_offset_s() * GALILEO_C_m_s;
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_M_S - this->get_time_offset_s() * GALILEO_C_M_S;
Galileo_week_number = galileo_ephemeris_iter->second.WN_5; //for GST
GST = galileo_ephemeris_iter->second.Galileo_System_Time(Galileo_week_number, hybrid_current_time);
@ -188,7 +185,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files)
// first estimate of transmit time
double Rx_time = hybrid_current_time;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_m_s;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_M_S;
// 2- compute the clock drift using the clock model (broadcast) for this SV, not including relativistic effect
SV_clock_bias_s = gps_ephemeris_iter->second.sv_clock_drift(Tx_time); //- gps_ephemeris_iter->second.d_TGD;
@ -208,10 +205,10 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// See IS-GPS-200E section 20.3.3.3.3.2
double sqrt_Gamma = GPS_L1_FREQ_HZ / GPS_L2_FREQ_HZ;
double Gamma = sqrt_Gamma * sqrt_Gamma;
double P1_P2 = (1.0 - Gamma) * (gps_ephemeris_iter->second.d_TGD * GPS_C_m_s);
double P1_P2 = (1.0 - Gamma) * (gps_ephemeris_iter->second.d_TGD * GPS_C_M_S);
double Code_bias_m = P1_P2 / (1.0 - Gamma);
obs.resize(valid_obs + 1, 1);
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s - Code_bias_m - this->get_time_offset_s() * GPS_C_m_s;
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_M_S - Code_bias_m - this->get_time_offset_s() * GPS_C_M_S;
// SV ECEF DEBUG OUTPUT
LOG(INFO) << "(new)ECEF GPS L1 CA satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN
@ -243,7 +240,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files)
// first estimate of transmit time
double Rx_time = hybrid_current_time;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_m_s;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_M_S;
// 2- compute the clock drift using the clock model (broadcast) for this SV
SV_clock_bias_s = gps_cnav_ephemeris_iter->second.sv_clock_drift(Tx_time);
@ -261,7 +258,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// 4- fill the observations vector with the corrected observables
obs.resize(valid_obs + 1, 1);
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s + SV_clock_bias_s * GPS_C_m_s;
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_M_S + SV_clock_bias_s * GPS_C_M_S;
GPS_week = gps_cnav_ephemeris_iter->second.i_GPS_week;
GPS_week = GPS_week % 1024; //Necessary due to the increase of WN bits in CNAV message (10 in GPS NAV and 13 in CNAV)
@ -311,17 +308,17 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
DLOG(INFO) << " Executing Bancroft algorithm...";
rx_position_and_time = bancroftPos(satpos.t(), obs);
this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration
this->set_time_offset_s(rx_position_and_time(3) / GPS_C_m_s); // save time for the next iteration [meters]->[seconds]
this->set_time_offset_s(rx_position_and_time(3) / GPS_C_M_S); // save time for the next iteration [meters]->[seconds]
}
// Execute WLS using previous position as the initialization point
rx_position_and_time = leastSquarePos(satpos, obs, W);
this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration
this->set_time_offset_s(this->get_time_offset_s() + rx_position_and_time(3) / GPS_C_m_s); // accumulate the rx time error for the next iteration [meters]->[seconds]
this->set_time_offset_s(this->get_time_offset_s() + rx_position_and_time(3) / GPS_C_M_S); // accumulate the rx time error for the next iteration [meters]->[seconds]
DLOG(INFO) << "Hybrid Position at TOW=" << hybrid_current_time << " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time;
DLOG(INFO) << "Accumulated rx clock error=" << this->get_time_offset_s() << " clock error for this iteration=" << rx_position_and_time(3) / GPS_C_m_s << " [s]";
DLOG(INFO) << "Accumulated rx clock error=" << this->get_time_offset_s() << " clock error for this iteration=" << rx_position_and_time(3) / GPS_C_M_S << " [s]";
// Compute GST and Gregorian time
if (GST != 0.0)

View File

@ -1,12 +1,12 @@
/*!
* \file galileo_e1_ls_pvt.h
* \file hybrid_ls_pvt.h
* \brief Interface of a Least Squares Position, Velocity, and Time (PVT)
* solver, based on K.Borre's Matlab receiver.
* \author Javier Arribas, 2011. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -46,21 +46,13 @@
/*!
* \brief This class implements a simple PVT Least Squares solution
*/
class hybrid_ls_pvt : public Ls_Pvt
class Hybrid_Ls_Pvt : public Ls_Pvt
{
private:
int count_valid_position;
bool d_flag_dump_enabled;
std::string d_dump_filename;
std::ofstream d_dump_file;
int d_nchannels; // Number of available channels for positioning
double d_galileo_current_time;
public:
hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file);
~hybrid_ls_pvt();
Hybrid_Ls_Pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file);
~Hybrid_Ls_Pvt();
bool get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, double Rx_time, bool flag_averaging);
bool get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, double hybrid_current_time, bool flag_averaging);
std::map<int, Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris
std::map<int, Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris
@ -75,6 +67,13 @@ public:
Gps_CNAV_Iono gps_cnav_iono;
Gps_CNAV_Utc_Model gps_cnav_utc_model;
private:
bool d_flag_dump_enabled;
std::string d_dump_filename;
std::ofstream d_dump_file;
int d_nchannels; // Number of available channels for positioning
double d_galileo_current_time;
};
#endif

View File

@ -7,7 +7,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -31,14 +31,36 @@
*/
#include "kml_printer.h"
#include "rtklib_solver.h"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <glog/logging.h>
#include <cstdlib> // for mkstemp
#include <ctime> // for tm
#include <exception> // for exception
#include <iostream> // for cout, cerr
#include <sstream>
#include <string>
#include <sys/stat.h> // for S_IXUSR | S_IRWXG | S_IRWXO
#include <sys/types.h> // for mode_t
#if HAS_STD_FILESYSTEM
#include <system_error>
namespace errorlib = std;
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
#else
#include <filesystem>
namespace fs = std::filesystem;
#endif
#else
#include <boost/filesystem/operations.hpp> // for create_directories, exists
#include <boost/filesystem/path.hpp> // for path, operator<<
#include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h>
#include <sstream>
using google::LogMessage;
#include <boost/system/error_code.hpp> // for error_code
namespace fs = boost::filesystem;
namespace errorlib = boost::system;
#endif
Kml_Printer::Kml_Printer(const std::string& base_path)
@ -46,24 +68,24 @@ Kml_Printer::Kml_Printer(const std::string& base_path)
positions_printed = false;
indent = " ";
kml_base_path = base_path;
boost::filesystem::path full_path(boost::filesystem::current_path());
const boost::filesystem::path p(kml_base_path);
if (!boost::filesystem::exists(p))
fs::path full_path(fs::current_path());
const fs::path p(kml_base_path);
if (!fs::exists(p))
{
std::string new_folder;
for (auto& folder : boost::filesystem::path(kml_base_path))
for (auto& folder : fs::path(kml_base_path))
{
new_folder += folder.string();
boost::system::error_code ec;
if (!boost::filesystem::exists(new_folder))
errorlib::error_code ec;
if (!fs::exists(new_folder))
{
if (!boost::filesystem::create_directory(new_folder, ec))
if (!fs::create_directory(new_folder, ec))
{
std::cout << "Could not create the " << new_folder << " folder." << std::endl;
kml_base_path = full_path.string();
}
}
new_folder += boost::filesystem::path::preferred_separator;
new_folder += fs::path::preferred_separator;
}
}
else
@ -75,13 +97,23 @@ Kml_Printer::Kml_Printer(const std::string& base_path)
std::cout << "KML files will be stored at " << kml_base_path << std::endl;
}
kml_base_path = kml_base_path + boost::filesystem::path::preferred_separator;
kml_base_path = kml_base_path + fs::path::preferred_separator;
boost::filesystem::path tmp_base_path = boost::filesystem::temp_directory_path();
boost::filesystem::path tmp_filename = boost::filesystem::unique_path();
boost::filesystem::path tmp_file = tmp_base_path / tmp_filename;
char tmp_filename_[] = "/tmp/file.XXXXXX";
mode_t mask = umask(S_IXUSR | S_IRWXG | S_IRWXO);
int fd = mkstemp(tmp_filename_);
if (fd == -1)
{
std::cerr << "Error in KML printer: failed to create temporary file" << std::endl;
}
else
{
close(fd);
}
umask(mask);
fs::path tmp_filename = fs::path(tmp_filename_);
tmp_file_str = tmp_file.string();
tmp_file_str = tmp_filename.string();
point_id = 0;
}
@ -211,7 +243,7 @@ bool Kml_Printer::set_headers(const std::string& filename, bool time_tag_name)
}
bool Kml_Printer::print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values)
bool Kml_Printer::print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values)
{
double latitude;
double longitude;
@ -219,7 +251,7 @@ bool Kml_Printer::print_position(const std::shared_ptr<rtklib_solver>& position,
positions_printed = true;
const std::shared_ptr<rtklib_solver>& position_ = position;
const std::shared_ptr<Rtklib_Solver>& position_ = position;
double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s
double course_over_ground = position_->get_course_over_ground(); // expressed in deg
@ -228,7 +260,10 @@ bool Kml_Printer::print_position(const std::shared_ptr<rtklib_solver>& position,
double vdop = position_->get_vdop();
double pdop = position_->get_pdop();
std::string utc_time = to_iso_extended_string(position_->get_position_UTC_time());
if (utc_time.length() < 23) utc_time += ".";
if (utc_time.length() < 23)
{
utc_time += ".";
}
utc_time.resize(23, '0'); // time up to ms
utc_time.append("Z"); // UTC time zone
@ -319,9 +354,20 @@ bool Kml_Printer::close_file()
Kml_Printer::~Kml_Printer()
{
close_file();
try
{
close_file();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
if (!positions_printed)
{
if (remove(kml_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary KML file";
errorlib::error_code ec;
if (!fs::remove(fs::path(kml_filename), ec))
{
LOG(INFO) << "Error deleting temporary KML file";
}
}
}

View File

@ -6,7 +6,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -33,13 +33,12 @@
#ifndef GNSS_SDR_KML_PRINTER_H_
#define GNSS_SDR_KML_PRINTER_H_
#include "pvt_solution.h"
#include "rtklib_solver.h"
#include <fstream>
#include <memory>
#include <string>
#include <fstream> // for ofstream
#include <memory> // for shared_ptr
class Rtklib_Solver;
/*!
* \brief Prints PVT information to OGC KML format file (can be viewed with Google Earth)
*
@ -47,6 +46,13 @@
*/
class Kml_Printer
{
public:
Kml_Printer(const std::string& base_path = std::string("."));
~Kml_Printer();
bool set_headers(const std::string& filename, bool time_tag_name = true);
bool print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values);
bool close_file();
private:
std::ofstream kml_file;
std::ofstream tmp_file;
@ -56,13 +62,6 @@ private:
std::string tmp_file_str;
unsigned int point_id;
std::string indent;
public:
Kml_Printer(const std::string& base_path = std::string("."));
~Kml_Printer();
bool set_headers(const std::string& filename, bool time_tag_name = true);
bool print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values);
bool close_file();
};
#endif

View File

@ -6,7 +6,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -33,13 +33,9 @@
#include "GPS_L1_CA.h"
#include "geofunctions.h"
#include <glog/logging.h>
#include <exception>
#include <stdexcept>
using google::LogMessage;
Ls_Pvt::Ls_Pvt() : Pvt_Solution()
{
}
@ -95,7 +91,7 @@ arma::vec Ls_Pvt::bancroftPos(const arma::mat& satpos, const arma::vec& obs)
{
int z = B(i, 2);
double rho = (x - pos(0)) * (x - pos(0)) + (y - pos(1)) * (y - pos(1)) + (z - pos(2)) * (z - pos(2));
traveltime = sqrt(rho) / GPS_C_m_s;
traveltime = sqrt(rho) / GPS_C_M_S;
}
double angle = traveltime * 7.292115147e-5;
double cosa = cos(angle);
@ -228,7 +224,7 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs,
(X(1, i) - pos(1)) +
(X(2, i) - pos(2)) *
(X(2, i) - pos(2));
traveltime = sqrt(rho2) / GPS_C_m_s;
traveltime = sqrt(rho2) / GPS_C_M_S;
//--- Correct satellite position (do to earth rotation) --------
Rot_X = Ls_Pvt::rotateSatellite(traveltime, X.col(i)); //armadillo
@ -253,7 +249,10 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs,
{
//--- Find delay due to troposphere (in meters)
Ls_Pvt::tropo(&trop, sin(*elev * GPS_PI / 180.0), h / 1000.0, 1013.0, 293.0, 50.0, 0.0, 0.0, 0.0);
if (trop > 5.0) trop = 0.0; //check for erratic values
if (trop > 5.0)
{
trop = 0.0; //check for erratic values
}
}
}
}
@ -280,9 +279,9 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs,
}
// check the consistency of the PVT solution
if (((fabs(pos(3)) * 1000.0) / GPS_C_m_s) > GPS_STARTOFFSET_ms * 2)
if (((fabs(pos(3)) * 1000.0) / GPS_C_M_S) > GPS_STARTOFFSET_MS * 2)
{
LOG(WARNING) << "Receiver time offset out of range! Estimated RX Time error [s]:" << pos(3) / GPS_C_m_s;
LOG(WARNING) << "Receiver time offset out of range! Estimated RX Time error [s]:" << pos(3) / GPS_C_M_S;
throw std::runtime_error("Receiver time offset out of range!");
}
return pos;

View File

@ -6,7 +6,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -41,12 +41,6 @@
*/
class Ls_Pvt : public Pvt_Solution
{
private:
/*!
* \brief Computes the Lorentz inner product between two vectors
*/
double lorentz(const arma::vec& x, const arma::vec& y);
public:
Ls_Pvt();
@ -59,6 +53,12 @@ public:
* \brief Computes the Weighted Least Squares position solution
*/
arma::vec leastSquarePos(const arma::mat& satpos, const arma::vec& obs, const arma::vec& w_vec);
private:
/*!
* \brief Computes the Lorentz inner product between two vectors
*/
double lorentz(const arma::vec& x, const arma::vec& y);
};
#endif

View File

@ -0,0 +1,140 @@
/*!
* \file monitor_pvt.h
* \brief Interface of the Monitor_Pvt class
* \author
* Álvaro Cebrián Juan, 2019. acebrianjuan(at)gmail.com
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_MONITOR_PVT_H_
#define GNSS_SDR_MONITOR_PVT_H_
#include <boost/serialization/nvp.hpp>
#include <cstdint>
/*!
* \brief This class contains parameters and outputs of the PVT block
*/
class Monitor_Pvt
{
public:
// TOW
uint32_t TOW_at_current_symbol_ms;
// WEEK
uint32_t week;
// PVT GPS time
double RX_time;
// User clock offset [s]
double user_clk_offset;
// ECEF POS X,Y,X [m] + ECEF VEL X,Y,X [m/s] (6 x double)
double pos_x;
double pos_y;
double pos_z;
double vel_x;
double vel_y;
double vel_z;
// position variance/covariance (m^2) {c_xx,c_yy,c_zz,c_xy,c_yz,c_zx} (6 x double)
double cov_xx;
double cov_yy;
double cov_zz;
double cov_xy;
double cov_yz;
double cov_zx;
// GEO user position Latitude [deg]
double latitude;
// GEO user position Longitude [deg]
double longitude;
// GEO user position Height [m]
double height;
// NUMBER OF VALID SATS
uint8_t valid_sats;
// RTKLIB solution status
uint8_t solution_status;
// RTKLIB solution type (0:xyz-ecef,1:enu-baseline)
uint8_t solution_type;
// AR ratio factor for validation
float AR_ratio_factor;
// AR ratio threshold for validation
float AR_ratio_threshold;
// GDOP / PDOP/ HDOP/ VDOP
double gdop;
double pdop;
double hdop;
double vdop;
/*!
* \brief This member function serializes and restores
* Monitor_Pvt objects from a byte stream.
*/
template <class Archive>
void serialize(Archive& ar, const unsigned int version)
{
if (version)
{
};
ar& BOOST_SERIALIZATION_NVP(TOW_at_current_symbol_ms);
ar& BOOST_SERIALIZATION_NVP(week);
ar& BOOST_SERIALIZATION_NVP(RX_time);
ar& BOOST_SERIALIZATION_NVP(user_clk_offset);
ar& BOOST_SERIALIZATION_NVP(pos_x);
ar& BOOST_SERIALIZATION_NVP(pos_y);
ar& BOOST_SERIALIZATION_NVP(pos_z);
ar& BOOST_SERIALIZATION_NVP(vel_x);
ar& BOOST_SERIALIZATION_NVP(vel_y);
ar& BOOST_SERIALIZATION_NVP(vel_z);
ar& BOOST_SERIALIZATION_NVP(cov_xx);
ar& BOOST_SERIALIZATION_NVP(cov_yy);
ar& BOOST_SERIALIZATION_NVP(cov_zz);
ar& BOOST_SERIALIZATION_NVP(cov_xy);
ar& BOOST_SERIALIZATION_NVP(cov_yz);
ar& BOOST_SERIALIZATION_NVP(cov_zx);
ar& BOOST_SERIALIZATION_NVP(latitude);
ar& BOOST_SERIALIZATION_NVP(longitude);
ar& BOOST_SERIALIZATION_NVP(height);
ar& BOOST_SERIALIZATION_NVP(valid_sats);
ar& BOOST_SERIALIZATION_NVP(solution_status);
ar& BOOST_SERIALIZATION_NVP(solution_type);
ar& BOOST_SERIALIZATION_NVP(AR_ratio_factor);
ar& BOOST_SERIALIZATION_NVP(AR_ratio_threshold);
ar& BOOST_SERIALIZATION_NVP(gdop);
ar& BOOST_SERIALIZATION_NVP(pdop);
ar& BOOST_SERIALIZATION_NVP(hdop);
ar& BOOST_SERIALIZATION_NVP(vdop);
}
};
#endif /* GNSS_SDR_MONITOR_PVT_H_ */

View File

@ -0,0 +1,84 @@
/*!
* \file monitor_pvt_udp_sink.cc
* \brief Implementation of a class that sends serialized Monitor_Pvt
* objects over udp to one or multiple endpoints
* \author Álvaro Cebrián Juan, 2019. acebrianjuan(at)gmail.com
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#include "monitor_pvt_udp_sink.h"
#include <boost/archive/binary_oarchive.hpp>
#include <iostream>
#include <sstream>
Monitor_Pvt_Udp_Sink::Monitor_Pvt_Udp_Sink(const std::vector<std::string>& addresses, const uint16_t& port, bool protobuf_enabled) : socket{io_context}
{
for (const auto& address : addresses)
{
boost::asio::ip::udp::endpoint endpoint(boost::asio::ip::address::from_string(address, error), port);
endpoints.push_back(endpoint);
}
use_protobuf = protobuf_enabled;
if (use_protobuf)
{
serdes = Serdes_Monitor_Pvt();
}
}
bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(const std::shared_ptr<Monitor_Pvt>& monitor_pvt)
{
std::string outbound_data;
if (use_protobuf == false)
{
std::ostringstream archive_stream;
boost::archive::binary_oarchive oa{archive_stream};
oa << *monitor_pvt.get();
outbound_data = archive_stream.str();
}
else
{
outbound_data = serdes.createProtobuffer(monitor_pvt);
}
for (const auto& endpoint : endpoints)
{
socket.open(endpoint.protocol(), error);
socket.connect(endpoint, error);
try
{
socket.send(boost::asio::buffer(outbound_data));
}
catch (boost::system::system_error const& e)
{
return false;
}
}
return true;
}

View File

@ -0,0 +1,61 @@
/*!
* \file monitor_pvt_udp_sink.h
* \brief Interface of a class that sends serialized Monitor_Pvt objects
* over udp to one or multiple endpoints
* \author Álvaro Cebrián Juan, 2019. acebrianjuan(at)gmail.com
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_MONITOR_PVT_UDP_SINK_H_
#define GNSS_SDR_MONITOR_PVT_UDP_SINK_H_
#include "monitor_pvt.h"
#include "serdes_monitor_pvt.h"
#include <boost/asio.hpp>
#if BOOST_GREATER_1_65
using b_io_context = boost::asio::io_context;
#else
using b_io_context = boost::asio::io_service;
#endif
class Monitor_Pvt_Udp_Sink
{
public:
Monitor_Pvt_Udp_Sink(const std::vector<std::string>& addresses, const uint16_t& port, bool protobuf_enabled);
bool write_monitor_pvt(const std::shared_ptr<Monitor_Pvt>& monitor_pvt);
private:
b_io_context io_context;
boost::asio::ip::udp::socket socket;
boost::system::error_code error;
std::vector<boost::asio::ip::udp::endpoint> endpoints;
Serdes_Monitor_Pvt serdes;
bool use_protobuf;
};
#endif /* GNSS_SDR_MONITOR_PVT_UDP_SINK_H_ */

View File

@ -10,7 +10,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -35,17 +35,33 @@
#include "nmea_printer.h"
#include "rtklib_solution.h"
#include <boost/date_time/posix_time/posix_time.hpp>
#include "rtklib_solver.h"
#include <glog/logging.h>
#include <array>
#include <cstdint>
#include <exception>
#include <fcntl.h>
#include <iostream> // for cout, cerr
#include <termios.h>
#if HAS_STD_FILESYSTEM
#include <system_error>
namespace errorlib = std;
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
#else
#include <filesystem>
namespace fs = std::filesystem;
#endif
#else
#include <boost/filesystem/operations.hpp> // for create_directories, exists
#include <boost/filesystem/path.hpp> // for path, operator<<
#include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h>
#include <cstdint>
#include <fcntl.h>
#include <termios.h>
using google::LogMessage;
#include <boost/system/error_code.hpp> // for error_code
namespace fs = boost::filesystem;
namespace errorlib = boost::system;
#endif
Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_file, bool flag_nmea_tty_port, std::string nmea_dump_devname, const std::string& base_path)
@ -54,24 +70,24 @@ Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_fi
d_flag_nmea_output_file = flag_nmea_output_file;
if (d_flag_nmea_output_file == true)
{
boost::filesystem::path full_path(boost::filesystem::current_path());
const boost::filesystem::path p(nmea_base_path);
if (!boost::filesystem::exists(p))
fs::path full_path(fs::current_path());
const fs::path p(nmea_base_path);
if (!fs::exists(p))
{
std::string new_folder;
for (auto& folder : boost::filesystem::path(nmea_base_path))
for (auto& folder : fs::path(nmea_base_path))
{
new_folder += folder.string();
boost::system::error_code ec;
if (!boost::filesystem::exists(new_folder))
errorlib::error_code ec;
if (!fs::exists(new_folder))
{
if (!boost::filesystem::create_directory(new_folder, ec))
if (!fs::create_directory(new_folder, ec))
{
std::cout << "Could not create the " << new_folder << " folder." << std::endl;
nmea_base_path = full_path.string();
}
}
new_folder += boost::filesystem::path::preferred_separator;
new_folder += fs::path::preferred_separator;
}
}
else
@ -84,7 +100,7 @@ Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_fi
std::cout << "NMEA files will be stored at " << nmea_base_path << std::endl;
}
nmea_base_path = nmea_base_path + boost::filesystem::path::preferred_separator;
nmea_base_path = nmea_base_path + fs::path::preferred_separator;
nmea_filename = nmea_base_path + filename;
@ -118,11 +134,38 @@ Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_fi
Nmea_Printer::~Nmea_Printer()
{
if (nmea_file_descriptor.is_open())
auto pos = nmea_file_descriptor.tellp();
try
{
nmea_file_descriptor.close();
if (nmea_file_descriptor.is_open())
{
nmea_file_descriptor.close();
}
}
catch (const std::ofstream::failure& e)
{
std::cerr << "Problem closing NMEA dump file: " << nmea_filename << '\n';
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
if (pos == 0)
{
errorlib::error_code ec;
if (!fs::remove(fs::path(nmea_filename), ec))
{
std::cerr << "Problem removing NMEA temporary file: " << nmea_filename << '\n';
}
}
try
{
close_serial();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
close_serial();
}
@ -132,9 +175,9 @@ int Nmea_Printer::init_serial(const std::string& serial_device)
* Opens the serial device and sets the default baud rate for a NMEA transmission (9600,8,N,1)
*/
int fd = 0;
struct termios options
{
};
// clang-format off
struct termios options{};
// clang-format on
int64_t BAUD;
int64_t DATABITS;
int64_t STOPBITS;
@ -142,10 +185,16 @@ int Nmea_Printer::init_serial(const std::string& serial_device)
int64_t PARITY;
fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY | O_CLOEXEC);
if (fd == -1) return fd; // failed to open TTY port
if (fd == -1)
{
return fd; // failed to open TTY port
}
if (fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O
tcgetattr(fd, &options); // read serial port options
if (fcntl(fd, F_SETFL, 0) == -1)
{
LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O
}
tcgetattr(fd, &options); // read serial port options
BAUD = B9600;
// BAUD = B38400;
@ -174,7 +223,7 @@ void Nmea_Printer::close_serial()
}
bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr<rtklib_solver>& pvt_data, bool print_average_values)
bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr<Rtklib_Solver>& pvt_data, bool print_average_values)
{
std::string GPRMC;
std::string GPGGA;
@ -244,7 +293,7 @@ bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr<rtklib_solver>& pvt_dat
}
char Nmea_Printer::checkSum(std::string sentence)
char Nmea_Printer::checkSum(const std::string& sentence)
{
char check = 0;
// iterate over the string, XOR each byte with the total sum:
@ -348,13 +397,22 @@ std::string Nmea_Printer::get_UTC_NMEA_time(boost::posix_time::ptime d_position_
utc_seconds = td.seconds();
utc_milliseconds = td.total_milliseconds() - td.total_seconds() * 1000;
if (utc_hours < 10) sentence_str << "0"; // two digits for hours
if (utc_hours < 10)
{
sentence_str << "0"; // two digits for hours
}
sentence_str << utc_hours;
if (utc_mins < 10) sentence_str << "0"; // two digits for minutes
if (utc_mins < 10)
{
sentence_str << "0"; // two digits for minutes
}
sentence_str << utc_mins;
if (utc_seconds < 10) sentence_str << "0"; // two digits for seconds
if (utc_seconds < 10)
{
sentence_str << "0"; // two digits for seconds
}
sentence_str << utc_seconds;
if (utc_milliseconds < 10)
@ -380,9 +438,9 @@ std::string Nmea_Printer::get_GPRMC()
{
// Sample -> $GPRMC,161229.487,A,3723.2475,N,12158.3416,W,0.13,309.62,120598,*10
std::stringstream sentence_str;
unsigned char buff[1024] = {0};
outnmea_rmc(buff, &d_PVT_data->pvt_sol);
sentence_str << buff;
std::array<unsigned char, 1024> buff{};
outnmea_rmc(buff.data(), &d_PVT_data->pvt_sol);
sentence_str << buff.data();
return sentence_str.str();
}
@ -392,9 +450,9 @@ std::string Nmea_Printer::get_GPGSA()
// $GPGSA,A,3,07,02,26,27,09,04,15, , , , , ,1.8,1.0,1.5*33
// GSA-GNSS DOP and Active Satellites
std::stringstream sentence_str;
unsigned char buff[1024] = {0};
outnmea_gsa(buff, &d_PVT_data->pvt_sol, d_PVT_data->pvt_ssat);
sentence_str << buff;
std::array<unsigned char, 1024> buff{};
outnmea_gsa(buff.data(), &d_PVT_data->pvt_sol, d_PVT_data->pvt_ssat.data());
sentence_str << buff.data();
return sentence_str.str();
}
@ -405,9 +463,9 @@ std::string Nmea_Printer::get_GPGSV()
// $GPGSV,2,1,07,07,79,048,42,02,51,062,43,26,36,256,42,27,27,138,42*71
// Notice that NMEA 2.1 only supports 12 channels
std::stringstream sentence_str;
unsigned char buff[1024] = {0};
outnmea_gsv(buff, &d_PVT_data->pvt_sol, d_PVT_data->pvt_ssat);
sentence_str << buff;
std::array<unsigned char, 1024> buff{};
outnmea_gsv(buff.data(), &d_PVT_data->pvt_sol, d_PVT_data->pvt_ssat.data());
sentence_str << buff.data();
return sentence_str.str();
}
@ -415,9 +473,9 @@ std::string Nmea_Printer::get_GPGSV()
std::string Nmea_Printer::get_GPGGA()
{
std::stringstream sentence_str;
unsigned char buff[1024] = {0};
outnmea_gga(buff, &d_PVT_data->pvt_sol);
sentence_str << buff;
std::array<unsigned char, 1024> buff{};
outnmea_gga(buff.data(), &d_PVT_data->pvt_sol);
sentence_str << buff.data();
return sentence_str.str();
// $GPGGA,104427.591,5920.7009,N,01803.2938,E,1,05,3.3,78.2,M,23.2,M,0.0,0000*4A
}

View File

@ -10,7 +10,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -36,10 +36,12 @@
#ifndef GNSS_SDR_NMEA_PRINTER_H_
#define GNSS_SDR_NMEA_PRINTER_H_
#include "rtklib_solver.h"
#include <fstream>
#include <string>
#include <boost/date_time/posix_time/ptime.hpp> // for ptime
#include <fstream> // for ofstream
#include <memory> // for shared_ptr
#include <string> // for string
class Rtklib_Solver;
/*!
* \brief This class provides a implementation of a subset of the NMEA-0183 standard for interfacing
@ -58,7 +60,7 @@ public:
/*!
* \brief Print NMEA PVT and satellite info to the initialized device
*/
bool Print_Nmea_Line(const std::shared_ptr<rtklib_solver>& pvt_data, bool print_average_values);
bool Print_Nmea_Line(const std::shared_ptr<Rtklib_Solver>& pvt_data, bool print_average_values);
/*!
* \brief Default destructor.
@ -71,7 +73,7 @@ private:
std::ofstream nmea_file_descriptor; // Output file stream for NMEA log file
std::string nmea_devname;
int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port)
std::shared_ptr<rtklib_solver> d_PVT_data;
std::shared_ptr<Rtklib_Solver> d_PVT_data;
int init_serial(const std::string& serial_device); //serial port control
void close_serial();
std::string get_GPGGA(); // fix data
@ -81,7 +83,7 @@ private:
std::string get_UTC_NMEA_time(boost::posix_time::ptime d_position_UTC_time);
std::string longitude_to_hm(double longitude);
std::string latitude_to_hm(double lat);
char checkSum(std::string sentence);
char checkSum(const std::string& sentence);
bool print_avg_pos;
bool d_flag_nmea_output_file;
};

View File

@ -5,7 +5,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -35,10 +35,14 @@ Pvt_Conf::Pvt_Conf()
type_of_receiver = 0U;
output_rate_ms = 0;
display_rate_ms = 0;
kml_rate_ms = 1000;
gpx_rate_ms = 1000;
geojson_rate_ms = 1000;
nmea_rate_ms = 1000;
max_obs_block_rx_clock_offset_ms = 40;
rinex_version = 0;
rinexobs_rate_ms = 0;
rinexnav_rate_ms = 0;
dump = false;
dump_mat = true;
@ -67,4 +71,10 @@ Pvt_Conf::Pvt_Conf()
kml_output_path = std::string(".");
xml_output_path = std::string(".");
rtcm_output_file_path = std::string(".");
monitor_enabled = false;
protobuf_enabled = true;
udp_port = 0;
show_local_time_zone = false;
}

View File

@ -5,7 +5,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -31,7 +31,6 @@
#ifndef GNSS_SDR_PVT_CONF_H_
#define GNSS_SDR_PVT_CONF_H_
#include <cstddef>
#include <cstdint>
#include <map>
#include <string>
@ -42,10 +41,13 @@ public:
uint32_t type_of_receiver;
int32_t output_rate_ms;
int32_t display_rate_ms;
int32_t kml_rate_ms;
int32_t gpx_rate_ms;
int32_t geojson_rate_ms;
int32_t nmea_rate_ms;
int32_t rinex_version;
int32_t rinexobs_rate_ms;
int32_t rinexnav_rate_ms;
std::map<int, int> rtcm_msg_rate_ms;
bool dump;
@ -71,6 +73,8 @@ public:
bool xml_output_enabled;
bool rtcm_output_file_enabled;
int32_t max_obs_block_rx_clock_offset_ms;
std::string output_path;
std::string rinex_output_path;
std::string gpx_output_path;
@ -80,6 +84,13 @@ public:
std::string xml_output_path;
std::string rtcm_output_file_path;
bool monitor_enabled;
bool protobuf_enabled;
std::string udp_addresses;
int udp_port;
bool show_local_time_zone;
Pvt_Conf();
};

View File

@ -6,7 +6,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -33,10 +33,7 @@
#include "GPS_L1_CA.h"
#include "geofunctions.h"
#include <glog/logging.h>
#include <exception>
using google::LogMessage;
#include <array>
Pvt_Solution::Pvt_Solution()
@ -57,6 +54,7 @@ Pvt_Solution::Pvt_Solution()
d_rx_dt_s = 0.0;
}
arma::vec Pvt_Solution::rotateSatellite(double const traveltime, const arma::vec &X_sat)
{
/*
@ -100,8 +98,8 @@ int Pvt_Solution::cart2geo(double X, double Y, double Z, int elipsoid_selection)
4. World Geodetic System 1984
*/
const double a[5] = {6378388.0, 6378160.0, 6378135.0, 6378137.0, 6378137.0};
const double f[5] = {1.0 / 297.0, 1.0 / 298.247, 1.0 / 298.26, 1.0 / 298.257222101, 1.0 / 298.257223563};
const std::array<double, 5> a = {6378388.0, 6378160.0, 6378135.0, 6378137.0, 6378137.0};
const std::array<double, 5> f = {1.0 / 297.0, 1.0 / 298.247, 1.0 / 298.26, 1.0 / 298.257222101, 1.0 / 298.257223563};
double lambda = atan2(Y, X);
double ex2 = (2.0 - f[elipsoid_selection]) * f[elipsoid_selection] / ((1.0 - f[elipsoid_selection]) * (1.0 - f[elipsoid_selection]));

View File

@ -6,7 +6,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -32,13 +32,14 @@
#ifndef GNSS_SDR_PVT_SOLUTION_H_
#define GNSS_SDR_PVT_SOLUTION_H_
#if ARMA_NO_BOUND_CHECKING
#define ARMA_NO_DEBUG 1
#endif
#include <armadillo>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <deque>
const unsigned int PVT_MAX_CHANNELS = 90;
const unsigned int PVT_MAX_PRN = 127; // 126 is SBAS
/*!
* \brief Base class for a PVT solution
@ -46,32 +47,6 @@ const unsigned int PVT_MAX_PRN = 127; // 126 is SBAS
*/
class Pvt_Solution
{
private:
double d_rx_dt_s; // RX time offset [s]
double d_latitude_d; // RX position Latitude WGS84 [deg]
double d_longitude_d; // RX position Longitude WGS84 [deg]
double d_height_m; // RX position height WGS84 [m]
double d_speed_over_ground_m_s; // RX speed over ground [m/s]
double d_course_over_ground_d; // RX course over ground [deg]
double d_avg_latitude_d; // Averaged latitude in degrees
double d_avg_longitude_d; // Averaged longitude in degrees
double d_avg_height_m; // Averaged height [m]
bool b_valid_position;
std::deque<double> d_hist_latitude_d;
std::deque<double> d_hist_longitude_d;
std::deque<double> d_hist_height_m;
bool d_flag_averaging;
int d_averaging_depth; // Length of averaging window
arma::vec d_rx_pos;
boost::posix_time::ptime d_position_UTC_time;
int d_valid_observations;
public:
Pvt_Solution();
@ -113,46 +88,72 @@ public:
arma::vec rotateSatellite(double traveltime, const arma::vec &X_sat);
/*!
* \brief Conversion of Cartesian coordinates (X,Y,Z) to geographical
* coordinates (d_latitude_d, d_longitude_d, d_height_m) on a selected reference ellipsoid.
*
* \param[in] X [m] Cartesian coordinate
* \param[in] Y [m] Cartesian coordinate
* \param[in] Z [m] Cartesian coordinate
* \param[in] elipsoid_selection. Choices of Reference Ellipsoid for Geographical Coordinates:
* 0 - International Ellipsoid 1924.
* 1 - International Ellipsoid 1967.
* 2 - World Geodetic System 1972.
* 3 - Geodetic Reference System 1980.
* 4 - World Geodetic System 1984.
*
*/
* \brief Conversion of Cartesian coordinates (X,Y,Z) to geographical
* coordinates (d_latitude_d, d_longitude_d, d_height_m) on a selected reference ellipsoid.
*
* \param[in] X [m] Cartesian coordinate
* \param[in] Y [m] Cartesian coordinate
* \param[in] Z [m] Cartesian coordinate
* \param[in] elipsoid_selection. Choices of Reference Ellipsoid for Geographical Coordinates:
* 0 - International Ellipsoid 1924.
* 1 - International Ellipsoid 1967.
* 2 - World Geodetic System 1972.
* 3 - Geodetic Reference System 1980.
* 4 - World Geodetic System 1984.
*
*/
int cart2geo(double X, double Y, double Z, int elipsoid_selection);
/*!
* \brief Tropospheric correction
*
* \param[in] sinel - sin of elevation angle of satellite
* \param[in] hsta_km - height of station in km
* \param[in] p_mb - atmospheric pressure in mb at height hp_km
* \param[in] t_kel - surface temperature in degrees Kelvin at height htkel_km
* \param[in] hum - humidity in % at height hhum_km
* \param[in] hp_km - height of pressure measurement in km
* \param[in] htkel_km - height of temperature measurement in km
* \param[in] hhum_km - height of humidity measurement in km
*
* \param[out] ddr_m - range correction (meters)
*
*
* Reference:
* Goad, C.C. & Goodman, L. (1974) A Modified Hopfield Tropospheric
* Refraction Correction Model. Paper presented at the
* American Geophysical Union Annual Fall Meeting, San
* Francisco, December 12-17
*
* Translated to C++ by Carles Fernandez from a Matlab implementation by Kai Borre
*/
* \brief Tropospheric correction
*
* \param[in] sinel - sin of elevation angle of satellite
* \param[in] hsta_km - height of station in km
* \param[in] p_mb - atmospheric pressure in mb at height hp_km
* \param[in] t_kel - surface temperature in degrees Kelvin at height htkel_km
* \param[in] hum - humidity in % at height hhum_km
* \param[in] hp_km - height of pressure measurement in km
* \param[in] htkel_km - height of temperature measurement in km
* \param[in] hhum_km - height of humidity measurement in km
*
* \param[out] ddr_m - range correction (meters)
*
*
* Reference:
* Goad, C.C. & Goodman, L. (1974) A Modified Hopfield Tropospheric
* Refraction Correction Model. Paper presented at the
* American Geophysical Union Annual Fall Meeting, San
* Francisco, December 12-17
*
* Translated to C++ by Carles Fernandez from a Matlab implementation by Kai Borre
*/
int tropo(double *ddr_m, double sinel, double hsta_km, double p_mb, double t_kel, double hum, double hp_km, double htkel_km, double hhum_km);
private:
double d_rx_dt_s; // RX time offset [s]
double d_latitude_d; // RX position Latitude WGS84 [deg]
double d_longitude_d; // RX position Longitude WGS84 [deg]
double d_height_m; // RX position height WGS84 [m]
double d_speed_over_ground_m_s; // RX speed over ground [m/s]
double d_course_over_ground_d; // RX course over ground [deg]
double d_avg_latitude_d; // Averaged latitude in degrees
double d_avg_longitude_d; // Averaged longitude in degrees
double d_avg_height_m; // Averaged height [m]
bool b_valid_position;
std::deque<double> d_hist_latitude_d;
std::deque<double> d_hist_longitude_d;
std::deque<double> d_hist_height_m;
bool d_flag_averaging;
int d_averaging_depth; // Length of averaging window
arma::vec d_rx_pos;
boost::posix_time::ptime d_position_UTC_time;
int d_valid_observations;
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -25,7 +25,7 @@
* \author Carles Fernandez Prades, 2011. cfernandez(at)cttc.es
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -51,23 +51,33 @@
#ifndef GNSS_SDR_RINEX_PRINTER_H_
#define GNSS_SDR_RINEX_PRINTER_H_
#include "GLONASS_L1_L2_CA.h"
#include "GPS_L1_CA.h"
#include "Galileo_E1.h"
#include "galileo_navigation_message.h"
#include "glonass_gnav_navigation_message.h"
#include "gnss_synchro.h"
#include "gps_cnav_navigation_message.h"
#include "gps_navigation_message.h"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <cstdint>
#include <fstream>
#include <cstdint> // for int32_t
#include <cstdlib> // for strtol, strtod
#include <fstream> // for fstream
#include <iomanip> // for setprecision
#include <map>
#include <map> // for map
#include <sstream> // for stringstream
#include <string>
#include <string> // for string
class Beidou_Dnav_Ephemeris;
class Beidou_Dnav_Iono;
class Beidou_Dnav_Utc_Model;
class Galileo_Ephemeris;
class Galileo_Iono;
class Galileo_Utc_Model;
class Glonass_Gnav_Almanac;
class Glonass_Gnav_Ephemeris;
class Glonass_Gnav_Utc_Model;
class Gnss_Synchro;
class Gps_CNAV_Ephemeris;
class Gps_CNAV_Iono;
class Gps_CNAV_Utc_Model;
class Gps_Ephemeris;
class Gps_Iono;
class Gps_Navigation_Message;
class Gps_Utc_Model;
class Sbas_Raw_Msg;
/*!
* \brief Class that handles the generation of Receiver
@ -86,17 +96,18 @@ public:
*/
~Rinex_Printer();
std::fstream obsFile; //<! Output file stream for RINEX observation file
std::fstream navFile; //<! Output file stream for RINEX navigation data file
std::fstream sbsFile; //<! Output file stream for RINEX SBAS raw data file
std::fstream navGalFile; //<! Output file stream for RINEX Galileo navigation data file
std::fstream navGloFile; //<! Output file stream for RINEX GLONASS navigation data file
std::fstream navMixFile; //<! Output file stream for RINEX Mixed navigation data file
std::fstream obsFile; //!< Output file stream for RINEX observation file
std::fstream navFile; //!< Output file stream for RINEX navigation data file
std::fstream sbsFile; //!< Output file stream for RINEX SBAS raw data file
std::fstream navGalFile; //!< Output file stream for RINEX Galileo navigation data file
std::fstream navGloFile; //!< Output file stream for RINEX GLONASS navigation data file
std::fstream navBdsFile; //!< Output file stream for RINEX Galileo navigation data file
std::fstream navMixFile; //!< Output file stream for RINEX Mixed navigation data file
/*!
* \brief Generates the GPS L1 C/A Navigation Data header
*/
void rinex_nav_header(std::fstream& out, const Gps_Iono& iono, const Gps_Utc_Model& utc_model);
void rinex_nav_header(std::fstream& out, const Gps_Iono& iono, const Gps_Utc_Model& utc_model, const Gps_Ephemeris& eph);
/*!
* \brief Generates the GPS L2C(M) Navigation Data header
@ -111,7 +122,7 @@ public:
/*!
* \brief Generates the Mixed (GPS/Galileo) Navigation Data header
*/
void rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model);
void rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Gps_Ephemeris& eph, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model);
/*!
* \brief Generates the Mixed (GPS CNAV/Galileo) Navigation Data header
@ -131,13 +142,38 @@ public:
/*!
* \brief Generates the Mixed (GPS L1 C/A/GLONASS L1, L2) Navigation Data header
*/
void rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac);
void rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Gps_Ephemeris& eph, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac);
/*!
* \brief Generates the Mixed (GPS L2C C/A/GLONASS L1, L2) Navigation Data header
*/
void rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_iono, const Gps_CNAV_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac);
/*!
* \brief Generates the BDS B1I or B3I Navigation Data header
*/
void rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono& iono, const Beidou_Dnav_Utc_Model& utc_model);
/*!
* \brief Generates the Mixed GPS L1,L5 + BDS B1I, B3I Navigation Data header
*/
void rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Gps_Ephemeris& eph, const Beidou_Dnav_Iono& bds_dnav_iono, const Beidou_Dnav_Utc_Model& bds_dnav_utc_model);
/*!
* \brief Generates the Mixed GPS L2C + BDS B1I, B3I Navigation Data header
*/
void rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_cnav_iono, const Gps_CNAV_Utc_Model& gps_cnav_utc_model, const Beidou_Dnav_Iono& bds_dnav_iono, const Beidou_Dnav_Utc_Model& bds_dnav_utc_model);
/*!
* \brief Generates the Mixed GLONASS L1,L2 + BDS B1I, B3I Navigation Data header
*/
void rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_Model& glo_gnav_utc_model, const Beidou_Dnav_Iono& bds_dnav_iono, const Beidou_Dnav_Utc_Model& bds_dnav_utc_model);
/*!
* \brief Generates the Mixed (Galileo/BDS B1I, B3I) Navigation Data header
*/
void rinex_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Beidou_Dnav_Iono& bds_dnav_iono, const Beidou_Dnav_Utc_Model& bds_dnav_utc_model);
/*!
* \brief Generates the GPS Observation data header
*/
@ -181,23 +217,37 @@ public:
/*!
* \brief Generates the Mixed (GPS L1 C/A /GLONASS) Observation data header. Example: galileo_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B".
*/
void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glo_bands = "1C");
void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands = "1C");
/*!
* \brief Generates the Mixed (Galileo/GLONASS) Observation data header. Example: galileo_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B".
*/
void rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& galileo_bands = "1B", const std::string& glo_bands = "1C");
void rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& galileo_bands = "1B", const std::string& glonass_bands = "1C");
/*!
* \brief Generates the Mixed (GPS L2C/GLONASS) Observation data header. Example: galileo_bands("1G")... Default: "1G".
*/
void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glo_bands = "1G");
void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands = "1G");
/*!
* \brief Generates the a Beidou B1I Observation data header. Example: beidou_bands("B1")
*/
void rinex_obs_header(std::fstream& out, const Beidou_Dnav_Ephemeris& eph, const double d_TOW_first_observation, const std::string& bands);
/*!
* \brief Generates the SBAS raw data header
*/
void rinex_sbs_header(std::fstream& out);
/*!
* \brief Computes the BDS Time and returns a boost::posix_time::ptime object
* \details Function used to convert the observation time into BDT time which is used
* as the default time for RINEX files
* \param eph BeiDou DNAV Ephemeris object
* \param obs_time Observation time in BDT seconds of week
*/
boost::posix_time::ptime compute_BDS_time(const Beidou_Dnav_Ephemeris& eph, const double obs_time);
/*!
* \brief Computes the UTC time and returns a boost::posix_time::ptime object
*/
@ -279,6 +329,11 @@ public:
*/
void log_rinex_nav(std::fstream& out, const std::map<int32_t, Galileo_Ephemeris>& galileo_eph_map, const std::map<int32_t, Glonass_Gnav_Ephemeris>& glonass_gnav_eph_map);
/*!
* \brief Writes data from the Beidou B1I navigation message into the RINEX file
*/
void log_rinex_nav(std::fstream& out, const std::map<int32_t, Beidou_Dnav_Ephemeris>& eph_map);
/*!
* \brief Writes GPS L1 observables into the RINEX file
*/
@ -327,12 +382,18 @@ public:
/*!
* \brief Writes Mixed GPS L2C - GLONASS observables into the RINEX file
*/
void log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
void log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
/*!
* \brief Writes Mixed Galileo/GLONASS observables into the RINEX file
*/
void log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
void log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double galileo_obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
/*!
* \brief Writes BDS B1I observables into the RINEX file
*/
void log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris& eph, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables, const std::string& bds_bands);
/*!
* \brief Represents GPS time in the date time format. Leap years are considered, but leap seconds are not.
@ -344,11 +405,11 @@ public:
*/
//void log_rinex_sbs(std::fstream & out, const Sbas_Raw_Msg & sbs_message);
void update_nav_header(std::fstream& out, const Gps_Utc_Model& gps_utc, const Gps_Iono& gps_iono);
void update_nav_header(std::fstream& out, const Gps_Utc_Model& utc_model, const Gps_Iono& gps_iono, const Gps_Ephemeris& eph);
void update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Model& utc_model, const Gps_CNAV_Iono& iono);
void update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model);
void update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Gps_Ephemeris& eph, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model);
void update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Model& utc_model, const Gps_CNAV_Iono& iono, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model);
@ -356,12 +417,14 @@ public:
void update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac);
void update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac);
void update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc, const Gps_Ephemeris& eph, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac);
void update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_cnav_iono, const Gps_CNAV_Utc_Model& gps_cnav_utc, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac);
void update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_iono, const Gps_CNAV_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac);
void update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac);
void update_nav_header(std::fstream& out, const Beidou_Dnav_Utc_Model& utc_model, const Beidou_Dnav_Iono& beidou_dnav_iono);
void update_obs_header(std::fstream& out, const Gps_Utc_Model& utc_model);
void update_obs_header(std::fstream& out, const Gps_CNAV_Utc_Model& utc_model);
@ -370,16 +433,19 @@ public:
void update_obs_header(std::fstream& out, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model);
std::map<std::string, std::string> satelliteSystem; //<! GPS, GLONASS, SBAS payload, Galileo or Compass
std::map<std::string, std::string> observationType; //<! PSEUDORANGE, CARRIER_PHASE, DOPPLER, SIGNAL_STRENGTH
std::map<std::string, std::string> observationCode; //<! GNSS observation descriptors
std::string stringVersion; //<! RINEX version (2.10/2.11 or 3.01/3.02)
void update_obs_header(std::fstream& out, const Beidou_Dnav_Utc_Model& utc_model);
std::map<std::string, std::string> satelliteSystem; //!< GPS, GLONASS, SBAS payload, Galileo or Beidou
std::map<std::string, std::string> observationType; //!< PSEUDORANGE, CARRIER_PHASE, DOPPLER, SIGNAL_STRENGTH
std::map<std::string, std::string> observationCode; //!< GNSS observation descriptors
std::string stringVersion; //!< RINEX version (2.10/2.11 or 3.01/3.02)
std::string navfilename;
std::string obsfilename;
std::string sbsfilename;
std::string navGalfilename;
std::string navGlofilename;
std::string navBdsfilename;
std::string navMixfilename;
private:
@ -641,8 +707,15 @@ inline std::string Rinex_Printer::doub2for(const double& d,
short exponentLength = expLen;
/* Validate the assumptions regarding the input arguments */
if (exponentLength < 0) exponentLength = 1;
if (exponentLength > 3 && checkSwitch) exponentLength = 3;
if (exponentLength < 0)
{
exponentLength = 1;
}
if (exponentLength > 3 && checkSwitch)
{
exponentLength = 3;
}
std::string toReturn = doub2sci(d, length, exponentLength, true, checkSwitch);
sci2for(toReturn, 0, length, exponentLength, checkSwitch);
@ -661,8 +734,15 @@ inline std::string Rinex_Printer::doub2sci(const double& d,
short exponentLength = expLen;
/* Validate the assumptions regarding the input arguments */
if (exponentLength < 0) exponentLength = 1;
if (exponentLength > 3 && checkSwitch) exponentLength = 3;
if (exponentLength < 0)
{
exponentLength = 1;
}
if (exponentLength > 3 && checkSwitch)
{
exponentLength = 3;
}
std::stringstream c;
c.setf(std::ios::scientific, std::ios::floatfield);
@ -674,7 +754,10 @@ inline std::string Rinex_Printer::doub2sci(const double& d,
// an extra -1 for '-' or ' ' if it's positive or negative
int expSize = 0;
if (showSign)
expSize = 1;
{
expSize = 1;
}
c.precision(length - 3 - exponentLength - 1 - expSize);
c << d;
c >> toReturn;
@ -716,7 +799,9 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr,
aStr[idx - 1] = '.';
// Only add one to the exponent if the number is non-zero
if (asDouble(aStr.substr(startPos, length)) != 0.0)
expAdd = 1;
{
expAdd = 1;
}
}
idx = aStr.find('e', startPos);
@ -731,9 +816,13 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr,
// Change the exponent character to D normally, or E of checkSwitch is false.
if (checkSwitch)
aStr[idx] = 'D';
{
aStr[idx] = 'D';
}
else
aStr[idx] = 'E';
{
aStr[idx] = 'E';
}
// Change the exponent itself
if (redoexp)
@ -749,7 +838,10 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr,
iexp -= iexp * 2;
}
else
aStr += "+";
{
aStr += "+";
}
aStr += Rinex_Printer::rightJustify(asString(iexp), expLen, '0');
}

View File

@ -5,7 +5,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -34,17 +34,22 @@
#include "concurrent_queue.h"
#include "galileo_fnav_message.h"
#include "glonass_gnav_navigation_message.h"
#include "galileo_ephemeris.h"
#include "glonass_gnav_ephemeris.h"
#include "glonass_gnav_utc_model.h"
#include "gnss_synchro.h"
#include "gps_cnav_navigation_message.h"
#include "gps_navigation_message.h"
#include "gps_cnav_ephemeris.h"
#include "gps_ephemeris.h"
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <glog/logging.h>
#include <pmt/pmt.h>
#include <bitset>
#include <cstddef> // for size_t
#include <cstdint>
#include <cstring> // for memcpy
#include <deque>
#include <list>
#include <map>
#include <memory>
#include <set>
@ -53,9 +58,15 @@
#include <utility>
#include <vector>
#if BOOST_GREATER_1_65
using b_io_context = boost::asio::io_context;
#else
using b_io_context = boost::asio::io_service;
#endif
/*!
* This class implements the generation and reading of some Message Types
* \brief This class implements the generation and reading of some Message Types
* defined in the RTCM 3.2 Standard, plus some utilities to handle messages.
*
* Generation of the following Message Types:
@ -86,7 +97,7 @@
class Rtcm
{
public:
Rtcm(uint16_t port = 2101); //<! Default constructor that sets TCP port of the RTCM message server and RTCM Station ID. 2101 is the standard RTCM port according to the Internet Assigned Numbers Authority (IANA). See https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml
Rtcm(uint16_t port = 2101); //!< Default constructor that sets TCP port of the RTCM message server and RTCM Station ID. 2101 is the standard RTCM port according to the Internet Assigned Numbers Authority (IANA). See https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml
~Rtcm();
/*!
@ -124,7 +135,7 @@ public:
*/
std::string print_MT1006(uint32_t ref_id, double ecef_x, double ecef_y, double ecef_z, bool gps, bool glonass, bool galileo, bool non_physical, bool single_oscillator, uint32_t quarter_cycle_indicator, double height);
std::string print_MT1005_test(); //<! For testing purposes
std::string print_MT1005_test(); //!< For testing purposes
/*!
* \brief Prints message type 1008 (Antenna Descriptor & Serial Number)
@ -141,6 +152,7 @@ public:
* \return string with message contents
*/
std::string print_MT1009(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables, uint16_t station_id);
/*!
* \brief Prints Extended L1-Only GLONASS RTK Observables
* \details This GLONASS message type is used when only L1 data is present and bandwidth is very tight, often 1012 is used in such cases.
@ -151,6 +163,7 @@ public:
* \return string with message contents
*/
std::string print_MT1010(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables, uint16_t station_id);
/*!
* \brief Prints L1&L2 GLONASS RTK Observables
* \details This GLONASS message type is not generally used or supported; type 1012 is to be preferred
@ -161,6 +174,7 @@ public:
* \return string with message contents
*/
std::string print_MT1011(const Glonass_Gnav_Ephemeris& glonass_gnav_ephL1, const Glonass_Gnav_Ephemeris& glonass_gnav_ephL2, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables, uint16_t station_id);
/*!
* \brief Prints Extended L1&L2 GLONASS RTK Observables
* \details This GLONASS message type is the most common observational message type, with L1/L2/SNR content. This is one of the most common messages found.
@ -329,9 +343,10 @@ public:
bool divergence_free,
bool more_messages);
uint32_t lock_time(const Gps_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); //<! Returns the time period in which GPS L1 signals have been continually tracked.
uint32_t lock_time(const Gps_CNAV_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); //<! Returns the time period in which GPS L2 signals have been continually tracked.
uint32_t lock_time(const Galileo_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); //<! Returns the time period in which Galileo signals have been continually tracked.
uint32_t lock_time(const Gps_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); //!< Returns the time period in which GPS L1 signals have been continually tracked.
uint32_t lock_time(const Gps_CNAV_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); //!< Returns the time period in which GPS L2 signals have been continually tracked.
uint32_t lock_time(const Galileo_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); //!< Returns the time period in which Galileo signals have been continually tracked.
/*!
* \brief Locks time period in which GLONASS signals have been continually tracked.
* \note Code added as part of GSoC 2017 program
@ -342,34 +357,26 @@ public:
*/
uint32_t lock_time(const Glonass_Gnav_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro);
std::string bin_to_hex(const std::string& s) const; //<! Returns a string of hexadecimal symbols from a string of binary symbols
std::string hex_to_bin(const std::string& s) const; //<! Returns a string of binary symbols from a string of hexadecimal symbols
std::string bin_to_hex(const std::string& s) const; //!< Returns a string of hexadecimal symbols from a string of binary symbols
std::string hex_to_bin(const std::string& s) const; //!< Returns a string of binary symbols from a string of hexadecimal symbols
std::string bin_to_binary_data(const std::string& s) const; //<! Returns a string of binary data from a string of binary symbols
std::string binary_data_to_bin(const std::string& s) const; //<! Returns a string of binary symbols from a string of binary data
std::string bin_to_binary_data(const std::string& s) const; //!< Returns a string of binary data from a string of binary symbols
std::string binary_data_to_bin(const std::string& s) const; //!< Returns a string of binary symbols from a string of binary data
uint32_t bin_to_uint(const std::string& s) const; //<! Returns an uint32_t from a string of binary symbols
uint32_t bin_to_uint(const std::string& s) const; //!< Returns an uint32_t from a string of binary symbols
int32_t bin_to_int(const std::string& s) const;
double bin_to_double(const std::string& s) const; //<! Returns double from a string of binary symbols
/*!
* \brief Locks time period in which GLONASS signals have been continually tracked.
* \note Code added as part of GSoC 2017 program
* \param eph GLONASS GNAV Broadcast Ephemeris
* \param obs_time Time of observation at the moment of printing
* \param observables Set of observables as defined by the platform
* \return //<! Returns a int64_t from a string of binary symbols
*/
double bin_to_double(const std::string& s) const; //!< Returns double from a string of binary symbols
int32_t bin_to_sint(const std::string& s) const;
uint64_t hex_to_uint(const std::string& s) const; //<! Returns an uint64_t from a string of hexadecimal symbols
int64_t hex_to_int(const std::string& s) const; //<! Returns a int64_t from a string of hexadecimal symbols
uint64_t hex_to_uint(const std::string& s) const; //!< Returns an uint64_t from a string of hexadecimal symbols
int64_t hex_to_int(const std::string& s) const; //!< Returns a int64_t from a string of hexadecimal symbols
bool check_CRC(const std::string& message) const; //<! Checks that the CRC of a RTCM package is correct
bool check_CRC(const std::string& message) const; //!< Checks that the CRC of a RTCM package is correct
void run_server(); //<! Starts running the server
void stop_server(); //<! Stops the server
void run_server(); //!< Starts running the server
void stop_server(); //!< Stops the server
void send_message(const std::string& message); //<! Sends a message through the server to all connected clients
bool is_server_running() const; //<! Returns true if the server is running, false otherwise
void send_message(const std::string& msg); //!< Sends a message through the server to all connected clients
bool is_server_running() const; //!< Returns true if the server is running, false otherwise
private:
//
@ -440,7 +447,7 @@ private:
* \param gnss_synchroL2 Information generated by channels while processing the GLONASS GNAV L2 satellite
* \return Returns the message content as set of bits
*/
std::bitset<107> get_MT1011_sat_content(const Glonass_Gnav_Ephemeris& ephGNAVL1, const Glonass_Gnav_Ephemeris& ephGNAVL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2);
std::bitset<107> get_MT1011_sat_content(const Glonass_Gnav_Ephemeris& ephL1, const Glonass_Gnav_Ephemeris& ephL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2);
/*!
* \brief Get the contents of the satellite specific portion of a type 1012 Message (GLONASS Extended RTK, L1 & L2)
* \details Contents generated for each satellite. See table 3.5-14
@ -452,7 +459,7 @@ private:
* \param gnss_synchroL2 Information generated by channels while processing the GLONASS GNAV L2 satellite
* \return Returns the message content as set of bits
*/
std::bitset<130> get_MT1012_sat_content(const Glonass_Gnav_Ephemeris& ephGNAVL1, const Glonass_Gnav_Ephemeris& ephGNAVL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2);
std::bitset<130> get_MT1012_sat_content(const Glonass_Gnav_Ephemeris& ephL1, const Glonass_Gnav_Ephemeris& ephL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2);
std::string get_MSM_header(uint32_t msg_number,
double obs_time,
@ -553,7 +560,9 @@ private:
{
body_length_ = new_length;
if (body_length_ > max_body_length)
body_length_ = max_body_length;
{
body_length_ = max_body_length;
}
}
inline bool decode_header()
@ -594,10 +603,10 @@ private:
};
class Rtcm_Listener
class RtcmListener
{
public:
virtual ~Rtcm_Listener() = default;
virtual ~RtcmListener() = default;
virtual void deliver(const Rtcm_Message& msg) = 0;
};
@ -605,14 +614,16 @@ private:
class Rtcm_Listener_Room
{
public:
inline void join(std::shared_ptr<Rtcm_Listener> participant)
inline void join(const std::shared_ptr<RtcmListener>& participant)
{
participants_.insert(participant);
for (auto msg : recent_msgs_)
participant->deliver(msg);
{
participant->deliver(msg);
}
}
inline void leave(std::shared_ptr<Rtcm_Listener> participant)
inline void leave(const std::shared_ptr<RtcmListener>& participant)
{
participants_.erase(participant);
}
@ -621,14 +632,18 @@ private:
{
recent_msgs_.push_back(msg);
while (recent_msgs_.size() > max_recent_msgs)
recent_msgs_.pop_front();
{
recent_msgs_.pop_front();
}
for (auto participant : participants_)
participant->deliver(msg);
for (const auto& participant : participants_)
{
participant->deliver(msg);
}
}
private:
std::set<std::shared_ptr<Rtcm_Listener> > participants_;
std::set<std::shared_ptr<RtcmListener> > participants_;
enum
{
max_recent_msgs = 1
@ -638,7 +653,7 @@ private:
class Rtcm_Session
: public Rtcm_Listener,
: public RtcmListener,
public std::enable_shared_from_this<Rtcm_Session>
{
public:
@ -750,11 +765,11 @@ private:
: public std::enable_shared_from_this<Tcp_Internal_Client>
{
public:
Tcp_Internal_Client(boost::asio::io_service& io_context,
Tcp_Internal_Client(b_io_context& io_context,
boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
: io_context_(io_context), socket_(io_context)
{
do_connect(endpoint_iterator);
do_connect(std::move(endpoint_iterator));
}
inline void close()
@ -778,7 +793,7 @@ private:
private:
inline void do_connect(boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
{
boost::asio::async_connect(socket_, endpoint_iterator,
boost::asio::async_connect(socket_, std::move(endpoint_iterator),
[this](boost::system::error_code ec, boost::asio::ip::tcp::resolver::iterator) {
if (!ec)
{
@ -828,7 +843,7 @@ private:
});
}
boost::asio::io_service& io_context_;
b_io_context& io_context_;
boost::asio::ip::tcp::socket socket_;
Rtcm_Message read_msg_;
std::deque<Rtcm_Message> write_msgs_;
@ -838,7 +853,7 @@ private:
class Queue_Reader
{
public:
Queue_Reader(boost::asio::io_service& io_context, std::shared_ptr<concurrent_queue<std::string> >& queue, int32_t port) : queue_(queue)
Queue_Reader(b_io_context& io_context, std::shared_ptr<Concurrent_Queue<std::string> >& queue, int32_t port) : queue_(queue)
{
boost::asio::ip::tcp::resolver resolver(io_context);
std::string host("localhost");
@ -854,7 +869,11 @@ private:
std::string message;
Rtcm_Message msg;
queue_->wait_and_pop(message); //message += '\n';
if (message == "Goodbye") break;
if (message == "Goodbye")
{
break;
}
const char* char_msg = message.c_str();
msg.body_length(message.length());
std::memcpy(msg.body(), char_msg, msg.body_length());
@ -865,14 +884,14 @@ private:
private:
std::shared_ptr<Tcp_Internal_Client> c;
std::shared_ptr<concurrent_queue<std::string> >& queue_;
std::shared_ptr<Concurrent_Queue<std::string> >& queue_;
};
class Tcp_Server
{
public:
Tcp_Server(boost::asio::io_service& io_context, const boost::asio::ip::tcp::endpoint& endpoint)
Tcp_Server(b_io_context& io_context, const boost::asio::ip::tcp::endpoint& endpoint)
: acceptor_(io_context), socket_(io_context)
{
acceptor_.open(endpoint.protocol());
@ -918,7 +937,10 @@ private:
LOG(INFO) << "Serving client from " << remote_addr;
}
}
if (start_session) std::make_shared<Rtcm_Session>(std::move(socket_), room_)->start();
if (start_session)
{
std::make_shared<Rtcm_Session>(std::move(socket_), room_)->start();
}
}
else
{
@ -936,8 +958,8 @@ private:
bool start_session = true;
};
boost::asio::io_service io_context;
std::shared_ptr<concurrent_queue<std::string> > rtcm_message_queue;
b_io_context io_context;
std::shared_ptr<Concurrent_Queue<std::string> > rtcm_message_queue;
std::thread t;
std::thread tq;
std::list<Rtcm::Tcp_Server> servers;
@ -1398,10 +1420,10 @@ private:
int32_t set_DF393(bool more_messages); //1 indicates that more MSMs follow for given physical time and reference station ID
std::bitset<64> DF394;
int32_t set_DF394(const std::map<int32_t, Gnss_Synchro>& observables);
int32_t set_DF394(const std::map<int32_t, Gnss_Synchro>& gnss_synchro);
std::bitset<32> DF395;
int32_t set_DF395(const std::map<int32_t, Gnss_Synchro>& observables);
int32_t set_DF395(const std::map<int32_t, Gnss_Synchro>& gnss_synchro);
std::string set_DF396(const std::map<int32_t, Gnss_Synchro>& observables);

View File

@ -8,7 +8,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -32,19 +32,40 @@
*/
#include "rtcm_printer.h"
#include <boost/date_time/posix_time/posix_time.hpp>
#include "galileo_ephemeris.h"
#include "glonass_gnav_ephemeris.h"
#include "glonass_gnav_utc_model.h"
#include "gnss_synchro.h"
#include "gps_cnav_ephemeris.h"
#include "gps_ephemeris.h"
#include "rtcm.h"
#include <boost/exception/diagnostic_information.hpp>
#include <glog/logging.h>
#include <ctime> // for tm
#include <exception> // for exception
#include <fcntl.h> // for O_RDWR
#include <iostream> // for cout, cerr
#include <termios.h> // for tcgetattr
#include <unistd.h> // for close, write
#if HAS_STD_FILESYSTEM
#include <system_error>
namespace errorlib = std;
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
#else
#include <filesystem>
namespace fs = std::filesystem;
#endif
#else
#include <boost/filesystem/operations.hpp> // for create_directories, exists
#include <boost/filesystem/path.hpp> // for path, operator<<
#include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h>
#include <cstdint>
#include <fcntl.h> // for O_RDWR
#include <iomanip>
#include <termios.h> // for tcgetattr
#include <utility>
using google::LogMessage;
#include <boost/system/error_code.hpp> // for error_code
namespace fs = boost::filesystem;
namespace errorlib = boost::system;
#endif
Rtcm_Printer::Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, const std::string& rtcm_dump_devname, bool time_tag_name, const std::string& base_path)
@ -55,24 +76,24 @@ Rtcm_Printer::Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump
rtcm_base_path = base_path;
if (d_rtcm_file_dump)
{
boost::filesystem::path full_path(boost::filesystem::current_path());
const boost::filesystem::path p(rtcm_base_path);
if (!boost::filesystem::exists(p))
fs::path full_path(fs::current_path());
const fs::path p(rtcm_base_path);
if (!fs::exists(p))
{
std::string new_folder;
for (auto& folder : boost::filesystem::path(rtcm_base_path))
for (auto& folder : fs::path(rtcm_base_path))
{
new_folder += folder.string();
boost::system::error_code ec;
if (!boost::filesystem::exists(new_folder))
errorlib::error_code ec;
if (!fs::exists(new_folder))
{
if (!boost::filesystem::create_directory(new_folder, ec))
if (!fs::create_directory(new_folder, ec))
{
std::cout << "Could not create the " << new_folder << " folder." << std::endl;
rtcm_base_path = full_path.string();
}
}
new_folder += boost::filesystem::path::preferred_separator;
new_folder += fs::path::preferred_separator;
}
}
else
@ -84,7 +105,7 @@ Rtcm_Printer::Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump
std::cout << "RTCM binary file will be stored at " << rtcm_base_path << std::endl;
}
rtcm_base_path = rtcm_base_path + boost::filesystem::path::preferred_separator;
rtcm_base_path = rtcm_base_path + fs::path::preferred_separator;
}
if (time_tag_name)
@ -143,7 +164,7 @@ Rtcm_Printer::Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump
}
}
rtcm_devname = std::move(rtcm_dump_devname);
rtcm_devname = rtcm_dump_devname;
if (flag_rtcm_tty_port == true)
{
rtcm_dev_descriptor = init_serial(rtcm_devname.c_str());
@ -190,13 +211,31 @@ Rtcm_Printer::~Rtcm_Printer()
{
int64_t pos;
pos = rtcm_file_descriptor.tellp();
rtcm_file_descriptor.close();
try
{
rtcm_file_descriptor.close();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
if (pos == 0)
{
if (remove(rtcm_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary RTCM file";
errorlib::error_code ec;
if (!fs::remove(fs::path(rtcm_filename), ec))
{
LOG(INFO) << "Error deleting temporary RTCM file";
}
}
}
close_serial();
try
{
close_serial();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
}
@ -345,7 +384,9 @@ int Rtcm_Printer::init_serial(const std::string& serial_device)
* Opens the serial device and sets the default baud rate for a RTCM transmission (9600,8,N,1)
*/
int32_t fd = 0;
struct termios options;
// clang-format off
struct termios options{};
// clang-format on
int64_t BAUD;
int64_t DATABITS;
int64_t STOPBITS;
@ -353,13 +394,19 @@ int Rtcm_Printer::init_serial(const std::string& serial_device)
int64_t PARITY;
fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY | O_CLOEXEC);
if (fd == -1) return fd; // failed to open TTY port
if (fd == -1)
{
return fd; // failed to open TTY port
}
if (fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O
tcgetattr(fd, &options); // read serial port options
if (fcntl(fd, F_SETFL, 0) == -1)
{
LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O
}
tcgetattr(fd, &options); // read serial port options
BAUD = B9600;
//BAUD = B38400;
// BAUD = B38400;
DATABITS = CS8;
STOPBITS = 0;
PARITYON = 0;
@ -367,7 +414,7 @@ int Rtcm_Printer::init_serial(const std::string& serial_device)
options.c_cflag = BAUD | DATABITS | STOPBITS | PARITYON | PARITY | CLOCAL | CREAD;
// enable receiver, set 8 bit data, ignore control lines
//options.c_cflag |= (CLOCAL | CREAD | CS8);
// options.c_cflag |= (CLOCAL | CREAD | CS8);
options.c_iflag = IGNPAR;
// set the new port options
@ -387,7 +434,7 @@ void Rtcm_Printer::close_serial()
bool Rtcm_Printer::Print_Message(const std::string& message)
{
//write to file
// write to file
if (d_rtcm_file_dump)
{
try
@ -401,7 +448,7 @@ bool Rtcm_Printer::Print_Message(const std::string& message)
}
}
//write to serial device
// write to serial device
if (rtcm_dev_descriptor != -1)
{
if (write(rtcm_dev_descriptor, message.c_str(), message.length()) == -1)

View File

@ -8,7 +8,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
@ -34,10 +34,18 @@
#ifndef GNSS_SDR_RTCM_PRINTER_H_
#define GNSS_SDR_RTCM_PRINTER_H_
#include "rtcm.h"
#include <fstream> // std::ofstream
#include <cstdint> // for int32_t
#include <fstream> // for std::ofstream
#include <map> // for std::map
#include <memory> // std::shared_ptr
class Galileo_Ephemeris;
class Glonass_Gnav_Ephemeris;
class Glonass_Gnav_Utc_Model;
class Gnss_Synchro;
class Gps_CNAV_Ephemeris;
class Gps_Ephemeris;
class Rtcm;
/*!
* \brief This class provides a implementation of a subset of the RTCM Standard 10403.2 messages
@ -48,7 +56,7 @@ public:
/*!
* \brief Default constructor.
*/
Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, const std::string& rtcm_dump_filename, bool time_tag_name = true, const std::string& base_path = ".");
Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, const std::string& rtcm_dump_devname, bool time_tag_name = true, const std::string& base_path = ".");
/*!
* \brief Default destructor.
@ -59,6 +67,7 @@ public:
bool Print_Rtcm_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
bool Print_Rtcm_MT1003(const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& cnav_eph, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
bool Print_Rtcm_MT1004(const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& cnav_eph, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
/*!
* \brief Prints L1-Only GLONASS RTK Observables
* \details This GLONASS message type is not generally used or supported; type 1012 is to be preferred.
@ -69,6 +78,7 @@ public:
* \return true or false upon operation success
*/
bool Print_Rtcm_MT1009(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
/*!
* \brief Prints Extended L1-Only GLONASS RTK Observables
* \details This GLONASS message type is used when only L1 data is present and bandwidth is very tight, often 1012 is used in such cases.
@ -79,6 +89,7 @@ public:
* \return true or false upon operation success
*/
bool Print_Rtcm_MT1010(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
/*!
* \brief Prints L1&L2 GLONASS RTK Observables
* \details This GLONASS message type is not generally used or supported; type 1012 is to be preferred
@ -90,6 +101,7 @@ public:
* \return true or false upon operation success
*/
bool Print_Rtcm_MT1011(const Glonass_Gnav_Ephemeris& glonass_gnav_ephL1, const Glonass_Gnav_Ephemeris& glonass_gnav_ephL2, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
/*!
* \brief Prints Extended L1&L2 GLONASS RTK Observables
* \details This GLONASS message type is the most common observational message type, with L1/L2/SNR content. This is one of the most common messages found.
@ -102,8 +114,9 @@ public:
*/
bool Print_Rtcm_MT1012(const Glonass_Gnav_Ephemeris& glonass_gnav_ephL1, const Glonass_Gnav_Ephemeris& glonass_gnav_ephL2, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
bool Print_Rtcm_MT1019(const Gps_Ephemeris& gps_eph); //<! GPS Ephemeris, should be broadcast in the event that the IODC does not match the IODE, and every 2 minutes.
bool Print_Rtcm_MT1045(const Galileo_Ephemeris& gal_eph); //<! Galileo Ephemeris, should be broadcast every 2 minutes
bool Print_Rtcm_MT1019(const Gps_Ephemeris& gps_eph); //!< GPS Ephemeris, should be broadcast in the event that the IODC does not match the IODE, and every 2 minutes.
bool Print_Rtcm_MT1045(const Galileo_Ephemeris& gal_eph); //!< Galileo Ephemeris, should be broadcast every 2 minutes
/*!
* \brief Prints GLONASS GNAV Ephemeris
* \details This GLONASS message should be broadcast every 2 minutes
@ -112,7 +125,7 @@ public:
* \param utc_model GLONASS GNAV Clock Information broadcast in string 5
* \return true or false upon operation success
*/
bool Print_Rtcm_MT1020(const Glonass_Gnav_Ephemeris& glo_gnav_eph, const Glonass_Gnav_Utc_Model& utc_model);
bool Print_Rtcm_MT1020(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const Glonass_Gnav_Utc_Model& utc_model);
bool Print_Rtcm_MSM(uint32_t msm_number,
const Gps_Ephemeris& gps_eph,
@ -127,10 +140,11 @@ public:
bool divergence_free,
bool more_messages);
std::string print_MT1005_test(); //<! For testing purposes
std::string print_MT1005_test(); //!< For testing purposes
uint32_t lock_time(const Gps_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro);
uint32_t lock_time(const Gps_CNAV_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro);
uint32_t lock_time(const Galileo_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro);
/*!
* \brief Locks time for logging given GLONASS GNAV Broadcast Ephemeris
* \note Code added as part of GSoC 2017 program

View File

@ -3,8 +3,8 @@
* \brief PVT solver based on rtklib library functions adapted to the GNSS-SDR
* data flow and structures
* \authors <ul>
* <li> 2017, Javier Arribas
* <li> 2017, Carles Fernandez
* <li> 2017-2019, Javier Arribas
* <li> 2017-2019, Carles Fernandez
* <li> 2007-2013, T. Takasu
* </ul>
*
@ -22,8 +22,8 @@
*
* -------------------------------------------------------------------------
* Copyright (C) 2007-2013, T. Takasu
* Copyright (C) 2017, Javier Arribas
* Copyright (C) 2017, Carles Fernandez
* Copyright (C) 2017-2019, Javier Arribas
* Copyright (C) 2017-2019, Carles Fernandez
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -52,35 +52,51 @@
* -----------------------------------------------------------------------*/
#include "rtklib_solver.h"
#include "Beidou_B1I.h"
#include "Beidou_B3I.h"
#include "Beidou_DNAV.h"
#include "GLONASS_L1_L2_CA.h"
#include "GPS_L1_CA.h"
#include "Galileo_E1.h"
#include "rtklib_conversions.h"
#include "rtklib_rtkpos.h"
#include "rtklib_solution.h"
#include <glog/logging.h>
#include <matio.h>
#include <exception>
#include <utility>
#include <vector>
#if HAS_STD_FILESYSTEM
#include <system_error>
namespace errorlib = std;
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
#else
#include <filesystem>
namespace fs = std::filesystem;
#endif
#else
#include <boost/filesystem/operations.hpp> // for create_directories, exists
#include <boost/filesystem/path.hpp> // for path, operator<<
#include <boost/filesystem/path_traits.hpp> // for filesystem
#include <boost/system/error_code.hpp> // for error_code
namespace fs = boost::filesystem;
namespace errorlib = boost::system;
#endif
using google::LogMessage;
rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t &rtk)
Rtklib_Solver::Rtklib_Solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t &rtk)
{
// init empty ephemeris for all the available GNSS channels
d_nchannels = nchannels;
d_dump_filename = std::move(dump_filename);
d_flag_dump_enabled = flag_dump_to_file;
d_flag_dump_mat_enabled = flag_dump_to_mat;
count_valid_position = 0;
this->set_averaging_flag(false);
rtk_ = rtk;
for (double &i : dop_) i = 0.0;
pvt_sol = {{0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, '0', '0', '0', 0, 0, 0};
ssat_t ssat0 = {0, 0, {0.0}, {0.0}, {0.0}, {'0'}, {'0'}, {'0'}, {'0'}, {'0'}, {}, {}, {}, {}, 0.0, 0.0, 0.0, 0.0, {{{0, 0}}, {{0, 0}}}, {{}, {}}};
for (auto &i : pvt_ssat)
{
i = ssat0;
}
// ############# ENABLE DATA FILE LOG #################
if (d_flag_dump_enabled == true)
{
@ -88,11 +104,11 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag
{
try
{
d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit);
d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary);
LOG(INFO) << "PVT lib dump enabled Log file: " << d_dump_filename.c_str();
}
catch (const std::ifstream::failure &e)
catch (const std::ofstream::failure &e)
{
LOG(WARNING) << "Exception opening RTKLIB dump file " << e.what();
}
@ -100,7 +116,45 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag
}
}
bool rtklib_solver::save_matfile()
Rtklib_Solver::~Rtklib_Solver()
{
if (d_dump_file.is_open() == true)
{
auto pos = d_dump_file.tellp();
try
{
d_dump_file.close();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Exception in destructor closing the RTKLIB dump file " << ex.what();
}
if (pos == 0)
{
errorlib::error_code ec;
if (!fs::remove(fs::path(d_dump_filename), ec))
{
std::cerr << "Problem removing temporary file " << d_dump_filename << '\n';
}
d_flag_dump_mat_enabled = false;
}
}
if (d_flag_dump_mat_enabled)
{
try
{
save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Exception in destructor saving the PVT .mat dump file " << ex.what();
}
}
}
bool Rtklib_Solver::save_matfile()
{
// READ DUMP FILE
std::string dump_filename = d_dump_filename;
@ -114,7 +168,6 @@ bool rtklib_solver::save_matfile()
sizeof(uint8_t) * number_of_uint8_vars +
sizeof(float) * number_of_float_vars;
std::ifstream dump_file;
std::cout << "Generating .mat file for " << dump_filename << std::endl;
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
try
{
@ -129,6 +182,7 @@ bool rtklib_solver::save_matfile()
int64_t num_epoch = 0LL;
if (dump_file.is_open())
{
std::cout << "Generating .mat file for " << dump_filename << std::endl;
size = dump_file.tellg();
num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
dump_file.seekg(0, std::ios::beg);
@ -138,34 +192,34 @@ bool rtklib_solver::save_matfile()
return false;
}
auto *TOW_at_current_symbol_ms = new uint32_t[num_epoch];
auto *week = new uint32_t[num_epoch];
auto *RX_time = new double[num_epoch];
auto *user_clk_offset = new double[num_epoch];
auto *pos_x = new double[num_epoch];
auto *pos_y = new double[num_epoch];
auto *pos_z = new double[num_epoch];
auto *vel_x = new double[num_epoch];
auto *vel_y = new double[num_epoch];
auto *vel_z = new double[num_epoch];
auto *cov_xx = new double[num_epoch];
auto *cov_yy = new double[num_epoch];
auto *cov_zz = new double[num_epoch];
auto *cov_xy = new double[num_epoch];
auto *cov_yz = new double[num_epoch];
auto *cov_zx = new double[num_epoch];
auto *latitude = new double[num_epoch];
auto *longitude = new double[num_epoch];
auto *height = new double[num_epoch];
auto *valid_sats = new uint8_t[num_epoch];
auto *solution_status = new uint8_t[num_epoch];
auto *solution_type = new uint8_t[num_epoch];
auto *AR_ratio_factor = new float[num_epoch];
auto *AR_ratio_threshold = new float[num_epoch];
auto *gdop = new double[num_epoch];
auto *pdop = new double[num_epoch];
auto *hdop = new double[num_epoch];
auto *vdop = new double[num_epoch];
auto TOW_at_current_symbol_ms = std::vector<uint32_t>(num_epoch);
auto week = std::vector<uint32_t>(num_epoch);
auto RX_time = std::vector<double>(num_epoch);
auto user_clk_offset = std::vector<double>(num_epoch);
auto pos_x = std::vector<double>(num_epoch);
auto pos_y = std::vector<double>(num_epoch);
auto pos_z = std::vector<double>(num_epoch);
auto vel_x = std::vector<double>(num_epoch);
auto vel_y = std::vector<double>(num_epoch);
auto vel_z = std::vector<double>(num_epoch);
auto cov_xx = std::vector<double>(num_epoch);
auto cov_yy = std::vector<double>(num_epoch);
auto cov_zz = std::vector<double>(num_epoch);
auto cov_xy = std::vector<double>(num_epoch);
auto cov_yz = std::vector<double>(num_epoch);
auto cov_zx = std::vector<double>(num_epoch);
auto latitude = std::vector<double>(num_epoch);
auto longitude = std::vector<double>(num_epoch);
auto height = std::vector<double>(num_epoch);
auto valid_sats = std::vector<uint8_t>(num_epoch);
auto solution_status = std::vector<uint8_t>(num_epoch);
auto solution_type = std::vector<uint8_t>(num_epoch);
auto AR_ratio_factor = std::vector<float>(num_epoch);
auto AR_ratio_threshold = std::vector<float>(num_epoch);
auto gdop = std::vector<double>(num_epoch);
auto pdop = std::vector<double>(num_epoch);
auto hdop = std::vector<double>(num_epoch);
auto vdop = std::vector<double>(num_epoch);
try
{
@ -208,35 +262,6 @@ bool rtklib_solver::save_matfile()
catch (const std::ifstream::failure &e)
{
std::cerr << "Problem reading dump file:" << e.what() << std::endl;
delete[] TOW_at_current_symbol_ms;
delete[] week;
delete[] RX_time;
delete[] user_clk_offset;
delete[] pos_x;
delete[] pos_y;
delete[] pos_z;
delete[] vel_x;
delete[] vel_y;
delete[] vel_z;
delete[] cov_xx;
delete[] cov_yy;
delete[] cov_zz;
delete[] cov_xy;
delete[] cov_yz;
delete[] cov_zx;
delete[] latitude;
delete[] longitude;
delete[] height;
delete[] valid_sats;
delete[] solution_status;
delete[] solution_type;
delete[] AR_ratio_factor;
delete[] AR_ratio_threshold;
delete[] gdop;
delete[] pdop;
delete[] hdop;
delete[] vdop;
return false;
}
@ -249,204 +274,164 @@ bool rtklib_solver::save_matfile()
matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73);
if (reinterpret_cast<int64_t *>(matfp) != nullptr)
{
size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
matvar = Mat_VarCreate("TOW_at_current_symbol_ms", MAT_C_UINT32, MAT_T_UINT32, 2, dims, TOW_at_current_symbol_ms, 0);
std::array<size_t, 2> dims{1, static_cast<size_t>(num_epoch)};
matvar = Mat_VarCreate("TOW_at_current_symbol_ms", MAT_C_UINT32, MAT_T_UINT32, 2, dims.data(), TOW_at_current_symbol_ms.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("week", MAT_C_UINT32, MAT_T_UINT32, 2, dims, week, 0);
matvar = Mat_VarCreate("week", MAT_C_UINT32, MAT_T_UINT32, 2, dims.data(), week.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("RX_time", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, RX_time, 0);
matvar = Mat_VarCreate("RX_time", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), RX_time.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("user_clk_offset", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, user_clk_offset, 0);
matvar = Mat_VarCreate("user_clk_offset", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), user_clk_offset.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("pos_x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, pos_x, 0);
matvar = Mat_VarCreate("pos_x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), pos_x.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("pos_y", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, pos_y, 0);
matvar = Mat_VarCreate("pos_y", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), pos_y.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("pos_z", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, pos_z, 0);
matvar = Mat_VarCreate("pos_z", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), pos_z.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("vel_x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, vel_x, 0);
matvar = Mat_VarCreate("vel_x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), vel_x.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("vel_y", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, vel_y, 0);
matvar = Mat_VarCreate("vel_y", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), vel_y.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("vel_z", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, vel_z, 0);
matvar = Mat_VarCreate("vel_z", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), vel_z.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("cov_xx", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, cov_xx, 0);
matvar = Mat_VarCreate("cov_xx", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), cov_xx.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("cov_yy", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, cov_yy, 0);
matvar = Mat_VarCreate("cov_yy", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), cov_yy.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("cov_zz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, cov_zz, 0);
matvar = Mat_VarCreate("cov_zz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), cov_zz.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("cov_xy", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, cov_xy, 0);
matvar = Mat_VarCreate("cov_xy", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), cov_xy.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("cov_yz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, cov_yz, 0);
matvar = Mat_VarCreate("cov_yz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), cov_yz.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("cov_zx", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, cov_zx, 0);
matvar = Mat_VarCreate("cov_zx", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), cov_zx.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("latitude", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, latitude, 0);
matvar = Mat_VarCreate("latitude", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), latitude.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("longitude", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, longitude, 0);
matvar = Mat_VarCreate("longitude", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), longitude.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("height", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, height, 0);
matvar = Mat_VarCreate("height", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), height.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("valid_sats", MAT_C_UINT8, MAT_T_UINT8, 2, dims, valid_sats, 0);
matvar = Mat_VarCreate("valid_sats", MAT_C_UINT8, MAT_T_UINT8, 2, dims.data(), valid_sats.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("solution_status", MAT_C_UINT8, MAT_T_UINT8, 2, dims, solution_status, 0);
matvar = Mat_VarCreate("solution_status", MAT_C_UINT8, MAT_T_UINT8, 2, dims.data(), solution_status.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("solution_type", MAT_C_UINT8, MAT_T_UINT8, 2, dims, solution_type, 0);
matvar = Mat_VarCreate("solution_type", MAT_C_UINT8, MAT_T_UINT8, 2, dims.data(), solution_type.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("AR_ratio_factor", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, AR_ratio_factor, 0);
matvar = Mat_VarCreate("AR_ratio_factor", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims.data(), AR_ratio_factor.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("AR_ratio_threshold", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, AR_ratio_threshold, 0);
matvar = Mat_VarCreate("AR_ratio_threshold", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims.data(), AR_ratio_threshold.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("gdop", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, gdop, 0);
matvar = Mat_VarCreate("gdop", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), gdop.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("pdop", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, pdop, 0);
matvar = Mat_VarCreate("pdop", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), pdop.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("hdop", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, hdop, 0);
matvar = Mat_VarCreate("hdop", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), hdop.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
matvar = Mat_VarCreate("vdop", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, vdop, 0);
matvar = Mat_VarCreate("vdop", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), vdop.data(), 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
}
Mat_Close(matfp);
delete[] TOW_at_current_symbol_ms;
delete[] week;
delete[] RX_time;
delete[] user_clk_offset;
delete[] pos_x;
delete[] pos_y;
delete[] pos_z;
delete[] vel_x;
delete[] vel_y;
delete[] vel_z;
delete[] cov_xx;
delete[] cov_yy;
delete[] cov_zz;
delete[] cov_xy;
delete[] cov_yz;
delete[] cov_zx;
delete[] latitude;
delete[] longitude;
delete[] height;
delete[] valid_sats;
delete[] solution_status;
delete[] solution_type;
delete[] AR_ratio_factor;
delete[] AR_ratio_threshold;
delete[] gdop;
delete[] pdop;
delete[] hdop;
delete[] vdop;
return true;
}
rtklib_solver::~rtklib_solver()
{
if (d_dump_file.is_open() == true)
{
try
{
d_dump_file.close();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Exception in destructor closing the RTKLIB dump file " << ex.what();
}
}
if (d_flag_dump_mat_enabled)
{
save_matfile();
}
}
double rtklib_solver::get_gdop() const
double Rtklib_Solver::get_gdop() const
{
return dop_[0];
}
double rtklib_solver::get_pdop() const
double Rtklib_Solver::get_pdop() const
{
return dop_[1];
}
double rtklib_solver::get_hdop() const
double Rtklib_Solver::get_hdop() const
{
return dop_[2];
}
double rtklib_solver::get_vdop() const
double Rtklib_Solver::get_vdop() const
{
return dop_[3];
}
bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_map, bool flag_averaging)
Monitor_Pvt Rtklib_Solver::get_monitor_pvt() const
{
return monitor_pvt;
}
bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_map, bool flag_averaging)
{
std::map<int, Gnss_Synchro>::const_iterator gnss_observables_iter;
std::map<int, Galileo_Ephemeris>::const_iterator galileo_ephemeris_iter;
std::map<int, Gps_Ephemeris>::const_iterator gps_ephemeris_iter;
std::map<int, Gps_CNAV_Ephemeris>::const_iterator gps_cnav_ephemeris_iter;
std::map<int, Glonass_Gnav_Ephemeris>::const_iterator glonass_gnav_ephemeris_iter;
std::map<int, Beidou_Dnav_Ephemeris>::const_iterator beidou_ephemeris_iter;
const Glonass_Gnav_Utc_Model gnav_utc = this->glonass_gnav_utc_model;
this->set_averaging_flag(flag_averaging);
@ -457,9 +442,9 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
int valid_obs = 0; // valid observations counter
int glo_valid_obs = 0; // GLONASS L1/L2 valid observations counter
obsd_t obs_data[MAXOBS];
eph_t eph_data[MAXOBS];
geph_t geph_data[MAXOBS];
obs_data.fill({});
std::vector<eph_t> eph_data(MAXOBS);
std::vector<geph_t> geph_data(MAXOBS);
// Workaround for NAV/CNAV clash problem
bool gps_dual_band = false;
@ -489,7 +474,10 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
}
}
}
if (band1 == true and band2 == true) gps_dual_band = true;
if (band1 == true and band2 == true)
{
gps_dual_band = true;
}
for (gnss_observables_iter = gnss_observables_map.cbegin();
gnss_observables_iter != gnss_observables_map.cend();
@ -730,7 +718,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
obs_data[i + valid_obs] = insert_obs_to_rtklib(obs_data[i + valid_obs],
gnss_observables_iter->second,
glonass_gnav_ephemeris_iter->second.d_WN,
1); //Band 1 (L2)
1); // Band 1 (L2)
found_L1_obs = true;
break;
}
@ -756,6 +744,75 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
}
break;
}
case 'C':
{
// BEIDOU B1I
// - find the ephemeris for the current BEIDOU SV observation. The SV PRN ID is the map key
std::string sig_(gnss_observables_iter->second.Signal);
if (sig_ == "B1")
{
beidou_ephemeris_iter = beidou_dnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (beidou_ephemeris_iter != beidou_dnav_ephemeris_map.cend())
{
// convert ephemeris from GNSS-SDR class to RTKLIB structure
eph_data[valid_obs] = eph_to_rtklib(beidou_ephemeris_iter->second);
// convert observation from GNSS-SDR class to RTKLIB structure
obsd_t newobs = {{0, 0}, '0', '0', {}, {}, {}, {}, {}, {}};
obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
gnss_observables_iter->second,
beidou_ephemeris_iter->second.i_BEIDOU_week + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET,
0);
valid_obs++;
}
else // the ephemeris are not available for this SV
{
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->first;
}
}
// BeiDou B3
if (sig_ == "B3")
{
beidou_ephemeris_iter = beidou_dnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (beidou_ephemeris_iter != beidou_dnav_ephemeris_map.cend())
{
bool found_B1I_obs = false;
for (int i = 0; i < valid_obs; i++)
{
if (eph_data[i].sat == (static_cast<int>(gnss_observables_iter->second.PRN + NSATGPS + NSATGLO + NSATGAL + NSATQZS)))
{
obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(obs_data[i + glo_valid_obs],
gnss_observables_iter->second,
beidou_ephemeris_iter->second.i_BEIDOU_week + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET,
2); // Band 3 (L2/G2/B3)
found_B1I_obs = true;
break;
}
}
if (!found_B1I_obs)
{
// insert BeiDou B3I obs as new obs and also insert its ephemeris
// convert ephemeris from GNSS-SDR class to RTKLIB structure
eph_data[valid_obs] = eph_to_rtklib(beidou_ephemeris_iter->second);
// convert observation from GNSS-SDR class to RTKLIB structure
auto default_code_ = static_cast<unsigned char>(CODE_NONE);
obsd_t newobs = {{0, 0}, '0', '0', {}, {},
{default_code_, default_code_, default_code_},
{}, {0.0, 0.0, 0.0}, {}};
obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
gnss_observables_iter->second,
beidou_ephemeris_iter->second.i_BEIDOU_week + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET,
2); // Band 2 (L2/G2)
valid_obs++;
}
}
else // the ephemeris are not available for this SV
{
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
}
}
break;
}
default:
DLOG(INFO) << "Hybrid observables: Unknown GNSS";
break;
@ -770,20 +827,101 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
if ((valid_obs + glo_valid_obs) > 3)
{
int result = 0;
nav_t nav_data;
nav_data.eph = eph_data;
nav_data.geph = geph_data;
nav_t nav_data{};
nav_data.eph = eph_data.data();
nav_data.geph = geph_data.data();
nav_data.n = valid_obs;
nav_data.ng = glo_valid_obs;
for (auto &i : nav_data.lam)
if (gps_iono.valid)
{
i[0] = SPEED_OF_LIGHT / FREQ1; // L1/E1
i[1] = SPEED_OF_LIGHT / FREQ2; // L2
i[2] = SPEED_OF_LIGHT / FREQ5; // L5/E5
nav_data.ion_gps[0] = gps_iono.d_alpha0;
nav_data.ion_gps[1] = gps_iono.d_alpha1;
nav_data.ion_gps[2] = gps_iono.d_alpha2;
nav_data.ion_gps[3] = gps_iono.d_alpha3;
nav_data.ion_gps[4] = gps_iono.d_beta0;
nav_data.ion_gps[5] = gps_iono.d_beta1;
nav_data.ion_gps[6] = gps_iono.d_beta2;
nav_data.ion_gps[7] = gps_iono.d_beta3;
}
if (!(gps_iono.valid) and gps_cnav_iono.valid)
{
nav_data.ion_gps[0] = gps_cnav_iono.d_alpha0;
nav_data.ion_gps[1] = gps_cnav_iono.d_alpha1;
nav_data.ion_gps[2] = gps_cnav_iono.d_alpha2;
nav_data.ion_gps[3] = gps_cnav_iono.d_alpha3;
nav_data.ion_gps[4] = gps_cnav_iono.d_beta0;
nav_data.ion_gps[5] = gps_cnav_iono.d_beta1;
nav_data.ion_gps[6] = gps_cnav_iono.d_beta2;
nav_data.ion_gps[7] = gps_cnav_iono.d_beta3;
}
if (galileo_iono.ai0_5 != 0.0)
{
nav_data.ion_gal[0] = galileo_iono.ai0_5;
nav_data.ion_gal[1] = galileo_iono.ai1_5;
nav_data.ion_gal[2] = galileo_iono.ai2_5;
nav_data.ion_gal[3] = 0.0;
}
if (beidou_dnav_iono.valid)
{
nav_data.ion_cmp[0] = beidou_dnav_iono.d_alpha0;
nav_data.ion_cmp[1] = beidou_dnav_iono.d_alpha1;
nav_data.ion_cmp[2] = beidou_dnav_iono.d_alpha2;
nav_data.ion_cmp[3] = beidou_dnav_iono.d_alpha3;
nav_data.ion_cmp[4] = beidou_dnav_iono.d_beta0;
nav_data.ion_cmp[5] = beidou_dnav_iono.d_beta0;
nav_data.ion_cmp[6] = beidou_dnav_iono.d_beta0;
nav_data.ion_cmp[7] = beidou_dnav_iono.d_beta3;
}
if (gps_utc_model.valid)
{
nav_data.utc_gps[0] = gps_utc_model.d_A0;
nav_data.utc_gps[1] = gps_utc_model.d_A1;
nav_data.utc_gps[2] = gps_utc_model.d_t_OT;
nav_data.utc_gps[3] = gps_utc_model.i_WN_T;
nav_data.leaps = gps_utc_model.d_DeltaT_LS;
}
if (!(gps_utc_model.valid) and gps_cnav_utc_model.valid)
{
nav_data.utc_gps[0] = gps_cnav_utc_model.d_A0;
nav_data.utc_gps[1] = gps_cnav_utc_model.d_A1;
nav_data.utc_gps[2] = gps_cnav_utc_model.d_t_OT;
nav_data.utc_gps[3] = gps_cnav_utc_model.i_WN_T;
nav_data.leaps = gps_cnav_utc_model.d_DeltaT_LS;
}
if (glonass_gnav_utc_model.valid)
{
nav_data.utc_glo[0] = glonass_gnav_utc_model.d_tau_c; // ??
nav_data.utc_glo[1] = 0.0; // ??
nav_data.utc_glo[2] = 0.0; // ??
nav_data.utc_glo[3] = 0.0; // ??
}
if (galileo_utc_model.A0_6 != 0.0)
{
nav_data.utc_gal[0] = galileo_utc_model.A0_6;
nav_data.utc_gal[1] = galileo_utc_model.A1_6;
nav_data.utc_gal[2] = galileo_utc_model.t0t_6;
nav_data.utc_gal[3] = galileo_utc_model.WNot_6;
nav_data.leaps = galileo_utc_model.Delta_tLS_6;
}
if (beidou_dnav_utc_model.valid)
{
nav_data.utc_cmp[0] = beidou_dnav_utc_model.d_A0_UTC;
nav_data.utc_cmp[1] = beidou_dnav_utc_model.d_A1_UTC;
nav_data.utc_cmp[2] = 0.0; // ??
nav_data.utc_cmp[3] = 0.0; // ??
nav_data.leaps = beidou_dnav_utc_model.d_DeltaT_LS;
}
result = rtkpos(&rtk_, obs_data, valid_obs + glo_valid_obs, &nav_data);
/* update carrier wave length using native function call in RTKlib */
for (int i = 0; i < MAXSAT; i++)
{
for (int j = 0; j < NFREQ; j++)
{
nav_data.lam[i][j] = satwavelen(i + 1, j, &nav_data);
}
}
result = rtkpos(&rtk_, obs_data.data(), valid_obs + glo_valid_obs, &nav_data);
if (result == 0)
{
@ -820,54 +958,61 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
}
}
if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_.data());
if (index_aux > 0)
{
dops(index_aux, azel.data(), 0.0, dop_.data());
}
this->set_valid_position(true);
arma::vec rx_position_and_time(4);
rx_position_and_time(0) = pvt_sol.rr[0]; // [m]
rx_position_and_time(1) = pvt_sol.rr[1]; // [m]
rx_position_and_time(2) = pvt_sol.rr[2]; // [m]
//todo: fix this ambiguity in the RTKLIB units in receiver clock offset!
if (rtk_.opt.mode == PMODE_SINGLE)
{
rx_position_and_time(3) = pvt_sol.dtr[0]; // if the RTKLIB solver is set to SINGLE, the dtr is already expressed in [s]
// if the RTKLIB solver is set to SINGLE, the dtr is already expressed in [s]
// add also the clock offset from gps to galileo (pvt_sol.dtr[2])
rx_position_and_time(3) = pvt_sol.dtr[0] + pvt_sol.dtr[2];
}
else
{
rx_position_and_time(3) = pvt_sol.dtr[0] / GPS_C_m_s; // the receiver clock offset is expressed in [meters], so we convert it into [s]
// the receiver clock offset is expressed in [meters], so we convert it into [s]
// add also the clock offset from gps to galileo (pvt_sol.dtr[2])
rx_position_and_time(3) = pvt_sol.dtr[2] + pvt_sol.dtr[0] / GPS_C_M_S;
}
this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration
//compute Ground speed and COG
// compute Ground speed and COG
double ground_speed_ms = 0.0;
double pos[3];
double enuv[3];
ecef2pos(pvt_sol.rr, pos);
ecef2enu(pos, &pvt_sol.rr[3], enuv);
this->set_speed_over_ground(norm_rtk(enuv, 2));
std::array<double, 3> pos{};
std::array<double, 3> enuv{};
ecef2pos(pvt_sol.rr, pos.data());
ecef2enu(pos.data(), &pvt_sol.rr[3], enuv.data());
this->set_speed_over_ground(norm_rtk(enuv.data(), 2));
double new_cog;
if (ground_speed_ms >= 1.0)
{
new_cog = atan2(enuv[0], enuv[1]) * R2D;
if (new_cog < 0.0) new_cog += 360.0;
if (new_cog < 0.0)
{
new_cog += 360.0;
}
this->set_course_over_ground(new_cog);
}
//observable fix:
//double offset_s = this->get_time_offset_s();
//this->set_time_offset_s(offset_s + (rx_position_and_time(3) / GPS_C_m_s)); // accumulate the rx time error for the next iteration [meters]->[seconds]
this->set_time_offset_s(rx_position_and_time(3));
DLOG(INFO) << "RTKLIB Position at RX TOW = " << gnss_observables_map.begin()->second.RX_time
<< " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time;
boost::posix_time::ptime p_time;
// gtime_t rtklib_utc_time = gpst2utc(pvt_sol.time); //Corrected RX Time (Non integer multiply of 1 ms of granularity)
// gtime_t rtklib_utc_time = gpst2utc(pvt_sol.time); // Corrected RX Time (Non integer multiply of 1 ms of granularity)
// Uncorrected RX Time (integer multiply of 1 ms and the same observables time reported in RTCM and RINEX)
gtime_t rtklib_time = gpst2time(adjgpsweek(nav_data.eph[0].week), gnss_observables_map.begin()->second.RX_time);
gtime_t rtklib_time = timeadd(pvt_sol.time, rx_position_and_time(3)); // uncorrected rx time
gtime_t rtklib_utc_time = gpst2utc(rtklib_time);
p_time = boost::posix_time::from_time_t(rtklib_utc_time.time);
p_time += boost::posix_time::microseconds(static_cast<long>(round(rtklib_utc_time.sec * 1e6))); // NOLINT(google-runtime-int)
this->set_position_UTC_time(p_time);
cart2geo(static_cast<double>(rx_position_and_time(0)), static_cast<double>(rx_position_and_time(1)), static_cast<double>(rx_position_and_time(2)), 4);
@ -876,6 +1021,56 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
<< " [deg], Height= " << this->get_height() << " [m]"
<< " RX time offset= " << this->get_time_offset_s() << " [s]";
// ######## PVT MONITOR #########
// TOW
monitor_pvt.TOW_at_current_symbol_ms = gnss_observables_map.begin()->second.TOW_at_current_symbol_ms;
// WEEK
monitor_pvt.week = adjgpsweek(nav_data.eph[0].week);
// PVT GPS time
monitor_pvt.RX_time = gnss_observables_map.begin()->second.RX_time;
// User clock offset [s]
monitor_pvt.user_clk_offset = rx_position_and_time(3);
// ECEF POS X,Y,X [m] + ECEF VEL X,Y,X [m/s] (6 x double)
monitor_pvt.pos_x = pvt_sol.rr[0];
monitor_pvt.pos_y = pvt_sol.rr[1];
monitor_pvt.pos_z = pvt_sol.rr[2];
monitor_pvt.vel_x = pvt_sol.rr[3];
monitor_pvt.vel_y = pvt_sol.rr[4];
monitor_pvt.vel_z = pvt_sol.rr[5];
// position variance/covariance (m^2) {c_xx,c_yy,c_zz,c_xy,c_yz,c_zx} (6 x double)
monitor_pvt.cov_xx = pvt_sol.qr[0];
monitor_pvt.cov_yy = pvt_sol.qr[1];
monitor_pvt.cov_zz = pvt_sol.qr[2];
monitor_pvt.cov_xy = pvt_sol.qr[3];
monitor_pvt.cov_yz = pvt_sol.qr[4];
monitor_pvt.cov_zx = pvt_sol.qr[5];
// GEO user position Latitude [deg]
monitor_pvt.latitude = get_latitude();
// GEO user position Longitude [deg]
monitor_pvt.longitude = get_longitude();
// GEO user position Height [m]
monitor_pvt.height = get_height();
// NUMBER OF VALID SATS
monitor_pvt.valid_sats = pvt_sol.ns;
// RTKLIB solution status
monitor_pvt.solution_status = pvt_sol.stat;
// RTKLIB solution type (0:xyz-ecef,1:enu-baseline)
monitor_pvt.solution_type = pvt_sol.type;
// AR ratio factor for validation
monitor_pvt.AR_ratio_factor = pvt_sol.ratio;
// AR ratio threshold for validation
monitor_pvt.AR_ratio_threshold = pvt_sol.thres;
// GDOP / PDOP/ HDOP/ VDOP
monitor_pvt.gdop = dop_[0];
monitor_pvt.pdop = dop_[1];
monitor_pvt.hdop = dop_[2];
monitor_pvt.vdop = dop_[3];
// ######## LOG FILE #########
if (d_flag_dump_enabled == true)
{

View File

@ -22,8 +22,8 @@
*
* -------------------------------------------------------------------------
* Copyright (C) 2007-2013, T. Takasu
* Copyright (C) 2017, Javier Arribas
* Copyright (C) 2017, Carles Fernandez
* Copyright (C) 2017-2019, Javier Arribas
* Copyright (C) 2017-2019, Carles Fernandez
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -55,14 +55,28 @@
#define GNSS_SDR_RTKLIB_SOLVER_H_
#include "beidou_dnav_almanac.h"
#include "beidou_dnav_ephemeris.h"
#include "beidou_dnav_iono.h"
#include "beidou_dnav_utc_model.h"
#include "galileo_almanac.h"
#include "galileo_navigation_message.h"
#include "glonass_gnav_navigation_message.h"
#include "galileo_ephemeris.h"
#include "galileo_iono.h"
#include "galileo_utc_model.h"
#include "glonass_gnav_almanac.h"
#include "glonass_gnav_ephemeris.h"
#include "glonass_gnav_utc_model.h"
#include "gnss_synchro.h"
#include "gps_cnav_navigation_message.h"
#include "gps_navigation_message.h"
#include "gps_almanac.h"
#include "gps_cnav_ephemeris.h"
#include "gps_cnav_iono.h"
#include "gps_cnav_utc_model.h"
#include "gps_ephemeris.h"
#include "gps_iono.h"
#include "gps_utc_model.h"
#include "monitor_pvt.h"
#include "pvt_solution.h"
#include "rtklib_rtkpos.h"
#include "rtklib.h"
#include <array>
#include <fstream>
#include <map>
@ -70,37 +84,29 @@
/*!
* \brief This class implements a simple PVT Least Squares solution
* \brief This class implements a PVT solution based on RTKLIB
*/
class rtklib_solver : public Pvt_Solution
class Rtklib_Solver : public Pvt_Solution
{
private:
rtk_t rtk_;
std::string d_dump_filename;
std::ofstream d_dump_file;
bool save_matfile();
bool d_flag_dump_enabled;
bool d_flag_dump_mat_enabled;
int d_nchannels; // Number of available channels for positioning
std::array<double, 4> dop_;
public:
sol_t pvt_sol;
ssat_t pvt_ssat[MAXSAT];
rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t& rtk);
~rtklib_solver();
Rtklib_Solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t& rtk);
~Rtklib_Solver();
bool get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_map, bool flag_averaging);
sol_t pvt_sol{};
std::array<ssat_t, MAXSAT> pvt_ssat{};
double get_hdop() const;
double get_vdop() const;
double get_pdop() const;
double get_gdop() const;
Monitor_Pvt get_monitor_pvt() const;
std::map<int, Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris
std::map<int, Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris
std::map<int, Gps_CNAV_Ephemeris> gps_cnav_ephemeris_map; //!< Map storing new GPS_CNAV_Ephemeris
std::map<int, Glonass_Gnav_Ephemeris> glonass_gnav_ephemeris_map; //!< Map storing new GLONASS GNAV Ephemeris
std::map<int, Beidou_Dnav_Ephemeris> beidou_dnav_ephemeris_map; //!< Map storing new BeiDou DNAV Ephmeris
Galileo_Utc_Model galileo_utc_model;
Galileo_Iono galileo_iono;
@ -116,7 +122,21 @@ public:
Glonass_Gnav_Utc_Model glonass_gnav_utc_model; //!< Map storing GLONASS GNAV UTC Model
Glonass_Gnav_Almanac glonass_gnav_almanac; //!< Map storing GLONASS GNAV Almanac Model
int count_valid_position;
Beidou_Dnav_Utc_Model beidou_dnav_utc_model;
Beidou_Dnav_Iono beidou_dnav_iono;
std::map<int, Beidou_Dnav_Almanac> beidou_dnav_almanac_map;
private:
rtk_t rtk_{};
Monitor_Pvt monitor_pvt{};
std::array<obsd_t, MAXOBS> obs_data{};
std::array<double, 4> dop_{};
std::string d_dump_filename;
std::ofstream d_dump_file;
int d_nchannels; // Number of available channels for positioning
bool d_flag_dump_enabled;
bool d_flag_dump_mat_enabled;
bool save_matfile();
};
#endif

View File

@ -0,0 +1,162 @@
/*!
* \file serdes_monitor_pvt.h
* \brief Serialization / Deserialization of Monitor_Pvt objects using
* Protocol Buffers
* \author Carles Fernandez-Prades, 2019. cfernandez(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_SERDES_MONITOR_PVT_H_
#define GNSS_SDR_SERDES_MONITOR_PVT_H_
#include "monitor_pvt.h"
#include "monitor_pvt.pb.h" // file created by Protocol Buffers at compile time
#include <memory>
/*!
* \brief This class implements serialization and deserialization of
* Monitor_Pvt objects using Protocol Buffers.
*/
class Serdes_Monitor_Pvt
{
public:
Serdes_Monitor_Pvt()
{
// Verify that the version of the library that we linked against is
// compatible with the version of the headers we compiled against.
GOOGLE_PROTOBUF_VERIFY_VERSION;
}
~Serdes_Monitor_Pvt()
{
// google::protobuf::ShutdownProtobufLibrary();
}
inline Serdes_Monitor_Pvt(Serdes_Monitor_Pvt&& other) //!< Copy constructor
{
this->monitor_ = other.monitor_;
}
inline Serdes_Monitor_Pvt& operator=(const Serdes_Monitor_Pvt& rhs) //!< Copy assignment operator
{
this->monitor_ = rhs.monitor_;
return *this;
}
inline Serdes_Monitor_Pvt(const Serdes_Monitor_Pvt& other) //!< Move constructor
{
this->monitor_ = std::move(other.monitor_);
}
inline Serdes_Monitor_Pvt& operator=(Serdes_Monitor_Pvt&& other) //!< Move assignment operator
{
if (this != &other)
{
this->monitor_ = std::move(other.monitor_);
}
return *this;
}
inline std::string createProtobuffer(std::shared_ptr<Monitor_Pvt> monitor) //!< Serialization into a string
{
monitor_.Clear();
std::string data;
monitor_.set_tow_at_current_symbol_ms(monitor->TOW_at_current_symbol_ms);
monitor_.set_week(monitor->week);
monitor_.set_rx_time(monitor->RX_time);
monitor_.set_user_clk_offset(monitor->user_clk_offset);
monitor_.set_pos_x(monitor->pos_x);
monitor_.set_pos_y(monitor->pos_y);
monitor_.set_pos_z(monitor->pos_z);
monitor_.set_vel_x(monitor->vel_x);
monitor_.set_vel_y(monitor->vel_y);
monitor_.set_vel_z(monitor->vel_z);
monitor_.set_cov_xx(monitor->cov_xx);
monitor_.set_cov_yy(monitor->cov_yy);
monitor_.set_cov_zz(monitor->cov_zz);
monitor_.set_cov_xy(monitor->cov_xy);
monitor_.set_cov_yz(monitor->cov_yz);
monitor_.set_cov_zx(monitor->cov_zx);
monitor_.set_latitude(monitor->latitude);
monitor_.set_longitude(monitor->longitude);
monitor_.set_height(monitor->height);
monitor_.set_valid_sats(monitor->valid_sats);
monitor_.set_solution_status(monitor->solution_status);
monitor_.set_solution_type(monitor->solution_type);
monitor_.set_ar_ratio_factor(monitor->AR_ratio_factor);
monitor_.set_ar_ratio_threshold(monitor->AR_ratio_threshold);
monitor_.set_gdop(monitor->gdop);
monitor_.set_pdop(monitor->pdop);
monitor_.set_hdop(monitor->hdop);
monitor_.set_vdop(monitor->vdop);
monitor_.SerializeToString(&data);
return data;
}
inline Monitor_Pvt readProtobuffer(const gnss_sdr::MonitorPvt& mon) //!< Deserialization
{
Monitor_Pvt monitor;
monitor.TOW_at_current_symbol_ms = mon.tow_at_current_symbol_ms();
monitor.week = mon.week();
monitor.RX_time = mon.rx_time();
monitor.user_clk_offset = mon.user_clk_offset();
monitor.pos_x = mon.pos_x();
monitor.pos_y = mon.pos_y();
monitor.pos_z = mon.pos_z();
monitor.vel_x = mon.vel_x();
monitor.vel_y = mon.vel_y();
monitor.vel_z = mon.vel_z();
monitor.cov_xx = mon.cov_xx();
monitor.cov_yy = mon.cov_yy();
monitor.cov_zz = mon.cov_zz();
monitor.cov_xy = mon.cov_xy();
monitor.cov_yz = mon.cov_yz();
monitor.cov_zx = mon.cov_zx();
monitor.latitude = mon.latitude();
monitor.longitude = mon.longitude();
monitor.height = mon.height();
monitor.valid_sats = static_cast<uint8_t>(mon.valid_sats());
monitor.solution_status = static_cast<uint8_t>(mon.solution_status());
monitor.solution_type = static_cast<uint8_t>(mon.solution_type());
monitor.AR_ratio_factor = mon.ar_ratio_factor();
monitor.AR_ratio_threshold = mon.ar_ratio_threshold();
monitor.gdop = mon.gdop();
monitor.pdop = mon.pdop();
monitor.hdop = mon.hdop();
monitor.vdop = mon.vdop();
return monitor;
}
private:
gnss_sdr::MonitorPvt monitor_{};
};
#endif // GNSS_SDR_SERDES_MONITOR_PVT_H_

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -34,6 +34,8 @@ set(ACQ_ADAPTER_SOURCES
galileo_e5a_pcps_acquisition.cc
glonass_l1_ca_pcps_acquisition.cc
glonass_l2_ca_pcps_acquisition.cc
beidou_b1i_pcps_acquisition.cc
beidou_b3i_pcps_acquisition.cc
)
set(ACQ_ADAPTER_HEADERS
@ -53,6 +55,8 @@ set(ACQ_ADAPTER_HEADERS
galileo_e5a_pcps_acquisition.h
glonass_l1_ca_pcps_acquisition.h
glonass_l2_ca_pcps_acquisition.h
beidou_b1i_pcps_acquisition.h
beidou_b3i_pcps_acquisition.h
)
if(ENABLE_FPGA)
@ -72,7 +76,7 @@ if(ENABLE_FPGA)
)
endif()
if(OPENCL_FOUND)
if(ENABLE_OPENCL)
set(ACQ_ADAPTER_SOURCES
${ACQ_ADAPTER_SOURCES}
gps_l1_ca_pcps_opencl_acquisition.cc
@ -82,33 +86,46 @@ if(OPENCL_FOUND)
)
endif()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/core/system_parameters
${CMAKE_SOURCE_DIR}/src/core/interfaces
${CMAKE_SOURCE_DIR}/src/core/receiver
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs
${CMAKE_SOURCE_DIR}/src/algorithms/libs
${Boost_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS}
${ARMADILLO_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
${GNURADIO_BLOCKS_INCLUDE_DIRS}
${VOLK_GNSSSDR_INCLUDE_DIRS}
)
list(SORT ACQ_ADAPTER_HEADERS)
list(SORT ACQ_ADAPTER_SOURCES)
add_library(acq_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS})
source_group(Headers FILES ${ACQ_ADAPTER_HEADERS})
target_link_libraries(acq_adapters
acquisition_lib
gnss_sp_libs
gnss_sdr_flags
acq_gr_blocks
${Boost_LIBRARIES}
${GNURADIO_RUNTIME_LIBRARIES}
${GNURADIO_BLOCKS_LIBRARIES}
add_library(acquisition_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS})
target_link_libraries(acquisition_adapters
PUBLIC
algorithms_libs
gnss_sdr_flags
acquisition_gr_blocks
acquisition_libs
channel_libs
core_system_parameters
Gnuradio::blocks
Volk::volk
PRIVATE
Boost::boost
Gflags::gflags
Glog::glog
Gnuradio::fft
Volkgnsssdr::volkgnsssdr
)
target_include_directories(acquisition_adapters
PUBLIC
${CMAKE_SOURCE_DIR}/src/core/interfaces
)
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(acquisition_adapters
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
set_property(TARGET acquisition_adapters
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

View File

@ -0,0 +1,324 @@
/*!
* \file beidou_b1i_pcps_acquisition.cc
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for
* BeiDou B1I signals
* \authors <ul>
* <li> Sergi Segura, 2018. sergi.segura.munoz(at)gmail.com
* </ul>
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#include "beidou_b1i_pcps_acquisition.h"
#include "Beidou_B1I.h"
#include "acq_conf.h"
#include "beidou_b1i_signal_processing.h"
#include "configuration_interface.h"
#include "gnss_sdr_flags.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
#include <algorithm>
#include <memory>
BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition(
ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams)
{
configuration_ = configuration;
std::string default_item_type = "gr_complex";
std::string default_dump_filename = "./acquisition.mat";
LOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
acq_parameters_.fs_in = fs_in_;
dump_ = configuration_->property(role + ".dump", false);
acq_parameters_.dump = dump_;
acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0);
blocking_ = configuration_->property(role + ".blocking", true);
acq_parameters_.blocking = blocking_;
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
acq_parameters_.doppler_max = doppler_max_;
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
acq_parameters_.bit_transition_flag = bit_transition_flag_;
use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions
acq_parameters_.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_;
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
acq_parameters_.max_dwells = max_dwells_;
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
acq_parameters_.dump_filename = dump_filename_;
acq_parameters_.sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1);
if (item_type_ == "cshort")
{
item_size_ = sizeof(lv_16sc_t);
}
else
{
item_size_ = sizeof(gr_complex);
}
acq_parameters_.ms_per_code = 1;
acq_parameters_.it_size = item_size_;
num_codes_ = acq_parameters_.sampled_ms;
acq_parameters_.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4);
acq_parameters_.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0);
acq_parameters_.make_2_steps = configuration_->property(role + ".make_two_steps", false);
acq_parameters_.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false);
acq_parameters_.use_automatic_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false);
acq_parameters_.resampled_fs = fs_in_;
//--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (BEIDOU_B1I_CODE_RATE_HZ / BEIDOU_B1I_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / BEIDOU_B1I_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(BEIDOU_B1I_CODE_PERIOD * 1000.0);
vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1);
code_ = std::vector<std::complex<float>>(vector_length_);
acquisition_ = pcps_make_acquisition(acq_parameters_);
DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")";
if (item_type_ == "cbyte")
{
cbyte_to_float_x2_ = make_complex_byte_to_float_x2();
float_to_complex_ = gr::blocks::float_to_complex::make();
}
channel_ = 0;
threshold_ = 0.0;
doppler_step_ = 0;
gnss_synchro_ = nullptr;
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
}
if (out_streams_ > 0)
{
LOG(ERROR) << "This implementation does not provide an output stream";
}
}
void BeidouB1iPcpsAcquisition::stop_acquisition()
{
}
void BeidouB1iPcpsAcquisition::set_threshold(float threshold)
{
float pfa = configuration_->property(role_ + ".pfa", 0.0);
if (pfa == 0.0)
{
threshold_ = threshold;
}
else
{
threshold_ = calculate_threshold(pfa);
}
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
acquisition_->set_threshold(threshold_);
}
void BeidouB1iPcpsAcquisition::set_doppler_max(uint32_t doppler_max)
{
doppler_max_ = doppler_max;
acquisition_->set_doppler_max(doppler_max_);
}
void BeidouB1iPcpsAcquisition::set_doppler_step(uint32_t doppler_step)
{
doppler_step_ = doppler_step;
acquisition_->set_doppler_step(doppler_step_);
}
void BeidouB1iPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{
gnss_synchro_ = gnss_synchro;
acquisition_->set_gnss_synchro(gnss_synchro_);
}
signed int BeidouB1iPcpsAcquisition::mag()
{
return acquisition_->mag();
}
void BeidouB1iPcpsAcquisition::init()
{
acquisition_->init();
set_local_code();
}
void BeidouB1iPcpsAcquisition::set_local_code()
{
std::vector<std::complex<float>> code(code_length_);
beidou_b1i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0);
gsl::span<gr_complex> code_span(code_.data(), vector_length_);
for (unsigned int i = 0; i < num_codes_; i++)
{
std::copy_n(code.data(), code_length_, code_span.subspan(i * code_length_, code_length_).data());
}
acquisition_->set_local_code(code_.data());
}
void BeidouB1iPcpsAcquisition::reset()
{
acquisition_->set_active(true);
}
void BeidouB1iPcpsAcquisition::set_state(int state)
{
acquisition_->set_state(state);
}
float BeidouB1iPcpsAcquisition::calculate_threshold(float pfa)
{
//Calculate the threshold
uint32_t frequency_bins = 0;
frequency_bins = (2 * doppler_max_ + doppler_step_) / doppler_step_;
DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa;
uint32_t ncells = vector_length_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent);
auto lambda = static_cast<double>(vector_length_);
boost::math::exponential_distribution<double> mydist(lambda);
auto threshold = static_cast<float>(quantile(mydist, val));
return threshold;
}
void BeidouB1iPcpsAcquisition::connect(gr::top_block_sptr top_block)
{
if (item_type_ == "gr_complex")
{
// nothing to connect
}
else if (item_type_ == "cshort")
{
// nothing to connect
}
else if (item_type_ == "cbyte")
{
// Since a byte-based acq implementation is not available,
// we just convert cshorts to gr_complex
top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
top_block->connect(float_to_complex_, 0, acquisition_, 0);
}
else
{
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}
}
void BeidouB1iPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
{
if (item_type_ == "gr_complex")
{
// nothing to disconnect
}
else if (item_type_ == "cshort")
{
// nothing to disconnect
}
else if (item_type_ == "cbyte")
{
top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
top_block->disconnect(float_to_complex_, 0, acquisition_, 0);
}
else
{
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}
}
gr::basic_block_sptr BeidouB1iPcpsAcquisition::get_left_block()
{
if (item_type_ == "gr_complex")
{
return acquisition_;
}
if (item_type_ == "cshort")
{
return acquisition_;
}
if (item_type_ == "cbyte")
{
return cbyte_to_float_x2_;
}
else
{
LOG(WARNING) << item_type_ << " unknown acquisition item type";
return nullptr;
}
}
gr::basic_block_sptr BeidouB1iPcpsAcquisition::get_right_block()
{
return acquisition_;
}
void BeidouB1iPcpsAcquisition::set_resampler_latency(uint32_t latency_samples)
{
acquisition_->set_resampler_latency(latency_samples);
}

View File

@ -0,0 +1,194 @@
/*!
* \file beidou_b1i_pcps_acquisition.h
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for
* Beidou B1I signals
* \authors <ul>
* <li> Sergi Segura, 2018. sergi.segura.munoz(at)gmail.com
* </ul>
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_BEIDOU_B1I_PCPS_ACQUISITION_H_
#define GNSS_SDR_BEIDOU_B1I_PCPS_ACQUISITION_H_
#include "channel_fsm.h"
#include "complex_byte_to_float_x2.h"
#include "gnss_synchro.h"
#include "pcps_acquisition.h"
#include <gnuradio/blocks/float_to_complex.h>
#include <gnuradio/blocks/stream_to_vector.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cstdint>
#include <memory>
#include <string>
#include <vector>
class ConfigurationInterface;
/*!
* \brief This class adapts a PCPS acquisition block to an AcquisitionInterface
* for GPS L1 C/A signals
*/
class BeidouB1iPcpsAcquisition : public AcquisitionInterface
{
public:
BeidouB1iPcpsAcquisition(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_streams,
unsigned int out_streams);
~BeidouB1iPcpsAcquisition() = default;
inline std::string role() override
{
return role_;
}
/*!
* \brief Returns "BEIDOU_B1I_PCPS_Acquisition"
*/
inline std::string implementation() override
{
return "BEIDOU_B1I_PCPS_Acquisition";
}
inline size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_->set_channel(channel_);
}
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::weak_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_->set_channel_fsm(channel_fsm);
}
/*!
* \brief Set statistics threshold of PCPS algorithm
*/
void set_threshold(float threshold) override;
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(uint32_t doppler_max) override;
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(uint32_t doppler_step) override;
/*!
* \brief Initializes acquisition algorithm.
*/
void init() override;
/*!
* \brief Sets local code for GPS L1/CA PCPS acquisition algorithm.
*/
void set_local_code() override;
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag() override;
/*!
* \brief Restart acquisition algorithm
*/
void reset() override;
/*!
* \brief If state = 1, it forces the block to start acquiring from the first sample
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
/*!
* \brief Sets the resampler latency to account it in the acquisition code delay estimation
*/
void set_resampler_latency(uint32_t latency_samples) override;
private:
ConfigurationInterface* configuration_;
pcps_acquisition_sptr acquisition_;
Acq_Conf acq_parameters_;
gr::blocks::float_to_complex::sptr float_to_complex_;
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
size_t item_size_;
std::string item_type_;
unsigned int vector_length_;
unsigned int code_length_;
bool bit_transition_flag_;
bool use_CFAR_algorithm_flag_;
unsigned int channel_;
std::weak_ptr<ChannelFsm> channel_fsm_;
float threshold_;
unsigned int doppler_max_;
unsigned int doppler_step_;
unsigned int max_dwells_;
int64_t fs_in_;
bool dump_;
bool blocking_;
std::string dump_filename_;
std::vector<std::complex<float>> code_;
Gnss_Synchro* gnss_synchro_;
std::string role_;
unsigned int num_codes_;
unsigned int in_streams_;
unsigned int out_streams_;
float calculate_threshold(float pfa);
};
#endif /* GNSS_SDR_BEIDOU_B1I_PCPS_ACQUISITION_H_ */

View File

@ -0,0 +1,325 @@
/*!
* \file beidou_b3i_pcps_acquisition.cc
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for
* BeiDou B3I signals
* \author Damian Miralles, 2019. dmiralles2009@gmail.com
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#include "beidou_b3i_pcps_acquisition.h"
#include "Beidou_B3I.h"
#include "acq_conf.h"
#include "beidou_b3i_signal_processing.h"
#include "configuration_interface.h"
#include "gnss_sdr_flags.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
#include <algorithm>
using google::LogMessage;
BeidouB3iPcpsAcquisition::BeidouB3iPcpsAcquisition(
ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams)
{
configuration_ = configuration;
std::string default_item_type = "gr_complex";
std::string default_dump_filename = "./acquisition.mat";
LOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
acq_parameters_.fs_in = fs_in_;
dump_ = configuration_->property(role + ".dump", false);
acq_parameters_.dump = dump_;
acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0);
blocking_ = configuration_->property(role + ".blocking", true);
acq_parameters_.blocking = blocking_;
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
acq_parameters_.doppler_max = doppler_max_;
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
acq_parameters_.bit_transition_flag = bit_transition_flag_;
use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions
acq_parameters_.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_;
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
acq_parameters_.max_dwells = max_dwells_;
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
acq_parameters_.dump_filename = dump_filename_;
acq_parameters_.sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1);
if (item_type_ == "cshort")
{
item_size_ = sizeof(lv_16sc_t);
}
else
{
item_size_ = sizeof(gr_complex);
}
acq_parameters_.ms_per_code = 1;
acq_parameters_.it_size = item_size_;
num_codes_ = acq_parameters_.sampled_ms;
acq_parameters_.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4);
acq_parameters_.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0);
acq_parameters_.make_2_steps = configuration_->property(role + ".make_two_steps", false);
acq_parameters_.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false);
acq_parameters_.use_automatic_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false);
acq_parameters_.resampled_fs = fs_in_;
//--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (BEIDOU_B3I_CODE_RATE_HZ / BEIDOU_B3I_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / BEIDOU_B3I_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(BEIDOU_B3I_CODE_PERIOD * 1000.0);
vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1);
code_ = std::vector<std::complex<float>>(vector_length_);
acquisition_ = pcps_make_acquisition(acq_parameters_);
DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")";
if (item_type_ == "cbyte")
{
cbyte_to_float_x2_ = make_complex_byte_to_float_x2();
float_to_complex_ = gr::blocks::float_to_complex::make();
}
channel_ = 0;
threshold_ = 0.0;
doppler_step_ = 0;
gnss_synchro_ = nullptr;
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
}
if (out_streams_ > 0)
{
LOG(ERROR) << "This implementation does not provide an output stream";
}
}
void BeidouB3iPcpsAcquisition::stop_acquisition()
{
}
void BeidouB3iPcpsAcquisition::set_threshold(float threshold)
{
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0);
if (pfa == 0.0)
{
pfa = configuration_->property(role_ + ".pfa", 0.0);
}
if (pfa == 0.0)
{
threshold_ = threshold;
}
else
{
threshold_ = calculate_threshold(pfa);
}
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
acquisition_->set_threshold(threshold_);
}
void BeidouB3iPcpsAcquisition::set_doppler_max(unsigned int doppler_max)
{
doppler_max_ = doppler_max;
acquisition_->set_doppler_max(doppler_max_);
}
void BeidouB3iPcpsAcquisition::set_doppler_step(unsigned int doppler_step)
{
doppler_step_ = doppler_step;
acquisition_->set_doppler_step(doppler_step_);
}
void BeidouB3iPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{
gnss_synchro_ = gnss_synchro;
acquisition_->set_gnss_synchro(gnss_synchro_);
}
signed int BeidouB3iPcpsAcquisition::mag()
{
return acquisition_->mag();
}
void BeidouB3iPcpsAcquisition::init()
{
acquisition_->init();
}
void BeidouB3iPcpsAcquisition::set_local_code()
{
std::vector<std::complex<float>> code(code_length_);
beidou_b3i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0);
gsl::span<gr_complex> code_span(code_.data(), vector_length_);
for (unsigned int i = 0; i < num_codes_; i++)
{
std::copy_n(code.data(), code_length_, code_span.subspan(i * code_length_, code_length_).data());
}
acquisition_->set_local_code(code_.data());
}
void BeidouB3iPcpsAcquisition::reset()
{
acquisition_->set_active(true);
}
void BeidouB3iPcpsAcquisition::set_state(int state)
{
acquisition_->set_state(state);
}
float BeidouB3iPcpsAcquisition::calculate_threshold(float pfa)
{
//Calculate the threshold
unsigned int frequency_bins = 0;
frequency_bins = (2 * doppler_max_ + doppler_step_) / doppler_step_;
DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa;
unsigned int ncells = vector_length_ * frequency_bins;
double exponent = 1.0 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent);
auto lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist(lambda);
auto threshold = static_cast<float>(quantile(mydist, val));
return threshold;
}
void BeidouB3iPcpsAcquisition::connect(gr::top_block_sptr top_block)
{
if (item_type_ == "gr_complex")
{
// nothing to connect
}
else if (item_type_ == "cshort")
{
// nothing to connect
}
else if (item_type_ == "cbyte")
{
// Since a byte-based acq implementation is not available,
// we just convert cshorts to gr_complex
top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
top_block->connect(float_to_complex_, 0, acquisition_, 0);
}
else
{
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}
}
void BeidouB3iPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
{
if (item_type_ == "gr_complex")
{
// nothing to disconnect
}
else if (item_type_ == "cshort")
{
// nothing to disconnect
}
else if (item_type_ == "cbyte")
{
top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
top_block->disconnect(float_to_complex_, 0, acquisition_, 0);
}
else
{
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}
}
gr::basic_block_sptr BeidouB3iPcpsAcquisition::get_left_block()
{
if (item_type_ == "gr_complex")
{
return acquisition_;
}
if (item_type_ == "cshort")
{
return acquisition_;
}
if (item_type_ == "cbyte")
{
return cbyte_to_float_x2_;
}
else
{
LOG(WARNING) << item_type_ << " unknown acquisition item type";
return nullptr;
}
}
gr::basic_block_sptr BeidouB3iPcpsAcquisition::get_right_block()
{
return acquisition_;
}
void BeidouB3iPcpsAcquisition::set_resampler_latency(uint32_t latency_samples)
{
acquisition_->set_resampler_latency(latency_samples);
}

Some files were not shown because too many files have changed in this diff Show More