From 603cab1ead6b5572063076b3b88e2446f503fe03 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 11 Jan 2021 13:57:29 +0100 Subject: [PATCH 01/11] Fix clash of the cpu_features library when volk_gnsssdr is built as a standalone library, and cpu_features was already installed by VOLK Added new building option ENABLE_OWN_CPUFEATURES, set to ON when building gnss-sdr but set to OFF when building volk_gnsssdr standalone. The default does no change old behavior when buiding gnss-sdr without volk_gnsssdr already installed --- CMakeLists.txt | 48 +++++++++++++-- docs/changelog.md | 14 +++++ .../volk_gnsssdr/CMakeLists.txt | 15 ++++- .../volk_gnsssdr/README.md | 8 ++- .../volk_gnsssdr/lib/CMakeLists.txt | 59 ++++++++++++++----- 5 files changed, 118 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 72d56e248..c8f75507b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,6 +94,8 @@ option(ENABLE_SYSTEM_TESTING_EXTRA "Download external tools and build extra syst option(ENABLE_GNSS_SIM_INSTALL "Enable the installation of gnss_sim on the fly" ON) +option(ENABLE_OWN_CPUFEATURES "Force the building of the cpu_features library even if it is already installed" ON) + if(NOT (ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)) set(ENABLE_GNSS_SIM_INSTALL OFF) endif() @@ -1102,6 +1104,7 @@ if(NOT VOLKGNSSSDR_FOUND) set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_COMPILER} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install -DENABLE_STATIC_LIBS=ON + -DENABLE_OWN_CPUFEATURES=${ENABLE_OWN_CPUFEATURES} -DENABLE_PROFILING=${ENABLE_PROFILING} -DENABLE_ORC=${ORC_ENABLED} ${STRIP_VOLK_GNSSSDR_PROFILE} @@ -1156,6 +1159,33 @@ if(NOT VOLKGNSSSDR_FOUND) ) else() if(SUPPORTED_CPU_FEATURES_ARCH) + set(VOLK_GNSSSDR_BUILD_BYPRODUCTS + ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/lib${VOLK_GNSSSDR_LIB_SUFFIX}/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile + ) + if(NOT ENABLE_OWN_CPUFEATURES) + find_package(CpuFeatures QUIET) + set_package_properties(CpuFeatures PROPERTIES + URL "https://github.com/google/cpu_features" + PURPOSE "Used by the volk_gnsssdr library." + TYPE REQUIRED + ) + endif() + if(CpuFeatures_FOUND) + message(STATUS "Found CpuFeatures: (found version ${CpuFeatures_VERSION})") + set_package_properties(CpuFeatures PROPERTIES + DESCRIPTION "A cross platform C99 library to get CPU features at runtime (found: v${CpuFeatures_VERSION})" + ) + else() + set_package_properties(CpuFeatures PROPERTIES + DESCRIPTION "A cross platform C99 library to get CPU features at runtime" + PURPOSE "CpuFeatures will be built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'." + ) + set(VOLK_GNSSSDR_BUILD_BYPRODUCTS + ${VOLK_GNSSSDR_BUILD_BYPRODUCTS} + ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}cpu_features${CMAKE_STATIC_LIBRARY_SUFFIX} + ) + endif() ExternalProject_Add(volk_gnsssdr_module PREFIX ${CMAKE_BINARY_DIR}/volk_gnsssdr_module SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr @@ -1167,9 +1197,7 @@ if(NOT VOLKGNSSSDR_FOUND) UPDATE_COMMAND "" PATCH_COMMAND "" BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile - BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/lib${VOLK_GNSSSDR_LIB_SUFFIX}/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile - ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}cpu_features${CMAKE_STATIC_LIBRARY_SUFFIX} + BUILD_BYPRODUCTS ${VOLK_GNSSSDR_BUILD_BYPRODUCTS} INSTALL_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install ) else() @@ -1200,6 +1228,9 @@ if(NOT VOLKGNSSSDR_FOUND) set_property(TARGET volk_gnsssdr PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/lib${VOLK_GNSSSDR_LIB_SUFFIX}/libvolk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX}) set(VOLK_GNSSSDR_INCLUDE_DIRS "${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/include/;${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include;${ORC_INCLUDE_DIRS}") set(VOLK_GNSSSDR_LIBRARIES volk_gnsssdr ${ORC_LIBRARIES_STATIC}) + if(CpuFeatures_FOUND) + set(VOLK_GNSSSDR_LIBRARIES ${VOLK_GNSSSDR_LIBRARIES} CpuFeatures::cpu_features) + endif() if(NOT TARGET Volkgnsssdr::volkgnsssdr) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/include) @@ -1213,9 +1244,11 @@ if(NOT VOLKGNSSSDR_FOUND) INTERFACE_LINK_LIBRARIES "${VOLK_GNSSSDR_LIBRARIES}" ) if(CMAKE_VERSION VERSION_GREATER 3.0 AND SUPPORTED_CPU_FEATURES_ARCH) - set_target_properties(Volkgnsssdr::volkgnsssdr PROPERTIES - INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}cpu_features${CMAKE_STATIC_LIBRARY_SUFFIX} - ) + if(NOT CpuFeatures_FOUND) + set_target_properties(Volkgnsssdr::volkgnsssdr PROPERTIES + INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}cpu_features${CMAKE_STATIC_LIBRARY_SUFFIX} + ) + endif() endif() endif() @@ -1240,6 +1273,8 @@ if(NOT VOLKGNSSSDR_FOUND) set_package_properties(VOLKGNSSSDR PROPERTIES PURPOSE "volk_gnsssdr will be built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'." ) +else() + set(ENABLE_OWN_CPUFEATURES OFF) endif() @@ -3210,6 +3245,7 @@ add_feature_info(ENABLE_GNSS_SIM_INSTALL ENABLE_GNSS_SIM_INSTALL "Enables downlo add_feature_info(ENABLE_INSTALL_TESTS ENABLE_INSTALL_TESTS "Install test binaries when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} install'.") add_feature_info(ENABLE_BENCHMARKS ENABLE_BENCHMARKS "Enables building of code snippet benchmarks.") add_feature_info(ENABLE_EXTERNAL_MATHJAX ENABLE_EXTERNAL_MATHJAX "Use MathJax from an external CDN in HTML docs when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc'.") +add_feature_info(ENABLE_OWN_CPUFEATURES ENABLE_OWN_CPUFEATURES "Force building own local version of the cpu_features library, even if it is already installed.") message(STATUS "") message(STATUS "***************************************") diff --git a/docs/changelog.md b/docs/changelog.md index 5c0e139f2..e04866a8f 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -8,6 +8,20 @@ SPDX-FileCopyrightText: 2011-2021 Carles Fernandez-Prades +## [Unreleased](https://github.com/gnss-sdr/gnss-sdr/tree/next) + +### Improvements in Portability: + +- Avoid collision of the `cpu_features` library when installing the + `volk_gnsssdr` library by its own, and VOLK has already installed its version. + Added a new building option `ENABLE_OWN_CPUFEATURES`, defaulting to `ON` when + building `gnss-sdr` but defaulting to `OFF` when building a stand-alone + version of `volk_gnsssdr`. When this building option is set to `ON`, it forces + the building of the local version of the cpu_features library, regardless of + whether it is already installed or not. + +  + ## [GNSS-SDR v0.0.14](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.14) ### Improvements in Availability: diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt index 4e29c8dbf..da86ef61a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt @@ -1,7 +1,7 @@ # GNSS-SDR is a Global Navigation Satellite System software-defined receiver. # This file is part of GNSS-SDR. # -# SPDX-FileCopyrightText: 2010-2020 C. Fernandez-Prades cfernandez(at)cttc.es +# SPDX-FileCopyrightText: 2010-2021 C. Fernandez-Prades cfernandez(at)cttc.es # SPDX-License-Identifier: BSD-3-Clause @@ -203,7 +203,7 @@ message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.") set(VERSION_INFO_MAJOR_VERSION 0) set(VERSION_INFO_MINOR_VERSION 0) -set(VERSION_INFO_MAINT_VERSION 14) +set(VERSION_INFO_MAINT_VERSION 14.git) include(VolkVersion) # setup version info @@ -244,6 +244,8 @@ endif() ######################################################################## # cpu_features +option(ENABLE_OWN_CPUFEATURES "Force the building of the cpu_features library even if it is already installed" OFF) + set(SUPPORTED_CPU_FEATURES_ARCH FALSE) if(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips") set(SUPPORTED_CPU_FEATURES_ARCH TRUE) @@ -265,7 +267,14 @@ if(CMAKE_VERSION VERSION_GREATER 3.0 AND SUPPORTED_CPU_FEATURES_ARCH) set(USE_CPU_FEATURES ON) set(BUILD_SHARED_LIBS_SAVED "${BUILD_SHARED_LIBS}") set(BUILD_SHARED_LIBS OFF) - add_subdirectory(cpu_features) + if(NOT ENABLE_OWN_CPUFEATURES) + find_package(CpuFeatures QUIET) + endif() + if(CpuFeatures_FOUND) + message(STATUS "Found CpuFeatures: (found version ${CpuFeatures_VERSION})") + else() + add_subdirectory(cpu_features) + endif() set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_SAVED}") endif() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/README.md b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/README.md index 46f1a8c62..bddf74727 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/README.md +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/README.md @@ -6,7 +6,7 @@ SPDX-License-Identifier: GPL-3.0-or-later ) [comment]: # ( -SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades +SPDX-FileCopyrightText: 2011-2021 Carles Fernandez-Prades ) @@ -57,6 +57,12 @@ not found by CMake on your system at configure time. However, you can install and use VOLK_GNSSSDR kernels as you use VOLK's, independently of GNSS-SDR. +If you want to install the VOLK and VOLK_GNSSSDR libraries in the same machine, +please install VOLK before building VOLK_GNSSSDR in order to avoid a clash of +the [cpu_features](https://github.com/google/cpu_features) library, used +internally by both. The CMake script will detect the presence of cpu_features +and will make use of it if already installed, thus avoiding to install it twice. + ### Install dependencies First, make sure that the required dependencies are installed in your machine: diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt index 48a34ddf7..20ffa9984 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt @@ -1,7 +1,7 @@ # GNSS-SDR is a Global Navigation Satellite System software-defined receiver. # This file is part of GNSS-SDR. # -# SPDX-FileCopyrightText: 2010-2020 C. Fernandez-Prades cfernandez(at)cttc.es +# SPDX-FileCopyrightText: 2010-2021 C. Fernandez-Prades cfernandez(at)cttc.es # SPDX-License-Identifier: BSD-3-Clause @@ -532,10 +532,17 @@ if(NOT (CMAKE_GENERATOR STREQUAL Xcode)) PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) if(USE_CPU_FEATURES) - target_include_directories(volk_gnsssdr_obj - PRIVATE - $ - ) + if(CpuFeatures_FOUND) + target_include_directories(volk_gnsssdr_obj + PRIVATE + $ + ) + else() + target_include_directories(volk_gnsssdr_obj + PRIVATE + $ + ) + endif() endif() # Configure object target properties if(NOT MSVC) @@ -550,10 +557,17 @@ else() add_library(volk_gnsssdr SHARED $) endif() if(USE_CPU_FEATURES) - target_link_libraries(volk_gnsssdr - PUBLIC ${volk_gnsssdr_libraries} - PRIVATE cpu_features - ) + if(CpuFeatures_FOUND) + target_link_libraries(volk_gnsssdr + PUBLIC ${volk_gnsssdr_libraries} + PRIVATE CpuFeatures::cpu_features + ) + else() + target_link_libraries(volk_gnsssdr + PUBLIC ${volk_gnsssdr_libraries} + PRIVATE cpu_features + ) + endif() else() target_link_libraries(volk_gnsssdr PUBLIC ${volk_gnsssdr_libraries}) endif() @@ -566,10 +580,17 @@ target_include_directories(volk_gnsssdr PUBLIC $ ) if(USE_CPU_FEATURES) - target_include_directories(volk_gnsssdr - PRIVATE - $ - ) + if(CpuFeatures_FOUND) + target_include_directories(volk_gnsssdr + PRIVATE + $ + ) + else() + target_include_directories(volk_gnsssdr + PRIVATE + $ + ) + endif() endif() # Configure target properties if(ORC_FOUND) @@ -598,9 +619,15 @@ if(ENABLE_STATIC_LIBS) endif() target_link_libraries(volk_gnsssdr_static PUBLIC ${volk_gnsssdr_libraries}) if(USE_CPU_FEATURES) - target_link_libraries(volk_gnsssdr_static - PRIVATE cpu_features - ) + if(CpuFeatures_FOUND) + target_link_libraries(volk_gnsssdr_static + PRIVATE CpuFeatures::cpu_features + ) + else() + target_link_libraries(volk_gnsssdr_static + PRIVATE cpu_features + ) + endif() endif() if(ORC_FOUND) target_link_libraries(volk_gnsssdr_static PUBLIC ${ORC_LIBRARIES_STATIC}) From f75017e5206a2803f8dcd9dc6d1385bb939586c7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 11 Jan 2021 20:22:54 +0100 Subject: [PATCH 02/11] Fix building when using the Xcode generator, Xcode >= 12 and CMake >= 3.19 --- CMakeLists.txt | 5 +++++ docs/changelog.md | 1 + 2 files changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c8f75507b..df28a6ecb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1110,6 +1110,11 @@ if(NOT VOLKGNSSSDR_FOUND) ${STRIP_VOLK_GNSSSDR_PROFILE} ${USE_THIS_PYTHON} ) + if(CMAKE_VERSION VERSION_GREATER 3.18.99 AND CMAKE_GENERATOR STREQUAL Xcode) + if(XCODE_VERSION VERSION_GREATER 11) + set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} -T buildsystem=1) + endif() + endif() if(DEFINED ENV{OECORE_TARGET_SYSROOT}) set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} -DCROSSCOMPILE_MULTILIB=TRUE diff --git a/docs/changelog.md b/docs/changelog.md index e04866a8f..f86b1156f 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,7 @@ SPDX-FileCopyrightText: 2011-2021 Carles Fernandez-Prades = 12 and CMake >= 3.19.   From 8b918b4f879e5c762cc7ad4d61553a72bdde5bae Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 12 Jan 2021 00:04:28 +0100 Subject: [PATCH 03/11] Update links to new Galileo ICD v2.0 in docs --- docs/doxygen/other/reference_docs.dox | 4 ++-- docs/doxygen/other/signal_model.dox | 8 ++++---- src/core/system_parameters/MATH_CONSTANTS.h | 4 ++-- src/core/system_parameters/galileo_almanac_helper.h | 2 +- src/core/system_parameters/galileo_ephemeris.h | 2 +- src/core/system_parameters/galileo_fnav_message.h | 4 ++-- src/core/system_parameters/galileo_inav_message.h | 4 ++-- src/core/system_parameters/galileo_iono.h | 2 +- src/core/system_parameters/galileo_utc_model.h | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/doxygen/other/reference_docs.dox b/docs/doxygen/other/reference_docs.dox index d1b97628d..641c5acf1 100644 --- a/docs/doxygen/other/reference_docs.dox +++ b/docs/doxygen/other/reference_docs.dox @@ -1,7 +1,7 @@ # GNSS-SDR is a Global Navigation Satellite System software-defined receiver. # This file is part of GNSS-SDR. # -# Copyright (C) 2012-2020 Carles Fernandez-Prades cfernandez(at)cttc.es +# Copyright (C) 2012-2021 Carles Fernandez-Prades cfernandez(at)cttc.es # SPDX-License-Identifier: GPL-3.0-or-later /*! \page reference_docs Reference Documents @@ -33,7 +33,7 @@ Check the Galileo website of the European Space Agency. There is a website with Galileo constellation status information from the GSA. -\li Galileo E5, E6, and E1: European GNSS (Galileo) Open Service. Signal In Space Interface Control Document. Ref: OS SIS ICD, Issue 1.3, European Commission, Dec. 2016. +\li Galileo E5, E6, and E1: European GNSS (Galileo) Open Service. Signal In Space Interface Control Document. Ref: OS SIS ICD, Issue 2.0, European Union, Jan. 2021. The European Commission is granting free access to the technical information on the future Galileo open service signal, i.e. the specifications manufacturers diff --git a/docs/doxygen/other/signal_model.dox b/docs/doxygen/other/signal_model.dox index 3dfec1a70..1625d77c9 100644 --- a/docs/doxygen/other/signal_model.dox +++ b/docs/doxygen/other/signal_model.dox @@ -1,7 +1,7 @@ # GNSS-SDR is a Global Navigation Satellite System software-defined receiver. # This file is part of GNSS-SDR. # -# Copyright (C) 2012-2020 Carles Fernandez-Prades cfernandez(at)cttc.es +# Copyright (C) 2012-2021 Carles Fernandez-Prades cfernandez(at)cttc.es # SPDX-License-Identifier: GPL-3.0-or-later /*! \page the_signal_model Signal model @@ -158,7 +158,7 @@ nominal constellation configuration. The Galileo satellites are placed in quasi- orbits with a nominal semi-major axis of about \f$30,000\f$ km and an approximate revolution period of \f$14\f$ hours. The Control segment full infrastructure will be composed of \f$30-40\f$ sensor stations, \f$3\f$ control centers, \f$9\f$ Mission Uplink stations, and \f$5\f$ TT\&C stations. -Galileo's Open Service is defined at Signal In Space Interface Control Document. Ref: OS SIS ICD, Issue 1.3, where the following signal structures are specified: +Galileo's Open Service is defined at Signal In Space Interface Control Document. Ref: OS SIS ICD, Issue 2.0, where the following signal structures are specified: \li Galileo E1. This band, centered at \f$f_{\text{Gal E1}}=1575.420\f$ MHz and with a reference bandwidth of \f$24.5520\f$ MHz, uses the so-called composite binary offset carrier @@ -181,7 +181,7 @@ In case of channel \f$C\f$, it is a pilot (dataless) channel with a secondary co \nonumber e_{E1C}(t)&= \sum_{m=-\infty}^{+\infty}C_{E1Cs}\Big[|m|_{25}\Big] \oplus \sum_{l=1}^{4092}C_{E1Cp}\Big[ l \Big] \cdot \\ {}& \; \; \cdot p(t-mT_{c,E1Cs}-lT_{c,E1Cp})~,\label{eq:E1C} \f} with \f$T_{c,E1B}=T_{c,E1Cp}=\frac{1}{1.023}\f$ \f$\mu\f$s and \f$T_{c,E1Cs}=4\f$ ms. The \f$C_{E1B}\f$ and \f$C_{E1Cp}\f$ primary codes are pseudorandom memory code sequences defined at - Annex C.7 and C.8 of OS SIS ICD. The binary + Annex C of OS SIS ICD. The binary sequence of the secondary code \f$C_{E1Cs}\f$ is 0011100000001010110110010. This band also contains another component, Galileo E1A, intended for the Public Regulated Service (PRS). It uses a BOC(15,2.5) modulation with cosine-shaped subcarrier \f$f_{s,E1A}=15.345\f$ MHz and \f$T_{c, E1A}=\frac{1}{2.5575}\f$ \f$\mu\f$s. The PRS spreading codes and the structure of the navigation message have not been made public. @@ -197,7 +197,7 @@ s_{T}^{\text{(Gal E6)}}(t) = \frac{1}{\sqrt{2}}\left(e_{E6B}(t)-e_{E6C}(t)\right \f} where \f$D_{\text{C/NAV}}\f$ is the C/NAV navigation data stream, which is modulated with the encrypted ranging code \f$C_{E6B}\f$ with chip period \f$T_{c,E6}=\frac{1}{5.115}\f$ \f$\mu\f$s, thus being a BPSK(5) modulation. Codes \f$C_{E6B}\f$ and primary codes \f$C_{E6Cs}\f$ and their respective lengths, \f$L_{E6B}\f$ and \f$L_{E6C}\f$, have not been published. The secondary codes - for the pilot component, \f$C_{E6Cs}\f$, are available at the OS SIS ICD. + for the pilot component, \f$C_{E6Cs}\f$, are available at the OS SIS ICD. The receiver reference bandwidth for this signal is \f$40.920\f$ MHz. This band also contains another component, Galileo E6A, intended for PRS. \li Galileo E5. Centered at \f$f_{\text{Gal E5}}=1191.795\f$ MHz and with a total bandwidth of \f$51.150\f$ MHz, its signal structure deserves some analysis. The AltBOC modulation can be generically expressed as diff --git a/src/core/system_parameters/MATH_CONSTANTS.h b/src/core/system_parameters/MATH_CONSTANTS.h index d5fcd2407..dad0f3e12 100644 --- a/src/core/system_parameters/MATH_CONSTANTS.h +++ b/src/core/system_parameters/MATH_CONSTANTS.h @@ -32,8 +32,8 @@ constexpr double GPS_GM = 3.986005e14; //!< Universal gravitational constan constexpr double GPS_F = -4.442807633e-10; //!< Constant, [s/(m)^(1/2)], IS-GPS-200K, pag. 92 // Physical constants for Galileo -constexpr double GALILEO_GM = 3.986004418e14; //!< Geocentric gravitational constant[m^3/s^2], OS SIS ICD v1.3, pag. 44 -constexpr double GALILEO_F = -4.442807309e-10; //!< Constant, [s/(m)^(1/2)]. OS SIS ICD v1.3, pag. 47 +constexpr double GALILEO_GM = 3.986004418e14; //!< Geocentric gravitational constant[m^3/s^2], OS SIS ICD v2.0, pag. 44 +constexpr double GALILEO_F = -4.442807309e-10; //!< Constant, [s/(m)^(1/2)]. OS SIS ICD v2.0, pag. 47 // Physical constants for GLONASS constexpr double GLONASS_OMEGA_EARTH_DOT = 7.292115e-5; //!< Earth rotation rate, [rad/s] ICD L1, L2 GLONASS Edition 5.1 2008 pag. 55 diff --git a/src/core/system_parameters/galileo_almanac_helper.h b/src/core/system_parameters/galileo_almanac_helper.h index 001d3a649..8cc1f403e 100644 --- a/src/core/system_parameters/galileo_almanac_helper.h +++ b/src/core/system_parameters/galileo_almanac_helper.h @@ -29,7 +29,7 @@ /*! * \brief This class is a storage for the GALILEO ALMANAC data as described in GALILEO ICD * - * See https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo-OS-SIS-ICD.pdf paragraph 5.1.10 + * See https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo_OS_SIS_ICD_v2.0.pdf paragraph 5.1.10 */ class Galileo_Almanac_Helper { diff --git a/src/core/system_parameters/galileo_ephemeris.h b/src/core/system_parameters/galileo_ephemeris.h index 3c99be769..811e92b44 100644 --- a/src/core/system_parameters/galileo_ephemeris.h +++ b/src/core/system_parameters/galileo_ephemeris.h @@ -30,7 +30,7 @@ /*! * \brief This class is a storage and orbital model functions for the Galileo SV ephemeris data as described in Galileo ICD paragraph 5.1.1 - * (See https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo-OS-SIS-ICD.pdf ) + * (See https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo_OS_SIS_ICD_v2.0.pdf ) * */ class Galileo_Ephemeris diff --git a/src/core/system_parameters/galileo_fnav_message.h b/src/core/system_parameters/galileo_fnav_message.h index 243d92260..eac37f256 100644 --- a/src/core/system_parameters/galileo_fnav_message.h +++ b/src/core/system_parameters/galileo_fnav_message.h @@ -44,8 +44,8 @@ /*! * \brief This class handles the Galileo F/NAV Data message, as described in the - * Galileo Open Service Signal in Space Interface Control Document (OS SIS ICD), Issue 1.2 (Nov 2015). - * See https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo-OS-SIS-ICD.pdf + * Galileo Open Service Signal in Space Interface Control Document (OS SIS ICD), Issue 2.0 (Jan. 2021). + * See https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo_OS_SIS_ICD_v2.0.pdf */ class Galileo_Fnav_Message { diff --git a/src/core/system_parameters/galileo_inav_message.h b/src/core/system_parameters/galileo_inav_message.h index a2b42ab72..c06c59647 100644 --- a/src/core/system_parameters/galileo_inav_message.h +++ b/src/core/system_parameters/galileo_inav_message.h @@ -38,8 +38,8 @@ /*! * \brief This class handles the Galileo I/NAV Data message, as described in the - * Galileo Open Service Signal in Space Interface Control Document (OS SIS ICD), Issue 1.2 (Nov 2015). - * See https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo-OS-SIS-ICD.pdf + * Galileo Open Service Signal in Space Interface Control Document (OS SIS ICD), Issue 2.0 (Jan. 2021). + * See https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo_OS_SIS_ICD_v2.0.pdf */ class Galileo_Inav_Message { diff --git a/src/core/system_parameters/galileo_iono.h b/src/core/system_parameters/galileo_iono.h index ca57f006b..36b4e9ce8 100644 --- a/src/core/system_parameters/galileo_iono.h +++ b/src/core/system_parameters/galileo_iono.h @@ -31,7 +31,7 @@ /*! * \brief This class is a storage for the GALILEO IONOSPHERIC data as described in Galileo ICD paragraph 5.1.6 * - * See https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo-OS-SIS-ICD.pdf + * See https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo_OS_SIS_ICD_v2.0.pdf */ class Galileo_Iono { diff --git a/src/core/system_parameters/galileo_utc_model.h b/src/core/system_parameters/galileo_utc_model.h index 770126755..6bf335478 100644 --- a/src/core/system_parameters/galileo_utc_model.h +++ b/src/core/system_parameters/galileo_utc_model.h @@ -30,7 +30,7 @@ /*! * \brief This class is a storage for the GALILEO UTC MODEL data as described in Galileo ICD - * https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo-OS-SIS-ICD.pdf + * https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo_OS_SIS_ICD_v2.0.pdf * paragraph 5.1.7 */ class Galileo_Utc_Model From ddc5bcff01a5aae20f02cf9ab6788397c346dc81 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 12 Jan 2021 10:34:55 +0100 Subject: [PATCH 04/11] Update references to new GPS ICDs --- docs/doxygen/other/reference_docs.dox | 6 ++--- docs/doxygen/other/signal_model.dox | 8 +++---- src/algorithms/PVT/libs/rinex_printer.cc | 10 ++++---- src/algorithms/libs/geofunctions.cc | 2 +- .../libs/rtklib/rtklib_conversions.cc | 4 ++-- src/algorithms/libs/rtklib/rtklib_rtkcmn.cc | 2 +- src/algorithms/libs/rtklib/rtklib_rtkcmn.h | 2 +- .../gps_l1_ca_telemetry_decoder_gs.cc | 2 +- .../gps_l1_ca_telemetry_decoder_gs.h | 2 +- .../gps_l2c_telemetry_decoder_gs.h | 2 +- src/core/system_parameters/GLONASS_L1_L2_CA.h | 2 +- src/core/system_parameters/GPS_CNAV.h | 2 +- src/core/system_parameters/GPS_L1_CA.h | 2 +- src/core/system_parameters/MATH_CONSTANTS.h | 4 ++-- .../system_parameters/beidou_dnav_ephemeris.h | 20 ++++++++-------- .../glonass_gnav_ephemeris.h | 4 ++-- src/core/system_parameters/gps_almanac.h | 6 ++--- .../system_parameters/gps_cnav_ephemeris.cc | 8 +++---- .../system_parameters/gps_cnav_ephemeris.h | 22 ++++++++--------- src/core/system_parameters/gps_cnav_iono.h | 4 ++-- .../gps_cnav_navigation_message.cc | 4 ++-- .../gps_cnav_navigation_message.h | 4 ++-- .../system_parameters/gps_cnav_utc_model.h | 12 +++++----- src/core/system_parameters/gps_ephemeris.cc | 2 +- src/core/system_parameters/gps_ephemeris.h | 24 +++++++++---------- src/core/system_parameters/gps_iono.h | 4 ++-- .../gps_navigation_message.cc | 4 ++-- .../gps_navigation_message.h | 18 +++++++------- src/core/system_parameters/gps_utc_model.h | 12 +++++----- 29 files changed, 99 insertions(+), 99 deletions(-) diff --git a/docs/doxygen/other/reference_docs.dox b/docs/doxygen/other/reference_docs.dox index 641c5acf1..7606703eb 100644 --- a/docs/doxygen/other/reference_docs.dox +++ b/docs/doxygen/other/reference_docs.dox @@ -12,9 +12,9 @@ All the current GPS Interface Control Documents can be downloaded from GPS.gov, the official U.S. Government webpage for GPS. -\li GPS L1 and L2C: Global Positioning System Directorate, Interface Specification IS-GPS-200 Revision K. March, 2019. -\li GPS L1C (available with first Block III launch): Global Positioning System Directorate, Interface Specification IS-GPS-800 Revision F. March, 2019. -\li GPS L5 (first Block IIF satellite launched on May, 2010): Global Positioning System Directorate, Interface Specification IS-GPS-705 Revision F. March, 2019. +\li GPS L1 and L2C: Global Positioning System Directorate, Interface Specification IS-GPS-200 Revision L. May, 2020. +\li GPS L1C (available with first Block III launch): Global Positioning System Directorate, Interface Specification IS-GPS-800 Revision G. May, 2020. +\li GPS L5 (first Block IIF satellite launched on May, 2010): Global Positioning System Directorate, Interface Specification IS-GPS-705 Revision G. May, 2020. diff --git a/docs/doxygen/other/signal_model.dox b/docs/doxygen/other/signal_model.dox index 1625d77c9..13741147f 100644 --- a/docs/doxygen/other/signal_model.dox +++ b/docs/doxygen/other/signal_model.dox @@ -62,7 +62,7 @@ and civilian users on a continuous, worldwide basis. Two GPS services are provid the Precise Positioning Service (PPS), available primarily to the military of the United States and its allies, and the Standard Positioning Service (SPS) open to civilian users. -\li GPS L1. Defined at Interface Specification IS-GPS-200 Revision K, this band is centered at \f$f_{\text{GPS L1}}=1575.42\f$ MHz. The complex baseband transmitted signal can be written as +\li GPS L1. Defined at Interface Specification IS-GPS-200 Revision L, this band is centered at \f$f_{\text{GPS L1}}=1575.42\f$ MHz. The complex baseband transmitted signal can be written as \f{equation}{ s^{\text{(GPS L1)}}_{T}(t)=e_{L1I}(t) + j e_{L1Q}(t)~, \f} @@ -76,12 +76,12 @@ s^{\text{(GPS L1)}}_{T}(t)=e_{L1I}(t) + j e_{L1Q}(t)~, \f$L_{\text{P(Y)}}=6.1871 \cdot 10^{12}\f$, and \f$p(t)\f$ is a rectangular pulse of a chip-period duration centered at \f$t=0\f$ and filtered at the transmitter. According to the chip rate, the binary phase-shift keying modulations in the equations above are denoted as BPSK(10) and BPSK(1), respectively. The precision P codes (named Y codes whenever the anti-spoofing mode is activated, encrypting the code and thus denying non-U.S. military users) are sequences of \f$7\f$ days in length. Regarding the modernization plans for GPS, it - is worthwhile to mention that there is a new civilian-use signal planned, called L1C and defined at Interface Specification IS-GPS-800 Revision F, + is worthwhile to mention that there is a new civilian-use signal planned, called L1C and defined at Interface Specification IS-GPS-800 Revision G, to be broadcast on the same L1 frequency that currently contains the C/A signal. The L1C will be available with first Block III launch, currently scheduled for 2013. The implementation will provide C/A code to ensure backward compatibility. -\li GPS L2C. Defined at Interface Specification IS-GPS-200 Revision K, is only available on +\li GPS L2C. Defined at Interface Specification IS-GPS-200 Revision L, is only available on Block IIR-M and subsequent satellite blocks. Centered at \f$f_{\text{GPS L2}}=1227.60\f$ MHz, the signal structure is the same than in (\ref{eq:GPSL1}), with the precision code in the In-phase component, just as in (\ref{eq:L1CAI}) but with an optional presence of the navigation message \f$D_{\text{NAV}}\f$. For the Quadrature-phase component, three options are defined: \f{align}{ e_{L2CQ}(t) =& \sum_{l=-\infty}^{\infty} D_{\text{CNAV}} \Big[ [l]_{10230} \Big] \oplus \left( C_{\text{CL}} \Big[ |l|_{L_{\text{CL}}} \Big] p_{\text{\tiny{1/2}}} \left( t - lT_{c,L2C} \right) + \right.\\ {} &+ \left. C_{\text{CM}} \Big[ |l|_{L_{\text{CM}}} \Big] p_{\text{\tiny{1/2}}}\left(t - \left(l+\frac{3}{4}\right)T_{c,L2C}\right) \right),\\ @@ -94,7 +94,7 @@ component, just as in (\ref{eq:L1CAI}) but with an optional presence of the navi data than the NAV data. It is transmitted at \f$25\f$ bps with forward error correction (FEC) encoding, resulting in \f$50\f$ sps. -\li GPS L5. The GPS L5 link, defined at Interface Specification IS-GPS-705 Revision F, is only available +\li GPS L5. The GPS L5 link, defined at Interface Specification IS-GPS-705 Revision G, is only available in Block IIF (first satellite launched on May, 2010) and subsequent satellite blocks. Centered at \f$f_{\text{GPS L5}}=1176.45\f$ MHz, this signal in space can be written as: \f{equation}{ s^{\text{(GPS L5)}}_{T}(t)=e_{L5I}(t) +j e_{L5Q}(t)~, diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 8e843eae9..3992c2a75 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -5103,7 +5103,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIA") { - // Block II/IIA (Table 20-XI IS-GPS-200K ) + // Block II/IIA (Table 20-XI IS-GPS-200L ) if ((gps_ephemeris_iter->second.d_IODC > 239) && (gps_ephemeris_iter->second.d_IODC < 248)) { curve_fit_interval = 8; @@ -5135,7 +5135,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIF") || (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIIA")) { - // Block IIR/IIR-M/IIF/IIIA (Table 20-XII IS-GPS-200K ) + // Block IIR/IIR-M/IIF/IIIA (Table 20-XII IS-GPS-200L ) if ((gps_ephemeris_iter->second.d_IODC > 239) && (gps_ephemeris_iter->second.d_IODC < 248)) { curve_fit_interval = 8; @@ -5222,7 +5222,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_Toe1 == gps_ephemeris_iter->second.d_Toe2) && (gps_ephemeris_iter->second.d_Toe1 == gps_ephemeris_iter->second.d_Toc))) // Toe1: Toe in message type 10, Toe2: Toe in message type 11 { // Toe1: Toe in message type 10, Toe2: Toe in message type 11, @@ -5252,7 +5252,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_Cus, 18, 2); line += std::string(1, ' '); - const double A_REF = 26559710.0; // See IS-GPS-200K, pp. 163 + const double A_REF = 26559710.0; // See IS-GPS-200L, pp. 161 double sqrt_A = sqrt(A_REF + gps_ephemeris_iter->second.d_DELTA_A); line += Rinex_Printer::doub2for(sqrt_A, 18, 2); Rinex_Printer::lengthCheck(line); @@ -5280,7 +5280,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_OMEGA, 18, 2); line += std::string(1, ' '); - const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200K pp. 164 + const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200L pp. 160 double OMEGA_DOT_aux = OMEGA_DOT_REF + gps_ephemeris_iter->second.d_DELTA_OMEGA_DOT; line += Rinex_Printer::doub2for(OMEGA_DOT_aux, 18, 2); Rinex_Printer::lengthCheck(line); diff --git a/src/algorithms/libs/geofunctions.cc b/src/algorithms/libs/geofunctions.cc index 2c566d746..3183863aa 100644 --- a/src/algorithms/libs/geofunctions.cc +++ b/src/algorithms/libs/geofunctions.cc @@ -20,7 +20,7 @@ #include #include // for sin, cos, sqrt, abs, pow -const double STRP_PI = 3.1415926535898; // Pi as defined in IS-GPS-200K +const double STRP_PI = 3.1415926535898; // Pi as defined in IS-GPS-200L arma::mat Skew_symmetric(const arma::vec &a) { diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.cc b/src/algorithms/libs/rtklib/rtklib_conversions.cc index d3c0dfabd..1c5d73e1e 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.cc +++ b/src/algorithms/libs/rtklib/rtklib_conversions.cc @@ -354,13 +354,13 @@ eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris& gps_cnav_eph) eph_t rtklib_sat = {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, 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, 0.0, {}, {}, 0.0, 0.0}; rtklib_sat.sat = gps_cnav_eph.i_satellite_PRN; - const double A_REF = 26559710.0; // See IS-GPS-200K, pp. 170 + const double A_REF = 26559710.0; // See IS-GPS-200L, pp. 161 rtklib_sat.A = A_REF + gps_cnav_eph.d_DELTA_A; rtklib_sat.M0 = gps_cnav_eph.d_M_0; rtklib_sat.deln = gps_cnav_eph.d_Delta_n; rtklib_sat.OMG0 = gps_cnav_eph.d_OMEGA0; // Compute the angle between the ascending node and the Greenwich meridian - const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200K pp. 164 + const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200L pp. 160 double d_OMEGA_DOT = OMEGA_DOT_REF * GNSS_PI + gps_cnav_eph.d_DELTA_OMEGA_DOT; rtklib_sat.OMGd = d_OMEGA_DOT; rtklib_sat.omg = gps_cnav_eph.d_OMEGA; diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc index cccf72d97..01b3e3d51 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc @@ -1727,7 +1727,7 @@ double timediff(gtime_t t1, gtime_t t2) *-----------------------------------------------------------------------------*/ double timediffweekcrossover(gtime_t t1, gtime_t t2) { - // as stated in IS-GPS-200K table 20-IV footnote among other parts of the ICD, + // as stated in IS-GPS-200L table 20-IV footnote among other parts of the ICD, // if tk=(t - toe) > 302400s then tk = tk - s // if tk=(t - toe) < -302400s then tk = tk + 604800s double tk = difftime(t1.time, t2.time) + t1.sec - t2.sec; diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.h b/src/algorithms/libs/rtklib/rtklib_rtkcmn.h index 8e11b6695..b7724fac2 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.h +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.h @@ -29,7 +29,7 @@ * * * References : - * [1] IS-GPS-200K, Navstar GPS Space Segment/Navigation User Interfaces, + * [1] IS-GPS-200L, Navstar GPS Space Segment/Navigation User Interfaces, * 7 March, 2006 * [2] RTCA/DO-229C, Minimum operational performanc standards for global * positioning system/wide area augmentation system airborne equipment, diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index 3f0c0633a..bea2b3174 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -162,7 +162,7 @@ bool gps_l1_ca_telemetry_decoder_gs::gps_word_parityCheck(uint32_t gpsword) { // XOR as many bits in parallel as possible. The magic constants pick // up bits which are to be XOR'ed together to implement the GPS parity - // check algorithm described in IS-GPS-200K. This avoids lengthy shift- + // check algorithm described in IS-GPS-200L. This avoids lengthy shift- // and-xor loops. const uint32_t d1 = gpsword & 0xFBFFBF00U; const uint32_t d2 = my_rotl::rotl(gpsword, 1U) & 0x07FFBF01U; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h index e368fac93..aabd96238 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h @@ -47,7 +47,7 @@ gps_l1_ca_telemetry_decoder_gs_sptr gps_l1_ca_make_telemetry_decoder_gs( const Tlm_Conf &conf); /*! - * \brief This class implements a block that decodes the NAV data defined in IS-GPS-200K + * \brief This class implements a block that decodes the NAV data defined in IS-GPS-200L */ class gps_l1_ca_telemetry_decoder_gs : public gr::block { diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.h index 8316b4eda..a54e0a740 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.h @@ -48,7 +48,7 @@ gps_l2c_telemetry_decoder_gs_sptr gps_l2c_make_telemetry_decoder_gs( const Tlm_Conf &conf); /*! - * \brief This class implements a block that decodes CNAV data defined in IS-GPS-200K + * \brief This class implements a block that decodes CNAV data defined in IS-GPS-200L */ class gps_l2c_telemetry_decoder_gs : public gr::block { diff --git a/src/core/system_parameters/GLONASS_L1_L2_CA.h b/src/core/system_parameters/GLONASS_L1_L2_CA.h index 80cde0b2f..c5fb7ce24 100644 --- a/src/core/system_parameters/GLONASS_L1_L2_CA.h +++ b/src/core/system_parameters/GLONASS_L1_L2_CA.h @@ -240,7 +240,7 @@ const std::vector GLONASS_GNAV_CRC_P_INDEX{66, 67, 68, 69, 70, 71, 72, const std::vector GLONASS_GNAV_CRC_Q_INDEX{9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85}; // GLONASS GNAV NAVIGATION MESSAGE STRUCTURE -// NAVIGATION MESSAGE FIELDS POSITIONS (from IS-GPS-200K Appendix II) +// NAVIGATION MESSAGE FIELDS POSITIONS (from IS-GPS-200L Appendix II) // FRAME 1-4 // COMMON FIELDS diff --git a/src/core/system_parameters/GPS_CNAV.h b/src/core/system_parameters/GPS_CNAV.h index caeef9c54..fd2ca23bf 100644 --- a/src/core/system_parameters/GPS_CNAV.h +++ b/src/core/system_parameters/GPS_CNAV.h @@ -30,7 +30,7 @@ // CNAV GPS NAVIGATION MESSAGE STRUCTURE -// NAVIGATION MESSAGE FIELDS POSITIONS (from IS-GPS-200K Appendix III) +// NAVIGATION MESSAGE FIELDS POSITIONS (from IS-GPS-200L Appendix III) constexpr int32_t GPS_CNAV_DATA_PAGE_BITS = 300; diff --git a/src/core/system_parameters/GPS_L1_CA.h b/src/core/system_parameters/GPS_L1_CA.h index 598912143..9b0b73050 100644 --- a/src/core/system_parameters/GPS_L1_CA.h +++ b/src/core/system_parameters/GPS_L1_CA.h @@ -73,7 +73,7 @@ constexpr char GPS_CA_PREAMBLE[9] = "10001011"; constexpr char GPS_CA_PREAMBLE_SYMBOLS_STR[161] = "1111111111111111111100000000000000000000000000000000000000000000000000000000000011111111111111111111000000000000000000001111111111111111111111111111111111111111"; // GPS NAVIGATION MESSAGE STRUCTURE -// NAVIGATION MESSAGE FIELDS POSITIONS (from IS-GPS-200K Appendix II) +// NAVIGATION MESSAGE FIELDS POSITIONS (from IS-GPS-200L Appendix II) // SUBFRAME 1-5 (TLM and HOW) diff --git a/src/core/system_parameters/MATH_CONSTANTS.h b/src/core/system_parameters/MATH_CONSTANTS.h index dad0f3e12..749468828 100644 --- a/src/core/system_parameters/MATH_CONSTANTS.h +++ b/src/core/system_parameters/MATH_CONSTANTS.h @@ -28,8 +28,8 @@ constexpr double SPEED_OF_LIGHT_M_S = 299792458.0; //!< Speed of light in constexpr double SPEED_OF_LIGHT_M_MS = 299792.4580; //!< Speed of light in vacuum [m/ms] // Physical constants for GPS -constexpr double GPS_GM = 3.986005e14; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] IS-GPS-200K, pag 92 -constexpr double GPS_F = -4.442807633e-10; //!< Constant, [s/(m)^(1/2)], IS-GPS-200K, pag. 92 +constexpr double GPS_GM = 3.986005e14; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] IS-GPS-200L, pag 96 +constexpr double GPS_F = -4.442807633e-10; //!< Constant, [s/(m)^(1/2)], IS-GPS-200L, pag. 95 // Physical constants for Galileo constexpr double GALILEO_GM = 3.986004418e14; //!< Geocentric gravitational constant[m^3/s^2], OS SIS ICD v2.0, pag. 44 diff --git a/src/core/system_parameters/beidou_dnav_ephemeris.h b/src/core/system_parameters/beidou_dnav_ephemeris.h index 642c75a6b..97444d7cd 100644 --- a/src/core/system_parameters/beidou_dnav_ephemeris.h +++ b/src/core/system_parameters/beidou_dnav_ephemeris.h @@ -45,20 +45,20 @@ public: /*! * \brief Compute the ECEF SV coordinates and ECEF velocity - * Implementation of Table 20-IV (IS-GPS-200K) + * Implementation of Table 20-IV (IS-GPS-200L) * and compute the clock bias term including relativistic effect (return value) */ double satellitePosition(double transmitTime); /*! * \brief Sets (\a d_satClkDrift)and returns the clock drift in seconds according to the User Algorithm for SV Clock Correction - * (IS-GPS-200K, 20.3.3.3.3.1) + * (IS-GPS-200L, 20.3.3.3.3.1) */ double sv_clock_drift(double transmitTime); /*! * \brief Sets (\a d_dtr) and returns the clock relativistic correction term in seconds according to the User Algorithm for SV Clock Correction - * (IS-GPS-200K, 20.3.3.3.3.1) + * (IS-GPS-200L, 20.3.3.3.3.1) */ double sv_clock_relativistic_term(double transmitTime); @@ -71,8 +71,8 @@ public: double d_eccentricity{}; //!< Eccentricity [dimensionless] double d_Cus{}; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)] - double d_Toe{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - double d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] + double d_Toe{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s] + double d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200L) [s] double d_Cic{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] double d_Cis{}; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] @@ -82,7 +82,7 @@ public: double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s] double d_IDOT{}; //!< Rate of Inclination Angle [semi-circles/s] int i_BEIDOU_week{}; //!< BEIDOU week number, aka WN [week] - int i_SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) + int i_SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200L) int i_SV_health{}; double d_TGD1{}; //!< Estimated Group Delay Differential on B1I [s] double d_TGD2{}; //!< Estimated Group Delay Differential on B2I [s] @@ -154,8 +154,8 @@ public: archive& make_nvp("d_e_eccentricity", d_eccentricity); //!< Eccentricity [dimensionless] archive& make_nvp("d_Cus", d_Cus); //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] archive& make_nvp("d_sqrt_A", d_sqrt_A); //!< Square Root of the Semi-Major Axis [sqrt(m)] - archive& make_nvp("d_Toe", d_Toe); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - archive& make_nvp("d_Toc", d_Toe); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] + archive& make_nvp("d_Toe", d_Toe); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s] + archive& make_nvp("d_Toc", d_Toe); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200L) [s] archive& make_nvp("d_Cic", d_Cic); //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] archive& make_nvp("d_OMEGA0", d_OMEGA0); //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] archive& make_nvp("d_Cis", d_Cis); //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] @@ -165,7 +165,7 @@ public: archive& make_nvp("d_OMEGA_DOT", d_OMEGA_DOT); //!< Rate of Right Ascension [semi-circles/s] archive& make_nvp("d_IDOT", d_IDOT); //!< Rate of Inclination Angle [semi-circles/s] archive& make_nvp("i_BEIDOU_week", i_BEIDOU_week); //!< GPS week number, aka WN [week] - archive& make_nvp("i_SV_accuracy", i_SV_accuracy); //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) + archive& make_nvp("i_SV_accuracy", i_SV_accuracy); //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200L) archive& make_nvp("i_SV_health", i_SV_health); archive& make_nvp("d_AODC", d_AODC); //!< Issue of Data, Clock archive& make_nvp("d_TGD1", d_TGD1); //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] @@ -189,7 +189,7 @@ private: /* * Accounts for the beginning or end of week crossover * - * See paragraph 20.3.3.3.3.1 (IS-GPS-200K) + * See paragraph 20.3.3.3.3.1 (IS-GPS-200L) * \param[in] - time in seconds * \param[out] - corrected time, in seconds */ diff --git a/src/core/system_parameters/glonass_gnav_ephemeris.h b/src/core/system_parameters/glonass_gnav_ephemeris.h index 4d33c090c..6beaf411e 100644 --- a/src/core/system_parameters/glonass_gnav_ephemeris.h +++ b/src/core/system_parameters/glonass_gnav_ephemeris.h @@ -90,7 +90,7 @@ public: /*! * \brief Sets (\a d_satClkDrift)and returns the clock drift in seconds according to the User Algorithm for SV Clock Correction - * (IS-GPS-200K, 20.3.3.3.3.1) + * (IS-GPS-200L, 20.3.3.3.3.1) */ double sv_clock_drift(double transmitTime, double timeCorrUTC); @@ -169,7 +169,7 @@ private: /* * Accounts for the beginning or end of week crossover * - * See paragraph 20.3.3.3.3.1 (IS-GPS-200K) + * See paragraph 20.3.3.3.3.1 (IS-GPS-200L) * \param[in] - time in seconds * \param[out] - corrected time, in seconds */ diff --git a/src/core/system_parameters/gps_almanac.h b/src/core/system_parameters/gps_almanac.h index fd5a1abbe..8822d40f0 100644 --- a/src/core/system_parameters/gps_almanac.h +++ b/src/core/system_parameters/gps_almanac.h @@ -28,9 +28,9 @@ /*! - * \brief This class is a storage for the GPS SV ALMANAC data as described in IS-GPS-200K + * \brief This class is a storage for the GPS SV ALMANAC data as described in IS-GPS-200L * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix II + * See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix II */ class Gps_Almanac { @@ -42,7 +42,7 @@ public: uint32_t i_satellite_PRN{}; //!< SV PRN NUMBER double d_Delta_i{}; //!< Inclination Angle at Reference Time (relative to i_0 = 0.30 semi-circles) - int32_t i_Toa{}; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] + int32_t i_Toa{}; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s] int32_t i_WNa{}; //!< Almanac week number double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] double d_e_eccentricity{}; //!< Eccentricity [dimensionless] diff --git a/src/core/system_parameters/gps_cnav_ephemeris.cc b/src/core/system_parameters/gps_cnav_ephemeris.cc index 35157fd46..6c1ced691 100644 --- a/src/core/system_parameters/gps_cnav_ephemeris.cc +++ b/src/core/system_parameters/gps_cnav_ephemeris.cc @@ -2,7 +2,7 @@ * \file gps_cnav_ephemeris.cc * \brief Interface of a GPS CNAV EPHEMERIS storage and orbital model functions * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix III + * See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix III * \author Javier Arribas, 2015. jarribas(at)cttc.es * * ----------------------------------------------------------------------------- @@ -53,7 +53,7 @@ double Gps_CNAV_Ephemeris::sv_clock_drift(double transmitTime) // compute the relativistic correction term double Gps_CNAV_Ephemeris::sv_clock_relativistic_term(double transmitTime) { - const double A_REF = 26559710.0; // See IS-GPS-200K, pp. 163 + const double A_REF = 26559710.0; // See IS-GPS-200L, pp. 161 const double d_sqrt_A = sqrt(A_REF + d_DELTA_A); // Restore semi-major axis @@ -100,8 +100,8 @@ double Gps_CNAV_Ephemeris::sv_clock_relativistic_term(double transmitTime) double Gps_CNAV_Ephemeris::satellitePosition(double transmitTime) { - const double A_REF = 26559710.0; // See IS-GPS-200K, pp. 170 - const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200K pp. 164 + const double A_REF = 26559710.0; // See IS-GPS-200L, pp. 161 + const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200L pp. 160 const double d_sqrt_A = sqrt(A_REF + d_DELTA_A); diff --git a/src/core/system_parameters/gps_cnav_ephemeris.h b/src/core/system_parameters/gps_cnav_ephemeris.h index a6523a3f4..36b053b83 100644 --- a/src/core/system_parameters/gps_cnav_ephemeris.h +++ b/src/core/system_parameters/gps_cnav_ephemeris.h @@ -28,9 +28,9 @@ /*! - * \brief This class is a storage and orbital model functions for the GPS SV ephemeris data as described in IS-GPS-200K + * \brief This class is a storage and orbital model functions for the GPS SV ephemeris data as described in IS-GPS-200L * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix III + * See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix III */ class Gps_CNAV_Ephemeris { @@ -42,19 +42,19 @@ public: /*! * \brief Compute the ECEF SV coordinates and ECEF velocity - * Implementation of Table 20-IV (IS-GPS-200K) + * Implementation of Table 20-IV (IS-GPS-200L) */ double satellitePosition(double transmitTime); /*! * \brief Sets (\a d_satClkDrift)and returns the clock drift in seconds according to the User Algorithm for SV Clock Correction - * (IS-GPS-200K, 20.3.3.3.3.1) + * (IS-GPS-200L, 20.3.3.3.3.1) */ double sv_clock_drift(double transmitTime); /*! * \brief Sets (\a d_dtr) and returns the clock relativistic correction term in seconds according to the User Algorithm for SV Clock Correction - * (IS-GPS-200K, 20.3.3.3.3.1) + * (IS-GPS-200L, 20.3.3.3.3.1) */ double sv_clock_relativistic_term(double transmitTime); @@ -73,8 +73,8 @@ public: double d_e_eccentricity{}; //!< Eccentricity double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-cicles] - int32_t d_Toe1{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - int32_t d_Toe2{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] + int32_t d_Toe1{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s] + int32_t d_Toe2{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s] double d_DELTA_OMEGA_DOT{}; //!< Rate of Right Ascension difference [semi-circles/s] double d_i_0{}; //!< Inclination Angle at Reference Time [semi-circles] double d_IDOT{}; //!< Rate of Inclination Angle [semi-circles/s] @@ -86,7 +86,7 @@ public: double d_Cuc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] // Clock Correction and Accuracy Parameters - int32_t d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] + int32_t d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200L) [s] double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s] double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s] double d_A_f2{}; //!< Coefficient 2 of code phase offset model [s/s^2] @@ -152,9 +152,9 @@ public: archive& make_nvp("d_Cuc", d_Cuc); //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] archive& make_nvp("d_e_eccentricity", d_e_eccentricity); //!< Eccentricity [dimensionless] archive& make_nvp("d_Cus", d_Cus); //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] - archive& make_nvp("d_Toe1", d_Toe1); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - archive& make_nvp("d_Toe2", d_Toe2); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - archive& make_nvp("d_Toc", d_Toc); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] + archive& make_nvp("d_Toe1", d_Toe1); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s] + archive& make_nvp("d_Toe2", d_Toe2); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s] + archive& make_nvp("d_Toc", d_Toc); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200L) [s] archive& make_nvp("d_Cic", d_Cic); //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] archive& make_nvp("d_OMEGA0", d_OMEGA0); //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] archive& make_nvp("d_Cis", d_Cis); //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] diff --git a/src/core/system_parameters/gps_cnav_iono.h b/src/core/system_parameters/gps_cnav_iono.h index 3def6e3af..91d1b9495 100644 --- a/src/core/system_parameters/gps_cnav_iono.h +++ b/src/core/system_parameters/gps_cnav_iono.h @@ -28,9 +28,9 @@ /*! - * \brief This class is a storage for the GPS IONOSPHERIC data as described in IS-GPS-200K + * \brief This class is a storage for the GPS IONOSPHERIC data as described in IS-GPS-200L * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix III + * See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix III */ class Gps_CNAV_Iono { diff --git a/src/core/system_parameters/gps_cnav_navigation_message.cc b/src/core/system_parameters/gps_cnav_navigation_message.cc index 7b8b4f80f..f67a0a934 100644 --- a/src/core/system_parameters/gps_cnav_navigation_message.cc +++ b/src/core/system_parameters/gps_cnav_navigation_message.cc @@ -1,8 +1,8 @@ /*! * \file gps_cnav_navigation_message.cc - * \brief Implementation of a GPS CNAV Data message decoder as described in IS-GPS-200K + * \brief Implementation of a GPS CNAV Data message decoder as described in IS-GPS-200L * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix III + * See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix III * \author Javier Arribas, 2015. jarribas(at)cttc.es * * ----------------------------------------------------------------------------- diff --git a/src/core/system_parameters/gps_cnav_navigation_message.h b/src/core/system_parameters/gps_cnav_navigation_message.h index 85bd2c2fb..017eca10c 100644 --- a/src/core/system_parameters/gps_cnav_navigation_message.h +++ b/src/core/system_parameters/gps_cnav_navigation_message.h @@ -37,9 +37,9 @@ /*! - * \brief This class decodes a GPS CNAV Data message as described in IS-GPS-200K + * \brief This class decodes a GPS CNAV Data message as described in IS-GPS-200L * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix III + * See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix III */ class Gps_CNAV_Navigation_Message { diff --git a/src/core/system_parameters/gps_cnav_utc_model.h b/src/core/system_parameters/gps_cnav_utc_model.h index 1bc5faf38..4c48c642f 100644 --- a/src/core/system_parameters/gps_cnav_utc_model.h +++ b/src/core/system_parameters/gps_cnav_utc_model.h @@ -28,9 +28,9 @@ /*! - * \brief This class is a storage for the GPS UTC MODEL data as described in in IS-GPS-200K + * \brief This class is a storage for the GPS UTC MODEL data as described in in IS-GPS-200L * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix III + * See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix III */ class Gps_CNAV_Utc_Model { @@ -41,10 +41,10 @@ public: Gps_CNAV_Utc_Model() = default; // UTC parameters - double d_A2{}; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] - double d_A1{}; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] - double d_A0{}; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s] - int32_t d_t_OT{}; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200K) [s] + double d_A2{}; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s/s] + double d_A1{}; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s/s] + double d_A0{}; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s] + int32_t d_t_OT{}; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200L) [s] int32_t i_WN_T{}; //!< UTC reference week number [weeks] int32_t d_DeltaT_LS{}; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. int32_t i_WN_LSF{}; //!< Week number at the end of which the leap second becomes effective [weeks] diff --git a/src/core/system_parameters/gps_ephemeris.cc b/src/core/system_parameters/gps_ephemeris.cc index 384c0be40..ecf3c23c8 100644 --- a/src/core/system_parameters/gps_ephemeris.cc +++ b/src/core/system_parameters/gps_ephemeris.cc @@ -2,7 +2,7 @@ * \file gps_ephemeris.cc * \brief Interface of a GPS EPHEMERIS storage and orbital model functions * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix II + * See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix II * \author Javier Arribas, 2013. jarribas(at)cttc.es * * ----------------------------------------------------------------------------- diff --git a/src/core/system_parameters/gps_ephemeris.h b/src/core/system_parameters/gps_ephemeris.h index 154f96710..ae047aff3 100644 --- a/src/core/system_parameters/gps_ephemeris.h +++ b/src/core/system_parameters/gps_ephemeris.h @@ -31,9 +31,9 @@ /*! - * \brief This class is a storage and orbital model functions for the GPS SV ephemeris data as described in IS-GPS-200K + * \brief This class is a storage and orbital model functions for the GPS SV ephemeris data as described in IS-GPS-200L * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix II + * See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix II */ class Gps_Ephemeris { @@ -45,20 +45,20 @@ public: /*! * \brief Compute the ECEF SV coordinates and ECEF velocity - * Implementation of Table 20-IV (IS-GPS-200K) + * Implementation of Table 20-IV (IS-GPS-200L) * and compute the clock bias term including relativistic effect (return value) */ double satellitePosition(double transmitTime); /*! * \brief Sets (\a d_satClkDrift)and returns the clock drift in seconds according to the User Algorithm for SV Clock Correction - * (IS-GPS-200K, 20.3.3.3.3.1) + * (IS-GPS-200L, 20.3.3.3.3.1) */ double sv_clock_drift(double transmitTime); /*! * \brief Sets (\a d_dtr) and returns the clock relativistic correction term in seconds according to the User Algorithm for SV Clock Correction - * (IS-GPS-200K, 20.3.3.3.3.1) + * (IS-GPS-200L, 20.3.3.3.3.1) */ double sv_clock_relativistic_term(double transmitTime); @@ -71,8 +71,8 @@ public: double d_e_eccentricity{}; //!< Eccentricity [dimensionless] double d_Cus{}; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)] - int32_t d_Toe{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - int32_t d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] + int32_t d_Toe{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s] + int32_t d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200L) [s] double d_Cic{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] double d_Cis{}; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] @@ -84,7 +84,7 @@ public: int32_t i_code_on_L2{}; //!< If 1, P code ON in L2; if 2, C/A code ON in L2; int32_t i_GPS_week{}; //!< GPS week number, aka WN [week] bool b_L2_P_data_flag{}; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel - int32_t i_SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) + int32_t i_SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200L) int32_t i_SV_health{}; double d_TGD{}; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] int32_t d_IODC{}; //!< Issue of Data, Clock @@ -155,8 +155,8 @@ public: archive& make_nvp("d_e_eccentricity", d_e_eccentricity); //!< Eccentricity [dimensionless] archive& make_nvp("d_Cus", d_Cus); //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] archive& make_nvp("d_sqrt_A", d_sqrt_A); //!< Square Root of the Semi-Major Axis [sqrt(m)] - archive& make_nvp("d_Toe", d_Toe); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - archive& make_nvp("d_Toc", d_Toc); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] + archive& make_nvp("d_Toe", d_Toe); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s] + archive& make_nvp("d_Toc", d_Toc); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200L) [s] archive& make_nvp("d_Cic", d_Cic); //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] archive& make_nvp("d_OMEGA0", d_OMEGA0); //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] archive& make_nvp("d_Cis", d_Cis); //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] @@ -168,7 +168,7 @@ public: archive& make_nvp("i_code_on_L2", i_code_on_L2); //!< If 1, P code ON in L2; if 2, C/A code ON in L2; archive& make_nvp("i_GPS_week", i_GPS_week); //!< GPS week number, aka WN [week] archive& make_nvp("b_L2_P_data_flag", b_L2_P_data_flag); //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel - archive& make_nvp("i_SV_accuracy", i_SV_accuracy); //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) + archive& make_nvp("i_SV_accuracy", i_SV_accuracy); //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200L) archive& make_nvp("i_SV_health", i_SV_health); archive& make_nvp("d_TGD", d_TGD); //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] archive& make_nvp("d_IODC", d_IODC); //!< Issue of Data, Clock @@ -191,7 +191,7 @@ private: /* * Accounts for the beginning or end of week crossover * - * See paragraph 20.3.3.3.3.1 (IS-GPS-200K) + * See paragraph 20.3.3.3.3.1 (IS-GPS-200L) * \param[in] - time in seconds * \param[out] - corrected time, in seconds */ diff --git a/src/core/system_parameters/gps_iono.h b/src/core/system_parameters/gps_iono.h index a145ca8c7..7c3ab353a 100644 --- a/src/core/system_parameters/gps_iono.h +++ b/src/core/system_parameters/gps_iono.h @@ -28,9 +28,9 @@ /*! - * \brief This class is a storage for the GPS IONOSPHERIC data as described in IS-GPS-200K + * \brief This class is a storage for the GPS IONOSPHERIC data as described in IS-GPS-200L * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix II + * See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix II */ class Gps_Iono { diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc index 420134a75..456daa51a 100644 --- a/src/core/system_parameters/gps_navigation_message.cc +++ b/src/core/system_parameters/gps_navigation_message.cc @@ -3,7 +3,7 @@ * \brief Implementation of a GPS NAV Data message decoder as described in IS-GPS-200K * \author Javier Arribas, 2011. jarribas(at)cttc.es * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix II + * See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix II * * * ----------------------------------------------------------------------------- @@ -135,7 +135,7 @@ int32_t Gps_Navigation_Message::subframe_decoder(char* subframe) switch (subframe_ID) { // --- Decode the sub-frame id ----------------------------------------- - // ICD (IS-GPS-200K Appendix II). https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf + // ICD (IS-GPS-200K Appendix II). https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf case 1: // --- It is subframe 1 ------------------------------------- // Compute the time of week (TOW) of the first sub-frames in the array ==== diff --git a/src/core/system_parameters/gps_navigation_message.h b/src/core/system_parameters/gps_navigation_message.h index 5b2616492..9c423f554 100644 --- a/src/core/system_parameters/gps_navigation_message.h +++ b/src/core/system_parameters/gps_navigation_message.h @@ -38,9 +38,9 @@ /*! - * \brief This class decodes a GPS NAV Data message as described in IS-GPS-200K + * \brief This class decodes a GPS NAV Data message as described in IS-GPS-200L * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix II + * See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix II */ class Gps_Navigation_Message { @@ -72,7 +72,7 @@ public: /*! * \brief Computes the Coordinated Universal Time (UTC) and - * returns it in [s] (IS-GPS-200K, 20.3.3.5.2.4) + * returns it in [s] (IS-GPS-200L, 20.3.3.5.2.4) */ double utc_time(const double gpstime_corrected) const; @@ -162,8 +162,8 @@ private: double d_Cus{}; // Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] double d_sqrt_A{}; // Square Root of the Semi-Major Axis [sqrt(m)] // broadcast orbit 3 - int32_t d_Toe{}; // Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - int32_t d_Toc{}; // clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] + int32_t d_Toe{}; // Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s] + int32_t d_Toc{}; // clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200L) [s] double d_Cic{}; // Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] double d_OMEGA0{}; // Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] double d_Cis{}; // Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] @@ -178,7 +178,7 @@ private: int32_t i_GPS_week{}; // GPS week number, aka WN [week] bool b_L2_P_data_flag{}; // When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel // broadcast orbit 6 - int32_t i_SV_accuracy{}; // User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) + int32_t i_SV_accuracy{}; // User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200L) int32_t i_SV_health{}; double d_TGD{}; // Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] int32_t d_IODC{}; // Issue of Data, Clock @@ -226,10 +226,10 @@ private: double d_beta3{}; // Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] // UTC parameters - double d_A0{}; // Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s] - double d_A1{}; // 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] + double d_A0{}; // Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s] + double d_A1{}; // 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s/s] - int32_t d_t_OT{}; // Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200K) [s] + int32_t d_t_OT{}; // Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200L) [s] int32_t i_WN_T{}; // UTC reference week number [weeks] int32_t d_DeltaT_LS{}; // delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. int32_t i_WN_LSF{}; // Week number at the end of which the leap second becomes effective [weeks] diff --git a/src/core/system_parameters/gps_utc_model.h b/src/core/system_parameters/gps_utc_model.h index 9104b3715..2d3324535 100644 --- a/src/core/system_parameters/gps_utc_model.h +++ b/src/core/system_parameters/gps_utc_model.h @@ -28,9 +28,9 @@ /*! - * \brief This class is a storage for the GPS UTC MODEL data as described in IS-GPS-200K + * \brief This class is a storage for the GPS UTC MODEL data as described in IS-GPS-200L * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix II + * See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix II */ class Gps_Utc_Model { @@ -41,10 +41,10 @@ public: Gps_Utc_Model() = default; // UTC parameters - double d_A0{}; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s] - double d_A1{}; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] - double d_A2{}; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] - int32_t d_t_OT{}; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200K) [s] + double d_A0{}; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s] + double d_A1{}; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s/s] + double d_A2{}; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s/s] + int32_t d_t_OT{}; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200L) [s] int32_t i_WN_T{}; //!< UTC reference week number [weeks] int32_t d_DeltaT_LS{}; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. int32_t i_WN_LSF{}; //!< Week number at the end of which the leap second becomes effective [weeks] From ede02f91df21a88015b37d149febb4a9839fb893 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 12 Jan 2021 10:46:38 +0100 Subject: [PATCH 05/11] Update references to new GPS ICDs (add missing file) --- .../system_parameters/gps_navigation_message.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc index 456daa51a..73baa56ea 100644 --- a/src/core/system_parameters/gps_navigation_message.cc +++ b/src/core/system_parameters/gps_navigation_message.cc @@ -1,6 +1,6 @@ /*! * \file gps_navigation_message.cc - * \brief Implementation of a GPS NAV Data message decoder as described in IS-GPS-200K + * \brief Implementation of a GPS NAV Data message decoder as described in IS-GPS-200L * \author Javier Arribas, 2011. jarribas(at)cttc.es * * See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix II @@ -135,7 +135,7 @@ int32_t Gps_Navigation_Message::subframe_decoder(char* subframe) switch (subframe_ID) { // --- Decode the sub-frame id ----------------------------------------- - // ICD (IS-GPS-200K Appendix II). https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf + // ICD (IS-GPS-200L Appendix II). https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf case 1: // --- It is subframe 1 ------------------------------------- // Compute the time of week (TOW) of the first sub-frames in the array ==== @@ -233,7 +233,7 @@ int32_t Gps_Navigation_Message::subframe_decoder(char* subframe) b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG); SV_data_ID = static_cast(read_navigation_unsigned(subframe_bits, SV_DATA_ID)); SV_page = static_cast(read_navigation_unsigned(subframe_bits, SV_PAGE)); - if (SV_page > 24 && SV_page < 33) // Page 4 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200K, page 110) + if (SV_page > 24 && SV_page < 33) // Page 4 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200L, page 110) { //! \TODO read almanac if (SV_data_ID != 0) @@ -241,12 +241,12 @@ int32_t Gps_Navigation_Message::subframe_decoder(char* subframe) } } - if (SV_page == 52) // Page 13 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200K, page 110) + if (SV_page == 52) // Page 13 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200L, page 110) { //! \TODO read Estimated Range Deviation (ERD) values } - if (SV_page == 56) // Page 18 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200K, page 110) + if (SV_page == 56) // Page 18 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200L, page 110) { // Page 18 - Ionospheric and UTC data d_alpha0 = static_cast(read_navigation_signed(subframe_bits, ALPHA_0)); @@ -284,7 +284,7 @@ int32_t Gps_Navigation_Message::subframe_decoder(char* subframe) // Reserved } - if (SV_page == 63) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200K, page 110) + if (SV_page == 63) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200L, page 110) { // Page 25 Anti-Spoofing, SV config and almanac health (PRN: 25-32) //! \TODO Read Anti-Spoofing, SV config @@ -317,7 +317,7 @@ int32_t Gps_Navigation_Message::subframe_decoder(char* subframe) { } } - if (SV_page_5 == 51) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200K, page 110) + if (SV_page_5 == 51) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200L, page 110) { i_Toa = static_cast(read_navigation_unsigned(subframe_bits, T_OA)); i_Toa = i_Toa * T_OA_LSB; @@ -411,7 +411,7 @@ double Gps_Navigation_Message::utc_time(const double gpstime_corrected) const /* 20.3.3.5.2.4c * Whenever the effectivity time of the leap second event, as indicated by the * WNLSF and DN values, is in the "past" (relative to the user's current time), - * and the user�s current time does not fall in the time span as given above + * and the user's current time does not fall in the time span as given above * in 20.3.3.5.2.4b,*/ Delta_t_UTC = d_DeltaT_LSF + d_A0 + d_A1 * (gpstime_corrected - d_t_OT + 604800 * static_cast((i_GPS_week - i_WN_T))); t_utc_daytime = fmod(gpstime_corrected - Delta_t_UTC, 86400); From 4fea48f603b8f84cab7485b285acf9f938e991e9 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 15 Jan 2021 13:39:26 +0100 Subject: [PATCH 06/11] Improve handling of change in GNU Radio 3.9 FFT API Fix compilation of some optional blocks when linking against GR 3.9 Fix warning -Wembedded-directive: embedding a directive within macro arguments has undefined behavior --- docs/changelog.md | 4 ++ .../acquisition/adapters/CMakeLists.txt | 1 - ...ileo_e1_pcps_ambiguous_acquisition_fpga.cc | 6 +- .../galileo_e5a_pcps_acquisition_fpga.cc | 5 +- .../galileo_e5b_pcps_acquisition_fpga.cc | 6 +- .../gps_l1_ca_pcps_acquisition_fpga.cc | 5 +- .../gps_l2_m_pcps_acquisition_fpga.cc | 5 +- .../adapters/gps_l5i_pcps_acquisition_fpga.cc | 5 +- .../gnuradio_blocks/CMakeLists.txt | 8 --- ...o_e5a_noncoherent_iq_acquisition_caf_cc.cc | 16 +---- ...eo_e5a_noncoherent_iq_acquisition_caf_cc.h | 12 ++-- .../galileo_pcps_8ms_acquisition_cc.cc | 15 +---- .../galileo_pcps_8ms_acquisition_cc.h | 12 ++-- .../gnuradio_blocks/pcps_acquisition.cc | 15 +---- .../gnuradio_blocks/pcps_acquisition.h | 12 +--- .../pcps_acquisition_fine_doppler_cc.cc | 22 ++----- .../pcps_acquisition_fine_doppler_cc.h | 11 +--- .../pcps_assisted_acquisition_cc.cc | 14 +---- .../pcps_assisted_acquisition_cc.h | 11 +--- .../pcps_cccwsr_acquisition_cc.cc | 15 +---- .../pcps_cccwsr_acquisition_cc.h | 11 +--- .../pcps_opencl_acquisition_cc.cc | 5 +- .../pcps_opencl_acquisition_cc.h | 6 +- .../pcps_quicksync_acquisition_cc.cc | 14 +---- .../pcps_quicksync_acquisition_cc.h | 11 +--- .../pcps_tong_acquisition_cc.cc | 15 +---- .../pcps_tong_acquisition_cc.h | 12 +--- .../gnuradio_blocks/CMakeLists.txt | 9 +-- .../input_filter/gnuradio_blocks/notch_cc.cc | 7 +-- .../input_filter/gnuradio_blocks/notch_cc.h | 9 +-- .../gnuradio_blocks/notch_lite_cc.cc | 7 +-- .../gnuradio_blocks/notch_lite_cc.h | 9 +-- src/algorithms/libs/CMakeLists.txt | 8 +++ src/algorithms/libs/gnss_sdr_fft.h | 63 +++++++++++++++++++ .../libs/supl/asn-rrlp/converter-sample.c | 2 +- src/tests/CMakeLists.txt | 5 -- .../unit-tests/arithmetic/fft_length_test.cc | 9 +-- .../unit-tests/arithmetic/fft_speed_test.cc | 9 +-- 38 files changed, 156 insertions(+), 255 deletions(-) create mode 100644 src/algorithms/libs/gnss_sdr_fft.h diff --git a/docs/changelog.md b/docs/changelog.md index f86b1156f..ccfef19db 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -21,6 +21,10 @@ SPDX-FileCopyrightText: 2011-2021 Carles Fernandez-Prades = 12 and CMake >= 3.19. +### Improvements in Maintainability: + +- Improved handling of change in GNU Radio 3.9 FFT API. +   ## [GNSS-SDR v0.0.14](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.14) diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index 38bfa860a..b836d0f42 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -123,7 +123,6 @@ if(ENABLE_FPGA) PRIVATE algorithms_libs core_libs - Gnuradio::fft Volk::volk Volkgnsssdr::volkgnsssdr ) diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc index 9d5ee27d7..30c096a63 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc @@ -19,8 +19,8 @@ #include "Galileo_E1.h" #include "configuration_interface.h" #include "galileo_e1_signal_replica.h" +#include "gnss_sdr_fft.h" #include "gnss_sdr_flags.h" -#include "gnss_sdr_make_unique.h" #include "uio_fpga.h" #include #include // for fft_complex @@ -92,8 +92,8 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( // compute all the GALILEO E1 PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - auto fft_if = std::make_unique(nsamples_total, true); // Direct FFT - volk_gnsssdr::vector> code(nsamples_total); // buffer for the local code + auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // Direct FFT + volk_gnsssdr::vector> code(nsamples_total); // buffer for the local code volk_gnsssdr::vector fft_codes_padded(nsamples_total); d_all_fft_codes_ = std::vector(nsamples_total * GALILEO_E1_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32 diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc index e86c4478c..62461494f 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc @@ -19,11 +19,10 @@ #include "Galileo_E5a.h" #include "configuration_interface.h" #include "galileo_e5_signal_replica.h" +#include "gnss_sdr_fft.h" #include "gnss_sdr_flags.h" -#include "gnss_sdr_make_unique.h" #include "uio_fpga.h" #include -#include // for fft_complex #include // for gr_complex #include // for volk_32fc_conjugate_32fc #include @@ -94,7 +93,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga( // compute all the GALILEO E5 PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - auto fft_if = std::make_unique(nsamples_total, true); // Direct FFT + auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // Direct FFT volk_gnsssdr::vector> code(nsamples_total); volk_gnsssdr::vector> fft_codes_padded(nsamples_total); d_all_fft_codes_ = std::vector(nsamples_total * GALILEO_E5A_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32 diff --git a/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.cc index ecc1df91c..bc0d8b3bc 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.cc @@ -20,10 +20,10 @@ #include "Galileo_E5b.h" #include "configuration_interface.h" #include "galileo_e5_signal_replica.h" +#include "gnss_sdr_fft.h" #include "gnss_sdr_flags.h" #include "uio_fpga.h" #include -#include // for fft_complex #include // for gr_complex #include // for volk_32fc_conjugate_32fc #include @@ -93,8 +93,8 @@ GalileoE5bPcpsAcquisitionFpga::GalileoE5bPcpsAcquisitionFpga(const Configuration // compute all the GALILEO E5b PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - auto fft_if = std::unique_ptr(new gr::fft::fft_complex(nsamples_total, true)); // Direct FFT - volk_gnsssdr::vector> code(nsamples_total); // Buffer for local code + auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // Direct FFT + volk_gnsssdr::vector> code(nsamples_total); // Buffer for local code volk_gnsssdr::vector> fft_codes_padded(nsamples_total); d_all_fft_codes_ = std::vector(nsamples_total * GALILEO_E5B_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32 diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc index 2c7ec4a37..8117920c7 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc @@ -21,12 +21,11 @@ #include "gps_l1_ca_pcps_acquisition_fpga.h" #include "GPS_L1_CA.h" #include "configuration_interface.h" +#include "gnss_sdr_fft.h" #include "gnss_sdr_flags.h" -#include "gnss_sdr_make_unique.h" #include "gps_sdr_signal_replica.h" #include "uio_fpga.h" #include -#include #include // for gr_complex #include // for volk_32fc_conjugate_32fc #include @@ -86,7 +85,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( // compute all the GPS L1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - auto fft_if = std::make_unique(nsamples_total, true); + auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // allocate memory to compute all the PRNs and compute all the possible codes volk_gnsssdr::vector> code(nsamples_total); volk_gnsssdr::vector> fft_codes_padded(nsamples_total); diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc index 2b23b58ac..464959a74 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc @@ -20,13 +20,12 @@ #include "gps_l2_m_pcps_acquisition_fpga.h" #include "GPS_L2C.h" #include "configuration_interface.h" +#include "gnss_sdr_fft.h" #include "gnss_sdr_flags.h" -#include "gnss_sdr_make_unique.h" #include "gnss_synchro.h" #include "gps_l2c_signal_replica.h" #include "uio_fpga.h" #include -#include // for fft_complex #include // for gr_complex #include // for volk_32fc_conjugate_32fc #include @@ -86,7 +85,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( // compute all the GPS L2C PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - auto fft_if = std::make_unique(nsamples_total, true); // Direct FFT + auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // Direct FFT // allocate memory to compute all the PRNs and compute all the possible codes volk_gnsssdr::vector> code(nsamples_total); volk_gnsssdr::vector> fft_codes_padded(nsamples_total); diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc index e5a39ca85..e287a8fd1 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc @@ -21,12 +21,11 @@ #include "gps_l5i_pcps_acquisition_fpga.h" #include "GPS_L5.h" #include "configuration_interface.h" +#include "gnss_sdr_fft.h" #include "gnss_sdr_flags.h" -#include "gnss_sdr_make_unique.h" #include "gps_l5_signal_replica.h" #include "uio_fpga.h" #include -#include // for fft_complex #include // for gr_complex #include // for volk_32fc_conjugate_32fc #include @@ -90,7 +89,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( // compute all the GPS L5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - auto fft_if = std::make_unique(nsamples_total, true); // Direct FFT + auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // Direct FFT volk_gnsssdr::vector> code(nsamples_total); volk_gnsssdr::vector> fft_codes_padded(nsamples_total); d_all_fft_codes_ = std::vector(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32 diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index 96fece0e0..6f18e2b11 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -81,8 +81,6 @@ target_link_libraries(acquisition_gr_blocks ) target_include_directories(acquisition_gr_blocks - PUBLIC - ${CMAKE_SOURCE_DIR}/src/algorithms/libs PRIVATE ${CMAKE_SOURCE_DIR}/src/core/receiver ) @@ -93,12 +91,6 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() -if(GNURADIO_FFT_USES_TEMPLATES) - target_compile_definitions(acquisition_gr_blocks - PUBLIC -DGNURADIO_FFT_USES_TEMPLATES=1 - ) -endif() - if(ENABLE_ARMA_NO_DEBUG) target_compile_definitions(acquisition_gr_blocks PUBLIC -DARMA_NO_BOUND_CHECKING=1 diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc index d60e954e9..4994c300b 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc @@ -23,7 +23,6 @@ #include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h" #include "MATH_CONSTANTS.h" -#include "gnss_sdr_make_unique.h" #include #include #include @@ -119,18 +118,9 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit } } -#if GNURADIO_FFT_USES_TEMPLATES - // Direct FFT - d_fft_if = std::make_unique(d_fft_size); - // Inverse FFT - d_ifft = std::make_unique(d_fft_size); -#else - // Direct FFT - d_fft_if = std::make_unique(d_fft_size, true); - // Inverse FFT - d_ifft = std::make_unique(d_fft_size, false); -#endif - // For dumping samples into a file + d_fft_if = gnss_fft_fwd_make_unique(d_fft_size); + d_ifft = gnss_fft_rev_make_unique(d_fft_size); + d_dump = dump; d_dump_filename = dump_filename; diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h index 4297693e1..f3230ae74 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h @@ -25,9 +25,9 @@ #define GNSS_SDR_GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_CC_H #include "channel_fsm.h" +#include "gnss_sdr_fft.h" #include "gnss_synchro.h" #include -#include #include #include #include @@ -204,13 +204,9 @@ private: float estimate_input_power(gr_complex* in); std::weak_ptr d_channel_fsm; -#if GNURADIO_FFT_USES_TEMPLATES - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; -#else - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; -#endif + std::unique_ptr d_fft_if; + std::unique_ptr d_ifft; + std::vector> d_grid_doppler_wipeoffs; std::vector d_fft_code_I_A; std::vector d_fft_code_I_B; diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc index 0e520a526..446151499 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc @@ -17,7 +17,6 @@ #include "galileo_pcps_8ms_acquisition_cc.h" #include "MATH_CONSTANTS.h" -#include "gnss_sdr_make_unique.h" #include #include #include @@ -76,18 +75,8 @@ galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc( d_fft_code_A = std::vector(d_fft_size, lv_cmake(0.0F, 0.0F)); d_fft_code_B = std::vector(d_fft_size, lv_cmake(0.0F, 0.0F)); d_magnitude = std::vector(d_fft_size, 0.0F); - -#if GNURADIO_FFT_USES_TEMPLATES - // Direct FFT - d_fft_if = std::make_unique(d_fft_size); - // Inverse FFT - d_ifft = std::make_unique(d_fft_size); -#else - // Direct FFT - d_fft_if = std::make_unique(d_fft_size, true); - // Inverse FFT - d_ifft = std::make_unique(d_fft_size, false); -#endif + d_fft_if = gnss_fft_fwd_make_unique(d_fft_size); + d_ifft = gnss_fft_rev_make_unique(d_fft_size); // For dumping samples into a file d_dump = dump; diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h index 5fb8360a6..6ed5200cf 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h @@ -19,9 +19,9 @@ #define GNSS_SDR_PCPS_8MS_ACQUISITION_CC_H #include "channel_fsm.h" +#include "gnss_sdr_fft.h" #include "gnss_synchro.h" #include -#include #include #include #include @@ -190,13 +190,9 @@ private: int32_t doppler_offset); std::weak_ptr d_channel_fsm; -#if GNURADIO_FFT_USES_TEMPLATES - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; -#else - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; -#endif + std::unique_ptr d_fft_if; + std::unique_ptr d_ifft; + std::vector> d_grid_doppler_wipeoffs; std::vector d_fft_code_A; std::vector d_fft_code_B; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 8869297aa..3782e6128 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -24,7 +24,6 @@ #include "MATH_CONSTANTS.h" // for TWO_PI #include "gnss_frequencies.h" #include "gnss_sdr_create_directory.h" -#include "gnss_sdr_make_unique.h" #include "gnss_synchro.h" #if HAS_STD_FILESYSTEM #if HAS_STD_FILESYSTEM_EXPERIMENTAL @@ -126,18 +125,8 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu d_tmp_buffer = volk_gnsssdr::vector(d_fft_size); d_fft_codes = volk_gnsssdr::vector>(d_fft_size); d_input_signal = volk_gnsssdr::vector>(d_fft_size); - -#if GNURADIO_FFT_USES_TEMPLATES - // Direct FFT - d_fft_if = std::make_unique(d_fft_size); - // Inverse FFT - d_ifft = std::make_unique(d_fft_size); -#else - // Direct FFT - d_fft_if = std::make_unique(d_fft_size, true); - // Inverse FFT - d_ifft = std::make_unique(d_fft_size, false); -#endif + d_fft_if = gnss_fft_fwd_make_unique(d_fft_size); + d_ifft = gnss_fft_rev_make_unique(d_fft_size); d_gnss_synchro = nullptr; d_worker_active = false; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h index 6ca0156d4..924ce64b5 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h @@ -44,10 +44,10 @@ #include "acq_conf.h" #include "channel_fsm.h" +#include "gnss_sdr_fft.h" #include #include #include -#include #include // for gr_complex #include // for scoped_lock #include // for gr_vector_const_void_star @@ -240,14 +240,8 @@ private: volk_gnsssdr::vector> d_data_buffer; volk_gnsssdr::vector d_data_buffer_sc; -#if GNURADIO_FFT_USES_TEMPLATES - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; -#else - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; -#endif - + std::unique_ptr d_fft_if; + std::unique_ptr d_ifft; std::weak_ptr d_channel_fsm; Acq_Conf d_acq_parameters; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc index 5917df106..90318d576 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc @@ -19,7 +19,6 @@ #include "pcps_acquisition_fine_doppler_cc.h" #include "GPS_L1_CA.h" // for GPS_L1_CA_CHIP_PERIOD_S #include "gnss_sdr_create_directory.h" -#include "gnss_sdr_make_unique.h" #include "gps_sdr_signal_replica.h" #if HAS_STD_FILESYSTEM #if HAS_STD_FILESYSTEM_EXPERIMENTAL @@ -77,17 +76,8 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con d_fft_codes.reserve(d_fft_size); d_magnitude.reserve(d_fft_size); d_10_ms_buffer.reserve(50 * d_samples_per_ms); -#if GNURADIO_FFT_USES_TEMPLATES - // Direct FFT - d_fft_if = std::make_unique(d_fft_size); - // Inverse FFT - d_ifft = std::make_unique(d_fft_size); -#else - // Direct FFT - d_fft_if = std::make_unique(d_fft_size, true); - // Inverse FFT - d_ifft = std::make_unique(d_fft_size, false); -#endif + d_fft_if = gnss_fft_fwd_make_unique(d_fft_size); + d_ifft = gnss_fft_rev_make_unique(d_fft_size); // For dumping samples into a file d_dump = conf_.dump; @@ -383,11 +373,9 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler() int signal_samples = prn_replicas * d_fft_size; // int fft_size_extended = nextPowerOf2(signal_samples * zero_padding_factor); int fft_size_extended = signal_samples * zero_padding_factor; -#if GNURADIO_FFT_USES_TEMPLATES - auto fft_operator = std::make_unique(fft_size_extended); -#else - auto fft_operator = std::make_unique(fft_size_extended, true); -#endif + + auto fft_operator = gnss_fft_fwd_make_unique(fft_size_extended); + // zero padding the entire vector std::fill_n(fft_operator->get_inbuf(), fft_size_extended, gr_complex(0.0, 0.0)); diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h index 299858536..22f6b35dd 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h @@ -41,10 +41,10 @@ #include "acq_conf.h" #include "channel_fsm.h" +#include "gnss_sdr_fft.h" #include "gnss_synchro.h" #include #include -#include #include #include // for volk_gnsssdr::vector #include @@ -197,13 +197,8 @@ private: bool start(); std::weak_ptr d_channel_fsm; -#if GNURADIO_FFT_USES_TEMPLATES - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; -#else - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; -#endif + std::unique_ptr d_fft_if; + std::unique_ptr d_ifft; volk_gnsssdr::vector>> d_grid_doppler_wipeoffs; volk_gnsssdr::vector> d_grid_data; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc index a31d41a22..de09906df 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc @@ -19,7 +19,6 @@ #include "pcps_assisted_acquisition_cc.h" #include "MATH_CONSTANTS.h" #include "concurrent_map.h" -#include "gnss_sdr_make_unique.h" #include "gps_acq_assist.h" #include #include @@ -69,17 +68,8 @@ pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc( d_disable_assist = false; d_fft_codes.reserve(d_fft_size); -#if GNURADIO_FFT_USES_TEMPLATES - // Direct FFT - d_fft_if = std::make_unique(d_fft_size); - // Inverse FFT - d_ifft = std::make_unique(d_fft_size); -#else - // Direct FFT - d_fft_if = std::make_unique(d_fft_size, true); - // Inverse FFT - d_ifft = std::make_unique(d_fft_size, false); -#endif + d_fft_if = gnss_fft_fwd_make_unique(d_fft_size); + d_ifft = gnss_fft_rev_make_unique(d_fft_size); // For dumping samples into a file d_dump = dump; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h index 275dbf2bf..55fdfd39d 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h @@ -35,9 +35,9 @@ #define GNSS_SDR_PCPS_ASSISTED_ACQUISITION_CC_H #include "channel_fsm.h" +#include "gnss_sdr_fft.h" #include "gnss_synchro.h" #include -#include #include #include #include @@ -198,13 +198,8 @@ private: void redefine_grid(); std::weak_ptr d_channel_fsm; -#if GNURADIO_FFT_USES_TEMPLATES - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; -#else - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; -#endif + std::unique_ptr d_fft_if; + std::unique_ptr d_ifft; std::vector>> d_grid_doppler_wipeoffs; std::vector> d_grid_data; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc index 86dbe6dfd..86a964c4c 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc @@ -22,7 +22,6 @@ #include "pcps_cccwsr_acquisition_cc.h" #include "MATH_CONSTANTS.h" // TWO_PI -#include "gnss_sdr_make_unique.h" #include #include #include @@ -86,17 +85,9 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc( d_correlation_minus.reserve(d_fft_size); d_magnitude.reserve(d_fft_size); -#if GNURADIO_FFT_USES_TEMPLATES - // Direct FFT - d_fft_if = std::make_unique(d_fft_size); - // Inverse FFT - d_ifft = std::make_unique(d_fft_size); -#else - // Direct FFT - d_fft_if = std::make_unique(d_fft_size, true); - // Inverse FFT - d_ifft = std::make_unique(d_fft_size, false); -#endif + d_fft_if = gnss_fft_fwd_make_unique(d_fft_size); + d_ifft = gnss_fft_rev_make_unique(d_fft_size); + // For dumping samples into a file d_dump = dump; d_dump_filename = dump_filename; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h index 9c710c4fb..83582cb42 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h @@ -24,9 +24,9 @@ #define GNSS_SDR_PCPS_CCCWSR_ACQUISITION_CC_H #include "channel_fsm.h" +#include "gnss_sdr_fft.h" #include "gnss_synchro.h" #include -#include #include #include #include @@ -183,13 +183,8 @@ private: std::weak_ptr d_channel_fsm; -#if GNURADIO_FFT_USES_TEMPLATES - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; -#else - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; -#endif + std::unique_ptr d_fft_if; + std::unique_ptr d_ifft; std::vector> d_grid_doppler_wipeoffs; std::vector d_fft_code_data; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc index c7ff3d8df..0465f90db 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc @@ -36,7 +36,6 @@ #include "pcps_opencl_acquisition_cc.h" #include "MATH_CONSTANTS.h" // TWO_PI -#include "gnss_sdr_make_unique.h" #include "opencl/fft_base_kernels.h" #include "opencl/fft_internal.h" #include @@ -112,10 +111,10 @@ pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc( if (d_opencl != 0) { // Direct FFT - d_fft_if = std::make_unique(d_fft_size, true); + d_fft_if = gnss_fft_fwd_make_unique(d_fft_size); // Inverse FFT - d_ifft = std::make_unique(d_fft_size, false); + d_ifft = gnss_fft_rev_make_unique(d_fft_size); } // For dumping samples into a file diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h index e1e4569be..caea4ffcc 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h @@ -40,10 +40,10 @@ #define CL_SILENCE_DEPRECATION #include "channel_fsm.h" #include "gnss_block_interface.h" +#include "gnss_sdr_fft.h" #include "gnss_synchro.h" #include "opencl/fft_internal.h" #include -#include #include #include "opencl/cl.hpp" #include @@ -239,8 +239,8 @@ private: std::weak_ptr d_channel_fsm; - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; + std::unique_ptr d_fft_if; + std::unique_ptr d_ifft; std::vector> d_grid_doppler_wipeoffs; std::vector> d_in_buffer; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc index 2895cf6a9..dddd8232f 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc @@ -16,7 +16,6 @@ #include "pcps_quicksync_acquisition_cc.h" #include "MATH_CONSTANTS.h" -#include "gnss_sdr_make_unique.h" #include #include #include @@ -95,17 +94,8 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc( original form to perform later correlation in time domain*/ d_code = std::vector(d_samples_per_code, lv_cmake(0.0F, 0.0F)); -#if GNURADIO_FFT_USES_TEMPLATES - // Direct FFT - d_fft_if = std::make_unique(d_fft_size); - // Inverse FFT - d_ifft = std::make_unique(d_fft_size); -#else - // Direct FFT - d_fft_if = std::make_unique(d_fft_size, true); - // Inverse FFT - d_ifft = std::make_unique(d_fft_size, false); -#endif + d_fft_if = gnss_fft_fwd_make_unique(d_fft_size); + d_ifft = gnss_fft_rev_make_unique(d_fft_size); // For dumping samples into a file d_dump = dump; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h index 2163483f4..44bb5cfb7 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h @@ -38,9 +38,9 @@ #define GNSS_SDR_PCPS_QUICKSYNC_ACQUISITION_CC_H #include "channel_fsm.h" +#include "gnss_sdr_fft.h" #include "gnss_synchro.h" #include -#include #include #include #include @@ -212,13 +212,8 @@ private: std::weak_ptr d_channel_fsm; -#if GNURADIO_FFT_USES_TEMPLATES - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; -#else - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; -#endif + std::unique_ptr d_fft_if; + std::unique_ptr d_ifft; std::vector> d_grid_doppler_wipeoffs; std::vector d_code; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc index ffbceecf5..c2a490a91 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc @@ -36,7 +36,6 @@ #include "pcps_tong_acquisition_cc.h" #include "MATH_CONSTANTS.h" // for TWO_PI -#include "gnss_sdr_make_unique.h" #include #include #include @@ -102,17 +101,9 @@ pcps_tong_acquisition_cc::pcps_tong_acquisition_cc( d_fft_codes.reserve(d_fft_size); d_magnitude.reserve(d_fft_size); -#if GNURADIO_FFT_USES_TEMPLATES - // Direct FFT - d_fft_if = std::make_unique(d_fft_size); - // Inverse FFT - d_ifft = std::make_unique(d_fft_size); -#else - // Direct FFT - d_fft_if = std::make_unique(d_fft_size, true); - // Inverse FFT - d_ifft = std::make_unique(d_fft_size, false); -#endif + d_fft_if = gnss_fft_fwd_make_unique(d_fft_size); + d_ifft = gnss_fft_rev_make_unique(d_fft_size); + // For dumping samples into a file d_dump = dump; d_dump_filename = dump_filename; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h index c58435301..45d8495ff 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h @@ -38,9 +38,9 @@ #define GNSS_SDR_PCPS_TONG_ACQUISITION_CC_H #include "channel_fsm.h" +#include "gnss_sdr_fft.h" #include "gnss_synchro.h" #include -#include #include #include #include // for weak_ptr @@ -199,14 +199,8 @@ private: int32_t doppler_offset); std::weak_ptr d_channel_fsm; - -#if GNURADIO_FFT_USES_TEMPLATES - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; -#else - std::unique_ptr d_fft_if; - std::unique_ptr d_ifft; -#endif + std::unique_ptr d_fft_if; + std::unique_ptr d_ifft; std::vector> d_grid_doppler_wipeoffs; std::vector> d_grid_data; diff --git a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt index 1701528a1..f6b8ee7ca 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt @@ -43,8 +43,8 @@ target_link_libraries(input_filter_gr_blocks Gnuradio::blocks Gnuradio::filter Volkgnsssdr::volkgnsssdr - PRIVATE algorithms_libs + PRIVATE Volk::volk Log4cpp::log4cpp ) @@ -60,13 +60,6 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() -if(GNURADIO_FFT_USES_TEMPLATES) - target_compile_definitions(input_filter_gr_blocks - PUBLIC -DGNURADIO_FFT_USES_TEMPLATES=1 - ) -endif() - - if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(input_filter_gr_blocks diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc index 455a5a986..797a4ce97 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc @@ -15,7 +15,6 @@ */ #include "notch_cc.h" -#include "gnss_sdr_make_unique.h" #include #include #include @@ -57,11 +56,7 @@ Notch::Notch(float pfa, angle_ = volk_gnsssdr::vector(length_); power_spect_ = volk_gnsssdr::vector(length_); last_out_ = gr_complex(0.0, 0.0); -#if GNURADIO_FFT_USES_TEMPLATES - d_fft_ = std::make_unique(length_); -#else - d_fft_ = std::make_unique(length_, true); -#endif + d_fft_ = gnss_fft_fwd_make_unique(length_); } diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.h b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.h index 3cc5764b8..5cb77ae0a 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.h +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.h @@ -19,8 +19,8 @@ #define GNSS_SDR_NOTCH_CC_H #include "gnss_block_interface.h" +#include "gnss_sdr_fft.h" #include -#include #include // for volk_gnsssdr::vector #include #include @@ -57,11 +57,8 @@ public: private: friend notch_sptr make_notch_filter(float pfa, float p_c_factor, int32_t length, int32_t n_segments_est, int32_t n_segments_reset); Notch(float pfa, float p_c_factor, int32_t length, int32_t n_segments_est, int32_t n_segments_reset); -#if GNURADIO_FFT_USES_TEMPLATES - std::unique_ptr d_fft_; -#else - std::unique_ptr d_fft_; -#endif + + std::unique_ptr d_fft_; volk_gnsssdr::vector c_samples_; volk_gnsssdr::vector angle_; volk_gnsssdr::vector power_spect_; diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc index a3b69dcd0..e365cfe13 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc @@ -16,7 +16,6 @@ */ #include "notch_lite_cc.h" -#include "gnss_sdr_make_unique.h" #include #include #include @@ -63,11 +62,7 @@ NotchLite::NotchLite(float p_c_factor, angle1_ = 0.0; angle2_ = 0.0; power_spect_ = volk_gnsssdr::vector(length_); -#if GNURADIO_FFT_USES_TEMPLATES - d_fft_ = std::make_unique(length_); -#else - d_fft_ = std::make_unique(length_, true); -#endif + d_fft_ = gnss_fft_fwd_make_unique(length_); } diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.h b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.h index 066fb78e4..74909e6b1 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.h +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.h @@ -19,8 +19,8 @@ #define GNSS_SDR_NOTCH_LITE_CC_H #include "gnss_block_interface.h" +#include "gnss_sdr_fft.h" #include -#include #include // for volk_gnsssdr::vector #include #include @@ -58,11 +58,8 @@ public: private: friend notch_lite_sptr make_notch_filter_lite(float p_c_factor, float pfa, int32_t length, int32_t n_segments_est, int32_t n_segments_reset, int32_t n_segments_coeff); NotchLite(float p_c_factor, float pfa, int32_t length, int32_t n_segments_est, int32_t n_segments_reset, int32_t n_segments_coeff); -#if GNURADIO_FFT_USES_TEMPLATES - std::unique_ptr d_fft_; -#else - std::unique_ptr d_fft_; -#endif + + std::unique_ptr d_fft_; volk_gnsssdr::vector power_spect_; gr_complex last_out_; gr_complex z_0_; diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index d5726f1e5..973b07865 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -53,6 +53,7 @@ set(GNSS_SPLIBS_HEADERS conjugate_ic.h cshort_to_float_x2.h gnss_sdr_create_directory.h + gnss_sdr_fft.h gnss_sdr_make_unique.h gnss_circular_deque.h geofunctions.h @@ -108,6 +109,7 @@ target_link_libraries(algorithms_libs Boost::headers Gnuradio::runtime Gnuradio::blocks + Gnuradio::fft PRIVATE core_system_parameters Volk::volk @@ -128,6 +130,12 @@ if(has_span) ) endif() +if(GNURADIO_FFT_USES_TEMPLATES) + target_compile_definitions(algorithms_libs + PUBLIC -DGNURADIO_FFT_USES_TEMPLATES=1 + ) +endif() + if(ENABLE_OPENCL) target_link_libraries(algorithms_libs PUBLIC OpenCL::OpenCL) target_include_directories(algorithms_libs PUBLIC diff --git a/src/algorithms/libs/gnss_sdr_fft.h b/src/algorithms/libs/gnss_sdr_fft.h new file mode 100644 index 000000000..986a87f9f --- /dev/null +++ b/src/algorithms/libs/gnss_sdr_fft.h @@ -0,0 +1,63 @@ +/*! + * \file gnss_sdr_fft.h + * \brief Helper file for FFT interface + * \author Carles Fernandez Prades, 2021. cfernandez(at)cttc.es + * + * ----------------------------------------------------------------------------- + * + * GNSS-SDR is a Global Navigation Satellite System software-defined receiver. + * This file is part of GNSS-SDR. + * + * Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors) + * SPDX-License-Identifier: GPL-3.0-or-later + * + * ----------------------------------------------------------------------------- + */ + + +#ifndef GNSS_SDR_GNSS_SDR_FFT_H +#define GNSS_SDR_GNSS_SDR_FFT_H + +#include "gnss_sdr_make_unique.h" +#include + +#if GNURADIO_FFT_USES_TEMPLATES +using gnss_fft_complex_fwd = gr::fft::fft_complex_fwd; +using gnss_fft_complex_rev = gr::fft::fft_complex_rev; +template +using gnss_fft_fwd_unique_ptr = std::unique_ptr; +template +gnss_fft_fwd_unique_ptr gnss_fft_fwd_make_unique(Args&&... args) +{ + return std::make_unique(std::forward(args)...); +} +template +using gnss_fft_rev_unique_ptr = std::unique_ptr; +template +gnss_fft_rev_unique_ptr gnss_fft_rev_make_unique(Args&&... args) +{ + return std::make_unique(std::forward(args)...); +} + +#else + +using gnss_fft_complex_fwd = gr::fft::fft_complex; +using gnss_fft_complex_rev = gr::fft::fft_complex; +template +using gnss_fft_fwd_unique_ptr = std::unique_ptr; +template +gnss_fft_fwd_unique_ptr gnss_fft_fwd_make_unique(Args&&... args) +{ + return std::make_unique(std::forward(args)..., true); +} +template +using gnss_fft_rev_unique_ptr = std::unique_ptr; +template +gnss_fft_rev_unique_ptr gnss_fft_rev_make_unique(Args&&... args) +{ + return std::make_unique(std::forward(args)..., false); +} + +#endif + +#endif // GNSS_SDR_GNSS_SDR_FFT_H diff --git a/src/core/libs/supl/asn-rrlp/converter-sample.c b/src/core/libs/supl/asn-rrlp/converter-sample.c index 3fb97ada8..5723cb1d2 100644 --- a/src/core/libs/supl/asn-rrlp/converter-sample.c +++ b/src/core/libs/supl/asn-rrlp/converter-sample.c @@ -500,7 +500,7 @@ static void buffer_dump() } else { - fprintf(stderr, " %ld\n", DynamicBuffer.length); + fprintf(stderr, " %lu\n", DynamicBuffer.length); } } diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 6bb34335d..ba862dbcc 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -533,11 +533,6 @@ if(ENABLE_UNIT_TESTING) PRIVATE -DGNURADIO_USES_STD_POINTERS=1 ) endif() - if(GNURADIO_FFT_USES_TEMPLATES) - target_compile_definitions(run_tests - PUBLIC -DGNURADIO_FFT_USES_TEMPLATES=1 - ) - endif() if(ENABLE_UNIT_TESTING_EXTRA) target_link_libraries(run_tests PRIVATE Gpstk::gpstk) if(GPSTK_OLDER_THAN_8) diff --git a/src/tests/unit-tests/arithmetic/fft_length_test.cc b/src/tests/unit-tests/arithmetic/fft_length_test.cc index e9497d3ec..7e94b69e4 100644 --- a/src/tests/unit-tests/arithmetic/fft_length_test.cc +++ b/src/tests/unit-tests/arithmetic/fft_length_test.cc @@ -15,10 +15,9 @@ * ----------------------------------------------------------------------------- */ -#include "gnss_sdr_make_unique.h" +#include "gnss_sdr_fft.h" #include "gnuplot_i.h" #include "test_flags.h" -#include #include #include #include @@ -71,11 +70,7 @@ TEST(FFTLengthTest, MeasureExecutionTime) EXPECT_NO_THROW( for (it = fft_sizes_v.cbegin(); it != fft_sizes_v.cend(); ++it) { d_fft_size = *it; -#if GNURADIO_FFT_USES_TEMPLATES - auto d_fft = std::make_unique(d_fft_size); -#else - auto d_fft = std::make_unique(d_fft_size, true); -#endif + auto d_fft = gnss_fft_fwd_make_unique(d_fft_size); std::generate_n(d_fft->get_inbuf(), d_fft_size, gen); start = std::chrono::system_clock::now(); diff --git a/src/tests/unit-tests/arithmetic/fft_speed_test.cc b/src/tests/unit-tests/arithmetic/fft_speed_test.cc index 400b4f674..eca130d21 100644 --- a/src/tests/unit-tests/arithmetic/fft_speed_test.cc +++ b/src/tests/unit-tests/arithmetic/fft_speed_test.cc @@ -16,9 +16,8 @@ * ----------------------------------------------------------------------------- */ -#include "gnss_sdr_make_unique.h" +#include "gnss_sdr_fft.h" #include -#include #include #include @@ -36,11 +35,7 @@ TEST(FFTSpeedTest, ArmadilloVSGNURadioExecutionTime) for (unsigned int fft_size : fft_sizes) { d_fft_size = fft_size; -#if GNURADIO_FFT_USES_TEMPLATES - auto d_gr_fft = std::make_unique(d_fft_size); -#else - auto d_gr_fft = std::make_unique(d_fft_size, true); -#endif + auto d_gr_fft = gnss_fft_fwd_make_unique(d_fft_size); arma::arma_rng::set_seed_random(); arma::cx_fvec d_arma_fft = arma::cx_fvec(d_fft_size).randn() + gr_complex(0.0, 1.0) * arma::cx_fvec(d_fft_size).randn(); arma::cx_fvec d_arma_fft_result(d_fft_size); From 11f13ebcab3fd33271d190595348fc63bbfd5e3d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 15 Jan 2021 15:03:36 +0100 Subject: [PATCH 07/11] Fix building in modern environments --- src/tests/CMakeLists.txt | 24 +++++++++++++++++++ .../gps_l1_ca_dll_pll_tracking_test_fpga.cc | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index ba862dbcc..e256e70c1 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -333,6 +333,9 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) endif() include(GNUInstallDirs) find_program(Patch_EXECUTABLE NAME patch PATHS ENV PATH) + if(Patch_EXECUTABLE-NOTFOUND) + message(FATAL_ERROR "The patch command is not found. Please check your OS documentation and install it.") + endif() set(GPSTK_PATCH_COMMAND cd ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} && ${Patch_EXECUTABLE} ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/CMakeLists.txt < ${CMAKE_SOURCE_DIR}/src/tests/data/gpstk_static.patch @@ -621,6 +624,27 @@ if(ENABLE_FPGA) else() target_link_libraries(gps_l1_ca_dll_pll_tracking_test_fpga PRIVATE Boost::filesystem Boost::system) endif() + if(USE_GENERIC_LAMBDAS) + set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) + set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) + target_compile_definitions(gps_l1_ca_dll_pll_tracking_test_fpga + PRIVATE + "$<$:${has_generic_lambdas}>" + "$<$>:${no_has_generic_lambdas}>" + ) + else() + target_compile_definitions(gps_l1_ca_dll_pll_tracking_test_fpga + PRIVATE + -DHAS_GENERIC_LAMBDA=0 + ) + endif() + if(USE_BOOST_BIND_PLACEHOLDERS) + target_compile_definitions(gps_l1_ca_dll_pll_tracking_test_fpga + PRIVATE + -DUSE_BOOST_BIND_PLACEHOLDERS=1 + ) + endif() + target_link_libraries(gps_l1_ca_dll_pll_tracking_test_fpga PRIVATE Armadillo::armadillo diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc index 76b90367b..3da9880f9 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc @@ -1,5 +1,5 @@ /*! - * \file gps_l1_ca_dll_pll_tracking_test.cc + * \file gps_l1_ca_dll_pll_tracking_test_fpga.cc * \brief This class implements a tracking test for Galileo_E5a_DLL_PLL_Tracking * implementation based on some input parameters. * \author Marc Majoral, 2017. mmajoral(at)cttc.cat From 0e9046c956bcdb3e850ba1f173d485d86115fe3b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 16 Jan 2021 10:51:38 +0100 Subject: [PATCH 08/11] Raise an error if GPSTK is to be built but the patch command is not found --- src/tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index e256e70c1..d6dbb50ef 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -333,8 +333,8 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) endif() include(GNUInstallDirs) find_program(Patch_EXECUTABLE NAME patch PATHS ENV PATH) - if(Patch_EXECUTABLE-NOTFOUND) - message(FATAL_ERROR "The patch command is not found. Please check your OS documentation and install it.") + if(NOT Patch_EXECUTABLE) + message(FATAL_ERROR "The patch command is not found. It is required to build GPSTk. Please check your OS documentation and install the patch command.") endif() set(GPSTK_PATCH_COMMAND cd ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} && From 1287e8fe794b56fd7e89ec47047c7221b3e86d33 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 16 Jan 2021 14:37:19 +0100 Subject: [PATCH 09/11] Improve handling of the filesystem library --- docs/changelog.md | 1 + .../PVT/gnuradio_blocks/CMakeLists.txt | 10 -- .../PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 18 +--- src/algorithms/PVT/libs/CMakeLists.txt | 11 +-- src/algorithms/PVT/libs/geojson_printer.cc | 21 +--- src/algorithms/PVT/libs/gpx_printer.cc | 22 +---- src/algorithms/PVT/libs/kml_printer.cc | 22 +---- src/algorithms/PVT/libs/nmea_printer.cc | 22 +---- src/algorithms/PVT/libs/rinex_printer.cc | 22 +---- src/algorithms/PVT/libs/rtcm_printer.cc | 22 +---- src/algorithms/PVT/libs/rtklib_solver.cc | 22 +---- .../gnuradio_blocks/CMakeLists.txt | 10 -- .../gnuradio_blocks/pcps_acquisition.cc | 20 +--- .../pcps_acquisition_fine_doppler_cc.cc | 20 +--- src/algorithms/libs/CMakeLists.txt | 27 +++--- .../libs/gnss_sdr_create_directory.cc | 22 +---- src/algorithms/libs/gnss_sdr_filesystem.h | 43 ++++++++ src/algorithms/libs/gnss_sdr_flags.cc | 14 +-- .../gnuradio_blocks/CMakeLists.txt | 10 -- .../gnuradio_blocks/hybrid_observables_gs.cc | 22 +---- .../telemetry_decoder/libs/CMakeLists.txt | 11 +-- .../telemetry_decoder/libs/tlm_utils.cc | 21 +--- .../tracking/gnuradio_blocks/CMakeLists.txt | 11 +-- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 14 +-- .../dll_pll_veml_tracking_fpga.cc | 13 +-- src/core/libs/CMakeLists.txt | 10 +- src/core/libs/uio_fpga.cc | 14 +-- src/main/CMakeLists.txt | 11 --- src/main/main.cc | 22 +---- src/tests/CMakeLists.txt | 97 ++----------------- src/tests/system-tests/position_test.cc | 9 +- .../unit-tests/arithmetic/fft_length_test.cc | 13 +-- src/tests/unit-tests/arithmetic/matio_test.cc | 22 +---- .../acquisition/acq_performance_test.cc | 18 +--- .../beidou_b1i_pcps_acquisition_test.cc | 13 +-- .../beidou_b3i_pcps_acquisition_test.cc | 13 +-- ...ileo_e1_pcps_ambiguous_acquisition_test.cc | 14 +-- ...e1_pcps_ambiguous_acquisition_test_fpga.cc | 18 +--- .../gps_l1_ca_pcps_acquisition_test.cc | 14 +-- .../gps_l1_ca_pcps_acquisition_test_fpga.cc | 13 +-- .../gps_l2_m_pcps_acquisition_test.cc | 14 +-- .../pvt/nmea_printer_test.cc | 21 +--- .../pvt/rinex_printer_test.cc | 21 +--- .../gps_l1_ca_dll_pll_tracking_test.cc | 14 +-- .../tracking/gps_l1_ca_kf_tracking_test.cc | 13 +-- .../tracking/tracking_pull-in_test.cc | 14 +-- .../tracking/tracking_pull-in_test_fpga.cc | 14 +-- src/utils/front-end-cal/CMakeLists.txt | 11 +-- src/utils/front-end-cal/main.cc | 9 +- 49 files changed, 108 insertions(+), 775 deletions(-) create mode 100644 src/algorithms/libs/gnss_sdr_filesystem.h diff --git a/docs/changelog.md b/docs/changelog.md index ccfef19db..d1398f834 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -24,6 +24,7 @@ SPDX-FileCopyrightText: 2011-2021 Carles Fernandez-Prades #endif -#if HAS_STD_FILESYSTEM -#include -namespace errorlib = std; -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -#include // for error_code -namespace fs = boost::filesystem; -namespace errorlib = boost::system; -#endif - #if USE_OLD_BOOST_MATH_COMMON_FACTOR #include namespace bc = boost::math; diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index 4bb0e2966..0326f9ca4 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -54,16 +54,6 @@ else() add_library(pvt_libs ${PVT_LIB_SOURCES} ${PROTO_SRCS} ${PVT_LIB_HEADERS} ${PROTO_HDRS}) endif() -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() - target_link_libraries(pvt_libs PRIVATE Boost::filesystem Boost::system) -endif() - target_link_libraries(pvt_libs PUBLIC Boost::date_time @@ -71,6 +61,7 @@ target_link_libraries(pvt_libs core_system_parameters algorithms_libs_rtklib PRIVATE + algorithms_libs Gflags::gflags Glog::glog Matio::matio diff --git a/src/algorithms/PVT/libs/geojson_printer.cc b/src/algorithms/PVT/libs/geojson_printer.cc index 877259dbd..c90e3c2c5 100644 --- a/src/algorithms/PVT/libs/geojson_printer.cc +++ b/src/algorithms/PVT/libs/geojson_printer.cc @@ -17,6 +17,7 @@ #include "geojson_printer.h" +#include "gnss_sdr_filesystem.h" #include "pvt_solution.h" #include #include @@ -26,26 +27,6 @@ #include // for cout, cerr #include // for stringstream -// clang-format off -#if HAS_STD_FILESYSTEM -#include -namespace errorlib = std; -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem -#include // for error_code -namespace fs = boost::filesystem; -namespace errorlib = boost::system; -#endif -// clang-format on GeoJSON_Printer::GeoJSON_Printer(const std::string& base_path) { diff --git a/src/algorithms/PVT/libs/gpx_printer.cc b/src/algorithms/PVT/libs/gpx_printer.cc index a77a50718..e6fc02c77 100644 --- a/src/algorithms/PVT/libs/gpx_printer.cc +++ b/src/algorithms/PVT/libs/gpx_printer.cc @@ -17,6 +17,7 @@ #include "gpx_printer.h" +#include "gnss_sdr_filesystem.h" #include "pvt_solution.h" #include #include @@ -26,27 +27,6 @@ #include // for cout, cerr #include // for stringstream -// clang-format off -#if HAS_STD_FILESYSTEM -#include -namespace errorlib = std; -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem -#include // for error_code -namespace fs = boost::filesystem; -namespace errorlib = boost::system; -#endif -// clang-format on - Gpx_Printer::Gpx_Printer(const std::string& base_path) { diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index d50758526..c0a21530c 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -17,6 +17,7 @@ */ #include "kml_printer.h" +#include "gnss_sdr_filesystem.h" #include "pvt_solution.h" #include #include @@ -28,27 +29,6 @@ #include // for S_IXUSR | S_IRWXG | S_IRWXO #include // for mode_t -// clang-format off -#if HAS_STD_FILESYSTEM -#include -namespace errorlib = std; -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem -#include // for error_code -namespace fs = boost::filesystem; -namespace errorlib = boost::system; -#endif -// clang-format on - Kml_Printer::Kml_Printer(const std::string& base_path) { diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index 3f89bb344..bbc34ea0a 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -20,6 +20,7 @@ */ #include "nmea_printer.h" +#include "gnss_sdr_filesystem.h" #include "rtklib_solution.h" #include "rtklib_solver.h" #include @@ -31,27 +32,6 @@ #include #include -// clang-format off -#if HAS_STD_FILESYSTEM -#include -namespace errorlib = std; -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem -#include // for error_code -namespace fs = boost::filesystem; -namespace errorlib = boost::system; -#endif -// clang-format on - 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) { diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 3992c2a75..29669adde 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -29,6 +29,7 @@ #include "glonass_gnav_almanac.h" #include "glonass_gnav_ephemeris.h" #include "glonass_gnav_utc_model.h" +#include "gnss_sdr_filesystem.h" #include "gnss_synchro.h" #include "gps_cnav_ephemeris.h" #include "gps_cnav_iono.h" @@ -54,27 +55,6 @@ #include #include -// clang-format off -#if HAS_STD_FILESYSTEM -#include -namespace errorlib = std; -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem -#include // for error_code -namespace fs = boost::filesystem; -namespace errorlib = boost::system; -#endif -// clang-format on - Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path, const std::string& base_name) { diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index b4df3bc8b..04e0c26bc 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -21,6 +21,7 @@ #include "galileo_ephemeris.h" #include "glonass_gnav_ephemeris.h" #include "glonass_gnav_utc_model.h" +#include "gnss_sdr_filesystem.h" #include "gnss_sdr_make_unique.h" #include "gnss_synchro.h" #include "gps_cnav_ephemeris.h" @@ -36,27 +37,6 @@ #include // for tcgetattr #include // for close, write -// clang-format off -#if HAS_STD_FILESYSTEM -#include -namespace errorlib = std; -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem -#include // for error_code -namespace fs = boost::filesystem; -namespace errorlib = boost::system; -#endif -// clang-format off - 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) { diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index a5ac7a566..7fd95fa29 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -32,6 +32,7 @@ #include "rtklib_solver.h" #include "Beidou_DNAV.h" +#include "gnss_sdr_filesystem.h" #include "rtklib_conversions.h" #include "rtklib_rtkpos.h" #include "rtklib_solution.h" @@ -41,27 +42,6 @@ #include #include -// clang-format off -#if HAS_STD_FILESYSTEM -#include -namespace errorlib = std; -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem -#include // for error_code -namespace fs = boost::filesystem; -namespace errorlib = boost::system; -#endif -// clang-format on - Rtklib_Solver::Rtklib_Solver(const rtk_t &rtk, int nchannels, const std::string &dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat) { diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index 6f18e2b11..81429538f 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -53,16 +53,6 @@ else() add_library(acquisition_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS}) endif() -if(${FILESYSTEM_FOUND}) - target_compile_definitions(acquisition_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1) - if(${find_experimental}) - target_compile_definitions(acquisition_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(acquisition_gr_blocks PRIVATE std::filesystem) -else() - target_link_libraries(acquisition_gr_blocks PRIVATE Boost::filesystem) -endif() - target_link_libraries(acquisition_gr_blocks PUBLIC algorithms_libs diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 3782e6128..5138689c6 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -24,16 +24,8 @@ #include "MATH_CONSTANTS.h" // for TWO_PI #include "gnss_frequencies.h" #include "gnss_sdr_create_directory.h" +#include "gnss_sdr_filesystem.h" #include "gnss_synchro.h" -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -#else -#include -#endif -#else -#include -#endif #include #include #include @@ -48,16 +40,6 @@ #include #include -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -namespace fs = std::experimental::filesystem; -#else -namespace fs = std::filesystem; -#endif -#else -namespace fs = boost::filesystem; -#endif - pcps_acquisition_sptr pcps_make_acquisition(const Acq_Conf& conf_) { diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc index 90318d576..fa02b1c74 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc @@ -19,16 +19,8 @@ #include "pcps_acquisition_fine_doppler_cc.h" #include "GPS_L1_CA.h" // for GPS_L1_CA_CHIP_PERIOD_S #include "gnss_sdr_create_directory.h" +#include "gnss_sdr_filesystem.h" #include "gps_sdr_signal_replica.h" -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -#else -#include -#endif -#else -#include -#endif #include #include #include @@ -38,16 +30,6 @@ #include #include -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -namespace fs = std::experimental::filesystem; -#else -namespace fs = std::filesystem; -#endif -#else -namespace fs = boost::filesystem; -#endif - pcps_acquisition_fine_doppler_cc_sptr pcps_make_acquisition_fine_doppler_cc(const Acq_Conf &conf_) { diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 973b07865..e8bd6f0aa 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -54,6 +54,7 @@ set(GNSS_SPLIBS_HEADERS cshort_to_float_x2.h gnss_sdr_create_directory.h gnss_sdr_fft.h + gnss_sdr_filesystem.h gnss_sdr_make_unique.h gnss_circular_deque.h geofunctions.h @@ -86,16 +87,6 @@ else() add_library(algorithms_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS}) endif() -if(${FILESYSTEM_FOUND}) - target_compile_definitions(algorithms_libs PRIVATE -DHAS_STD_FILESYSTEM=1) - if(${find_experimental}) - target_compile_definitions(algorithms_libs PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(algorithms_libs PRIVATE std::filesystem) -else() - target_link_libraries(algorithms_libs PRIVATE Boost::filesystem Boost::system) -endif() - if(NOT has_span) target_include_directories(algorithms_libs PUBLIC @@ -124,6 +115,16 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() +if(FILESYSTEM_FOUND) + target_compile_definitions(algorithms_libs PUBLIC -DHAS_STD_FILESYSTEM=1) + if(find_experimental) + target_compile_definitions(algorithms_libs PUBLIC -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) + endif() + target_link_libraries(algorithms_libs PUBLIC std::filesystem) +else() + target_link_libraries(algorithms_libs PUBLIC Boost::filesystem Boost::system) +endif() + if(has_span) target_compile_definitions(algorithms_libs PUBLIC -DHAS_STD_SPAN=1 @@ -193,14 +194,14 @@ else() add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h) endif() -if(${FILESYSTEM_FOUND}) +if(FILESYSTEM_FOUND) target_compile_definitions(gnss_sdr_flags PRIVATE -DHAS_STD_FILESYSTEM=1) - if(${find_experimental}) + if(find_experimental) target_compile_definitions(gnss_sdr_flags PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) endif() target_link_libraries(gnss_sdr_flags PRIVATE std::filesystem) else() - target_link_libraries(gnss_sdr_flags PRIVATE Boost::filesystem) + target_link_libraries(gnss_sdr_flags PRIVATE Boost::filesystem Boost::system) endif() target_link_libraries(gnss_sdr_flags diff --git a/src/algorithms/libs/gnss_sdr_create_directory.cc b/src/algorithms/libs/gnss_sdr_create_directory.cc index f986bcf83..677dc1fbc 100644 --- a/src/algorithms/libs/gnss_sdr_create_directory.cc +++ b/src/algorithms/libs/gnss_sdr_create_directory.cc @@ -16,30 +16,10 @@ */ #include "gnss_sdr_create_directory.h" +#include "gnss_sdr_filesystem.h" #include // for exception #include // for ofstream -// clang-format off -#if HAS_STD_FILESYSTEM -#include -namespace errorlib = std; -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem -#include // for error_code -namespace fs = boost::filesystem; -namespace errorlib = boost::system; -#endif -// clang-format on - bool gnss_sdr_create_directory(const std::string& foldername) { std::string new_folder; diff --git a/src/algorithms/libs/gnss_sdr_filesystem.h b/src/algorithms/libs/gnss_sdr_filesystem.h new file mode 100644 index 000000000..c3e85442a --- /dev/null +++ b/src/algorithms/libs/gnss_sdr_filesystem.h @@ -0,0 +1,43 @@ +/*! + * \file gnss_sdr_filesystem.h + * \brief Helper file for fylesystem library interface + * \author Carles Fernandez Prades, 2021. cfernandez(at)cttc.es + * + * ----------------------------------------------------------------------------- + * + * GNSS-SDR is a Global Navigation Satellite System software-defined receiver. + * This file is part of GNSS-SDR. + * + * Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors) + * SPDX-License-Identifier: GPL-3.0-or-later + * + * ----------------------------------------------------------------------------- + */ + + +#ifndef GNSS_SDR_GNSS_SDR_FILESYSTEM_H +#define GNSS_SDR_GNSS_SDR_FILESYSTEM_H + +// clang-format off +#if HAS_STD_FILESYSTEM +#include +namespace errorlib = std; +#if HAS_STD_FILESYSTEM_EXPERIMENTAL +#include +namespace fs = std::experimental::filesystem; +#else +#include +namespace fs = std::filesystem; +#endif +#else +#include // for create_directories, exists +#include // for path, operator<< +#include // for filesystem +#include // for error_code +namespace fs = boost::filesystem; +namespace errorlib = boost::system; +#endif +// clang-format on + + +#endif // GNSS_SDR_GNSS_SDR_FILESYSTEM_H diff --git a/src/algorithms/libs/gnss_sdr_flags.cc b/src/algorithms/libs/gnss_sdr_flags.cc index 3bd3e35ce..f13e69e5a 100644 --- a/src/algorithms/libs/gnss_sdr_flags.cc +++ b/src/algorithms/libs/gnss_sdr_flags.cc @@ -17,22 +17,10 @@ #include "gnss_sdr_flags.h" +#include "gnss_sdr_filesystem.h" #include #include -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include // for exists -namespace fs = boost::filesystem; -#endif - DEFINE_string(c, "-", "Path to the configuration file (if set, overrides --config_file)."); diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index d0433b30b..a48fb65e6 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -18,16 +18,6 @@ else() add_library(obs_gr_blocks hybrid_observables_gs.cc hybrid_observables_gs.h) endif() -if(${FILESYSTEM_FOUND}) - target_compile_definitions(obs_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1) - if(${find_experimental}) - target_compile_definitions(obs_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(obs_gr_blocks PRIVATE std::filesystem) -else() - target_link_libraries(obs_gr_blocks PRIVATE Boost::filesystem) -endif() - target_include_directories(obs_gr_blocks PUBLIC ${CMAKE_SOURCE_DIR}/src/algorithms/libs diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc index 6561ace27..a3a55b565 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc @@ -20,6 +20,7 @@ #include "gnss_circular_deque.h" #include "gnss_frequencies.h" #include "gnss_sdr_create_directory.h" +#include "gnss_sdr_filesystem.h" #include "gnss_sdr_make_unique.h" #include "gnss_synchro.h" #include @@ -38,27 +39,6 @@ #include #endif -// clang-format off -#if HAS_STD_FILESYSTEM -#include -namespace errorlib = std; -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem -#include // for error_code -namespace fs = boost::filesystem; -namespace errorlib = boost::system; -#endif -// clang-format on - hybrid_observables_gs_sptr hybrid_observables_gs_make(const Obs_Conf &conf_) { diff --git a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt index d08dc2f9d..ae9693543 100644 --- a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt @@ -43,21 +43,12 @@ target_link_libraries(telemetry_decoder_libs PUBLIC Volkgnsssdr::volkgnsssdr PRIVATE + algorithms_libs Gflags::gflags Glog::glog Matio::matio ) -if(FILESYSTEM_FOUND) - target_compile_definitions(telemetry_decoder_libs PRIVATE -DHAS_STD_FILESYSTEM=1) - if(find_experimental) - target_compile_definitions(telemetry_decoder_libs PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(telemetry_decoder_libs PRIVATE std::filesystem) -else() - target_link_libraries(telemetry_decoder_libs PRIVATE Boost::filesystem Boost::system) -endif() - target_include_directories(telemetry_decoder_libs PUBLIC ${CMAKE_SOURCE_DIR}/src/core/interfaces diff --git a/src/algorithms/telemetry_decoder/libs/tlm_utils.cc b/src/algorithms/telemetry_decoder/libs/tlm_utils.cc index 03246f02c..258fa9fa8 100644 --- a/src/algorithms/telemetry_decoder/libs/tlm_utils.cc +++ b/src/algorithms/telemetry_decoder/libs/tlm_utils.cc @@ -15,6 +15,7 @@ */ #include "tlm_utils.h" +#include "gnss_sdr_filesystem.h" #include #include #include @@ -22,26 +23,6 @@ #include #include -// clang-format off -#if HAS_STD_FILESYSTEM -#include -namespace errorlib = std; -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include // for remove -#include // for path, operator<< -#include // for filesystem -#include // for error_code -namespace fs = boost::filesystem; -namespace errorlib = boost::system; -#endif -// clang-format on int save_tlm_matfile(const std::string &dumpfile) { diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index 4438a4ceb..d40b38a1d 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -75,21 +75,12 @@ else() ) endif() -if(${FILESYSTEM_FOUND}) - target_compile_definitions(tracking_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1) - if(${find_experimental}) - target_compile_definitions(tracking_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(tracking_gr_blocks PRIVATE std::filesystem) -else() - target_link_libraries(tracking_gr_blocks PRIVATE Boost::filesystem) -endif() - target_link_libraries(tracking_gr_blocks PUBLIC Gnuradio::blocks tracking_libs PRIVATE + algorithms_libs Matio::matio gnss_sdr_flags Glog::glog diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 2498055e4..92f11ded9 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -38,6 +38,7 @@ #include "galileo_e6_signal_replica.h" #include "gnss_satellite.h" #include "gnss_sdr_create_directory.h" +#include "gnss_sdr_filesystem.h" #include "gnss_synchro.h" #include "gps_l2c_signal_replica.h" #include "gps_l5_signal_replica.h" @@ -64,19 +65,6 @@ #include #endif -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -namespace fs = boost::filesystem; -#endif - dll_pll_veml_tracking_sptr dll_pll_veml_make_tracking(const Dll_Pll_Conf &conf_) { diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index 4b24feb7f..b0192f26e 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -30,6 +30,7 @@ #include "fpga_multicorrelator.h" #include "gnss_satellite.h" #include "gnss_sdr_create_directory.h" +#include "gnss_sdr_filesystem.h" #include "gnss_synchro.h" #include "gps_sdr_signal_replica.h" #include "lock_detectors.h" @@ -53,18 +54,6 @@ #include #endif -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -namespace fs = boost::filesystem; -#endif dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(const Dll_Pll_Conf_Fpga &conf_) { diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index 587e33fb9..a525f87c4 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -123,15 +123,7 @@ if(USE_BOOST_BIND_PLACEHOLDERS) endif() if(ENABLE_FPGA OR ENABLE_AD9361) - if(FILESYSTEM_FOUND) - target_compile_definitions(core_libs PRIVATE -DHAS_STD_FILESYSTEM=1) - if(find_experimental) - target_compile_definitions(core_libs PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(core_libs PRIVATE std::filesystem) - else() - target_link_libraries(core_libs PRIVATE Boost::filesystem Boost::system) - endif() + target_link_libraries(core_libs PRIVATE algorithms_libs) endif() if(ENABLE_CLANG_TIDY) diff --git a/src/core/libs/uio_fpga.cc b/src/core/libs/uio_fpga.cc index 634adbcfa..14156a654 100644 --- a/src/core/libs/uio_fpga.cc +++ b/src/core/libs/uio_fpga.cc @@ -16,6 +16,7 @@ */ #include "uio_fpga.h" +#include "gnss_sdr_filesystem.h" #include // sort #include // atoi, size_t #include // ifstream @@ -24,19 +25,6 @@ #include // std::stringstream #include -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -#include -namespace fs = boost::filesystem; -#endif int32_t get_uio_num(std::string uio_name) { diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 0d2ad6d01..8ff20a537 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -12,17 +12,6 @@ else() add_executable(gnss-sdr main.cc) endif() - -if(${FILESYSTEM_FOUND}) - target_compile_definitions(gnss-sdr PRIVATE -DHAS_STD_FILESYSTEM=1) - if(${find_experimental}) - target_compile_definitions(gnss-sdr PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(gnss-sdr PRIVATE std::filesystem) -else() - target_link_libraries(gnss-sdr PRIVATE Boost::filesystem Boost::system) -endif() - target_link_libraries(gnss-sdr PRIVATE algorithms_libs diff --git a/src/main/main.cc b/src/main/main.cc index 082d17c0a..685af0c18 100644 --- a/src/main/main.cc +++ b/src/main/main.cc @@ -28,6 +28,7 @@ #include "concurrent_map.h" #include "concurrent_queue.h" #include "control_thread.h" +#include "gnss_sdr_filesystem.h" #include "gnss_sdr_make_unique.h" #include "gps_acq_assist.h" #include // for diagnostic_information @@ -46,27 +47,6 @@ #include #endif -// clang-format off -#if HAS_STD_FILESYSTEM -#include -namespace errorlib = std; -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem -#include // for error_code -namespace fs = boost::filesystem; -namespace errorlib = boost::system; -#endif -// clang-format on - #if GFLAGS_OLD_NAMESPACE namespace gflags { diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index d6dbb50ef..69f3629d6 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -483,15 +483,6 @@ if(ENABLE_UNIT_TESTING) else() add_executable(run_tests ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cc) endif() - if(${FILESYSTEM_FOUND}) - target_compile_definitions(run_tests PRIVATE -DHAS_STD_FILESYSTEM=1) - if(${find_experimental}) - target_compile_definitions(run_tests PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(run_tests PRIVATE std::filesystem) - else() - target_link_libraries(run_tests PRIVATE Boost::filesystem Boost::system) - endif() target_link_libraries(run_tests PRIVATE @@ -615,15 +606,7 @@ if(ENABLE_FPGA) else() add_executable(gps_l1_ca_dll_pll_tracking_test_fpga ${GPS_L1_CA_DLL_PLL_TRACKING_TEST_FPGA_SOURCES}) endif() - if(${FILESYSTEM_FOUND}) - target_compile_definitions(gps_l1_ca_dll_pll_tracking_test_fpga PRIVATE -DHAS_STD_FILESYSTEM=1) - if(${find_experimental}) - target_compile_definitions(gps_l1_ca_dll_pll_tracking_test_fpga PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(gps_l1_ca_dll_pll_tracking_test_fpga PRIVATE std::filesystem) - else() - target_link_libraries(gps_l1_ca_dll_pll_tracking_test_fpga PRIVATE Boost::filesystem Boost::system) - endif() + if(USE_GENERIC_LAMBDAS) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) @@ -697,18 +680,8 @@ function(add_system_test executable) else() add_executable(${executable} ${SYSTEM_TEST_SOURCES}) endif() - if(${FILESYSTEM_FOUND}) - target_compile_definitions(${executable} PRIVATE -DHAS_STD_FILESYSTEM=1) - if(${find_experimental}) - target_compile_definitions(${executable} PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(${executable} PRIVATE std::filesystem) - else() - target_link_libraries(${executable} PRIVATE Boost::filesystem Boost::system) - endif() - target_include_directories(${executable} - PRIVATE ${OPT_INCLUDES_} ${CMAKE_SOURCE_DIR}/src/algorithms/libs + PRIVATE ${OPT_INCLUDES_} INTERFACE ${CMAKE_SOURCE_DIR}/src/tests/common-files ) target_link_libraries(${executable} PRIVATE ${OPT_LIBS_} algorithms_libs) @@ -824,15 +797,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) else() add_executable(flowgraph_test ${FLOWGRAPH_TEST_SOURCES}) endif() - if(${FILESYSTEM_FOUND}) - target_compile_definitions(flowgraph_test PRIVATE -DHAS_STD_FILESYSTEM=1) - if(${find_experimental}) - target_compile_definitions(flowgraph_test PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(flowgraph_test PRIVATE std::filesystem) - else() - target_link_libraries(flowgraph_test PRIVATE Boost::filesystem Boost::system) - endif() + target_link_libraries(flowgraph_test PRIVATE Boost::thread @@ -879,15 +844,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) else() add_executable(gnss_block_test ${GNSS_BLOCK_TEST_SOURCES}) endif() - if(${FILESYSTEM_FOUND}) - target_compile_definitions(gnss_block_test PRIVATE -DHAS_STD_FILESYSTEM=1) - if(${find_experimental}) - target_compile_definitions(gnss_block_test PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(gnss_block_test PRIVATE std::filesystem) - else() - target_link_libraries(gnss_block_test PRIVATE Boost::filesystem Boost::system) - endif() + target_link_libraries(gnss_block_test PRIVATE Boost::thread @@ -935,15 +892,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) else() add_executable(gnuradio_block_test ${GNURADIO_BLOCK_TEST_SOURCES}) endif() - if(${FILESYSTEM_FOUND}) - target_compile_definitions(gnuradio_block_test PRIVATE -DHAS_STD_FILESYSTEM=1) - if(${find_experimental}) - target_compile_definitions(gnuradio_block_test PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(gnuradio_block_test PRIVATE std::filesystem) - else() - target_link_libraries(gnuradio_block_test PRIVATE Boost::filesystem Boost::system) - endif() + target_link_libraries(gnuradio_block_test PRIVATE Boost::thread @@ -980,18 +929,9 @@ else() add_executable(matio_test ${MATIO_TEST_SOURCES}) endif() -if(${FILESYSTEM_FOUND}) - target_compile_definitions(matio_test PRIVATE -DHAS_STD_FILESYSTEM=1) - if(${find_experimental}) - target_compile_definitions(matio_test PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(matio_test PRIVATE std::filesystem) -else() - target_link_libraries(matio_test PRIVATE Boost::filesystem Boost::system) -endif() - target_link_libraries(matio_test PRIVATE + algorithms_libs Gflags::gflags Glog::glog GTest::GTest @@ -1022,12 +962,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) else() add_executable(acq_test ${ACQ_TEST_SOURCES}) endif() - if(${FILESYSTEM_FOUND}) - target_compile_definitions(acq_test PRIVATE -DHAS_STD_FILESYSTEM=1) - target_link_libraries(acq_test PRIVATE std::filesystem) - else() - target_link_libraries(acq_test PRIVATE Boost::filesystem Boost::system) - endif() + target_link_libraries(acq_test PRIVATE Boost::thread @@ -1101,15 +1036,6 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) else() add_executable(trk_test ${TRKTEST_SOURCES}) endif() - if(${FILESYSTEM_FOUND}) - target_compile_definitions(trk_test PRIVATE -DHAS_STD_FILESYSTEM=1) - if(${find_experimental}) - target_compile_definitions(trk_test PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(trk_test PRIVATE std::filesystem) - else() - target_link_libraries(trk_test PRIVATE Boost::filesystem Boost::system) - endif() target_link_libraries(trk_test PRIVATE @@ -1169,15 +1095,6 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) else() add_executable(control_thread_test ${CONTROL_THREAD_TEST_SOURCES}) endif() - if(${FILESYSTEM_FOUND}) - target_compile_definitions(control_thread_test PRIVATE -DHAS_STD_FILESYSTEM=1) - if(${find_experimental}) - target_compile_definitions(control_thread_test PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(control_thread_test PRIVATE std::filesystem) - else() - target_link_libraries(control_thread_test PRIVATE Boost::filesystem Boost::system) - endif() target_link_libraries(control_thread_test PRIVATE diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index b89d90bcb..948808e63 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -25,6 +25,7 @@ #include "control_thread.h" #include "file_configuration.h" #include "geofunctions.h" +#include "gnss_sdr_filesystem.h" #include "gnss_sdr_flags.h" #include "gnuplot_i.h" #include "in_memory_configuration.h" @@ -46,14 +47,6 @@ #include #include -#if HAS_STD_FILESYSTEM -#include -namespace fs = std::filesystem; -#else -#include -namespace fs = boost::filesystem; -#endif - #if GFLAGS_OLD_NAMESPACE namespace gflags { diff --git a/src/tests/unit-tests/arithmetic/fft_length_test.cc b/src/tests/unit-tests/arithmetic/fft_length_test.cc index 7e94b69e4..8ad39a141 100644 --- a/src/tests/unit-tests/arithmetic/fft_length_test.cc +++ b/src/tests/unit-tests/arithmetic/fft_length_test.cc @@ -16,6 +16,7 @@ */ #include "gnss_sdr_fft.h" +#include "gnss_sdr_filesystem.h" #include "gnuplot_i.h" #include "test_flags.h" #include @@ -23,18 +24,6 @@ #include #include -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -namespace fs = boost::filesystem; -#endif DEFINE_int32(fft_iterations_test, 1000, "Number of averaged iterations in FFT length timing test"); DEFINE_bool(plot_fft_length_test, false, "Plots results of FFTLengthTest with gnuplot"); diff --git a/src/tests/unit-tests/arithmetic/matio_test.cc b/src/tests/unit-tests/arithmetic/matio_test.cc index 3599df72a..1b1bb3a22 100644 --- a/src/tests/unit-tests/arithmetic/matio_test.cc +++ b/src/tests/unit-tests/arithmetic/matio_test.cc @@ -16,32 +16,12 @@ * ----------------------------------------------------------------------------- */ +#include "gnss_sdr_filesystem.h" #include #include #include #include -// clang-format off -#if HAS_STD_FILESYSTEM -#include -namespace errorlib = std; -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem -#include // for error_code -namespace fs = boost::filesystem; -namespace errorlib = boost::system; -#endif -// clang-format on - TEST(MatioTest, WriteAndReadDoubles) { // Write a .mat file diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc index 5bab76ff5..63d5d8a8e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc @@ -24,6 +24,7 @@ #include "glonass_l1_ca_pcps_acquisition.h" #include "glonass_l2_ca_pcps_acquisition.h" #include "gnss_block_interface.h" +#include "gnss_sdr_filesystem.h" #include "gnss_sdr_valve.h" #include "gnuplot_i.h" #include "gps_l1_ca_pcps_acquisition.h" @@ -48,23 +49,6 @@ #include #endif -#if HAS_STD_FILESYSTEM -#include -namespace errorlib = std; -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -#include // for error_code -namespace fs = boost::filesystem; -namespace errorlib = boost::system; -#endif - DEFINE_string(config_file_ptest, std::string(""), "File containing alternative configuration parameters for the acquisition performance test."); DEFINE_string(acq_test_input_file, std::string(""), "File containing raw signal data, must be in int8_t format. The signal generator will not be used."); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc index 52d4692af..82a331ec5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc @@ -22,6 +22,7 @@ #include "beidou_b1i_pcps_acquisition.h" #include "concurrent_queue.h" #include "gnss_block_interface.h" +#include "gnss_sdr_filesystem.h" #include "gnss_sdr_valve.h" #include "gnss_synchro.h" #include "gnuplot_i.h" @@ -49,18 +50,6 @@ #include #endif -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -namespace fs = boost::filesystem; -#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class BeidouB1iPcpsAcquisitionTest_msg_rx; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc index e8bcafe4d..d2314fc18 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc @@ -22,6 +22,7 @@ #include "beidou_b3i_pcps_acquisition.h" #include "concurrent_queue.h" #include "gnss_block_interface.h" +#include "gnss_sdr_filesystem.h" #include "gnss_sdr_valve.h" #include "gnss_synchro.h" #include "gnuplot_i.h" @@ -49,18 +50,6 @@ #include #endif -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -namespace fs = boost::filesystem; -#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class BeidouB3iPcpsAcquisitionTest_msg_rx; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc index a5d467a8d..085c704fa 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc @@ -23,6 +23,7 @@ #include "galileo_e1_pcps_ambiguous_acquisition.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" +#include "gnss_sdr_filesystem.h" #include "gnss_sdr_valve.h" #include "gnss_signal.h" #include "gnss_synchro.h" @@ -51,19 +52,6 @@ #include #endif -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -namespace fs = boost::filesystem; -#endif - // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test_fpga.cc index 22e61bf2e..821eefadc 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test_fpga.cc @@ -1,7 +1,6 @@ /*! - * \file gps_l1_ca_pcps_acquisition_test_fpga.cc - * \brief This class implements an acquisition test for - * GpsL1CaPcpsAcquisitionFpga class based on some input parameters. + * \file galileo_e1_pcps_acquisition_test_fpga.cc + * \brief This class implements an acquisition test Galileo FPFA acquisition * \authors
    *
  • Marc Majoral, 2019. mmajoral(at)cttc.cat *
  • Luis Esteve, 2012. luis(at)epsilon-formacion.com @@ -24,6 +23,7 @@ #include "fpga_switch.h" #include "galileo_e1_pcps_ambiguous_acquisition_fpga.h" #include "gnss_block_interface.h" +#include "gnss_sdr_filesystem.h" #include "gnss_signal.h" #include "gnss_synchro.h" #include "in_memory_configuration.h" @@ -44,18 +44,6 @@ #include #endif -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -namespace fs = boost::filesystem; -#endif struct DMA_handler_args_galileo_e1_pcps_ambiguous_acq_test { diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc index 4fd0091fa..d337b8453 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc @@ -21,6 +21,7 @@ #include "acquisition_dump_reader.h" #include "concurrent_queue.h" #include "gnss_block_interface.h" +#include "gnss_sdr_filesystem.h" #include "gnss_sdr_valve.h" #include "gnss_synchro.h" #include "gnuplot_i.h" @@ -48,19 +49,6 @@ #include #endif -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -namespace fs = boost::filesystem; -#endif - // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsAcquisitionTest_msg_rx; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc index 5a2923d69..19bd91b7c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc @@ -23,6 +23,7 @@ #include "concurrent_queue.h" #include "fpga_switch.h" #include "gnss_block_interface.h" +#include "gnss_sdr_filesystem.h" #include "gnss_synchro.h" #include "gps_l1_ca_pcps_acquisition_fpga.h" #include "in_memory_configuration.h" @@ -42,18 +43,6 @@ #include #endif -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -namespace fs = boost::filesystem; -#endif struct DMA_handler_args_gps_l1_acq_test { diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc index 69dc85893..9cd291e1c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc @@ -21,6 +21,7 @@ #include "acquisition_dump_reader.h" #include "concurrent_queue.h" #include "gnss_block_interface.h" +#include "gnss_sdr_filesystem.h" #include "gnss_sdr_valve.h" #include "gnss_synchro.h" #include "gnuplot_i.h" @@ -49,19 +50,6 @@ #include #endif -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -namespace fs = boost::filesystem; -#endif - // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL2MPcpsAcquisitionTest_msg_rx; diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc index 53637ff42..0ece1bd71 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc @@ -15,32 +15,13 @@ */ +#include "gnss_sdr_filesystem.h" #include "nmea_printer.h" #include "rtklib_rtkpos.h" #include "rtklib_solver.h" #include #include -// clang-format off -#if HAS_STD_FILESYSTEM -#include -namespace errorlib = std; -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem -#include // for error_code -namespace fs = boost::filesystem; -namespace errorlib = boost::system; -#endif -// clang-format on class NmeaPrinterTest : public ::testing::Test { diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc index d72b9a52b..1b291da9b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc @@ -14,32 +14,13 @@ * ----------------------------------------------------------------------------- */ +#include "gnss_sdr_filesystem.h" #include "rinex_printer.h" #include "rtklib_rtkpos.h" #include "rtklib_solver.h" #include #include -// clang-format off -#if HAS_STD_FILESYSTEM -#include -namespace errorlib = std; -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem -#include // for error_code -namespace fs = boost::filesystem; -namespace errorlib = boost::system; -#endif -// clang-format on class RinexPrinterTest : public ::testing::Test { diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc index 03fd87d01..57310bbfa 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc @@ -19,6 +19,7 @@ #include "GPS_L1_CA.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" +#include "gnss_sdr_filesystem.h" #include "gnuplot_i.h" #include "in_memory_configuration.h" #include "signal_generator_flags.h" @@ -52,19 +53,6 @@ #include #endif -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -namespace fs = boost::filesystem; -#endif - // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CADllPllTrackingTest_msg_rx; diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc index 72c2e76db..c47d0728e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc @@ -19,6 +19,7 @@ #include "GPS_L1_CA.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" +#include "gnss_sdr_filesystem.h" #include "gnss_sdr_flags.h" #include "gnuplot_i.h" #include "in_memory_configuration.h" @@ -51,18 +52,6 @@ #include #endif -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -namespace fs = boost::filesystem; -#endif DEFINE_bool(plot_gps_l1_kf_tracking_test, false, "Plots results of GpsL1CAKfTrackingTest with gnuplot"); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc index c7a90a86e..cf91049c9 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc @@ -28,6 +28,7 @@ #include "galileo_e5a_pcps_acquisition.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" +#include "gnss_sdr_filesystem.h" #include "gnss_sdr_valve.h" #include "gnuplot_i.h" #include "gps_l1_ca_pcps_acquisition.h" @@ -67,19 +68,6 @@ #include #endif -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -namespace fs = boost::filesystem; -#endif - // ######## GNURADIO TRACKING BLOCK MESSAGE RECEVER ######### class TrackingPullInTest_msg_rx; diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc index b10fd1b6b..5384f7753 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc @@ -29,6 +29,7 @@ #include "galileo_e5a_pcps_acquisition_fpga.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" +#include "gnss_sdr_filesystem.h" #include "gnuplot_i.h" #include "gps_l1_ca_pcps_acquisition_fpga.h" #include "gps_l5i_pcps_acquisition_fpga.h" @@ -66,19 +67,6 @@ #include #endif -#if HAS_STD_FILESYSTEM -#if HAS_STD_FILESYSTEM_EXPERIMENTAL -#include -namespace fs = std::experimental::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif -#else -#include -namespace fs = boost::filesystem; -#endif - // ######## GNURADIO TRACKING BLOCK MESSAGE RECEVER ######### class TrackingPullInTest_msg_rx_Fpga; diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index 45fa9c957..fe017a5a0 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -52,19 +52,10 @@ else() add_executable(front-end-cal main.cc) endif() -if(${FILESYSTEM_FOUND}) - target_compile_definitions(front-end-cal PRIVATE -DHAS_STD_FILESYSTEM=1) - if(${find_experimental}) - target_compile_definitions(front-end-cal PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) - endif() - target_link_libraries(front-end-cal PRIVATE std::filesystem) -else() - target_link_libraries(front-end-cal PRIVATE Boost::filesystem Boost::system) -endif() - target_link_libraries(front-end-cal PRIVATE core_receiver + algorithms_libs front_end_cal_lib gnss_sdr_flags Boost::headers diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index 69e721d30..d89478fb5 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -27,6 +27,7 @@ #include "front_end_cal.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" // for GNSSBlockInte... +#include "gnss_sdr_filesystem.h" #include "gnss_sdr_flags.h" #include "gnss_synchro.h" #include "gps_acq_assist.h" // for Gps_Acq_Assist @@ -72,14 +73,6 @@ #include #endif -#if HAS_STD_FILESYSTEM -#include -namespace fs = std::filesystem; -#else -#include -namespace fs = boost::filesystem; -#endif - #if GFLAGS_OLD_NAMESPACE namespace gflags { From 3773f3c71adc36f23a898556f3452214a9fd7876 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 18 Jan 2021 16:00:33 +0100 Subject: [PATCH 10/11] Do not apply clang-tidy fixes to protobuf-generated headers --- src/algorithms/PVT/libs/CMakeLists.txt | 12 ++++++++---- src/core/monitor/CMakeLists.txt | 11 ++++++++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index 0326f9ca4..7149e7a4b 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -67,14 +67,18 @@ target_link_libraries(pvt_libs Matio::matio ) -get_filename_component(PROTO_INCLUDE_HEADERS ${PROTO_HDRS} DIRECTORY) +get_filename_component(PROTO_INCLUDE_HEADERS_DIR ${PROTO_HDRS} DIRECTORY) +# for concurrent_queue.h target_include_directories(pvt_libs PUBLIC ${CMAKE_SOURCE_DIR}/src/core/receiver - SYSTEM ${PROTO_INCLUDE_HEADERS} - PRIVATE - ${CMAKE_SOURCE_DIR}/src/algorithms/libs # for gnss_sdr_make_unique.h +) + +# Do not apply clang-tidy fixes to protobuf generated headers +target_include_directories(pvt_libs + SYSTEM PUBLIC + ${PROTO_INCLUDE_HEADERS_DIR} ) target_compile_definitions(pvt_libs PRIVATE -DGNSS_SDR_VERSION="${VERSION}") diff --git a/src/core/monitor/CMakeLists.txt b/src/core/monitor/CMakeLists.txt index 3738f4852..73605b992 100644 --- a/src/core/monitor/CMakeLists.txt +++ b/src/core/monitor/CMakeLists.txt @@ -53,14 +53,19 @@ target_link_libraries(core_monitor Gnuradio::pmt ) -get_filename_component(PROTO_INCLUDE_HEADERS ${PROTO_HDRS} DIRECTORY) +get_filename_component(PROTO_INCLUDE_HEADERS_DIR ${PROTO_HDRS} DIRECTORY) target_include_directories(core_monitor PUBLIC - SYSTEM ${PROTO_INCLUDE_HEADERS} ${CMAKE_SOURCE_DIR}/src/core/interfaces PRIVATE - ${CMAKE_SOURCE_DIR}/src/algorithms/libs # for gnss_sdr_make_unique + ${CMAKE_SOURCE_DIR}/src/algorithms/libs # for gnss_sdr_make_unique +) + +# Do not apply clang-tidy fixes to protobuf generated headers +target_include_directories(core_monitor + SYSTEM PUBLIC + ${PROTO_INCLUDE_HEADERS_DIR} ) if(GNURADIO_USES_STD_POINTERS) From 419eff94247d299b1621a0840d2397efdda3c417 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 18 Jan 2021 16:08:56 +0100 Subject: [PATCH 11/11] Update changelog --- docs/changelog.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index d1398f834..aed239a7b 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -20,11 +20,14 @@ SPDX-FileCopyrightText: 2011-2021 Carles Fernandez-Prades = 12 and CMake >= 3.19. +- Fix building of FPGA blocks when linking against GNU Radio >= 3.9 and/or + Boost >= 1.74. ### Improvements in Maintainability: - Improved handling of change in GNU Radio 3.9 FFT API. - Improved handling of the filesystem library. +- Do not apply clang-tidy fixes to protobuf-generated headers.