diff --git a/CMakeLists.txt b/CMakeLists.txt index a24768c62..47b78e114 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -23,7 +23,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) message(WARNING "In-tree build is bad practice. Try 'cd build && cmake ../' ") endif() -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.12) project(gnss-sdr CXX C) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) file(RELATIVE_PATH RELATIVE_CMAKE_CALL ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) @@ -324,12 +324,12 @@ endif() ################################################################################ # Minimum required versions ################################################################################ -set(GNSSSDR_CMAKE_MIN_VERSION "2.8.8") +set(GNSSSDR_CMAKE_MIN_VERSION "2.8.12") set(GNSSSDR_GCC_MIN_VERSION "4.7.2") set(GNSSSDR_CLANG_MIN_VERSION "3.4.0") set(GNSSSDR_APPLECLANG_MIN_VERSION "500") set(GNSSSDR_GNURADIO_MIN_VERSION "3.7.3") -set(GNSSSDR_BOOST_MIN_VERSION "1.45") +set(GNSSSDR_BOOST_MIN_VERSION "1.53") set(GNSSSDR_PYTHON_MIN_VERSION "2.7") set(GNSSSDR_PYTHON3_MIN_VERSION "3.4") set(GNSSSDR_MAKO_MIN_VERSION "0.4.2") @@ -413,6 +413,9 @@ endif() if(NOT OS_IS_MACOSX) if(CMAKE_CROSSCOMPILING) set(IS_ARM TRUE) + if(NOT CMAKE_NO_SYSTEM_FROM_IMPORTED) + set(CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE) + endif() else() include(TestForARM) endif() @@ -487,8 +490,7 @@ if(UNIX AND EXISTS "/usr/lib64") list(APPEND BOOST_LIBRARYDIR "/usr/lib64") # Fedora 64-bit fix endif() set(Boost_ADDITIONAL_VERSIONS - "1.45.0" "1.45" "1.46.0" "1.46" "1.48.0" "1.48" "1.49.0" "1.49" - "1.50.0" "1.50" "1.51.0" "1.51" "1.53.0" "1.53" "1.54.0" "1.54" + "1.53.0" "1.53" "1.54.0" "1.54" "1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59" "1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64" "1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69" @@ -498,11 +500,84 @@ set(Boost_ADDITIONAL_VERSIONS ) set(Boost_USE_MULTITHREAD ON) set(Boost_USE_STATIC_LIBS OFF) -find_package(Boost COMPONENTS date_time system filesystem thread serialization chrono REQUIRED) +find_package(Boost ${GNSSSDR_BOOST_MIN_VERSION} COMPONENTS atomic chrono date_time filesystem serialization system thread REQUIRED) if(NOT Boost_FOUND) message(FATAL_ERROR "Fatal error: Boost (version >=${GNSSSDR_BOOST_MIN_VERSION}) required.") endif() +if(CMAKE_VERSION VERSION_LESS 3.5) + if(NOT TARGET Boost::boost) + add_library(Boost::boost SHARED IMPORTED) # Trick for CMake 2.8.12 + set_property(TARGET Boost::boost PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::boost PROPERTY + IMPORTED_LOCATION ${Boost_DATE_TIME_LIBRARIES}) + endif() + if(NOT TARGET Boost::date_time) + add_library(Boost::date_time SHARED IMPORTED) + set_property(TARGET Boost::date_time PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::date_time PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_DATE_TIME_LIBRARIES}) + set_property(TARGET Boost::date_time PROPERTY + IMPORTED_LOCATION ${Boost_DATE_TIME_LIBRARIES}) + endif() + if(NOT TARGET Boost::system) + add_library(Boost::system SHARED IMPORTED) + set_property(TARGET Boost::system PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::system PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_SYSTEM_LIBRARIES}) + set_property(TARGET Boost::system PROPERTY + IMPORTED_LOCATION ${Boost_SYSTEM_LIBRARIES}) + endif() + if(NOT TARGET Boost::filesystem) + add_library(Boost::filesystem SHARED IMPORTED) + set_property(TARGET Boost::filesystem PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::filesystem PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_FILESYSTEM_LIBRARIES}) + set_property(TARGET Boost::filesystem PROPERTY + IMPORTED_LOCATION ${Boost_FILESYSTEM_LIBRARIES}) + endif() + if(NOT TARGET Boost::thread) + add_library(Boost::thread SHARED IMPORTED) + set_property(TARGET Boost::thread PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::thread PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_THREAD_LIBRARIES}) + set_property(TARGET Boost::thread PROPERTY + IMPORTED_LOCATION ${Boost_THREAD_LIBRARIES}) + endif() + if(NOT TARGET Boost::serialization) + add_library(Boost::serialization SHARED IMPORTED) + set_property(TARGET Boost::serialization PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::serialization PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_SERIALIZATION_LIBRARIES}) + set_property(TARGET Boost::serialization PROPERTY + IMPORTED_LOCATION ${Boost_SERIALIZATION_LIBRARIES}) + endif() + if(NOT TARGET Boost::chrono) + add_library(Boost::chrono SHARED IMPORTED) + set_property(TARGET Boost::chrono PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::chrono PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_CHRONO_LIBRARIES}) + set_property(TARGET Boost::chrono PROPERTY + IMPORTED_LOCATION ${Boost_CHRONO_LIBRARIES}) + endif() + if(NOT TARGET Boost::atomic) + add_library(Boost::atomic SHARED IMPORTED) + set_property(TARGET Boost::atomic PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::atomic PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_ATOMIC_LIBRARIES}) + set_property(TARGET Boost::atomic PROPERTY + IMPORTED_LOCATION ${Boost_ATOMIC_LIBRARIES}) + endif() +endif() + ################################################################################ @@ -530,22 +605,98 @@ if(NOT GNURADIO_RUNTIME_FOUND) message(" brew install gnuradio") message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") endif() +else() + if(NOT TARGET Gnuradio::runtime) + add_library(Gnuradio::runtime SHARED IMPORTED) + list(GET GNURADIO_RUNTIME_LIBRARIES 0 FIRST_DIR) + get_filename_component(GNURADIO_RUNTIME_DIR ${FIRST_DIR} ABSOLUTE) + set_target_properties(Gnuradio::runtime PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GNURADIO_RUNTIME_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_RUNTIME_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GNURADIO_RUNTIME_LIBRARIES}" + ) + endif() endif() if(NOT GNURADIO_ANALOG_FOUND) message(FATAL_ERROR "*** The gnuradio-analog library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") +else() + if(NOT TARGET Gnuradio::analog) + add_library(Gnuradio::analog SHARED IMPORTED) + list(GET GNURADIO_ANALOG_LIBRARIES 0 FIRST_DIR) + get_filename_component(GNURADIO_ANALOG_DIR ${FIRST_DIR} ABSOLUTE) + set_target_properties(Gnuradio::analog PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GNURADIO_ANALOG_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_ANALOG_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GNURADIO_ANALOG_LIBRARIES}" + ) + endif() endif() + if(NOT GNURADIO_BLOCKS_FOUND) message(FATAL_ERROR "*** The gnuradio-blocks library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") +else() + if(NOT TARGET Gnuradio::blocks) + add_library(Gnuradio::blocks SHARED IMPORTED) + list(GET GNURADIO_BLOCKS_LIBRARIES 0 FIRST_DIR) + get_filename_component(GNURADIO_BLOCKS_DIR ${FIRST_DIR} ABSOLUTE) + set_target_properties(Gnuradio::blocks PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GNURADIO_BLOCKS_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_BLOCKS_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GNURADIO_BLOCKS_LIBRARIES}" + ) + endif() endif() + if(NOT GNURADIO_FILTER_FOUND) message(FATAL_ERROR "*** The gnuradio-filter library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") +else() + if(NOT TARGET Gnuradio::filter) + add_library(Gnuradio::filter SHARED IMPORTED) + list(GET GNURADIO_FILTER_LIBRARIES 0 FIRST_DIR) + get_filename_component(GNURADIO_FILTER_DIR ${FIRST_DIR} ABSOLUTE) + set_target_properties(Gnuradio::filter PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GNURADIO_FILTER_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_FILTER_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GNURADIO_FILTER_LIBRARIES}" + ) + endif() endif() + if(NOT GNURADIO_FFT_FOUND) message(FATAL_ERROR "*** The gnuradio-fft library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") +else() + if(NOT TARGET Gnuradio::fft) + add_library(Gnuradio::fft SHARED IMPORTED) + list(GET GNURADIO_FFT_LIBRARIES 0 FIRST_DIR) + get_filename_component(GNURADIO_FFT_DIR ${FIRST_DIR} ABSOLUTE) + set_target_properties(Gnuradio::fft PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GNURADIO_FFT_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_FFT_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GNURADIO_FFT_LIBRARIES}" + ) + endif() endif() + if(NOT GNURADIO_PMT_FOUND) message(FATAL_ERROR "*** The gnuradio-pmt library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") +else() + if(NOT TARGET Gnuradio::pmt) + add_library(Gnuradio::pmt SHARED IMPORTED) + list(GET GNURADIO_PMT_LIBRARIES 0 FIRST_DIR) + get_filename_component(GNURADIO_PMT_DIR ${FIRST_DIR} ABSOLUTE) + set_target_properties(Gnuradio::pmt PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GNURADIO_PMT_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_PMT_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GNURADIO_PMT_LIBRARIES}" + ) + endif() endif() @@ -695,6 +846,19 @@ if(NOT VOLKGNSSSDR_FOUND) set(VOLK_GNSSSDR_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build/include/;${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include;${ORC_INCLUDE_DIRS}") set(VOLK_GNSSSDR_LIBRARIES volk_gnsssdr ${ORC_LIBRARIES}) + if(NOT TARGET Volkgnsssdr::volkgnsssdr) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build/include) + add_library(Volkgnsssdr::volkgnsssdr STATIC IMPORTED) + add_dependencies(Volkgnsssdr::volkgnsssdr volk_gnsssdr_module) + set_target_properties(Volkgnsssdr::volkgnsssdr PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/libvolk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX}" + INCLUDE_DIRECTORIES "${VOLK_GNSSSDR_INCLUDE_DIRS}" + INTERFACE_INCLUDE_DIRECTORIES "${VOLK_GNSSSDR_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${VOLK_GNSSSDR_LIBRARIES}" + ) + endif() + if(CMAKE_VERSION VERSION_LESS 3.2) add_custom_command(TARGET volk_gnsssdr_module POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile @@ -756,16 +920,23 @@ if(NOT GFLAGS_FOUND) ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include CACHE PATH "Local Gflags headers" ) - add_library(gflags UNKNOWN IMPORTED) - set_property(TARGET gflags PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}) - add_dependencies(gflags gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) - set(GFlags_LIBS gflags) - file(GLOB GFlags_SHARED_LIBS "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_SHARED_LIBRARY_SUFFIX}*") - set(GFlags_LIBRARY gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) - set(GFlags_LIBRARY_PATH ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib) - link_directories(${GFlags_LIBRARY_PATH}) - set(GFlags_lib ${GFlags_LIBS} CACHE FILEPATH "Local Gflags library") - set(GFlags_LIBRARY_PATH ${GFlags_LIBS}) + file(GLOB GFlags_SHARED_LIBS + "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_SHARED_LIBRARY_SUFFIX}*" + ) + + if(NOT TARGET Gflags::gflags) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include) + add_library(Gflags::gflags STATIC IMPORTED) + add_dependencies(Gflags::gflags gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) + set_target_properties(Gflags::gflags PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}" + INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include" + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include" + INTERFACE_LINK_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) + endif() + set(LOCAL_GFLAGS true CACHE STRING "GFlags downloaded and built automatically" FORCE) endif() @@ -899,6 +1070,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c INSTALL_COMMAND "" ) endif() + add_dependencies(glog-${GNSSSDR_GLOG_LOCAL_VERSION} Gflags::gflags) # Set up variables set(GLOG_INCLUDE_DIRS @@ -908,15 +1080,28 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c set(GLOG_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} ) + + # Create Glog::glog target + if(NOT TARGET Glog::glog) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src) + add_library(Glog::glog STATIC IMPORTED) + add_dependencies(Glog::glog glog-${GNSSSDR_GLOG_LOCAL_VERSION}) + set_target_properties(Glog::glog PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}" + INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIRS}" + INTERFACE_INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) + endif() + set(LOCAL_GLOG true CACHE STRING "Glog downloaded and built automatically" FORCE) -else() - add_library(glog-${GNSSSDR_GLOG_LOCAL_VERSION} UNKNOWN IMPORTED) - set_property(TARGET glog-${GNSSSDR_GLOG_LOCAL_VERSION} PROPERTY IMPORTED_LOCATION "${GLOG_LIBRARIES}") endif() if(NOT ENABLE_LOG) message(STATUS "Logging is not enabled") - add_definitions(-DGOOGLE_STRIP_LOG=1) + target_compile_definitions(Glog::glog PUBLIC -DGOOGLE_STRIP_LOG=1) endif() @@ -967,6 +1152,14 @@ if(ARMADILLO_FOUND) if(${ARMADILLO_VERSION_STRING} VERSION_LESS ${GNSSSDR_ARMADILLO_MIN_VERSION}) set(ARMADILLO_FOUND false) set(ENABLE_OWN_ARMADILLO true) + else() + add_library(Armadillo::armadillo SHARED IMPORTED) + set_target_properties(Armadillo::armadillo PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${ARMADILLO_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${ARMADILLO_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${ARMADILLO_LIBRARIES}" + ) endif() endif() @@ -1028,17 +1221,22 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) # Set up variables ExternalProject_Get_Property(armadillo-${armadillo_RELEASE} binary_dir) - set(ARMADILLO_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include) + #set(ARMADILLO_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include) if(NOT GFORTRAN) set(GFORTRAN "") endif() set(ARMADILLO_LIBRARIES ${BLAS} ${LAPACK} ${GFORTRAN} ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}) set(LOCAL_ARMADILLO true CACHE STRING "Armadillo downloaded and built automatically" FORCE) set(ARMADILLO_VERSION_STRING ${armadillo_RELEASE}) -else() - set(armadillo_RELEASE ${ARMADILLO_VERSION_STRING}) - add_library(armadillo-${armadillo_RELEASE} UNKNOWN IMPORTED) - set_property(TARGET armadillo-${armadillo_RELEASE} PROPERTY IMPORTED_LOCATION "${ARMADILLO_LIBRARIES}") + file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include) + add_library(Armadillo::armadillo STATIC IMPORTED) + add_dependencies(Armadillo::armadillo armadillo-${armadillo_RELEASE}) + set_target_properties(Armadillo::armadillo PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include" + INTERFACE_LINK_LIBRARIES "${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) endif() @@ -1165,6 +1363,7 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS set(HDF5_BASE_DIR /usr/local) endif() endif() + if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION} PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio @@ -1173,7 +1372,7 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= - BUILD_COMMAND make + BUILD_COMMAND $(MAKE) ) else() ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION} @@ -1183,13 +1382,23 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= - BUILD_COMMAND make + BUILD_COMMAND $(MAKE) BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} ) endif() - set(MATIO_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} ${HDF5_LIBRARIES} ${ZLIB_LIBRARIES}) - set(MATIO_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/matio/include) set(MATIO_LOCAL true) + if(NOT TARGET Matio::matio) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/matio/include) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/matio/lib) + add_library(Matio::matio SHARED IMPORTED) + add_dependencies(Matio::matio matio-${GNSSSDR_MATIO_LOCAL_VERSION}) + set_target_properties(Matio::matio PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_SHARED_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/matio/include" + INTERFACE_LINK_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + endif() else() message(STATUS " The hdf5 library has not been found in your system.") message(STATUS " Please try to install it by doing:") @@ -1250,29 +1459,22 @@ else() INSTALL_COMMAND "" ) endif() - set(PUGIXML_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}) - set(PUGIXML_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src) - set(PUGIXML_LOCAL true) -endif() - -################################################################################ -# USRP Hardware Driver (UHD) - OPTIONAL -################################################################################ -if(ENABLE_UHD) - find_package(UHD) - if(NOT UHD_FOUND) - set(ENABLE_UHD OFF) - message(STATUS " The USRP Hardware Driver (UHD) signal source will not be built,") - message(STATUS " so all USRP-based front-ends will not be usable.") - message(STATUS " Please check https://files.ettus.com/manual/") - else() - set(GR_REQUIRED_COMPONENTS UHD) - find_package(Gnuradio) + if(NOT TARGET Pugixml::pugixml) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src) + add_library(Pugixml::pugixml STATIC IMPORTED) + add_dependencies(Pugixml::pugixml pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}) + set_target_properties(Pugixml::pugixml PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src" + INTERFACE_LINK_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) endif() endif() + ################################################################################ # Doxygen - http://www.stack.nl/~dimitri/doxygen/index.html (OPTIONAL, used if found) ################################################################################ @@ -1389,14 +1591,16 @@ endif() # CUSTOM UDP PACKET SOURCE (OPTIONAL) ############################################################################### if(ENABLE_RAW_UDP) - message(STATUS "High-optimized custom UDP ip packet source will be enabled.") - message(STATUS "You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ../'") -else() - message(STATUS "High-optimized custom UDP ip packet source will be enabled.") + message(STATUS "High-optimized custom UDP IP packet source is enabled.") message(STATUS "You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ../'") + find_package(PCAP) + if(NOT PCAP_FOUND) + message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (with ENABLE_RAW_UDP=ON)") + endif() endif() + ############################################################################### # FPGA (OPTIONAL) ############################################################################### @@ -1413,40 +1617,39 @@ endif() ################################################################################ # Setup of optional drivers ################################################################################ -if($ENV{GN3S_DRIVER}) - message(STATUS "GN3S_DRIVER environment variable found.") - set(ENABLE_GN3S ON) -endif() -if(GN3S_DRIVER) - set(ENABLE_GN3S ON) -endif() -if(ENABLE_GN3S) - message(STATUS "The GN3S driver will be compiled.") - message(STATUS "You can disable it with 'cmake -DENABLE_GN3S=OFF ../'") -else() - message(STATUS "The (optional and experimental) GN3S driver is not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_GN3S=ON ../' to add support for the GN3S dongle.") + +######################################## +# USRP Hardware Driver (UHD) - OPTIONAL +######################################## +if(ENABLE_UHD) + find_package(UHD) + if(NOT UHD_FOUND) + set(ENABLE_UHD OFF) + message(STATUS " The USRP Hardware Driver (UHD) signal source will not be built,") + message(STATUS " so all USRP-based front-ends will not be usable.") + message(STATUS " Please check https://files.ettus.com/manual/") + else() + set(GR_REQUIRED_COMPONENTS UHD) + find_package(Gnuradio) + if(NOT TARGET Gnuradio::uhd) + add_library(Gnuradio::uhd SHARED IMPORTED) + list(GET GNURADIO_UHD_LIBRARIES 0 FIRST_DIR) + get_filename_component(GNURADIO_UHD_DIR ${FIRST_DIR} ABSOLUTE) + set_target_properties(Gnuradio::uhd PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GNURADIO_UHD_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_UHD_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GNURADIO_UHD_LIBRARIES}" + ) + endif() + endif() endif() -if($ENV{RAW_ARRAY_DRIVER}) - message(STATUS "RAW_ARRAY_DRIVER environment variable found.") - set(ENABLE_ARRAY ON) -endif() - -if(RAW_ARRAY_DRIVER) - set(ENABLE_ARRAY ON) -endif() - -if(ENABLE_ARRAY) - message(STATUS "CTTC's Antenna Array front-end driver will be compiled.") - message(STATUS "You can disable it with 'cmake -DENABLE_ARRAY=OFF ../'") - # copy firmware to install folder - # Build project gr-dbfcttc -else() - message(STATUS "The (optional) CTTC's Antenna Array front-end driver is not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_ARRAY=ON ../' to add support for the CTTC experimental array front-end.") -endif() +########################################## +# gr-osmosdr - OPTIONAL +# https://github.com/osmocom/gr-osmosdr +########################################## if($ENV{RTLSDR_DRIVER}) message(STATUS "RTLSDR_DRIVER environment variable found.") set(ENABLE_OSMOSDR ON) @@ -1469,6 +1672,30 @@ else() message(STATUS "Enable it with 'cmake -DENABLE_OSMOSDR=ON ../' to add support for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based USB dongles, etc.)") endif() + +############################################## +# gr-iio - OPTIONAL +# IIO blocks for GNU Radio +# https://github.com/analogdevicesinc/gr-iio +############################################## +if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) + find_package(GRIIO) +endif() + + +################################################################################### +# libiio - OPTIONAL +# A cross platform library for interfacing with local and remote Linux IIO devices +# https://github.com/analogdevicesinc/libiio +################################################################################### +if(ENABLE_AD9361) + find_package(LIBIIO) +endif() + + +############################################## +# TELEORBIT FLEXIBAND FRONTEND - OPTIONAL +############################################## if($ENV{FLEXIBAND_DRIVER}) message(STATUS "FLEXIBAND_DRIVER environment variable found.") set(ENABLE_FLEXIBAND ON) @@ -1485,11 +1712,59 @@ else() message(STATUS "The (optional) Teleorbit Flexiband front-end driver adapter is not enabled.") message(STATUS "Enable it with 'cmake -DENABLE_FLEXIBAND=ON ../' to add support for the Teleorbit Flexiband front-end.") endif() +if(ENABLE_FLEXIBAND) + find_package(TELEORBIT) + if(NOT TELEORBIT_FOUND) + message(FATAL_ERROR "Teleorbit Flexiband GNU Radio driver required to build gnss-sdr with the optional FLEXIBAND adapter") + endif() +endif() + + +############################################## +# GN3S - OPTIONAL +############################################## +if($ENV{GN3S_DRIVER}) + message(STATUS "GN3S_DRIVER environment variable found.") + set(ENABLE_GN3S ON) +endif() +if(GN3S_DRIVER) + set(ENABLE_GN3S ON) +endif() +if(ENABLE_GN3S) + message(STATUS "The GN3S driver will be compiled.") + message(STATUS "You can disable it with 'cmake -DENABLE_GN3S=OFF ../'") + find_package(GRGN3S QUIET) +else() + message(STATUS "The (optional and experimental) GN3S driver is not enabled.") + message(STATUS "Enable it with 'cmake -DENABLE_GN3S=ON ../' to add support for the GN3S dongle.") +endif() + + +####################################################### +# CTTC's digital array beamformer prototype - OPTIONAL +####################################################### +if($ENV{RAW_ARRAY_DRIVER}) + message(STATUS "RAW_ARRAY_DRIVER environment variable found.") + set(ENABLE_ARRAY ON) +endif() + +if(RAW_ARRAY_DRIVER) + set(ENABLE_ARRAY ON) +endif() + +if(ENABLE_ARRAY) + message(STATUS "CTTC's Antenna Array front-end driver will be compiled.") + message(STATUS "You can disable it with 'cmake -DENABLE_ARRAY=OFF ../'") + find_package(GRDBFCTTC QUIET) +else() + message(STATUS "The (optional) CTTC's Antenna Array front-end driver is not enabled.") + message(STATUS "Enable it with 'cmake -DENABLE_ARRAY=ON ../' to add support for the CTTC experimental array front-end.") +endif() ################################################################################ -# GPerftools - https://github.com/gperftools/gperftools (OPTIONAL) +# GPerftools - https://github.com/gperftools/gperftools - OPTIONAL) ################################################################################ if(ENABLE_GPERFTOOLS) find_package(GPERFTOOLS) @@ -1581,7 +1856,7 @@ endif() if(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) AND NOT WIN32) if(NOT (CMAKE_VERSION VERSION_LESS "3.1")) set(CMAKE_C_STANDARD 11) - set(CMAKE_CXX_STANDARD 14) + set(CMAKE_CXX_STANDARD 11) endif() endif() diff --git a/README.md b/README.md index ba2a1579d..7398372ba 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,20 @@ [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) -link to website: https://gnsssdrbeidoub1igsoc2018.wordpress.com/ **Welcome to GNSS-SDR!** This program is a software-defined receiver which is able to process (that is, to perform detection, synchronization, demodulation and decoding of the navigation message, computation of observables and, finally, computation of position fixes) the following Global Navigation Satellite System's signals: In the L1 band: + - 🛰 BeiDou B1I (centered at 1561.098 MHz) :white_check_mark: - 🛰 GPS L1 C/A (centered at 1575.42 MHz) :white_check_mark: - 🛰 Galileo E1b/c (centered at 1575.42 MHz) :white_check_mark: - - 🛰 GLONASS L1 C/A (centered at 1601.72 MHz) :white_check_mark: + - 🛰 GLONASS L1 C/A (centered at 1602.00 MHz) :white_check_mark: In the L2 band: - 🛰 GPS L2C (centered at 1227.60 MHz) :white_check_mark: - - 🛰 GLONASS L2 C/A (centered at 1246 MHz) :white_check_mark: + - 🛰 GLONASS L2 C/A (centered at 1246.00 MHz) :white_check_mark: In the L5 band: - 🛰 GPS L5 (centered at 1176.45 MHz) :white_check_mark: @@ -189,9 +189,9 @@ $ sudo apt-get install libblas-dev liblapack-dev # For Debian/Ubuntu/Linux $ sudo yum install lapack-devel blas-devel # For Fedora/CentOS/RHEL $ sudo zypper install lapack-devel blas-devel # For OpenSUSE $ sudo pacman -S blas lapack # For Arch Linux -$ wget https://sourceforge.net/projects/arma/files/armadillo-9.100.5.tar.xz -$ tar xvfz armadillo-9.100.5.tar.xz -$ cd armadillo-9.100.5 +$ wget https://sourceforge.net/projects/arma/files/armadillo-9.200.7.tar.xz +$ tar xvfz armadillo-9.200.7.tar.xz +$ cd armadillo-9.200.7 $ cmake . $ make $ sudo make install @@ -573,7 +573,7 @@ First, install [Homebrew](https://brew.sh/). Paste this in a terminal prompt: $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ~~~~~~ -The script explains what it will do and then pauses before it does it. There are more installation options [here](https://docs.brew.sh/Installation.html). +The script explains what it will do, and then it pauses before doing it. There are more installation options [here](https://docs.brew.sh/Installation.html). Install pip: @@ -584,17 +584,26 @@ $ sudo easy_install pip Install the required dependencies: ~~~~~~ -$ brew tap homebrew/science -$ brew install cmake hdf5 arpack superlu -$ brew install armadillo -$ brew install glog gflags gnutls +$ brew install cmake +$ brew install hdf5 arpack superlu armadillo +$ brew install glog gflags $ brew install gnuradio $ brew install libmatio +$ brew install log4cpp $ brew install pugixml $ pip install mako $ pip install six +$ brew install openssl ~~~~~~ +In the last step, Homebrew installs OpenSSL but it does not link it into `/usr/local`. Thus, you must manually link it instead: + +~~~~~~ +$ ln -s /usr/local/opt/openssl/include/openssl /usr/local/include +$ ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/ +~~~~~~ + + #### Build GNSS-SDR Finally, you are ready to clone the GNSS-SDR repository, configure and build the software: @@ -1118,6 +1127,7 @@ Each channel must be assigned to a GNSS signal, according to the following ident | GPS L1 C/A | 1C | | Galileo E1b/c | 1B | | Glonass L1 C/A | 1G | +| Beidou B1I | B1 | | GPS L2 L2C(M) | 2S | | Glonass L2 C/A | 2G | | GPS L5 | L5 | diff --git a/cmake/Modules/FindGFLAGS.cmake b/cmake/Modules/FindGFLAGS.cmake index 31739e216..db1f9d891 100644 --- a/cmake/Modules/FindGFLAGS.cmake +++ b/cmake/Modules/FindGFLAGS.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -26,6 +26,10 @@ # GFlags_INCLUDE_DIRS # GFlags_LIBS # GFlags_LIBRARY_DIRS +# +# Provides the following imported target: +# Gflags::gflags +# if(APPLE) find_path(GFlags_ROOT_DIR @@ -95,9 +99,6 @@ if(GFlags_ROOT_DIR) else() set(GFLAGS_GREATER_20 FALSE) endif() - # set up include and link directory - include_directories(${GFlags_INCLUDE_DIRS}) - link_directories(${GFlags_LIBRARY_DIRS}) message(STATUS "gflags library found at ${GFlags_lib}") set(GFlags_LIBS ${GFlags_lib}) set(GFlags_FOUND true) @@ -109,3 +110,13 @@ endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GFLAGS DEFAULT_MSG GFlags_LIBS GFlags_INCLUDE_DIRS) + +if(GFLAGS_FOUND AND NOT TARGET Gflags::gflags) + add_library(Gflags::gflags SHARED IMPORTED) + set_target_properties(Gflags::gflags PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GFlags_LIBS}" + INTERFACE_INCLUDE_DIRECTORIES "${GFlags_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GFlags_LIBS}" + ) +endif() diff --git a/cmake/Modules/FindGLOG.cmake b/cmake/Modules/FindGLOG.cmake index 2d8f154f3..b85339195 100644 --- a/cmake/Modules/FindGLOG.cmake +++ b/cmake/Modules/FindGLOG.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -27,6 +27,9 @@ # # GLOG_ROOT - Can be set to Glog install path or Windows build path # +# Provides the following imported target: +# Glog::glog +# if(NOT DEFINED GLOG_ROOT) set(GLOG_ROOT /usr /usr/local) @@ -135,6 +138,12 @@ else() string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) endif() -if(GLOG_FOUND) - # _GLOG_APPEND_LIBRARIES(GLOG GLOG_LIBRARIES) +if(GLOG_FOUND AND NOT TARGET Glog::glog) + add_library(Glog::glog SHARED IMPORTED) + set_target_properties(Glog::glog PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GLOG_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GLOG_LIBRARIES}" + ) endif() diff --git a/cmake/Modules/FindGPSTK.cmake b/cmake/Modules/FindGPSTK.cmake index f5ecb667e..1959c3ff6 100644 --- a/cmake/Modules/FindGPSTK.cmake +++ b/cmake/Modules/FindGPSTK.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -32,18 +32,30 @@ find_path(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp set(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk) +include(GNUInstallDirs) + find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} HINTS /usr/lib /usr/local/lib + /usr/${CMAKE_INSTALL_LIBDIR} + /usr/local/${CMAKE_INSTALL_LIBDIR} /opt/local/lib - ${GPSTK_ROOT}/lib - $ENV{GPSTK_ROOT}/lib - ${GPSTK_ROOT}/lib64 - $ENV{GPSTK_ROOT}/lib64 + ${GPSTK_ROOT}/${CMAKE_INSTALL_LIBDIR} + $ENV{GPSTK_ROOT}/${CMAKE_INSTALL_LIBDIR} ) # handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if # all listed variables are TRUE include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR) -mark_as_advanced(GPSTK_INCLUDE_DIR GPSTK_LIBRARY GPSTK_INCLUDE_DIR) +mark_as_advanced(GPSTK_LIBRARY GPSTK_INCLUDE_DIR) + +if(GPSTK_FOUND AND NOT TARGET Gpstk::gpstk) + add_library(Gpstk::gpstk SHARED IMPORTED) + set_target_properties(Gpstk::gpstk PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GPSTK_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${GPSTK_INCLUDE_DIR};${GPSTK_INCLUDE_DIR}/gpstk" + INTERFACE_LINK_LIBRARIES "${GPSTK_LIBRARY}" + ) +endif() diff --git a/cmake/Modules/FindGRDBFCTTC.cmake b/cmake/Modules/FindGRDBFCTTC.cmake index e0689aeaf..64c838af1 100644 --- a/cmake/Modules/FindGRDBFCTTC.cmake +++ b/cmake/Modules/FindGRDBFCTTC.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -53,4 +53,15 @@ find_library( include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GRDBFCTTC DEFAULT_MSG GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) + +if(GRDBFCTTC_FOUND AND NOT TARGET Gnuradio::dbfcttc) + add_library(Gnuradio::dbfcttc SHARED IMPORTED) + set_target_properties(Gnuradio::dbfcttc PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GR_DBFCTTC_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${GR_DBFCTTC_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GR_DBFCTTC_LIBRARIES}" + ) +endif() + mark_as_advanced(GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGRGN3S.cmake b/cmake/Modules/FindGRGN3S.cmake index 93f7bda89..4664a6edb 100644 --- a/cmake/Modules/FindGRGN3S.cmake +++ b/cmake/Modules/FindGRGN3S.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -53,4 +53,15 @@ find_library( include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GRGN3S DEFAULT_MSG GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) + +if(GRGN3S_FOUND AND NOT TARGET Gnuradio::gn3s) + add_library(Gnuradio::gn3s SHARED IMPORTED) + set_target_properties(Gnuradio::gn3s PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GR_GN3S_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${GR_GN3S_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GR_GN3S_LIBRARIES}" + ) +endif() + mark_as_advanced(GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGRIIO.cmake b/cmake/Modules/FindGRIIO.cmake index 6d341e7fd..8cb8e9efc 100644 --- a/cmake/Modules/FindGRIIO.cmake +++ b/cmake/Modules/FindGRIIO.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -15,6 +15,12 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . +# +# Provides the following imported target: +# Gnuradio::iio +# + + include(FindPkgConfig) pkg_check_modules(PC_IIO gnuradio-iio) @@ -69,4 +75,15 @@ find_library(IIO_LIBRARIES include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GRIIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS) + +if(GRIIO_FOUND AND NOT TARGET Gnuradio::iio) + add_library(Gnuradio::iio SHARED IMPORTED) + set_target_properties(Gnuradio::iio PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${IIO_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${IIO_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${IIO_LIBRARIES}" + ) +endif() + mark_as_advanced(IIO_LIBRARIES IIO_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGROSMOSDR.cmake b/cmake/Modules/FindGROSMOSDR.cmake index 48379ed76..0054db97d 100644 --- a/cmake/Modules/FindGROSMOSDR.cmake +++ b/cmake/Modules/FindGROSMOSDR.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -33,6 +33,11 @@ # GROSMOSDR_FOUND System has gr-osmosdr libs/headers # GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr) # GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers +# +# Provides the following imported target: +# Gnuradio::osmosdr +# + include(FindPkgConfig) pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr) @@ -89,4 +94,15 @@ find_library(GROSMOSDR_LIBRARIES include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GROSMOSDR DEFAULT_MSG GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR) + +if(GROSMOSDR_FOUND AND NOT TARGET Gnuradio::osmosdr) + add_library(Gnuradio::osmosdr SHARED IMPORTED) + set_target_properties(Gnuradio::osmosdr PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GROSMOSDR_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${GROSMOSDR_INCLUDE_DIR};${GROSMOSDR_INCLUDE_DIR}/osmosdr" + INTERFACE_LINK_LIBRARIES "${GROSMOSDR_LIBRARIES}" + ) +endif() + mark_as_advanced(GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR) diff --git a/cmake/Modules/FindLIBIIO.cmake b/cmake/Modules/FindLIBIIO.cmake index a76180ca2..5a9a3806f 100644 --- a/cmake/Modules/FindLIBIIO.cmake +++ b/cmake/Modules/FindLIBIIO.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -15,6 +15,11 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . +# +# Provides the following imported target: +# Iio::iio +# + include(FindPkgConfig) pkg_check_modules(PC_LIBIIO libiio) @@ -73,4 +78,15 @@ find_library( include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LIBIIO DEFAULT_MSG LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) + +if(LIBIIO_FOUND AND NOT TARGET Iio::iio) + add_library(Iio::iio SHARED IMPORTED) + set_target_properties(Iio::iio PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${LIBIIO_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${LIBIIO_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${LIBIIO_LIBRARIES}" + ) +endif() + mark_as_advanced(LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) diff --git a/cmake/Modules/FindLIBOSMOSDR.cmake b/cmake/Modules/FindLIBOSMOSDR.cmake index 1e3aaf5e0..7534f4a00 100644 --- a/cmake/Modules/FindLIBOSMOSDR.cmake +++ b/cmake/Modules/FindLIBOSMOSDR.cmake @@ -27,6 +27,10 @@ # LIBOSMOSDR_FOUND System has libosmosdr libs/headers # LIBOSMOSDR_LIBRARIES The libosmosdr libraries # LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers +# +# Provides the following imported target: +# Osmosdr::osmosdr +# include(FindPkgConfig) pkg_check_modules(LIBOSMOSDR_PKG libosmosdr) @@ -77,4 +81,15 @@ find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LIBOSMOSDR DEFAULT_MSG LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) + +if(LIBOSMOSDR_FOUND AND NOT TARGET Osmosdr::osmosdr) + add_library(Osmosdr::osmosdr SHARED IMPORTED) + set_target_properties(Osmosdr::osmosdr PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${LIBOSMOSDR_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${LIBOSMOSDR_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${LIBOSMOSDR_LIBRARIES}" + ) +endif() + mark_as_advanced(LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) diff --git a/cmake/Modules/FindLOG4CPP.cmake b/cmake/Modules/FindLOG4CPP.cmake index 283c3ddf9..29c7308fa 100644 --- a/cmake/Modules/FindLOG4CPP.cmake +++ b/cmake/Modules/FindLOG4CPP.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -21,7 +21,10 @@ # LOG4CPP_INCLUDE_DIR - where to find LOG4CPP.h, etc. # LOG4CPP_LIBRARIES - List of libraries when using LOG4CPP. # LOG4CPP_FOUND - True if LOG4CPP found. - +# +# Provides the following imported target: +# Log4cpp::log4cpp +# if(LOG4CPP_INCLUDE_DIR) # Already in cache, be silent @@ -90,3 +93,18 @@ endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LOG4CPP DEFAULT_MSG LOG4CPP_INCLUDE_DIRS LOG4CPP_LIBRARIES) + +if (LOG4CPP_FOUND AND NOT TARGET Log4cpp::log4cpp) + add_library(Log4cpp::log4cpp SHARED IMPORTED) + set_target_properties(Log4cpp::log4cpp PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${LOG4CPP_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${LOG4CPP_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${LOG4CPP_LIBRARIES}" + ) +endif() + +mark_as_advanced( + LOG4CPP_LIBRARIES + LOG4CPP_INCLUDE_DIRS +) diff --git a/cmake/Modules/FindMATIO.cmake b/cmake/Modules/FindMATIO.cmake index 08facf069..623939690 100644 --- a/cmake/Modules/FindMATIO.cmake +++ b/cmake/Modules/FindMATIO.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -26,6 +26,9 @@ # MATIO_INCLUDE_DIRS - where to find matio.h, etc.. # MATIO_VERSION_STRING - version number as a string (e.g.: "1.3.4") # +# Provides the following imported target: +# Matio::matio +# #============================================================================= # Copyright 2015 Avtech Scientific # @@ -127,3 +130,13 @@ else() set(MATIO_LIBRARIES) set(MATIO_INCLUDE_DIRS) endif() + +if(MATIO_FOUND AND NOT TARGET Matio::matio) + add_library(Matio::matio SHARED IMPORTED) + set_target_properties(Matio::matio PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${MATIO_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${MATIO_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${MATIO_LIBRARY}" + ) +endif() diff --git a/cmake/Modules/FindPCAP.cmake b/cmake/Modules/FindPCAP.cmake index af746c852..6c8e52f8f 100644 --- a/cmake/Modules/FindPCAP.cmake +++ b/cmake/Modules/FindPCAP.cmake @@ -43,7 +43,10 @@ # PCAP_INCLUDE_DIRS - where to find pcap.h, etc. # PCAP_LIBRARIES - List of libraries when using pcap. # PCAP_FOUND - True if pcap found. - +# +# Provides the following imported target: +# Pcap::pcap +# if(EXISTS $ENV{PCAPDIR}) find_path(PCAP_INCLUDE_DIR @@ -113,10 +116,20 @@ check_function_exists("pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS) check_function_exists("pcap_open_dead" HAVE_PCAP_OPEN_DEAD) check_function_exists("pcap_set_datalink" HAVE_PCAP_SET_DATALINK) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES) + +if(PCAP_FOUND AND NOT TARGET Pcap::pcap) + add_library(Pcap::pcap SHARED IMPORTED) + set_target_properties(Pcap::pcap PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${PCAP_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${PCAP_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${PCAP_LIBRARIES}" + ) +endif() + mark_as_advanced( PCAP_LIBRARIES PCAP_INCLUDE_DIRS ) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES) diff --git a/cmake/Modules/FindPUGIXML.cmake b/cmake/Modules/FindPUGIXML.cmake index 236a4c95a..3232285c3 100644 --- a/cmake/Modules/FindPUGIXML.cmake +++ b/cmake/Modules/FindPUGIXML.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -22,6 +22,10 @@ # PUGIXML_INCLUDE_DIR - header location # PUGIXML_LIBRARIES - library to link against # PUGIXML_FOUND - true if pugixml was found. +# +# Provides the following imported target: +# Pugixml::pugixml +# find_path(PUGIXML_INCLUDE_DIR NAMES pugixml.hpp @@ -73,3 +77,13 @@ else() endif() mark_as_advanced(PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR) + +if(PUGIXML_FOUND AND NOT TARGET Pugixml::pugixml) + add_library(Pugixml::pugixml SHARED IMPORTED) + set_target_properties(Pugixml::pugixml PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${PUGIXML_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${PUGIXML_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${PUGIXML_LIBRARY}" + ) +endif() diff --git a/cmake/Modules/FindTELEORBIT.cmake b/cmake/Modules/FindTELEORBIT.cmake index eb2420687..bdb3d861c 100644 --- a/cmake/Modules/FindTELEORBIT.cmake +++ b/cmake/Modules/FindTELEORBIT.cmake @@ -47,4 +47,15 @@ find_library(TELEORBIT_LIBRARIES include(FindPackageHandleStandardArgs) find_package_handle_standard_args(TELEORBIT DEFAULT_MSG TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) + +if(TELEORBIT_FOUND AND NOT TARGET Gnuradio::teleorbit) + add_library(Gnuradio::teleorbit SHARED IMPORTED) + set_target_properties(Gnuradio::teleorbit PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${TELEORBIT_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${TELEORBIT_INCLUDE_DIRS};${TELEORBIT_INCLUDE_DIRS}/teleorbit" + INTERFACE_LINK_LIBRARIES "${TELEORBIT_LIBRARIES}" + ) +endif() + mark_as_advanced(TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) diff --git a/cmake/Modules/FindUHD.cmake b/cmake/Modules/FindUHD.cmake index 31d299937..e0d6d77e0 100644 --- a/cmake/Modules/FindUHD.cmake +++ b/cmake/Modules/FindUHD.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -15,10 +15,14 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . +# +# Provides the following imported target: +# Iio::iio +# + ######################################################################## # Find the library for the USRP Hardware Driver ######################################################################## - include(FindPkgConfig) pkg_check_modules(PC_UHD uhd) @@ -72,4 +76,15 @@ find_library(UHD_LIBRARIES include(FindPackageHandleStandardArgs) find_package_handle_standard_args(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS) + +if(UHD_FOUND AND NOT TARGET Uhd::uhd) + add_library(Uhd::uhd SHARED IMPORTED) + set_target_properties(Uhd::uhd PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${UHD_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${UHD_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${UHD_LIBRARIES}" + ) +endif() + mark_as_advanced(UHD_LIBRARIES UHD_INCLUDE_DIRS) diff --git a/cmake/Modules/FindVOLK.cmake b/cmake/Modules/FindVOLK.cmake index 97191179c..26d236625 100644 --- a/cmake/Modules/FindVOLK.cmake +++ b/cmake/Modules/FindVOLK.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -15,6 +15,11 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . +# +# Provides the following imported target: +# Volk::volk +# + ######################################################################## # Find VOLK (Vector-Optimized Library of Kernels) ######################################################################## @@ -74,3 +79,13 @@ find_library(VOLK_LIBRARIES include(FindPackageHandleStandardArgs) find_package_handle_standard_args(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS) mark_as_advanced(VOLK_LIBRARIES VOLK_INCLUDE_DIRS VOLK_VERSION) + +if(VOLK_FOUND AND NOT TARGET Volk::volk) + add_library(Volk::volk SHARED IMPORTED) + set_target_properties(Volk::volk PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${VOLK_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${VOLK_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${VOLK_LIBRARIES}" + ) +endif() diff --git a/cmake/Modules/FindVOLKGNSSSDR.cmake b/cmake/Modules/FindVOLKGNSSSDR.cmake index 5cdc4e61d..448187cad 100644 --- a/cmake/Modules/FindVOLKGNSSSDR.cmake +++ b/cmake/Modules/FindVOLKGNSSSDR.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -15,6 +15,12 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . +# +# Provides the following imported target: +# Volkgnsssdr::volkgnsssdr +# + + ######################################################################## # Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library ######################################################################## @@ -51,3 +57,14 @@ find_library(VOLK_GNSSSDR_LIBRARIES include(FindPackageHandleStandardArgs) find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) + + +if(GFLAGS_FOUND AND NOT TARGET Volkgnsssdr::volkgnsssdr) + add_library(Volkgnsssdr::volkgnsssdr SHARED IMPORTED) + set_target_properties(Volkgnsssdr::volkgnsssdr PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${VOLK_GNSSSDR_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${VOLK_GNSSSDR_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${VOLK_GNSSSDR_LIBRARIES}" + ) +endif() diff --git a/conf/gnss-sdr_GLONASS_L1_ibyte.conf b/conf/gnss-sdr_GLONASS_L1_ibyte.conf index 0b16fa3d8..9c5183c98 100644 --- a/conf/gnss-sdr_GLONASS_L1_ibyte.conf +++ b/conf/gnss-sdr_GLONASS_L1_ibyte.conf @@ -5,8 +5,8 @@ [GNSS-SDR] ;######### GLOBAL OPTIONS ################## -;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz]. -GNSS-SDR.internal_fs_hz=6625000 +;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [Hz]. +GNSS-SDR.internal_fs_sps=6625000 ;######### CONTROL_THREAD CONFIG ############ ControlThread.wait_for_flowgraph=false @@ -54,7 +54,6 @@ Channel.signal=1R Acquisition_1R.dump=false Acquisition_1R.dump_filename=./acq_dump.dat Acquisition_1R.item_type=cshort -Acquisition_1R.if=0 Acquisition_1R.sampled_ms=1 Acquisition_1R.implementation=GLONASS_L1_CA_PCPS_Acquisition Acquisition_1R.threshold=0.008 @@ -68,7 +67,6 @@ Acquisition_1R.tong_max_dwells=20 ;######### TRACKING GLOBAL CONFIG ############ Tracking_1R.implementation=GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking Tracking_1R.item_type=cshort -Tracking_1R.if=0 Tracking_1R.dump=false Tracking_1R.dump_filename=../data/epl_tracking_ch_ Tracking_1R.pll_bw_hz=40.0; @@ -78,7 +76,6 @@ Tracking_1R.order=3; ;######### TELEMETRY DECODER GPS CONFIG ############ TelemetryDecoder_1R.implementation=GLONASS_L1_CA_Telemetry_Decoder TelemetryDecoder_1R.dump=false -TelemetryDecoder_1R.decimation_factor=1; ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables diff --git a/conf/gnss-sdr_GPS_L1_CA_byte.conf b/conf/gnss-sdr_GPS_L1_CA_byte.conf deleted file mode 100644 index 258130315..000000000 --- a/conf/gnss-sdr_GPS_L1_CA_byte.conf +++ /dev/null @@ -1,110 +0,0 @@ -; This is a GNSS-SDR configuration file -; The configuration API is described at https://gnss-sdr.org/docs/sp-blocks/ - -; You can define your own receiver and invoke it by doing -; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf -; - -[GNSS-SDR] - -;######### GLOBAL OPTIONS ################## -;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second]. -GNSS-SDR.internal_fs_sps=99375000 - -;######### CONTROL_THREAD CONFIG ############ -ControlThread.wait_for_flowgraph=false - -;######### SIGNAL_SOURCE CONFIG ############ -SignalSource.implementation=File_Signal_Source -SignalSource.filename=/media/dmiralles/Seagate Backup Plus Drive/GNSS Data/Beidou_B1_IF_signal.bin -SignalSource.item_type=byte -SignalSource.sampling_frequency=99375000 -SignalSource.samples=0 -SignalSource.repeat=false -SignalSource.dump=false -SignalSource.enable_throttle_control=false - -;######### SIGNAL_CONDITIONER CONFIG ############ -SignalConditioner.implementation=Signal_Conditioner -DataTypeAdapter.implementation=Byte_To_Short -InputFilter.implementation=Freq_Xlating_Fir_Filter -InputFilter.input_item_type=short -InputFilter.output_item_type=gr_complex -InputFilter.taps_item_type=float -InputFilter.number_of_taps=5 -InputFilter.number_of_bands=2 -InputFilter.band1_begin=0.0 -InputFilter.band1_end=0.70 -InputFilter.band2_begin=0.80 -InputFilter.band2_end=1.0 -InputFilter.ampl1_begin=1.0 -InputFilter.ampl1_end=1.0 -InputFilter.ampl2_begin=0.0 -InputFilter.ampl2_end=0.0 -InputFilter.band1_error=1.0 -InputFilter.band2_error=1.0 -InputFilter.filter_type=bandpass -InputFilter.grid_density=16 -InputFilter.sampling_frequency=99375000 -InputFilter.IF=14580000 -Resampler.implementation=Direct_Resampler -Resampler.sample_freq_in=99375000 -Resampler.sample_freq_out=99375000 -Resampler.item_type=gr_complex - - -;######### CHANNELS GLOBAL CONFIG ############ -Channels_1C.count=8 -Channels.in_acquisition=1 -Channel.signal=1C - - -;######### ACQUISITION GLOBAL CONFIG ############ -Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -Acquisition_1C.item_type=gr_complex -Acquisition_1C.coherent_integration_time_ms=1 -Acquisition_1C.threshold=3.5 -;Acquisition_1C.pfa=0.000001; -Acquisition_1C.doppler_max=14000 -Acquisition_1C.doppler_step=100 -Acquisition_1C.dump=true -Acquisition_1C.dump_filename=./gps_acq -Acquisition_1C.blocking=false; -Acquisition_1C.use_CFAR_algorithm=false - - -;######### TRACKING GLOBAL CONFIG ############ -Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -Tracking_1C.item_type=gr_complex -Tracking_1C.pll_bw_hz=30.0; -Tracking_1C.dll_bw_hz=3.0; -Tracking_1C.dump=true; -Tracking_1C.dump_filename=./epl_tracking_ch_ - - -;######### TELEMETRY DECODER GPS CONFIG ############ -TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder -TelemetryDecoder_1C.dump=false - - -;######### OBSERVABLES CONFIG ############ -Observables.implementation=Hybrid_Observables -Observables.dump=true -Observables.dump_filename=./observables.dat - - -;######### PVT CONFIG ############ -PVT.implementation=RTKLIB_PVT -PVT.positioning_mode=Single ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic -PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX -PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -PVT.output_rate_ms=100 -PVT.display_rate_ms=500 -PVT.dump_filename=./PVT -PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -PVT.flag_nmea_tty_port=false; -PVT.nmea_dump_devname=/dev/pts/4 -PVT.flag_rtcm_server=false -PVT.flag_rtcm_tty_port=false -PVT.rtcm_dump_devname=/dev/pts/1 -PVT.dump=false diff --git a/conf/gnss-sdr_GPS_L1_ishort.conf b/conf/gnss-sdr_GPS_L1_ishort.conf index d160f728a..373049a25 100644 --- a/conf/gnss-sdr_GPS_L1_ishort.conf +++ b/conf/gnss-sdr_GPS_L1_ishort.conf @@ -16,7 +16,7 @@ ControlThread.wait_for_flowgraph=false ;######### SIGNAL_SOURCE CONFIG ############ SignalSource.implementation=File_Signal_Source -SignalSource.filename=/home/sergi/gnss/gnss-sdr/data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ; <- PUT YOUR FILE HERE +SignalSource.filename=/archive/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ; <- PUT YOUR FILE HERE SignalSource.item_type=ishort SignalSource.sampling_frequency=4000000 SignalSource.samples=0 @@ -29,14 +29,13 @@ SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ SignalConditioner.implementation=Signal_Conditioner -DataTypeAdapter.implementation=Ishort_To_Complex +DataTypeAdapter.implementation=Ishort_To_Cshort InputFilter.implementation=Pass_Through -InputFilter.item_type=gr_complex +InputFilter.item_type=cshort Resampler.implementation=Direct_Resampler Resampler.sample_freq_in=4000000 Resampler.sample_freq_out=2000000 -Resampler.item_type=gr_complex - +Resampler.item_type=cshort ;######### CHANNELS GLOBAL CONFIG ############ Channels_1C.count=8 @@ -46,19 +45,19 @@ Channel.signal=1C ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -Acquisition_1C.item_type=gr_complex +Acquisition_1C.item_type=cshort Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.008 ;Acquisition_1C.pfa=0.000001 Acquisition_1C.doppler_max=10000 Acquisition_1C.doppler_step=250 -Acquisition_1C.dump=true +Acquisition_1C.dump=false Acquisition_1C.dump_filename=./acq_dump.dat Acquisition_1C.blocking=false; ;######### TRACKING GLOBAL CONFIG ############ -Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -Tracking_1C.item_type=gr_complex +Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking +Tracking_1C.item_type=cshort Tracking_1C.pll_bw_hz=40.0; Tracking_1C.dll_bw_hz=4.0; Tracking_1C.order=3; diff --git a/conf/prova.conf b/conf/prova.conf deleted file mode 100644 index a481302cf..000000000 --- a/conf/prova.conf +++ /dev/null @@ -1,56 +0,0 @@ -[GNSS-SDR] - - -;######### GLOBAL OPTIONS ################## -GNSS-SDR.internal_fs_hz=2000000 - -;######### SIGNAL_SOURCE CONFIG ############ -SignalSource.implementation=File_Signal_Source -SignalSource.filename=/home/sergi/gnss/gnss-sdr/data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat -SignalSource.item_type=ishort -SignalSource.sampling_frequency=4000000 -SignalSource.freq=1575420000 -SignalSource.samples=0 - -;######### SIGNAL_CONDITIONER CONFIG ############ -SignalConditioner.implementation=Signal_Conditioner -DataTypeAdapter.implementation=Ishort_To_Complex -InputFilter.implementation=Pass_Through -InputFilter.item_type=gr_complex -Resampler.implementation=Direct_Resampler -Resampler.sample_freq_in=4000000 -Resampler.sample_freq_out=2000000 -Resampler.item_type=gr_complex - -;######### CHANNELS GLOBAL CONFIG ############ -Channels_1C.count=8 -Channels.in_acquisition=1 -Channel.signal=1C - -;######### ACQUISITION GLOBAL CONFIG ############ -Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -Acquisition_1C.item_type=gr_complex -Acquisition_1C.threshold=0.008 -Acquisition_1C.doppler_max=10000 -Acquisition_1C.doppler_step=250 - -;######### TRACKING GLOBAL CONFIG ############ -Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -Tracking_1C.item_type=gr_complex -Tracking_1C.pll_bw_hz=40.0; -Tracking_1C.dll_bw_hz=4.0; - -;######### TELEMETRY DECODER GPS CONFIG ############ -TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder - -;######### OBSERVABLES CONFIG ############ -Observables.implementation=GPS_L1_CA_Observables - -;######### PVT CONFIG ############ -PVT.implementation=GPS_L1_CA_PVT -PVT.averaging_depth=100 -PVT.flag_averaging=true -PVT.output_rate_ms=10 -PVT.display_rate_ms=500 - - diff --git a/docs/changelog b/docs/changelog index f9effa7d2..692a939ef 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,3 +1,14 @@ +## [Unreleased](https://github.com/gnss-sdr/gnss-sdr/tree/next) + +### Improvements in Interoperability: + +- Added the BeiDou B1I receiver chain. + +### Improvements in Portability: + +- CMake scripts now follow a modern approach (targets and properties) but still work in 2.8.12 + + ## [0.0.10](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.10) This release has several improvements in different dimensions, addition of new features and bug fixes: diff --git a/docs/doxygen/images/GeneralBlockDiagram.png b/docs/doxygen/images/GeneralBlockDiagram.png index fb5b95d76..b208624ef 100644 Binary files a/docs/doxygen/images/GeneralBlockDiagram.png and b/docs/doxygen/images/GeneralBlockDiagram.png differ diff --git a/src/algorithms/PVT/adapters/CMakeLists.txt b/src/algorithms/PVT/adapters/CMakeLists.txt index d8c055506..2bf0e3e95 100644 --- a/src/algorithms/PVT/adapters/CMakeLists.txt +++ b/src/algorithms/PVT/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -17,10 +17,6 @@ # -if(Boost_VERSION LESS 105800) - add_definitions(-DOLD_BOOST=1) -endif() - set(PVT_ADAPTER_SOURCES rtklib_pvt.cc ) @@ -29,28 +25,27 @@ set(PVT_ADAPTER_HEADERS rtklib_pvt.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) +source_group(Headers FILES ${PVT_ADAPTER_HEADERS}) add_library(pvt_adapters ${PVT_ADAPTER_SOURCES} ${PVT_ADAPTER_HEADERS}) -source_group(Headers FILES ${PVT_ADAPTER_HEADERS}) - target_link_libraries(pvt_adapters - pvt_gr_blocks - ${ARMADILLO_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} + PUBLIC + pvt_gr_blocks + Armadillo::armadillo + Gnuradio::runtime + gnss_system_parameters + gnss_rx + pvt_lib + PRIVATE + Boost::serialization +) + +if(Boost_VERSION LESS 105800) + target_compile_definitions(pvt_adapters PRIVATE -DOLD_BOOST=1) +endif() + +set_property(TARGET pvt_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index ff952252e..516546876 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -52,7 +52,7 @@ using google::LogMessage; RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, - unsigned int out_streams) : role_(std::move(role)), + unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { @@ -534,6 +534,11 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, pvt_output_parameters.nmea_output_file_path = configuration->property(role + ".nmea_output_file_path", default_output_path); pvt_output_parameters.rtcm_output_file_path = configuration->property(role + ".rtcm_output_file_path", default_output_path); + // Read PVT MONITOR Configuration + pvt_output_parameters.monitor_enabled = configuration->property(role + ".enable_monitor", false); + pvt_output_parameters.udp_addresses = configuration->property(role + ".monitor_client_addresses", std::string("127.0.0.1")); + pvt_output_parameters.udp_port = configuration->property(role + ".monitor_udp_port", 1234); + // make PVT object pvt_ = rtklib_make_pvt_cc(in_streams_, pvt_output_parameters, rtk); DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")"; diff --git a/src/algorithms/PVT/adapters/rtklib_pvt3.cc b/src/algorithms/PVT/adapters/rtklib_pvt3.cc deleted file mode 100644 index 24f4c9150..000000000 --- a/src/algorithms/PVT/adapters/rtklib_pvt3.cc +++ /dev/null @@ -1,561 +0,0 @@ -/*! - * \file rtklib_pvt.cc - * \brief Interface of a Position Velocity and Time computation block - * \author Javier Arribas, 2017. jarribas(at)cttc.es - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * GNSS-SDR is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNSS-SDR is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . - * - * ------------------------------------------------------------------------- - */ - - -#include "rtklib_pvt.h" -#include "configuration_interface.h" -#include "gnss_sdr_flags.h" -#include -#include -#include -#include -#include - - -using google::LogMessage; - -RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams) : role_(role), - in_streams_(in_streams), - out_streams_(out_streams) -{ - // dump parameters - std::string default_dump_filename = "./pvt.dat"; - std::string default_nmea_dump_filename = "./nmea_pvt.nmea"; - std::string default_nmea_dump_devname = "/dev/tty1"; - std::string default_rtcm_dump_devname = "/dev/pts/1"; - DLOG(INFO) << "role " << role; - dump_ = configuration->property(role + ".dump", false); - dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); - - // output rate - int output_rate_ms = configuration->property(role + ".output_rate_ms", 500); - - // display rate - int display_rate_ms = configuration->property(role + ".display_rate_ms", 500); - - // NMEA Printer settings - bool flag_nmea_tty_port = configuration->property(role + ".flag_nmea_tty_port", false); - std::string nmea_dump_filename = configuration->property(role + ".nmea_dump_filename", default_nmea_dump_filename); - std::string nmea_dump_devname = configuration->property(role + ".nmea_dump_devname", default_nmea_dump_devname); - - // RINEX version - int rinex_version = configuration->property(role + ".rinex_version", 3); - if (FLAGS_RINEX_version.compare("3.01") == 0) - { - rinex_version = 3; - } - else if (FLAGS_RINEX_version.compare("3.02") == 0) - { - rinex_version = 3; - } - else if (FLAGS_RINEX_version.compare("3") == 0) - { - rinex_version = 3; - } - else if (FLAGS_RINEX_version.compare("2.11") == 0) - { - rinex_version = 2; - } - else if (FLAGS_RINEX_version.compare("2.10") == 0) - { - rinex_version = 2; - } - else if (FLAGS_RINEX_version.compare("2") == 0) - { - rinex_version = 2; - } - int rinexobs_rate_ms = boost::math::lcm(configuration->property(role + ".rinexobs_rate_ms", 1000), output_rate_ms); - int rinexnav_rate_ms = boost::math::lcm(configuration->property(role + ".rinexnav_rate_ms", 6000), output_rate_ms); - - // RTCM Printer settings - bool flag_rtcm_tty_port = configuration->property(role + ".flag_rtcm_tty_port", false); - std::string rtcm_dump_devname = configuration->property(role + ".rtcm_dump_devname", default_rtcm_dump_devname); - bool flag_rtcm_server = configuration->property(role + ".flag_rtcm_server", false); - unsigned short rtcm_tcp_port = configuration->property(role + ".rtcm_tcp_port", 2101); - unsigned short rtcm_station_id = configuration->property(role + ".rtcm_station_id", 1234); - // RTCM message rates: least common multiple with output_rate_ms - int rtcm_MT1019_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MT1019_rate_ms", 5000), output_rate_ms); - int rtcm_MT1020_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MT1020_rate_ms", 5000), output_rate_ms); - int rtcm_MT1045_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MT1045_rate_ms", 5000), output_rate_ms); - int rtcm_MSM_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MSM_rate_ms", 1000), output_rate_ms); - int rtcm_MT1077_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MT1077_rate_ms", rtcm_MSM_rate_ms), output_rate_ms); - int rtcm_MT1087_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MT1087_rate_ms", rtcm_MSM_rate_ms), output_rate_ms); - int rtcm_MT1097_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MT1097_rate_ms", rtcm_MSM_rate_ms), output_rate_ms); - std::map rtcm_msg_rate_ms; - rtcm_msg_rate_ms[1019] = rtcm_MT1019_rate_ms; - rtcm_msg_rate_ms[1020] = rtcm_MT1020_rate_ms; - rtcm_msg_rate_ms[1045] = rtcm_MT1045_rate_ms; - for (int k = 1071; k < 1078; k++) // All GPS MSM - { - rtcm_msg_rate_ms[k] = rtcm_MT1077_rate_ms; - } - for (int k = 1081; k < 1088; k++) // All GLONASS MSM - { - rtcm_msg_rate_ms[k] = rtcm_MT1087_rate_ms; - } - for (int k = 1091; k < 1098; k++) // All Galileo MSM - { - rtcm_msg_rate_ms[k] = rtcm_MT1097_rate_ms; - } - // getting names from the config file, if available - // default filename for assistance data - const std::string eph_default_xml_filename = "./gps_ephemeris.xml"; - const std::string utc_default_xml_filename = "./gps_utc_model.xml"; - const std::string iono_default_xml_filename = "./gps_iono.xml"; - const std::string ref_time_default_xml_filename = "./gps_ref_time.xml"; - const std::string ref_location_default_xml_filename = "./gps_ref_location.xml"; - eph_xml_filename_ = configuration->property("GNSS-SDR.SUPL_gps_ephemeris_xml", eph_default_xml_filename); - //std::string utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_utc_model.xml", utc_default_xml_filename); - //std::string iono_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_iono_xml", iono_default_xml_filename); - //std::string ref_time_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ref_time_xml", ref_time_default_xml_filename); - //std::string ref_location_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ref_location_xml", ref_location_default_xml_filename); - - // Infer the type of receiver - /* - * TYPE | RECEIVER - * 0 | Unknown - * 1 | GPS L1 C/A - * 2 | GPS L2C - * 3 | GPS L5 - * 4 | Galileo E1B - * 5 | Galileo E5a - * 6 | Galileo E5b - * 7 | GPS L1 C/A + GPS L2C - * 8 | GPS L1 C/A + GPS L5 - * 9 | GPS L1 C/A + Galileo E1B - * 10 | GPS L1 C/A + Galileo E5a - * 11 | GPS L1 C/A + Galileo E5b - * 12 | Galileo E1B + GPS L2C - * 13 | Galileo E1B + GPS L5 - * 14 | Galileo E1B + Galileo E5a - * 15 | Galileo E1B + Galileo E5b - * 16 | GPS L2C + GPS L5 - * 17 | GPS L2C + Galileo E5a - * 18 | GPS L2C + Galileo E5b - * 19 | GPS L5 + Galileo E5a - * 20 | GPS L5 + Galileo E5b - * 21 | GPS L1 C/A + Galileo E1B + GPS L2C - * 22 | GPS L1 C/A + Galileo E1B + GPS L5 - * 23 | GLONASS L1 C/A - * 24 | GLONASS L2 C/A - * 25 | GLONASS L1 C/A + GLONASS L2 C/A - * 26 | GPS L1 C/A + GLONASS L1 C/A - * 27 | Galileo E1B + GLONASS L1 C/A - * 28 | GPS L2C + GLONASS L1 C/A - */ - int gps_1C_count = configuration->property("Channels_1C.count", 0); - int gps_2S_count = configuration->property("Channels_2S.count", 0); - int gps_L5_count = configuration->property("Channels_L5.count", 0); - int gal_1B_count = configuration->property("Channels_1B.count", 0); - int gal_E5a_count = configuration->property("Channels_5X.count", 0); - int gal_E5b_count = configuration->property("Channels_7X.count", 0); - int glo_1G_count = configuration->property("Channels_1G.count", 0); - int glo_2G_count = configuration->property("Channels_2G.count", 0); - - unsigned int type_of_receiver = 0; - - // *******************WARNING!!!!!!!*********** - // GPS L5 only configurable for single frequency, single system at the moment!!!!!! - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 1; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 2; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 3; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 4; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 5; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 6; - - if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 7; - //if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 8; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 9; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 10; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 11; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 12; - //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 13; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 14; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 15; - //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 16; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 17; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 18; - //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 19; - //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 20; - if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 21; - //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count = 0)) type_of_receiver = 22; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 23; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) type_of_receiver = 24; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0)) type_of_receiver = 25; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) type_of_receiver = 26; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) type_of_receiver = 27; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) type_of_receiver = 28; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) type_of_receiver = 29; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) type_of_receiver = 30; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) type_of_receiver = 31; - //RTKLIB PVT solver options - // Settings 1 - int positioning_mode = -1; - std::string default_pos_mode("Single"); - std::string positioning_mode_str = configuration->property(role + ".positioning_mode", default_pos_mode); /* (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h */ - if (positioning_mode_str.compare("Single") == 0) positioning_mode = PMODE_SINGLE; - if (positioning_mode_str.compare("Static") == 0) positioning_mode = PMODE_STATIC; - if (positioning_mode_str.compare("Kinematic") == 0) positioning_mode = PMODE_KINEMA; - if (positioning_mode_str.compare("PPP_Static") == 0) positioning_mode = PMODE_PPP_STATIC; - if (positioning_mode_str.compare("PPP_Kinematic") == 0) positioning_mode = PMODE_PPP_KINEMA; - - if (positioning_mode == -1) - { - //warn user and set the default - std::cout << "WARNING: Bad specification of positioning mode." << std::endl; - std::cout << "positioning_mode possible values: Single / Static / Kinematic / PPP_Static / PPP_Kinematic" << std::endl; - std::cout << "positioning_mode specified value: " << positioning_mode_str << std::endl; - std::cout << "Setting positioning_mode to Single" << std::endl; - positioning_mode = PMODE_SINGLE; - } - - int num_bands = 0; - - if ((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) num_bands = 1; - if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0))) num_bands = 2; - if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 2; - if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 3; - - int number_of_frequencies = configuration->property(role + ".num_bands", num_bands); /* (1:L1, 2:L1+L2, 3:L1+L2+L5) */ - if ((number_of_frequencies < 1) || (number_of_frequencies > 3)) - { - //warn user and set the default - number_of_frequencies = num_bands; - } - - double elevation_mask = configuration->property(role + ".elevation_mask", 15.0); - if ((elevation_mask < 0.0) || (elevation_mask > 90.0)) - { - //warn user and set the default - LOG(WARNING) << "Erroneous Elevation Mask. Setting to default value of 15.0 degrees"; - elevation_mask = 15.0; - } - - int dynamics_model = configuration->property(role + ".dynamics_model", 0); /* dynamics model (0:none, 1:velocity, 2:accel) */ - if ((dynamics_model < 0) || (dynamics_model > 2)) - { - //warn user and set the default - LOG(WARNING) << "Erroneous Dynamics Model configuration. Setting to default value of (0:none)"; - dynamics_model = 0; - } - - std::string default_iono_model("OFF"); - std::string iono_model_str = configuration->property(role + ".iono_model", default_iono_model); /* (IONOOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */ - int iono_model = -1; - if (iono_model_str.compare("OFF") == 0) iono_model = IONOOPT_OFF; - if (iono_model_str.compare("Broadcast") == 0) iono_model = IONOOPT_BRDC; - if (iono_model_str.compare("SBAS") == 0) iono_model = IONOOPT_SBAS; - if (iono_model_str.compare("Iono-Free-LC") == 0) iono_model = IONOOPT_IFLC; - if (iono_model_str.compare("Estimate_STEC") == 0) iono_model = IONOOPT_EST; - if (iono_model_str.compare("IONEX") == 0) iono_model = IONOOPT_TEC; - if (iono_model == -1) - { - //warn user and set the default - std::cout << "WARNING: Bad specification of ionospheric model." << std::endl; - std::cout << "iono_model possible values: OFF / Broadcast / SBAS / Iono-Free-LC / Estimate_STEC / IONEX" << std::endl; - std::cout << "iono_model specified value: " << iono_model_str << std::endl; - std::cout << "Setting iono_model to OFF" << std::endl; - iono_model = IONOOPT_OFF; /* 0: ionosphere option: correction off */ - } - - std::string default_trop_model("OFF"); - int trop_model = -1; - std::string trop_model_str = configuration->property(role + ".trop_model", default_trop_model); /* (TROPOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */ - if (trop_model_str.compare("OFF") == 0) trop_model = TROPOPT_OFF; - if (trop_model_str.compare("Saastamoinen") == 0) trop_model = TROPOPT_SAAS; - if (trop_model_str.compare("SBAS") == 0) trop_model = TROPOPT_SBAS; - if (trop_model_str.compare("Estimate_ZTD") == 0) trop_model = TROPOPT_EST; - if (trop_model_str.compare("Estimate_ZTD_Grad") == 0) trop_model = TROPOPT_ESTG; - if (trop_model == -1) - { - //warn user and set the default - std::cout << "WARNING: Bad specification of tropospheric model." << std::endl; - std::cout << "trop_model possible values: OFF / Saastamoinen / SBAS / Estimate_ZTD / Estimate_ZTD_Grad" << std::endl; - std::cout << "trop_model specified value: " << trop_model_str << std::endl; - std::cout << "Setting trop_model to OFF" << std::endl; - trop_model = TROPOPT_OFF; - } - - /* RTKLIB positioning options */ - int sat_PCV = 0; /* Set whether the satellite antenna PCV (phase center variation) model is used or not. This feature requires a Satellite Antenna PCV File. */ - int rec_PCV = 0; /* Set whether the receiver antenna PCV (phase center variation) model is used or not. This feature requires a Receiver Antenna PCV File. */ - - /* Set whether the phase windup correction for PPP modes is applied or not. Only applicable to PPP‐* modes.*/ - int phwindup = configuration->property(role + ".phwindup", 0); - - /* Set whether the GPS Block IIA satellites in eclipse are excluded or not. - The eclipsing Block IIA satellites often degrade the PPP solutions due to unpredicted behavior of yaw‐attitude. Only applicable to PPP‐* modes.*/ - int reject_GPS_IIA = configuration->property(role + ".reject_GPS_IIA", 0); - - /* Set whether RAIM (receiver autonomous integrity monitoring) FDE (fault detection and exclusion) feature is enabled or not. - In case of RAIM FDE enabled, a satellite is excluded if SSE (sum of squared errors) of residuals is over a threshold. - The excluded satellite is selected to indicate the minimum SSE. */ - int raim_fde = configuration->property(role + ".raim_fde", 0); - - int earth_tide = configuration->property(role + ".earth_tide", 0); - - int nsys = 0; - if ((gps_1C_count > 0) || (gps_2S_count > 0) || (gps_L5_count > 0)) nsys += SYS_GPS; - if ((gal_1B_count > 0) || (gal_E5a_count > 0) || (gal_E5b_count > 0)) nsys += SYS_GAL; - if ((glo_1G_count > 0) || (glo_2G_count > 0)) nsys += SYS_GLO; - int navigation_system = configuration->property(role + ".navigation_system", nsys); /* (SYS_XXX) see src/algorithms/libs/rtklib/rtklib.h */ - if ((navigation_system < 1) || (navigation_system > 255)) /* GPS: 1 SBAS: 2 GPS+SBAS: 3 Galileo: 8 Galileo+GPS: 9 GPS+SBAS+Galileo: 11 All: 255 */ - { - //warn user and set the default - LOG(WARNING) << "Erroneous Navigation System. Setting to default value of (0:none)"; - navigation_system = nsys; - } - - // Settings 2 - std::string default_gps_ar("Continuous"); - std::string integer_ambiguity_resolution_gps_str = configuration->property(role + ".AR_GPS", default_gps_ar); /* Integer Ambiguity Resolution mode for GPS (0:off,1:continuous,2:instantaneous,3:fix and hold,4:ppp-ar) */ - int integer_ambiguity_resolution_gps = -1; - if (integer_ambiguity_resolution_gps_str.compare("OFF") == 0) integer_ambiguity_resolution_gps = ARMODE_OFF; - if (integer_ambiguity_resolution_gps_str.compare("Continuous") == 0) integer_ambiguity_resolution_gps = ARMODE_CONT; - if (integer_ambiguity_resolution_gps_str.compare("Instantaneous") == 0) integer_ambiguity_resolution_gps = ARMODE_INST; - if (integer_ambiguity_resolution_gps_str.compare("Fix-and-Hold") == 0) integer_ambiguity_resolution_gps = ARMODE_FIXHOLD; - if (integer_ambiguity_resolution_gps_str.compare("PPP-AR") == 0) integer_ambiguity_resolution_gps = ARMODE_PPPAR; - if (integer_ambiguity_resolution_gps == -1) - { - //warn user and set the default - std::cout << "WARNING: Bad specification of GPS ambiguity resolution method." << std::endl; - std::cout << "AR_GPS possible values: OFF / Continuous / Instantaneous / Fix-and-Hold / PPP-AR" << std::endl; - std::cout << "AR_GPS specified value: " << integer_ambiguity_resolution_gps_str << std::endl; - std::cout << "Setting AR_GPS to OFF" << std::endl; - integer_ambiguity_resolution_gps = ARMODE_OFF; - } - - int integer_ambiguity_resolution_glo = configuration->property(role + ".AR_GLO", 1); /* Integer Ambiguity Resolution mode for GLONASS (0:off,1:on,2:auto cal,3:ext cal) */ - if ((integer_ambiguity_resolution_glo < 0) || (integer_ambiguity_resolution_glo > 3)) - { - //warn user and set the default - LOG(WARNING) << "Erroneous Integer Ambiguity Resolution for GLONASS . Setting to default value of (1:on)"; - integer_ambiguity_resolution_glo = 1; - } - - int integer_ambiguity_resolution_bds = configuration->property(role + ".AR_DBS", 1); /* Integer Ambiguity Resolution mode for BEIDOU (0:off,1:on) */ - if ((integer_ambiguity_resolution_bds < 0) || (integer_ambiguity_resolution_bds > 1)) - { - //warn user and set the default - LOG(WARNING) << "Erroneous Integer Ambiguity Resolution for BEIDOU . Setting to default value of (1:on)"; - integer_ambiguity_resolution_bds = 1; - } - - double min_ratio_to_fix_ambiguity = configuration->property(role + ".min_ratio_to_fix_ambiguity", 3.0); /* Set the integer ambiguity validation threshold for ratio‐test, - which uses the ratio of squared residuals of the best integer vector to the second‐best vector. */ - - int min_lock_to_fix_ambiguity = configuration->property(role + ".min_lock_to_fix_ambiguity", 0); /* Set the minimum lock count to fix integer ambiguity. - If the lock count is less than the value, the ambiguity is excluded from the fixed integer vector. */ - - double min_elevation_to_fix_ambiguity = configuration->property(role + ".min_elevation_to_fix_ambiguity", 0.0); /* Set the minimum elevation (deg) to fix integer ambiguity. - If the elevation of the satellite is less than the value, the ambiguity is excluded from the fixed integer vector. */ - - int outage_reset_ambiguity = configuration->property(role + ".outage_reset_ambiguity", 5); /* Set the outage count to reset ambiguity. If the data outage count is over the value, the estimated ambiguity is reset to the initial value. */ - - double slip_threshold = configuration->property(role + ".slip_threshold", 0.05); /* set the cycle‐slip threshold (m) of geometry‐free LC carrier‐phase difference between epochs */ - - double threshold_reject_gdop = configuration->property(role + ".threshold_reject_gdop", 30.0); /* reject threshold of GDOP. If the GDOP is over the value, the observable is excluded for the estimation process as an outlier. */ - - double threshold_reject_innovation = configuration->property(role + ".threshold_reject_innovation", 30.0); /* reject threshold of innovation (m). If the innovation is over the value, the observable is excluded for the estimation process as an outlier. */ - - int number_filter_iter = configuration->property(role + ".number_filter_iter", 1); /* Set the number of iteration in the measurement update of the estimation filter. - If the baseline length is very short like 1 m, the iteration may be effective to handle - the nonlinearity of measurement equation. */ - - /// Statistics - double bias_0 = configuration->property(role + ".bias_0", 30.0); - - double iono_0 = configuration->property(role + ".iono_0", 0.03); - - double trop_0 = configuration->property(role + ".trop_0", 0.3); - - double sigma_bias = configuration->property(role + ".sigma_bias", 1e-4); /* Set the process noise standard deviation of carrier‐phase - bias (ambiguity) (cycle/sqrt(s)) */ - - double sigma_iono = configuration->property(role + ".sigma_iono", 1e-3); /* Set the process noise standard deviation of vertical ionospheric delay per 10 km baseline (m/sqrt(s)). */ - - double sigma_trop = configuration->property(role + ".sigma_trop", 1e-4); /* Set the process noise standard deviation of zenith tropospheric delay (m/sqrt(s)). */ - - double sigma_acch = configuration->property(role + ".sigma_acch", 1e-1); /* Set the process noise standard deviation of the receiver acceleration as - the horizontal component. (m/s2/sqrt(s)). If Receiver Dynamics is set to OFF, they are not used. */ - - double sigma_accv = configuration->property(role + ".sigma_accv", 1e-2); /* Set the process noise standard deviation of the receiver acceleration as - the vertical component. (m/s2/sqrt(s)). If Receiver Dynamics is set to OFF, they are not used. */ - - double sigma_pos = configuration->property(role + ".sigma_pos", 0.0); - - double code_phase_error_ratio_l1 = configuration->property(role + ".code_phase_error_ratio_l1", 100.0); - double code_phase_error_ratio_l2 = configuration->property(role + ".code_phase_error_ratio_l2", 100.0); - double code_phase_error_ratio_l5 = configuration->property(role + ".code_phase_error_ratio_l5", 100.0); - double carrier_phase_error_factor_a = configuration->property(role + ".carrier_phase_error_factor_a", 0.003); - double carrier_phase_error_factor_b = configuration->property(role + ".carrier_phase_error_factor_b", 0.003); - - snrmask_t snrmask = {{}, {{}, {}}}; - - prcopt_t rtklib_configuration_options = { - positioning_mode, /* positioning mode (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h */ - 0, /* solution type (0:forward,1:backward,2:combined) */ - number_of_frequencies, /* number of frequencies (1:L1, 2:L1+L2, 3:L1+L2+L5)*/ - navigation_system, /* navigation system */ - elevation_mask * D2R, /* elevation mask angle (degrees) */ - snrmask, /* snrmask_t snrmask SNR mask */ - 0, /* satellite ephemeris/clock (EPHOPT_XXX) */ - integer_ambiguity_resolution_gps, /* AR mode (0:off,1:continuous,2:instantaneous,3:fix and hold,4:ppp-ar) */ - integer_ambiguity_resolution_glo, /* GLONASS AR mode (0:off,1:on,2:auto cal,3:ext cal) */ - integer_ambiguity_resolution_bds, /* BeiDou AR mode (0:off,1:on) */ - outage_reset_ambiguity, /* obs outage count to reset bias */ - min_lock_to_fix_ambiguity, /* min lock count to fix ambiguity */ - 10, /* min fix count to hold ambiguity */ - 1, /* max iteration to resolve ambiguity */ - iono_model, /* ionosphere option (IONOOPT_XXX) */ - trop_model, /* troposphere option (TROPOPT_XXX) */ - dynamics_model, /* dynamics model (0:none, 1:velocity, 2:accel) */ - earth_tide, /* earth tide correction (0:off,1:solid,2:solid+otl+pole) */ - number_filter_iter, /* number of filter iteration */ - 0, /* code smoothing window size (0:none) */ - 0, /* interpolate reference obs (for post mission) */ - 0, /* sbssat_t sbssat SBAS correction options */ - 0, /* sbsion_t sbsion[MAXBAND+1] SBAS satellite selection (0:all) */ - 0, /* rover position for fixed mode */ - 0, /* base position for relative mode */ - /* 0:pos in prcopt, 1:average of single pos, */ - /* 2:read from file, 3:rinex header, 4:rtcm pos */ - {code_phase_error_ratio_l1, code_phase_error_ratio_l2, code_phase_error_ratio_l5}, /* eratio[NFREQ] code/phase error ratio */ - {100.0, carrier_phase_error_factor_a, carrier_phase_error_factor_b, 0.0, 1.0}, /* err[5]: measurement error factor [0]:reserved, [1-3]:error factor a/b/c of phase (m) , [4]:doppler frequency (hz) */ - {bias_0, iono_0, trop_0}, /* std[3]: initial-state std [0]bias,[1]iono [2]trop*/ - {sigma_bias, sigma_iono, sigma_trop, sigma_acch, sigma_accv, sigma_pos}, /* prn[6] process-noise std */ - 5e-12, /* sclkstab: satellite clock stability (sec/sec) */ - {min_ratio_to_fix_ambiguity, 0.9999, 0.25, 0.1, 0.05, 0.0, 0.0, 0.0}, /* thresar[8]: AR validation threshold */ - min_elevation_to_fix_ambiguity, /* elevation mask of AR for rising satellite (deg) */ - 0.0, /* elevation mask to hold ambiguity (deg) */ - slip_threshold, /* slip threshold of geometry-free phase (m) */ - 30.0, /* max difference of time (sec) */ - threshold_reject_innovation, /* reject threshold of innovation (m) */ - threshold_reject_gdop, /* reject threshold of gdop */ - {}, /* double baseline[2] baseline length constraint {const,sigma} (m) */ - {}, /* double ru[3] rover position for fixed mode {x,y,z} (ecef) (m) */ - {}, /* double rb[3] base position for relative mode {x,y,z} (ecef) (m) */ - {"", ""}, /* char anttype[2][MAXANT] antenna types {rover,base} */ - {{}, {}}, /* double antdel[2][3] antenna delta {{rov_e,rov_n,rov_u},{ref_e,ref_n,ref_u}} */ - {}, /* pcv_t pcvr[2] receiver antenna parameters {rov,base} */ - {}, /* unsigned char exsats[MAXSAT] excluded satellites (1:excluded, 2:included) */ - 0, /* max averaging epoches */ - 0, /* initialize by restart */ - 1, /* output single by dgps/float/fix/ppp outage */ - {"", ""}, /* char rnxopt[2][256] rinex options {rover,base} */ - {sat_PCV, rec_PCV, phwindup, reject_GPS_IIA, raim_fde}, /* posopt[6] positioning options [0]: satellite and receiver antenna PCV model; [1]: interpolate antenna parameters; [2]: apply phase wind-up correction for PPP modes; [3]: exclude measurements of GPS Block IIA satellites satellite [4]: RAIM FDE (fault detection and exclusion) [5]: handle day-boundary clock jump */ - 0, /* solution sync mode (0:off,1:on) */ - {{}, {}}, /* odisp[2][6*11] ocean tide loading parameters {rov,base} */ - {{}, {{}, {}}, {{}, {}}, {}, {}}, /* exterr_t exterr extended receiver error model */ - 0, /* disable L2-AR */ - {} /* char pppopt[256] ppp option "-GAP_RESION=" default gap to reset iono parameters (ep) */ - }; - - rtkinit(&rtk, &rtklib_configuration_options); - - // make PVT object - pvt_ = rtklib_make_pvt_cc(in_streams_, dump_, dump_filename_, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname, rinex_version, rinexobs_rate_ms, rinexnav_rate_ms, flag_rtcm_server, flag_rtcm_tty_port, rtcm_tcp_port, rtcm_station_id, rtcm_msg_rate_ms, rtcm_dump_devname, type_of_receiver, rtk); - DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")"; - if (out_streams_ > 0) - { - LOG(ERROR) << "The PVT block does not have an output stream"; - } -} - - -bool RtklibPvt::save_assistance_to_XML() -{ - LOG(INFO) << "SUPL: Try to save GPS ephemeris to XML file " << eph_xml_filename_; - std::map eph_map = pvt_->get_GPS_L1_ephemeris_map(); - - if (eph_map.size() > 0) - { - try - { - std::ofstream ofs(eph_xml_filename_.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", eph_map); - ofs.close(); - LOG(INFO) << "Saved GPS L1 Ephemeris map data"; - } - catch (const std::exception& e) - { - LOG(WARNING) << e.what(); - return false; - } - return true; // return variable (true == succeeded) - } - else - { - LOG(WARNING) << "Failed to save Ephemeris, map is empty"; - return false; - } -} - - -RtklibPvt::~RtklibPvt() -{ - rtkfree(&rtk); - save_assistance_to_XML(); -} - - -void RtklibPvt::connect(gr::top_block_sptr top_block) -{ - if (top_block) - { /* top_block is not null */ - }; - // Nothing to connect internally - DLOG(INFO) << "nothing to connect internally"; -} - - -void RtklibPvt::disconnect(gr::top_block_sptr top_block) -{ - if (top_block) - { /* top_block is not null */ - }; - // Nothing to disconnect -} - - -gr::basic_block_sptr RtklibPvt::get_left_block() -{ - return pvt_; -} - - -gr::basic_block_sptr RtklibPvt::get_right_block() -{ - return pvt_; // this is a sink, nothing downstream -} diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt index eb58c0894..e9ce9906e 100644 --- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -16,11 +16,6 @@ # along with GNSS-SDR. If not, see . # - -if(Boost_VERSION LESS 105800) - add_definitions(-DOLD_BOOST=1) -endif() - set(PVT_GR_BLOCKS_SOURCES rtklib_pvt_cc.cc ) @@ -29,21 +24,36 @@ set(PVT_GR_BLOCKS_HEADERS rtklib_pvt_cc.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) +source_group(Headers FILES ${PVT_GR_BLOCKS_HEADERS}) add_library(pvt_gr_blocks ${PVT_GR_BLOCKS_SOURCES} ${PVT_GR_BLOCKS_HEADERS}) -source_group(Headers FILES ${PVT_GR_BLOCKS_HEADERS}) -target_link_libraries(pvt_gr_blocks pvt_lib ${ARMADILLO_LIBRARIES}) + +target_link_libraries(pvt_gr_blocks + PUBLIC + Boost::date_time + pvt_lib + Gnuradio::runtime + gnss_system_parameters + gnss_rx + PRIVATE + Gflags::gflags + Glog::glog + Boost::filesystem + Boost::system +) + +target_include_directories(pvt_gr_blocks + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs + ${CMAKE_SOURCE_DIR}/src/core/system_parameters +) + +if(Boost_VERSION LESS 105800) + target_compile_definitions(pvt_gr_blocks PRIVATE -DOLD_BOOST=1) +endif() + +set_property(TARGET pvt_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ + $ +) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index a59e5a8a7..f639d4ecd 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -67,7 +67,7 @@ rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, } -void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) +void rtklib_pvt_cc::msg_handler_telemetry(const pmt::pmt_t& msg) { try { @@ -321,8 +321,8 @@ void rtklib_pvt_cc::clear_ephemeris() rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, const Pvt_Conf& conf_, const rtk_t& rtk) : gr::sync_block("rtklib_pvt_cc", - gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), - gr::io_signature::make(0, 0, 0)) + gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), + gr::io_signature::make(0, 0, 0)) { d_output_rate_ms = conf_.output_rate_ms; d_display_rate_ms = conf_.display_rate_ms; @@ -334,10 +334,10 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, { std::string dump_path; // Get path - if (d_dump_filename.find_last_of("/") != std::string::npos) + if (d_dump_filename.find_last_of('/') != std::string::npos) { - std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1); - dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/")); + std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of('/') + 1); + dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of('/')); d_dump_filename = dump_filename_; } else @@ -349,9 +349,9 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, d_dump_filename = "pvt"; } // remove extension if any - if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos) + if (d_dump_filename.substr(1).find_last_of('.') != std::string::npos) { - d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of(".")); + d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of('.')); } dump_ls_pvt_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename; dump_ls_pvt_filename.append(".dat"); @@ -559,6 +559,19 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, d_last_status_print_seg = 0; + // PVT MONITOR + flag_monitor_pvt_enabled = conf_.monitor_enabled; + if (flag_monitor_pvt_enabled) + { + std::string address_string = conf_.udp_addresses; + std::vector udp_addr_vec = split_string(address_string, '_'); + std::sort(udp_addr_vec.begin(), udp_addr_vec.end()); + udp_addr_vec.erase(std::unique(udp_addr_vec.begin(), udp_addr_vec.end()), udp_addr_vec.end()); + + udp_sink_ptr = std::unique_ptr(new Monitor_Pvt_Udp_Sink(udp_addr_vec, conf_.udp_port)); + } + + // Create Sys V message queue first_fix = true; sysv_msg_key = 1101; @@ -574,7 +587,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, rtklib_pvt_cc::~rtklib_pvt_cc() { - msgctl(sysv_msqid, IPC_RMID, NULL); + msgctl(sysv_msqid, IPC_RMID, nullptr); if (d_xml_storage) { // save GPS L2CM ephemeris to XML file @@ -1018,8 +1031,8 @@ bool rtklib_pvt_cc::save_gnss_synchro_map_xml(const std::string& file_name) return true; } - LOG(WARNING) << "Failed to save gnss_synchro, map is empty"; - return false; + LOG(WARNING) << "Failed to save gnss_synchro, map is empty"; + return false; } @@ -1064,7 +1077,7 @@ bool rtklib_pvt_cc::get_latest_PVT(double* longitude_deg, return true; } - return false; + return false; } @@ -1085,7 +1098,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item bool flag_write_RINEX_nav_output = false; gnss_observables_map.clear(); - const Gnss_Synchro** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer + const auto** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer // ############ 1. READ PSEUDORANGES #### for (uint32_t i = 0; i < d_nchannels; i++) { @@ -1564,7 +1577,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - break; + break; case 50: // BDS B1I only if (beidou_dnav_ephemeris_iter != d_pvt_solver->beidou_dnav_ephemeris_map.cend()) { @@ -1996,17 +2009,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 1: // GPS L1 C/A if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; @@ -2015,76 +2028,76 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 6: if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 7: // GPS L1 C/A + GPS L2C if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 8: // L1+L5 if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 9: // GPS L1 C/A + Galileo E1B if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2092,7 +2105,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2104,7 +2117,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) @@ -2116,28 +2129,28 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 13: // L5+E5a if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output and d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); int gal_channel = 0; int gps_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2149,10 +2162,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { // This is a channel with valid GPS signal gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) - { + if (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) + { gps_channel = 1; - } + } } } if (gal_channel == 0) @@ -2160,8 +2173,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system == "E") { gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) - { + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + { gal_channel = 1; } } @@ -2170,11 +2183,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend() and (d_rtcm_MT1077_rate_ms != 0)) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; @@ -2182,17 +2195,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 15: if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; @@ -2201,17 +2214,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 25: if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (auto glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator glo_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto glo_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); if (glo_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2219,14 +2232,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 26: // GPS L1 C/A + GLONASS L1 C/A if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (auto glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_pvt_solver->glonass_gnav_utc_model); } @@ -2234,8 +2247,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2268,34 +2281,34 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 27: // GLONASS L1 C/A + Galileo E1B if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gal_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2327,25 +2340,25 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 29: // GPS L1 C/A + GLONASS L2 C/A if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } @@ -2353,8 +2366,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2386,34 +2399,34 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 30: // GLONASS L2 C/A + Galileo E1B if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gal_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2445,34 +2458,34 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 32: // L1+E1+L5+E5a if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); int gal_channel = 0; int gps_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2504,11 +2517,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; @@ -2524,18 +2537,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 1: // GPS L1 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2545,17 +2558,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 6: if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2563,18 +2576,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 7: // GPS L1 C/A + GPS L2C if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2582,18 +2595,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 8: // L1+L5 if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2601,23 +2614,23 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 9: // GPS L1 C/A + Galileo E1B if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MT1045_rate_ms != 0) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2649,11 +2662,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2662,15 +2675,15 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 13: // L5+E5a if (d_rtcm_MT1045_rate_ms != 0) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { @@ -2690,7 +2703,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2699,17 +2712,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 15: if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2719,17 +2732,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 25: if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator glo_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto glo_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); if (glo_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2737,14 +2750,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 26: // GPS L1 C/A + GLONASS L1 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } @@ -2752,8 +2765,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2785,11 +2798,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2797,16 +2810,16 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 27: // GLONASS L1 C/A + Galileo E1B if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) @@ -2814,8 +2827,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item int gal_channel = 0; int glo_channel = 0; std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); @@ -2845,11 +2858,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2857,22 +2870,22 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 29: // GPS L1 C/A + GLONASS L2 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); std::map::const_iterator gnss_observables_iter; int gps_channel = 0; int glo_channel = 0; @@ -2905,12 +2918,12 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2918,16 +2931,16 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 30: // GLONASS L2 C/A + Galileo E1B if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) @@ -2935,8 +2948,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item int gal_channel = 0; int glo_channel = 0; std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); @@ -2966,11 +2979,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2978,23 +2991,23 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 32: // L1+E1+L5+E5a if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -3026,11 +3039,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -3086,8 +3099,29 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item << d_pvt_solver->get_vdop() << " GDOP = " << d_pvt_solver->get_gdop() << std::endl; */ } + + // PVT MONITOR + if (d_pvt_solver->is_valid_position() and flag_monitor_pvt_enabled) + { + Monitor_Pvt monitor_pvt = d_pvt_solver->get_monitor_pvt(); + udp_sink_ptr->write_monitor_pvt(monitor_pvt); + } } } return noutput_items; } + +std::vector rtklib_pvt_cc::split_string(const std::string& s, char delim) +{ + std::vector v; + std::stringstream ss(s); + std::string item; + + while (std::getline(ss, item, delim)) + { + *(std::back_inserter(v)++) = item; + } + + return v; +} diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index df79836c7..4f84f8a27 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -35,6 +35,7 @@ #include "gps_ephemeris.h" #include "gpx_printer.h" #include "kml_printer.h" +#include "monitor_pvt_udp_sink.h" #include "nmea_printer.h" #include "pvt_conf.h" #include "rinex_printer.h" @@ -71,7 +72,7 @@ private: const Pvt_Conf& conf_, const rtk_t& rtk); - void msg_handler_telemetry(pmt::pmt_t msg); + void msg_handler_telemetry(const pmt::pmt_t& msg); bool d_dump; bool d_dump_mat; @@ -143,6 +144,9 @@ private: return (pt - boost::posix_time::ptime(boost::gregorian::date(1970, 1, 1))).total_seconds(); } + bool flag_monitor_pvt_enabled; + std::unique_ptr udp_sink_ptr; + std::vector split_string(const std::string& s, char delim); public: rtklib_pvt_cc(uint32_t nchannels, diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index 25a4c592a..9b9237128 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -16,7 +16,6 @@ # along with GNSS-SDR. If not, see . # -add_definitions(-DGNSS_SDR_VERSION="${VERSION}") set(PVT_LIB_SOURCES pvt_solution.cc @@ -30,6 +29,7 @@ set(PVT_LIB_SOURCES geojson_printer.cc rtklib_solver.cc pvt_conf.cc + monitor_pvt_udp_sink.cc ) set(PVT_LIB_HEADERS @@ -44,50 +44,44 @@ set(PVT_LIB_HEADERS geojson_printer.h rtklib_solver.h pvt_conf.h -) - -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${Boost_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} + monitor_pvt_udp_sink.h + monitor_pvt.h ) list(SORT PVT_LIB_HEADERS) list(SORT PVT_LIB_SOURCES) -add_library(pvt_lib ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS}) source_group(Headers FILES ${PVT_LIB_HEADERS}) -if(MATIO_FOUND) - add_dependencies(pvt_lib - glog-${glog_RELEASE} - armadillo-${armadillo_RELEASE} - ) -else() - add_dependencies(pvt_lib - glog-${glog_RELEASE} - armadillo-${armadillo_RELEASE} - matio-${GNSSSDR_MATIO_LOCAL_VERSION} - ) -endif() +add_library(pvt_lib ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS}) target_link_libraries(pvt_lib - rtklib_lib - gnss_sdr_flags - gnss_sp_libs - ${Boost_LIBRARIES} - ${GLOG_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${BLAS} - ${LAPACK} - ${MATIO_LIBRARIES} + PUBLIC + Armadillo::armadillo + Boost::date_time + gnss_system_parameters + gnss_sp_libs + rtklib_lib + gnss_rx + PRIVATE + Boost::filesystem + Boost::system + Gflags::gflags + Glog::glog + Matio::matio +) + +target_include_directories(pvt_lib + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib +) + +target_compile_definitions(pvt_lib PRIVATE -DGNSS_SDR_VERSION="${VERSION}") + +set_property(TARGET pvt_lib APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ + $ + $ + $ ) diff --git a/src/algorithms/PVT/libs/monitor_pvt.h b/src/algorithms/PVT/libs/monitor_pvt.h new file mode 100644 index 000000000..4cfc8f991 --- /dev/null +++ b/src/algorithms/PVT/libs/monitor_pvt.h @@ -0,0 +1,140 @@ +/*! + * \file monitor_pvt.h + * \brief Interface of the Monitor_Pvt class + * \author + * Álvaro Cebrián Juan, 2019. acebrianjuan(at)gmail.com + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#ifndef MONITOR_PVT_H_ +#define MONITOR_PVT_H_ + +#include +#include + +/*! + * \brief This class contains parameters and outputs of the PVT block + */ +class Monitor_Pvt +{ +public: + // TOW + uint32_t TOW_at_current_symbol_ms; + // WEEK + uint32_t week; + // PVT GPS time + double RX_time; + // User clock offset [s] + double user_clk_offset; + + // ECEF POS X,Y,X [m] + ECEF VEL X,Y,X [m/s] (6 x double) + double pos_x; + double pos_y; + double pos_z; + double vel_x; + double vel_y; + double vel_z; + + // position variance/covariance (m^2) {c_xx,c_yy,c_zz,c_xy,c_yz,c_zx} (6 x double) + double cov_xx; + double cov_yy; + double cov_zz; + double cov_xy; + double cov_yz; + double cov_zx; + + // GEO user position Latitude [deg] + double latitude; + // GEO user position Longitude [deg] + double longitude; + // GEO user position Height [m] + double height; + + // NUMBER OF VALID SATS + uint8_t valid_sats; + // RTKLIB solution status + uint8_t solution_status; + // RTKLIB solution type (0:xyz-ecef,1:enu-baseline) + uint8_t solution_type; + // AR ratio factor for validation + float AR_ratio_factor; + // AR ratio threshold for validation + float AR_ratio_threshold; + + // GDOP / PDOP/ HDOP/ VDOP + double gdop; + double pdop; + double hdop; + double vdop; + + /*! + * \brief This member function serializes and restores + * Monitor_Pvt objects from a byte stream. + */ + template + + void serialize(Archive& ar, const unsigned int version) + { + if (version) + { + }; + + ar& BOOST_SERIALIZATION_NVP(TOW_at_current_symbol_ms); + ar& BOOST_SERIALIZATION_NVP(week); + ar& BOOST_SERIALIZATION_NVP(RX_time); + ar& BOOST_SERIALIZATION_NVP(user_clk_offset); + + ar& BOOST_SERIALIZATION_NVP(pos_x); + ar& BOOST_SERIALIZATION_NVP(pos_y); + ar& BOOST_SERIALIZATION_NVP(pos_z); + ar& BOOST_SERIALIZATION_NVP(vel_x); + ar& BOOST_SERIALIZATION_NVP(vel_y); + ar& BOOST_SERIALIZATION_NVP(vel_z); + + ar& BOOST_SERIALIZATION_NVP(cov_xx); + ar& BOOST_SERIALIZATION_NVP(cov_yy); + ar& BOOST_SERIALIZATION_NVP(cov_zz); + ar& BOOST_SERIALIZATION_NVP(cov_xy); + ar& BOOST_SERIALIZATION_NVP(cov_yz); + ar& BOOST_SERIALIZATION_NVP(cov_zx); + + ar& BOOST_SERIALIZATION_NVP(latitude); + ar& BOOST_SERIALIZATION_NVP(longitude); + ar& BOOST_SERIALIZATION_NVP(height); + + ar& BOOST_SERIALIZATION_NVP(valid_sats); + ar& BOOST_SERIALIZATION_NVP(solution_status); + ar& BOOST_SERIALIZATION_NVP(solution_type); + ar& BOOST_SERIALIZATION_NVP(AR_ratio_factor); + ar& BOOST_SERIALIZATION_NVP(AR_ratio_threshold); + + ar& BOOST_SERIALIZATION_NVP(gdop); + ar& BOOST_SERIALIZATION_NVP(pdop); + ar& BOOST_SERIALIZATION_NVP(hdop); + ar& BOOST_SERIALIZATION_NVP(vdop); + } +}; + +#endif /* MONITOR_PVT_H_ */ diff --git a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.cc b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.cc new file mode 100644 index 000000000..0aaf14e2c --- /dev/null +++ b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.cc @@ -0,0 +1,69 @@ +/*! + * \file monitor_pvt_udp_sink.cc + * \brief Implementation of a class that sends serialized Monitor_Pvt + * objects over udp to one or multiple endpoints + * \author Álvaro Cebrián Juan, 2019. acebrianjuan(at)gmail.com + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#include "monitor_pvt_udp_sink.h" +#include +//#include +#include +#include + +Monitor_Pvt_Udp_Sink::Monitor_Pvt_Udp_Sink(std::vector addresses, const uint16_t& port) : socket{io_service} +{ + for (auto address : addresses) + { + boost::asio::ip::udp::endpoint endpoint(boost::asio::ip::address::from_string(address, error), port); + endpoints.push_back(endpoint); + } +} + +bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(Monitor_Pvt monitor_pvt) +{ + std::ostringstream archive_stream; + boost::archive::binary_oarchive oa{archive_stream}; + oa << monitor_pvt; + std::string outbound_data = archive_stream.str(); + + for (auto endpoint : endpoints) + { + socket.open(endpoint.protocol(), error); + socket.connect(endpoint, error); + + try + { + socket.send(boost::asio::buffer(outbound_data)); + } + catch (boost::system::system_error const& e) + { + return false; + } + } + return true; +} diff --git a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h new file mode 100644 index 000000000..713e9eff3 --- /dev/null +++ b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h @@ -0,0 +1,53 @@ +/*! + * \file monitor_pvt_udp_sink.h + * \brief Interface of a class that sends serialized Monitor_Pvt objects + * over udp to one or multiple endpoints + * \author Álvaro Cebrián Juan, 2019. acebrianjuan(at)gmail.com + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#ifndef MONITOR_PVT_UDP_SINK_H_ +#define MONITOR_PVT_UDP_SINK_H_ + +#include "monitor_pvt.h" +#include + +class Monitor_Pvt_Udp_Sink +{ +public: + Monitor_Pvt_Udp_Sink(std::vector addresses, const uint16_t &port); + bool write_monitor_pvt(Monitor_Pvt monitor_pvt); + +private: + boost::asio::io_service io_service; + boost::asio::ip::udp::socket socket; + boost::system::error_code error; + std::vector endpoints; + Monitor_Pvt monitor_pvt; +}; + + +#endif /* MONITOR_PVT_UDP_SINK_H_ */ diff --git a/src/algorithms/PVT/libs/nmea_printer.h b/src/algorithms/PVT/libs/nmea_printer.h index c73ef91ff..6e18d7451 100644 --- a/src/algorithms/PVT/libs/nmea_printer.h +++ b/src/algorithms/PVT/libs/nmea_printer.h @@ -38,6 +38,7 @@ #include "rtklib_solver.h" #include +#include #include diff --git a/src/algorithms/PVT/libs/pvt_conf.h b/src/algorithms/PVT/libs/pvt_conf.h index f5e9af10e..45c960c2f 100644 --- a/src/algorithms/PVT/libs/pvt_conf.h +++ b/src/algorithms/PVT/libs/pvt_conf.h @@ -80,6 +80,10 @@ public: std::string xml_output_path; std::string rtcm_output_file_path; + bool monitor_enabled; + std::string udp_addresses; + int udp_port; + Pvt_Conf(); }; diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 1490482cb..0c7e6b149 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -31,7 +31,6 @@ #include "rinex_printer.h" #include #include -#include #include #include // for create_directories, exists #include // for path, operator<< @@ -251,9 +250,9 @@ Rinex_Printer::~Rinex_Printer() if (remove(navGlofilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } if (posnc == 0) - { - if (remove(navBdsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; - } + { + if (remove(navBdsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + } } @@ -1371,8 +1370,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co line += std::string(3, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 18, 2), 19); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 18, 2), 19); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 9); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 9); // valid until 2019 + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 9); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 9); // valid until 2019 line += std::string(1, ' '); line += Rinex_Printer::leftJustify("DELTA-UTC: A0,A1,T,W", 20); } @@ -1382,8 +1381,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co line += std::string("GPUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 5); // valid until 2019 + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 5); // valid until 2019 /* if ( SBAS ) { line += string(1, ' '); @@ -1403,16 +1402,16 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); if (version == 2) { line += std::string(54, ' '); } if (version == 3) { - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line += std::string(36, ' '); } line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); @@ -1616,38 +1615,38 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono& // -------- Line ionospheric info 1, only version 3 supported line.clear(); line += std::string("BDSA"); - line += std::string(1, ' '); - line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha0, 10, 2), 12); - line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha1, 10, 2), 12); - line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha2, 10, 2), 12); - line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha3, 10, 2), 12); - line += std::string(7, ' '); - line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); + line += std::string(1, ' '); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha0, 10, 2), 12); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha1, 10, 2), 12); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha2, 10, 2), 12); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha3, 10, 2), 12); + line += std::string(7, ' '); + line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; // -------- Line ionospheric info 2 line.clear(); - line += std::string("BDSB"); - line += std::string(1, ' '); - line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta0, 10, 2), 12); - line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta1, 10, 2), 12); - line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta2, 10, 2), 12); - line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta3, 10, 2), 12); - line += std::string(7, ' '); - line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); + line += std::string("BDSB"); + line += std::string(1, ' '); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta0, 10, 2), 12); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta1, 10, 2), 12); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta2, 10, 2), 12); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta3, 10, 2), 12); + line += std::string(7, ' '); + line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; // -------- Line 5 system time correction line.clear(); - line += std::string("BDUT"); - line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0_UTC, 16, 2), 18); - line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1_UTC, 15, 2), 16); - line += std::string(22, ' '); - line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); + line += std::string("BDUT"); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0_UTC, 16, 2), 18); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1_UTC, 15, 2), 16); + line += std::string(22, ' '); + line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -1656,9 +1655,9 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono& // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); @@ -2794,59 +2793,58 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Beidou_Dnav_Utc_M { line_aux.clear(); - if (line_str.find("BDSA", 0) != std::string::npos) - { - line_aux += std::string("GPSA"); - line_aux += std::string(1, ' '); - line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha0, 10, 2), 12); - line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha1, 10, 2), 12); - line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha2, 10, 2), 12); - line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha3, 10, 2), 12); - line_aux += std::string(7, ' '); - line_aux += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); - data.push_back(line_aux); - } - else if (line_str.find("BDSB", 0) != std::string::npos) - { - line_aux += std::string("GPSB"); - line_aux += std::string(1, ' '); - line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta0, 10, 2), 12); - line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta1, 10, 2), 12); - line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta2, 10, 2), 12); - line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta3, 10, 2), 12); - line_aux += std::string(7, ' '); - line_aux += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); - data.push_back(line_aux); - } - else if (line_str.find("BDUT", 0) != std::string::npos) - { - line_aux += std::string("GPUT"); - line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0_UTC, 16, 2), 18); - line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1_UTC, 15, 2), 16); - line_aux += std::string(22, ' '); - line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); - data.push_back(line_aux); - } - else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) - { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); - line_aux += std::string(36, ' '); - line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); - data.push_back(line_aux); - } - else if (line_str.find("END OF HEADER", 59) != std::string::npos) - { - data.push_back(line_str); - no_more_finds = true; - } - else - { - data.push_back(line_str); - } - + if (line_str.find("BDSA", 0) != std::string::npos) + { + line_aux += std::string("GPSA"); + line_aux += std::string(1, ' '); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha0, 10, 2), 12); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha1, 10, 2), 12); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha2, 10, 2), 12); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha3, 10, 2), 12); + line_aux += std::string(7, ' '); + line_aux += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); + data.push_back(line_aux); + } + else if (line_str.find("BDSB", 0) != std::string::npos) + { + line_aux += std::string("GPSB"); + line_aux += std::string(1, ' '); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta0, 10, 2), 12); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta1, 10, 2), 12); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta2, 10, 2), 12); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta3, 10, 2), 12); + line_aux += std::string(7, ' '); + line_aux += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); + data.push_back(line_aux); + } + else if (line_str.find("BDUT", 0) != std::string::npos) + { + line_aux += std::string("GPUT"); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0_UTC, 16, 2), 18); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1_UTC, 15, 2), 16); + line_aux += std::string(22, ' '); + line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); + data.push_back(line_aux); + } + else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) + { + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); + line_aux += std::string(36, ' '); + line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); + data.push_back(line_aux); + } + else if (line_str.find("END OF HEADER", 59) != std::string::npos) + { + data.push_back(line_str); + no_more_finds = true; + } + else + { + data.push_back(line_str); + } } else { @@ -3759,7 +3757,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map::const_iterator bds_ephemeris_iter; for (bds_ephemeris_iter = eph_map.cbegin(); - bds_ephemeris_iter != eph_map.cend(); + bds_ephemeris_iter != eph_map.cend(); bds_ephemeris_iter++) { // -------- SV / EPOCH / SV CLK @@ -3771,28 +3769,28 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.i_satellite_PRN < 10) line += std::string("0"); - line += boost::lexical_cast(bds_ephemeris_iter->second.i_satellite_PRN); - std::string year(timestring, 0, 4); - line += std::string(1, ' '); - line += year; - line += std::string(1, ' '); - line += month; - line += std::string(1, ' '); - line += day; - line += std::string(1, ' '); - line += hour; - line += std::string(1, ' '); - line += minutes; - line += std::string(1, ' '); - line += seconds; - line += std::string(1, ' '); - line += Rinex_Printer::doub2for(bds_ephemeris_iter->second.d_A_f0, 18, 2); - line += std::string(1, ' '); - line += Rinex_Printer::doub2for(bds_ephemeris_iter->second.d_A_f1, 18, 2); - line += std::string(1, ' '); - line += Rinex_Printer::doub2for(bds_ephemeris_iter->second.d_A_f2, 18, 2); + line += satelliteSystem["Beidou"]; + if (bds_ephemeris_iter->second.i_satellite_PRN < 10) line += std::string("0"); + line += std::to_string(bds_ephemeris_iter->second.i_satellite_PRN); + std::string year(timestring, 0, 4); + line += std::string(1, ' '); + line += year; + line += std::string(1, ' '); + line += month; + line += std::string(1, ' '); + line += day; + line += std::string(1, ' '); + line += hour; + line += std::string(1, ' '); + line += minutes; + line += std::string(1, ' '); + line += seconds; + line += std::string(1, ' '); + line += Rinex_Printer::doub2for(bds_ephemeris_iter->second.d_A_f0, 18, 2); + line += std::string(1, ' '); + line += Rinex_Printer::doub2for(bds_ephemeris_iter->second.d_A_f1, 18, 2); + line += std::string(1, ' '); + line += Rinex_Printer::doub2for(bds_ephemeris_iter->second.d_A_f2, 18, 2); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -3855,7 +3853,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(bds_ephemeris_iter->second.i_BEIDOU_week); + auto BDS_week_continuous_number = static_cast(bds_ephemeris_iter->second.i_BEIDOU_week); line += Rinex_Printer::doub2for(BDS_week_continuous_number, 18, 2); line += std::string(1, ' '); line += std::string(18, ' '); // spare @@ -7205,7 +7203,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps } -void Rinex_Printer::rinex_obs_header(std::fstream& out, const Beidou_Dnav_Ephemeris& eph, const double d_TOW_first_observation, const std::string bands) +void Rinex_Printer::rinex_obs_header(std::fstream& out, const Beidou_Dnav_Ephemeris& eph, const double d_TOW_first_observation, const std::string& bands) { std::string line; version = 3; @@ -7662,27 +7660,26 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Beidou_Dnav_Utc_M { line_aux.clear(); - if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) - { - data.push_back(line_str); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); - line_aux += std::string(36, ' '); - line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); - data.push_back(line_aux); - } - else if (line_str.find("END OF HEADER", 59) != std::string::npos) - { - data.push_back(line_str); - no_more_finds = true; - } - else - { - data.push_back(line_str); - } - + if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) + { + data.push_back(line_str); + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); + line_aux += std::string(36, ' '); + line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); + data.push_back(line_aux); + } + else if (line_str.find("END OF HEADER", 59) != std::string::npos) + { + data.push_back(line_str); + no_more_finds = true; + } + else + { + data.push_back(line_str); + } } else { @@ -10413,7 +10410,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep } -void Rinex_Printer::log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris& eph, double obs_time, const std::map& observables, const std::string bds_bands) +void Rinex_Printer::log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris& eph, double obs_time, const std::map& observables, const std::string& bds_bands) { std::string line; @@ -10524,7 +10521,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris } int32_t numSatellitesObserved = available_prns.size(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); @@ -10540,9 +10537,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris lineObs.clear(); lineObs += satelliteSystem["Beidou"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_map.equal_range(*it); - for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) + for (auto iter = ret.first; iter != ret.second; ++iter) { lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index cfdcf86a8..b5ea3357d 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -51,21 +51,19 @@ #ifndef GNSS_SDR_RINEX_PRINTER_H_ #define GNSS_SDR_RINEX_PRINTER_H_ -#include "gps_navigation_message.h" -#include "gps_cnav_navigation_message.h" -#include "galileo_navigation_message.h" -#include "glonass_gnav_navigation_message.h" -#include "beidou_dnav_navigation_message.h" +#include "Beidou_B1I.h" +#include "GLONASS_L1_L2_CA.h" #include "GPS_L1_CA.h" #include "Galileo_E1.h" -#include "GLONASS_L1_L2_CA.h" -#include "Beidou_B1I.h" +#include "beidou_dnav_navigation_message.h" +#include "galileo_navigation_message.h" +#include "glonass_gnav_navigation_message.h" #include "gnss_synchro.h" +#include "gps_cnav_navigation_message.h" +#include "gps_navigation_message.h" #include #include -#include #include -#include // for stringstream #include // for setprecision #include #include // for stringstream @@ -203,7 +201,7 @@ public: /*! * \brief Generates the a Beidou B1I Observation data header. Example: beidou_bands("B1") */ - void rinex_obs_header(std::fstream& out, const Beidou_Dnav_Ephemeris& eph, const double d_TOW_first_observation, const std::string bands); + void rinex_obs_header(std::fstream& out, const Beidou_Dnav_Ephemeris& eph, const double d_TOW_first_observation, const std::string& bands); /*! * \brief Generates the SBAS raw data header @@ -363,7 +361,7 @@ public: /*! * \brief Writes BDS B1I observables into the RINEX file */ - void log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris& eph, double obs_time, const std::map& observables, const std::string bds_bands); + void log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris& eph, double obs_time, const std::map& observables, const std::string& bds_bands); /*! diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index da32c0e9b..b4892e2f8 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -143,7 +143,7 @@ Rtcm_Printer::Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump } } - rtcm_devname = std::move(rtcm_dump_devname); + rtcm_devname = rtcm_dump_devname; if (flag_rtcm_tty_port == true) { rtcm_dev_descriptor = init_serial(rtcm_devname.c_str()); diff --git a/src/algorithms/PVT/libs/rtcm_printer.h b/src/algorithms/PVT/libs/rtcm_printer.h index aca7197bb..c5ea3a54a 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.h +++ b/src/algorithms/PVT/libs/rtcm_printer.h @@ -36,8 +36,8 @@ #include "rtcm.h" #include // std::ofstream -#include // std::shared_ptr - +#include +#include // std::shared_ptr /*! * \brief This class provides a implementation of a subset of the RTCM Standard 10403.2 messages diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 28a770faa..a6bb03c4a 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -52,10 +52,10 @@ * -----------------------------------------------------------------------*/ #include "rtklib_solver.h" +#include "Beidou_B1I.h" #include "GLONASS_L1_L2_CA.h" #include "GPS_L1_CA.h" #include "Galileo_E1.h" -#include "Beidou_B1I.h" #include "rtklib_conversions.h" #include "rtklib_solution.h" #include @@ -440,6 +440,10 @@ double rtklib_solver::get_vdop() const return dop_[3]; } +Monitor_Pvt rtklib_solver::get_monitor_pvt() const +{ + return monitor_pvt; +} bool rtklib_solver::get_PVT(const std::map &gnss_observables_map, bool flag_averaging) { @@ -785,7 +789,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ } } break; - } + } default: DLOG(INFO) << "Hybrid observables: Unknown GNSS"; @@ -907,6 +911,58 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ << " [deg], Height= " << this->get_height() << " [m]" << " RX time offset= " << this->get_time_offset_s() << " [s]"; + // PVT MONITOR + + // TOW + monitor_pvt.TOW_at_current_symbol_ms = gnss_observables_map.begin()->second.TOW_at_current_symbol_ms; + // WEEK + monitor_pvt.week = adjgpsweek(nav_data.eph[0].week); + // PVT GPS time + monitor_pvt.RX_time = gnss_observables_map.begin()->second.RX_time; + // User clock offset [s] + monitor_pvt.user_clk_offset = rx_position_and_time(3); + + // ECEF POS X,Y,X [m] + ECEF VEL X,Y,X [m/s] (6 x double) + monitor_pvt.pos_x = pvt_sol.rr[0]; + monitor_pvt.pos_y = pvt_sol.rr[1]; + monitor_pvt.pos_z = pvt_sol.rr[2]; + monitor_pvt.vel_x = pvt_sol.rr[3]; + monitor_pvt.vel_y = pvt_sol.rr[4]; + monitor_pvt.vel_z = pvt_sol.rr[5]; + + // position variance/covariance (m^2) {c_xx,c_yy,c_zz,c_xy,c_yz,c_zx} (6 x double) + monitor_pvt.cov_xx = pvt_sol.qr[0]; + monitor_pvt.cov_yy = pvt_sol.qr[1]; + monitor_pvt.cov_zz = pvt_sol.qr[2]; + monitor_pvt.cov_xy = pvt_sol.qr[3]; + monitor_pvt.cov_yz = pvt_sol.qr[4]; + monitor_pvt.cov_zx = pvt_sol.qr[5]; + + // GEO user position Latitude [deg] + monitor_pvt.latitude = get_latitude(); + // GEO user position Longitude [deg] + monitor_pvt.longitude = get_longitude(); + // GEO user position Height [m] + monitor_pvt.height = get_height(); + + // NUMBER OF VALID SATS + monitor_pvt.valid_sats = pvt_sol.ns; + // RTKLIB solution status + monitor_pvt.solution_status = pvt_sol.stat; + // RTKLIB solution type (0:xyz-ecef,1:enu-baseline) + monitor_pvt.solution_type = pvt_sol.type; + // AR ratio factor for validation + monitor_pvt.AR_ratio_factor = pvt_sol.ratio; + // AR ratio threshold for validation + monitor_pvt.AR_ratio_threshold = pvt_sol.thres; + + // GDOP / PDOP/ HDOP/ VDOP + monitor_pvt.gdop = dop_[0]; + monitor_pvt.pdop = dop_[1]; + monitor_pvt.hdop = dop_[2]; + monitor_pvt.vdop = dop_[3]; + + // ######## LOG FILE ######### if (d_flag_dump_enabled == true) { diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index 935cb3dde..a3504c796 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -55,13 +55,14 @@ #define GNSS_SDR_RTKLIB_SOLVER_H_ +#include "beidou_dnav_navigation_message.h" #include "galileo_almanac.h" #include "galileo_navigation_message.h" #include "glonass_gnav_navigation_message.h" #include "gnss_synchro.h" #include "gps_cnav_navigation_message.h" #include "gps_navigation_message.h" -#include "beidou_dnav_navigation_message.h" +#include "monitor_pvt.h" #include "pvt_solution.h" #include "rtklib_rtkpos.h" #include @@ -85,6 +86,7 @@ private: bool d_flag_dump_mat_enabled; int d_nchannels; // Number of available channels for positioning std::array dop_; + Monitor_Pvt monitor_pvt; public: sol_t pvt_sol; @@ -97,12 +99,13 @@ public: double get_vdop() const; double get_pdop() const; double get_gdop() const; + Monitor_Pvt get_monitor_pvt() const; std::map galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris std::map gps_ephemeris_map; //!< Map storing new GPS_Ephemeris std::map gps_cnav_ephemeris_map; //!< Map storing new GPS_CNAV_Ephemeris std::map glonass_gnav_ephemeris_map; //!< Map storing new GLONASS GNAV Ephemeris - std::map beidou_dnav_ephemeris_map; //!< Map storing new GLONASS GNAV Ephmeris + std::map beidou_dnav_ephemeris_map; //!< Map storing new GLONASS GNAV Ephmeris Galileo_Utc_Model galileo_utc_model; Galileo_Iono galileo_iono; diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index 9f7cc312e..8a9c2d0c5 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -86,33 +86,30 @@ if(OPENCL_FOUND) ) endif() -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${GNURADIO_BLOCKS_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} -) - list(SORT ACQ_ADAPTER_HEADERS) list(SORT ACQ_ADAPTER_SOURCES) -add_library(acq_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS}) + source_group(Headers FILES ${ACQ_ADAPTER_HEADERS}) + +add_library(acq_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS}) + target_link_libraries(acq_adapters - acquisition_lib - gnss_sp_libs - gnss_sdr_flags - acq_gr_blocks - ${Boost_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} + PUBLIC + gnss_sp_libs + gnss_sdr_flags + acq_gr_blocks + rx_core_lib + Gnuradio::blocks + gnss_system_parameters + PRIVATE + Boost::boost + Gflags::gflags + Glog::glog + Volkgnsssdr::volkgnsssdr + acquisition_lib +) + +set_property(TARGET acq_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc index b355794ff..d2c8a99e2 100644 --- a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc @@ -32,27 +32,26 @@ */ #include "beidou_b1i_pcps_acquisition.h" +#include "Beidou_B1I.h" +#include "acq_conf.h" +#include "beidou_b1i_signal_processing.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" -#include "acq_conf.h" #include #include -#include "beidou_b1i_signal_processing.h" -#include "Beidou_B1I.h" - using google::LogMessage; BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition( ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams) : role_(role), - in_streams_(in_streams), - out_streams_(out_streams) + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { - Acq_Conf acq_parameters = Acq_Conf(); + Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; std::string default_item_type = "gr_complex"; std::string default_dump_filename = "./data/acquisition.dat"; @@ -61,7 +60,7 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; dump_ = configuration_->property(role + ".dump", false); @@ -82,7 +81,7 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition( dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); acq_parameters.dump_filename = dump_filename_; //--- Find number of samples per spreading code ------------------------- - code_length_ = static_cast(std::round(static_cast(fs_in_) / ( BEIDOU_B1I_CODE_RATE_HZ / BEIDOU_B1I_CODE_LENGTH_CHIPS))); + code_length_ = static_cast(std::round(static_cast(fs_in_) / (BEIDOU_B1I_CODE_RATE_HZ / BEIDOU_B1I_CODE_LENGTH_CHIPS))); vector_length_ = code_length_ * sampled_ms_; @@ -93,7 +92,7 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("cshort") == 0) + if (item_type_ == "cshort") { item_size_ = sizeof(lv_16sc_t); } @@ -114,7 +113,7 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition( stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")"; - if (item_type_.compare("cbyte") == 0) + if (item_type_ == "cbyte") { cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); float_to_complex_ = gr::blocks::float_to_complex::make(); @@ -123,7 +122,7 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -210,7 +209,7 @@ void BeidouB1iPcpsAcquisition::init() void BeidouB1iPcpsAcquisition::set_local_code() { - std::complex* code = new std::complex[code_length_]; + auto* code = new std::complex[code_length_]; beidou_b1i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); @@ -254,9 +253,9 @@ float BeidouB1iPcpsAcquisition::calculate_threshold(float pfa) unsigned int ncells = vector_length_ * frequency_bins; double exponent = 1 / static_cast(ncells); double val = pow(1.0 - pfa, exponent); - double lambda = static_cast(vector_length_); + auto lambda = static_cast(vector_length_); boost::math::exponential_distribution mydist(lambda); - float threshold = static_cast(quantile(mydist, val)); + auto threshold = static_cast(quantile(mydist, val)); return threshold; } @@ -264,15 +263,15 @@ float BeidouB1iPcpsAcquisition::calculate_threshold(float pfa) void BeidouB1iPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { - // nothing to connect + // nothing to connect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { - // nothing to connect + // nothing to connect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0); top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1); @@ -287,15 +286,15 @@ void BeidouB1iPcpsAcquisition::connect(gr::top_block_sptr top_block) void BeidouB1iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { - // nothing to disconnect + // nothing to disconnect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { - // nothing to disconnect + // nothing to disconnect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { // Since a byte-based acq implementation is not available, // we just convert cshorts to gr_complex @@ -312,15 +311,15 @@ void BeidouB1iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr BeidouB1iPcpsAcquisition::get_left_block() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_; } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { return acquisition_; } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { return cbyte_to_float_x2_; } diff --git a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h index e7a9c8430..13e623949 100644 --- a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h @@ -34,13 +34,12 @@ #ifndef GNSS_SDR_BEIDOU_B1I_PCPS_ACQUISITION_H_ #define GNSS_SDR_BEIDOU_B1I_PCPS_ACQUISITION_H_ -#include "acq_conf.h" #include "acquisition_interface.h" +#include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition.h" -#include "complex_byte_to_float_x2.h" -#include #include +#include #include #include @@ -55,7 +54,7 @@ class BeidouB1iPcpsAcquisition : public AcquisitionInterface { public: BeidouB1iPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, unsigned int in_streams, unsigned int out_streams); virtual ~BeidouB1iPcpsAcquisition(); diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index 60825d6f0..67d639da4 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -49,21 +49,6 @@ if(OPENCL_FOUND) set(ACQ_GR_BLOCKS_HEADERS ${ACQ_GR_BLOCKS_HEADERS} pcps_opencl_acquisition_cc.h) endif() -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} -) if(OPENCL_FOUND) include_directories(${OPENCL_INCLUDE_DIRS}) @@ -76,35 +61,36 @@ endif() list(SORT ACQ_GR_BLOCKS_HEADERS) list(SORT ACQ_GR_BLOCKS_SOURCES) -add_library(acq_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS}) + source_group(Headers FILES ${ACQ_GR_BLOCKS_HEADERS}) -if(ENABLE_FPGA) - target_link_libraries(acq_gr_blocks +add_library(acq_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS}) + +target_link_libraries(acq_gr_blocks + PUBLIC + Gnuradio::runtime + Gnuradio::fft + Volk::volk + gnss_system_parameters acquisition_lib - gnss_sp_libs - gnss_system_parameters - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${VOLK_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} ${OPT_LIBRARIES} - ${OPT_ACQUISITION_LIBRARIES} - ) -else() - target_link_libraries(acq_gr_blocks + PRIVATE + Boost::filesystem + Gflags::gflags + Glog::glog + Matio::matio + Volkgnsssdr::volkgnsssdr gnss_sp_libs - gnss_system_parameters - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${VOLK_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - ${OPT_LIBRARIES} - ${MATIO_LIBRARIES} - ${OPT_ACQUISITION_LIBRARIES} - ) + gnss_rx +) + +if(OPENCL_FOUND) + target_include_directories(acq_gr_blocks PUBLIC ${OPENCL_INCLUDE_DIRS}) endif() -if(NOT VOLKGNSSSDR_FOUND) - add_dependencies(acq_gr_blocks volk_gnsssdr_module) -endif() +target_include_directories(acq_gr_blocks PUBLIC ${CMAKE_SOURCE_DIR}/src/algorithms/libs) + +set_property(TARGET acq_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/acquisition/libs/CMakeLists.txt b/src/algorithms/acquisition/libs/CMakeLists.txt index c3f368be6..aa753b054 100644 --- a/src/algorithms/acquisition/libs/CMakeLists.txt +++ b/src/algorithms/acquisition/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -19,17 +19,6 @@ if(ENABLE_FPGA) set(ACQUISITION_LIB_SOURCES fpga_acquisition.cc) set(ACQUISITION_LIB_HEADERS fpga_acquisition.h) - include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${VOLK_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ) endif() set(ACQUISITION_LIB_HEADERS ${ACQUISITION_LIB_HEADERS} acq_conf.h) @@ -38,21 +27,26 @@ set(ACQUISITION_LIB_SOURCES ${ACQUISITION_LIB_SOURCES} acq_conf.cc) list(SORT ACQUISITION_LIB_HEADERS) list(SORT ACQUISITION_LIB_SOURCES) +source_group(Headers FILES ${ACQUISITION_LIB_HEADERS}) + add_library(acquisition_lib ${ACQUISITION_LIB_SOURCES} ${ACQUISITION_LIB_HEADERS} ) -source_group(Headers FILES ${ACQUISITION_LIB_HEADERS}) - target_link_libraries(acquisition_lib - ${VOLK_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} + PUBLIC + Volk::volk + Gnuradio::fft + PRIVATE + Gflags::gflags + Glog::glog + gnss_system_parameters + gnss_rx + gnss_sp_libs ) -if(VOLKGNSSSDR_FOUND) - add_dependencies(acquisition_lib glog-${glog_RELEASE}) -else() - add_dependencies(acquisition_lib glog-${glog_RELEASE} volk_gnsssdr_module) -endif() +set_property(TARGET acquisition_lib + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/channel/adapters/CMakeLists.txt b/src/algorithms/channel/adapters/CMakeLists.txt index 65591834c..b3507210d 100644 --- a/src/algorithms/channel/adapters/CMakeLists.txt +++ b/src/algorithms/channel/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -19,19 +19,6 @@ set(CHANNEL_ADAPTER_SOURCES channel.cc) set(CHANNEL_ADAPTER_HEADERS channel.h) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) - add_library(channel_adapters ${CHANNEL_ADAPTER_SOURCES} ${CHANNEL_ADAPTER_HEADERS} @@ -40,8 +27,17 @@ add_library(channel_adapters source_group(Headers FILES ${CHANNEL_ADAPTER_HEADERS}) target_link_libraries(channel_adapters - channel_fsm - ${GNURADIO_RUNTIME_LIBRARIES} - ${Boost_LIBRARIES} - gnss_sdr_flags + PUBLIC + Gnuradio::runtime + channel_fsm + gnss_rx + PRIVATE + Gflags::gflags + Glog::glog + gnss_sdr_flags +) + +set_property(TARGET channel_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/channel/libs/CMakeLists.txt b/src/algorithms/channel/libs/CMakeLists.txt index 70bee59f9..091b2ee38 100644 --- a/src/algorithms/channel/libs/CMakeLists.txt +++ b/src/algorithms/channel/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -26,23 +26,23 @@ set(CHANNEL_FSM_HEADERS channel_msg_receiver_cc.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) - list(SORT CHANNEL_FSM_HEADERS) list(SORT CHANNEL_FSM_SOURCES) -add_library(channel_fsm ${CHANNEL_FSM_SOURCES} ${CHANNEL_FSM_HEADERS}) source_group(Headers FILES ${CHANNEL_FSM_HEADERS}) -add_dependencies(channel_fsm glog-${glog_RELEASE}) -target_link_libraries(channel_fsm gnss_rx) +add_library(channel_fsm ${CHANNEL_FSM_SOURCES} ${CHANNEL_FSM_HEADERS}) + +target_link_libraries(channel_fsm + PUBLIC + gnss_rx + Gnuradio::runtime + PRIVATE + Gflags::gflags + Glog::glog +) + +set_property(TARGET channel_fsm + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/conditioner/adapters/CMakeLists.txt b/src/algorithms/conditioner/adapters/CMakeLists.txt index 38d606824..ee3f854ce 100644 --- a/src/algorithms/conditioner/adapters/CMakeLists.txt +++ b/src/algorithms/conditioner/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -27,21 +27,23 @@ set(COND_ADAPTER_HEADERS array_signal_conditioner.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) - list(SORT COND_ADAPTER_HEADERS) list(SORT COND_ADAPTER_SOURCES) -add_library(conditioner_adapters ${COND_ADAPTER_SOURCES} ${COND_ADAPTER_HEADERS}) source_group(Headers FILES ${COND_ADAPTER_HEADERS}) -add_dependencies(conditioner_adapters glog-${glog_RELEASE}) + +add_library(conditioner_adapters ${COND_ADAPTER_SOURCES} ${COND_ADAPTER_HEADERS}) + +target_link_libraries(conditioner_adapters + PUBLIC + gnss_rx + Gnuradio::runtime + PRIVATE + Gflags::gflags + Glog::glog +) + +set_property(TARGET conditioner_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt index 1977f7a5a..c88b1f473 100644 --- a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -35,30 +35,35 @@ set(DATATYPE_ADAPTER_HEADERS ishort_to_complex.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} -) - list(SORT DATATYPE_ADAPTER_HEADERS) list(SORT DATATYPE_ADAPTER_SOURCES) +source_group(Headers FILES ${DATATYPE_ADAPTER_HEADERS}) + add_library(datatype_adapters ${DATATYPE_ADAPTER_SOURCES} ${DATATYPE_ADAPTER_HEADERS} ) -source_group(Headers FILES ${DATATYPE_ADAPTER_HEADERS}) -add_dependencies(datatype_adapters glog-${glog_RELEASE}) target_link_libraries(datatype_adapters - data_type_gr_blocks - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} + PUBLIC + Gnuradio::blocks + gnss_system_parameters + gnss_rx + data_type_gr_blocks + gnss_sp_libs + PRIVATE + Gflags::gflags + Glog::glog + Volk::volk +) + +target_include_directories(datatype_adapters + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/libs +) + +set_property(TARGET datatype_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt index b4f429db9..252f4490d 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -29,23 +29,26 @@ set(DATA_TYPE_GR_BLOCKS_HEADERS interleaved_byte_to_complex_short.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} -) - list(SORT DATA_TYPE_GR_BLOCKS_HEADERS) list(SORT DATA_TYPE_GR_BLOCKS_SOURCES) +source_group(Headers FILES ${DATA_TYPE_GR_BLOCKS_HEADERS}) + add_library(data_type_gr_blocks ${DATA_TYPE_GR_BLOCKS_SOURCES} ${DATA_TYPE_GR_BLOCKS_HEADERS} ) -source_group(Headers FILES ${DATA_TYPE_GR_BLOCKS_HEADERS}) - target_link_libraries(data_type_gr_blocks - ${GNURADIO_RUNTIME_LIBRARIES} - ${VOLK_LIBRARIES} + PUBLIC + Gnuradio::runtime + Boost::boost + gnss_sp_libs + PRIVATE + Volk::volk +) + +set_property(TARGET data_type_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/input_filter/adapters/CMakeLists.txt b/src/algorithms/input_filter/adapters/CMakeLists.txt index 8153c6c3c..c7a7c68e2 100644 --- a/src/algorithms/input_filter/adapters/CMakeLists.txt +++ b/src/algorithms/input_filter/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -34,36 +34,36 @@ set(INPUT_FILTER_ADAPTER_HEADERS notch_filter_lite.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} -) - -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") - add_definitions(-DGR_GREATER_38=1) -endif() - list(SORT INPUT_FILTER_ADAPTER_HEADERS) list(SORT INPUT_FILTER_ADAPTER_SOURCES) +source_group(Headers FILES ${INPUT_FILTER_ADAPTER_HEADERS}) + add_library(input_filter_adapters ${INPUT_FILTER_ADAPTER_SOURCES} ${INPUT_FILTER_ADAPTER_HEADERS} ) -source_group(Headers FILES ${INPUT_FILTER_ADAPTER_HEADERS}) -add_dependencies(input_filter_adapters glog-${glog_RELEASE} gnss_sp_libs) target_link_libraries(input_filter_adapters - input_filter_gr_blocks - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - gnss_sp_libs + PUBLIC + Gnuradio::blocks + Gnuradio::filter + input_filter_gr_blocks + gnss_sp_libs + gnss_rx + PRIVATE + Volk::volk +) + +target_include_directories(input_filter_adapters + PUBLIC ${CMAKE_SOURCE_DIR}/src/algorithms/libs +) + +if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + target_compile_definitions(input_filter_adapters PUBLIC -DGR_GREATER_38=1) +endif() + +set_property(TARGET input_filter_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt index 8a4aefc11..682c1f01b 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -31,31 +31,27 @@ set(INPUT_FILTER_GR_BLOCKS_HEADERS notch_lite_cc.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${GNURADIO_BLOCKS_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} -) - list(SORT INPUT_FILTER_GR_BLOCKS_HEADERS) list(SORT INPUT_FILTER_GR_BLOCKS_SOURCES) +source_group(Headers FILES ${INPUT_FILTER_GR_BLOCKS_HEADERS}) + add_library(input_filter_gr_blocks ${INPUT_FILTER_GR_BLOCKS_SOURCES} ${INPUT_FILTER_GR_BLOCKS_HEADERS}) -source_group(Headers FILES ${INPUT_FILTER_GR_BLOCKS_HEADERS}) - target_link_libraries(input_filter_gr_blocks - ${GNURADIO_FILTER_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - ${LOG4CPP_LIBRARIES}) + PUBLIC + Gnuradio::blocks + Gnuradio::filter + Volkgnsssdr::volkgnsssdr + PRIVATE + Gflags::gflags + Glog::glog + Log4cpp::log4cpp +) -if(NOT VOLKGNSSSDR_FOUND) - add_dependencies(input_filter_gr_blocks volk_gnsssdr_module glog-${glog_RELEASE}) -else() - add_dependencies(input_filter_gr_blocks glog-${glog_RELEASE}) -endif() +set_property(TARGET input_filter_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 063ec1098..c54f2c2d1 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -92,20 +92,6 @@ if(OPENCL_FOUND) ) endif() -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${GNURADIO_BLOCKS_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} -) if(OPENCL_FOUND) include_directories(${OPENCL_INCLUDE_DIRS}) @@ -116,38 +102,63 @@ if(OPENCL_FOUND) endif() endif() -add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") - list(SORT GNSS_SPLIBS_HEADERS) list(SORT GNSS_SPLIBS_SOURCES) -add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS}) source_group(Headers FILES ${GNSS_SPLIBS_HEADERS}) +add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS}) + target_link_libraries(gnss_sp_libs - ${GNURADIO_RUNTIME_LIBRARIES} - ${VOLK_LIBRARIES} ${ORC_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} - ${GFlags_LIBS} - ${ARMADILLO_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${OPT_LIBRARIES} - gnss_rx + PUBLIC + Boost::boost + Gflags::gflags + Armadillo::armadillo + Gnuradio::runtime + Gnuradio::blocks + Volk::volk ${ORC_LIBRARIES} + Volkgnsssdr::volkgnsssdr + gnss_system_parameters + ${OPT_LIBRARIES} + PRIVATE + Boost::filesystem + Gflags::gflags + Glog::glog + gnss_rx ) -if(NOT VOLKGNSSSDR_FOUND) - add_dependencies(gnss_sp_libs volk_gnsssdr_module - armadillo-${armadillo_RELEASE}) -else() - add_dependencies(gnss_sp_libs armadillo-${armadillo_RELEASE}) -endif() +target_compile_definitions(gnss_sp_libs + PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" +) -if(${GFLAGS_GREATER_20}) - add_definitions(-DGFLAGS_GREATER_2_0=1) -endif() +set_property(TARGET gnss_sp_libs + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) + + +############################################################################### + +source_group(Headers FILES gnss_sdr_flags.h) add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h) -source_group(Headers FILES gnss_sdr_flags.h) -target_link_libraries(gnss_sdr_flags ${GFlags_LIBS}) + +target_link_libraries(gnss_sdr_flags + PUBLIC + Gflags::gflags + PRIVATE + Boost::filesystem +) + +if(${GFLAGS_GREATER_20}) + target_compile_definitions(gnss_sdr_flags PRIVATE -DGFLAGS_GREATER_2_0=1) +endif() + +target_compile_definitions(gnss_sdr_flags + PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" +) + +set_property(TARGET gnss_sdr_flags + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/libs/beidou_b1i_signal_processing.cc b/src/algorithms/libs/beidou_b1i_signal_processing.cc index b04cd9b96..47230943a 100644 --- a/src/algorithms/libs/beidou_b1i_signal_processing.cc +++ b/src/algorithms/libs/beidou_b1i_signal_processing.cc @@ -39,8 +39,8 @@ void beidou_b1i_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shi const unsigned int _code_length = 2046; bool G1[_code_length]; bool G2[_code_length]; - bool G1_register[11] = {0,1,0,1,0,1,0,1,0,1,0}; - bool G2_register[11] = {0,1,0,1,0,1,0,1,0,1,0}; + bool G1_register[11] = {false, true, false, true, false, true, false, true, false, true, false}; + bool G2_register[11] = {false, true, false, true, false, true, false, true, false, true, false}; bool feedback1, feedback2; bool aux; unsigned int lcv, lcv2; @@ -70,7 +70,7 @@ void beidou_b1i_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shi for (lcv = 0; lcv < _code_length; lcv++) { G1[lcv] = G1_register[0]; - G2[lcv] = G2_register[-(phase1[prn_idx] - 11) ] ^ G2_register[-(phase2[prn_idx] - 11) ]; + G2[lcv] = G2_register[-(phase1[prn_idx] - 11)] ^ G2_register[-(phase2[prn_idx] - 11)]; feedback1 = (G1_register[0] + G1_register[1] + G1_register[2] + G1_register[3] + G1_register[4] + G1_register[10]) & 0x1; feedback2 = (G2_register[0] + G2_register[2] + G2_register[3] + G2_register[6] + G2_register[7] + G2_register[8] + G2_register[9] + G2_register[10]) & 0x1; @@ -86,7 +86,7 @@ void beidou_b1i_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shi } /* Set the delay */ - delay = _code_length - delays[prn_idx]*0; //********************************** + delay = _code_length - delays[prn_idx] * 0; //********************************** delay += _chip_shift; delay %= _code_length; @@ -104,7 +104,7 @@ void beidou_b1i_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shi } delay++; -//std::cout << _dest[lcv] << " "; + //std::cout << _dest[lcv] << " "; delay %= _code_length; } } @@ -156,8 +156,8 @@ void beidou_b1i_code_gen_complex_sampled(std::complex* _dest, unsigned in _samplesPerCode = static_cast(static_cast(_fs) / static_cast(_codeFreqBasis / _codeLength)); //--- Find time constants -------------------------------------------------- - _ts = 1.0 / static_cast(_fs); // Sampling period in sec - _tc = 1.0 / static_cast(_codeFreqBasis); // C/A chip period in sec + _ts = 1.0 / static_cast(_fs); // Sampling period in sec + _tc = 1.0 / static_cast(_codeFreqBasis); // C/A chip period in sec beidou_b1i_code_gen_complex(_code, _prn, _chip_shift); //generate C/A code 1 sample per chip for (signed int i = 0; i < _samplesPerCode; i++) diff --git a/src/algorithms/libs/rtklib/CMakeLists.txt b/src/algorithms/libs/rtklib/CMakeLists.txt index 882cd4a81..c1808b1b8 100644 --- a/src/algorithms/libs/rtklib/CMakeLists.txt +++ b/src/algorithms/libs/rtklib/CMakeLists.txt @@ -16,7 +16,6 @@ # along with GNSS-SDR. If not, see . # -add_definitions(-DGNSS_SDR_VERSION="${VERSION}") set(RTKLIB_LIB_SOURCES rtklib_rtkcmn.cc @@ -59,33 +58,30 @@ set(RTKLIB_LIB_HEADERS rtklib.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${Boost_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} -) - list(SORT RTKLIB_LIB_HEADERS) list(SORT RTKLIB_LIB_SOURCES) -add_library(rtklib_lib ${RTKLIB_LIB_SOURCES} ${RTKLIB_LIB_HEADERS}) source_group(Headers FILES ${RTKLIB_LIB_HEADERS}) -add_dependencies(rtklib_lib glog-${glog_RELEASE}) + +add_library(rtklib_lib ${RTKLIB_LIB_SOURCES} ${RTKLIB_LIB_HEADERS}) if(OS_IS_MACOSX) set(MAC_LIBRARIES "-framework Accelerate") endif() -target_link_libraries( - rtklib_lib - ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${BLAS} - ${LAPACK} - ${MAC_LIBRARIES} +target_link_libraries(rtklib_lib + PUBLIC + gnss_rx + gnss_system_parameters + PRIVATE + Gflags::gflags + Glog::glog + ${BLAS} + ${LAPACK} + ${MAC_LIBRARIES} +) + +set_property(TARGET rtklib_lib + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/libs/rtklib/rtklib.h b/src/algorithms/libs/rtklib/rtklib.h index 3a7471e5e..da2644a3a 100644 --- a/src/algorithms/libs/rtklib/rtklib.h +++ b/src/algorithms/libs/rtklib/rtklib.h @@ -223,8 +223,8 @@ const int NSYSQZS = 0; #define ENABDS #ifdef ENABDS -const int MINPRNBDS = 1; //!< min satellite sat number of BeiDou -const int MAXPRNBDS = 35; //!< max satellite sat number of BeiDou +const int MINPRNBDS = 1; //!< min satellite sat number of BeiDou +const int MAXPRNBDS = 35; //!< max satellite sat number of BeiDou const int NSATBDS = (MAXPRNBDS - MINPRNBDS + 1); //!< number of BeiDou satellites const int NSYSBDS = 1; #else diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.cc b/src/algorithms/libs/rtklib/rtklib_conversions.cc index 5dfec8066..0f732e3cd 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.cc +++ b/src/algorithms/libs/rtklib/rtklib_conversions.cc @@ -75,15 +75,15 @@ obsd_t insert_obs_to_rtklib(obsd_t& rtklib_obs, const Gnss_Synchro& gnss_synchro // Mote that BeiDou week numbers do not need adjustment for foreseeable future. Consider change // to more elegant solution -// if(gnss_synchro.System == 'C') -// { -// rtklib_obs.time = bdt2gpst(bdt2time(week, gnss_synchro.RX_time)); -// } -// else -// { -// rtklib_obs.time = gpst2time(adjgpsweek(week), gnss_synchro.RX_time); -// } -// + // if(gnss_synchro.System == 'C') + // { + // rtklib_obs.time = bdt2gpst(bdt2time(week, gnss_synchro.RX_time)); + // } + // else + // { + // rtklib_obs.time = gpst2time(adjgpsweek(week), gnss_synchro.RX_time); + // } + // rtklib_obs.time = gpst2time(adjgpsweek(week), gnss_synchro.RX_time); rtklib_obs.rcv = 1; return rtklib_obs; @@ -245,8 +245,8 @@ eph_t eph_to_rtklib(const Gps_Ephemeris& gps_eph) eph_t eph_to_rtklib(const Beidou_Dnav_Ephemeris& bei_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 = bei_eph.i_satellite_PRN + NSATGPS + NSATGLO + NSATGAL + NSATQZS ; + 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 = bei_eph.i_satellite_PRN + NSATGPS + NSATGLO + NSATGAL + NSATQZS; rtklib_sat.A = bei_eph.d_sqrt_A * bei_eph.d_sqrt_A; rtklib_sat.M0 = bei_eph.d_M_0; rtklib_sat.deln = bei_eph.d_Delta_n; @@ -259,10 +259,10 @@ eph_t eph_to_rtklib(const Beidou_Dnav_Ephemeris& bei_eph) rtklib_sat.Adot = 0; //only in CNAV; rtklib_sat.ndot = 0; //only in CNAV; - rtklib_sat.code = bei_eph.i_sig_type; /*B1I data*/ - rtklib_sat.flag = bei_eph.i_nav_type; /*MEO/IGSO satellite*/ - rtklib_sat.iode=(int32_t)bei_eph.d_AODE; /* AODE */ - rtklib_sat.iodc=(int32_t)bei_eph.d_AODC; /* AODC */ + rtklib_sat.code = bei_eph.i_sig_type; /*B1I data*/ + rtklib_sat.flag = bei_eph.i_nav_type; /*MEO/IGSO satellite*/ + rtklib_sat.iode = static_cast(bei_eph.d_AODE); /* AODE */ + rtklib_sat.iodc = static_cast(bei_eph.d_AODC); /* AODC */ rtklib_sat.week = bei_eph.i_BEIDOU_week; /* week of tow */ rtklib_sat.cic = bei_eph.d_Cic; @@ -285,8 +285,8 @@ eph_t eph_to_rtklib(const Beidou_Dnav_Ephemeris& bei_eph) /* adjustment for week handover */ double tow, toc, toe; tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week); - toc = time2gpst(rtklib_sat.toc, NULL); - toe = time2gpst(rtklib_sat.toe, NULL); + toc = time2gpst(rtklib_sat.toc, nullptr); + toe = time2gpst(rtklib_sat.toe, nullptr); if (rtklib_sat.toes < tow - 302400.0) { @@ -306,7 +306,6 @@ eph_t eph_to_rtklib(const Beidou_Dnav_Ephemeris& bei_eph) } - 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, diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.h b/src/algorithms/libs/rtklib/rtklib_conversions.h index 8f88442ef..de2b7baaf 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.h +++ b/src/algorithms/libs/rtklib/rtklib_conversions.h @@ -31,6 +31,7 @@ #ifndef GNSS_SDR_RTKLIB_CONVERSIONS_H_ #define GNSS_SDR_RTKLIB_CONVERSIONS_H_ +#include "beidou_dnav_ephemeris.h" #include "galileo_almanac.h" #include "galileo_ephemeris.h" #include "glonass_gnav_ephemeris.h" @@ -39,7 +40,6 @@ #include "gps_almanac.h" #include "gps_cnav_ephemeris.h" #include "gps_ephemeris.h" -#include "beidou_dnav_ephemeris.h" #include "rtklib.h" eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph); diff --git a/src/algorithms/libs/rtklib/rtklib_ionex.cc b/src/algorithms/libs/rtklib/rtklib_ionex.cc index 162778f9a..ab02c788f 100644 --- a/src/algorithms/libs/rtklib/rtklib_ionex.cc +++ b/src/algorithms/libs/rtklib/rtklib_ionex.cc @@ -59,6 +59,7 @@ #include "rtklib_ionex.h" #include "rtklib_rtkcmn.h" +#include /* get index -----------------------------------------------------------------*/ int getindex(double value, const double *range) diff --git a/src/algorithms/libs/rtklib/rtklib_lambda.cc b/src/algorithms/libs/rtklib/rtklib_lambda.cc index e96efb39a..c493e05e5 100644 --- a/src/algorithms/libs/rtklib/rtklib_lambda.cc +++ b/src/algorithms/libs/rtklib/rtklib_lambda.cc @@ -52,6 +52,7 @@ #include "rtklib_lambda.h" #include "rtklib_rtkcmn.h" +#include /* LD factorization (Q=L'*diag(D)*L) -----------------------------------------*/ int LD(int n, const double *Q, double *L, double *D) diff --git a/src/algorithms/libs/rtklib/rtklib_pntpos.cc b/src/algorithms/libs/rtklib/rtklib_pntpos.cc index 016037f77..d143cb302 100644 --- a/src/algorithms/libs/rtklib/rtklib_pntpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_pntpos.cc @@ -54,6 +54,7 @@ #include "rtklib_ephemeris.h" #include "rtklib_ionex.h" #include "rtklib_sbas.h" +#include /* pseudorange measurement error variance ------------------------------------*/ double varerr(const prcopt_t *opt, double el, int sys) diff --git a/src/algorithms/libs/rtklib/rtklib_ppp.cc b/src/algorithms/libs/rtklib/rtklib_ppp.cc index 3589ab522..d6bbed928 100644 --- a/src/algorithms/libs/rtklib/rtklib_ppp.cc +++ b/src/algorithms/libs/rtklib/rtklib_ppp.cc @@ -57,6 +57,7 @@ #include "rtklib_rtkcmn.h" #include "rtklib_sbas.h" #include "rtklib_tides.h" +#include /* wave length of LC (m) -----------------------------------------------------*/ double lam_LC(int i, int j, int k) diff --git a/src/algorithms/libs/rtklib/rtklib_preceph.cc b/src/algorithms/libs/rtklib/rtklib_preceph.cc index 72c62fbf1..3c9f34c40 100644 --- a/src/algorithms/libs/rtklib/rtklib_preceph.cc +++ b/src/algorithms/libs/rtklib/rtklib_preceph.cc @@ -62,6 +62,7 @@ #include "rtklib_preceph.h" #include "rtklib_rtkcmn.h" +#include /* satellite code to satellite system ----------------------------------------*/ int code2sys(char code) diff --git a/src/algorithms/libs/rtklib/rtklib_rtcm3.cc b/src/algorithms/libs/rtklib/rtklib_rtcm3.cc index ef11206a5..abda7995f 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtcm3.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtcm3.cc @@ -54,6 +54,7 @@ #include "rtklib_rtcm3.h" #include "rtklib_rtkcmn.h" +#include /* msm signal id table -------------------------------------------------------*/ diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc index 9eea3a0b2..a4a8d2673 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc @@ -52,6 +52,7 @@ #include "rtklib_rtkcmn.h" //#include +#include #include #include #include diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.h b/src/algorithms/libs/rtklib/rtklib_rtkcmn.h index f58e95193..8fbde5a88 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.h +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.h @@ -79,7 +79,7 @@ #define GNSS_SDR_RTKLIB_RTKCMN_H_ #include "rtklib.h" -#include +//#include /* coordinate rotation matrix ------------------------------------------------*/ #define Rx(t, X) \ diff --git a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc index 1634b8fcb..dde3e2a95 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc @@ -57,6 +57,7 @@ #include "rtklib_pntpos.h" #include "rtklib_ppp.h" #include "rtklib_tides.h" +#include static int resamb_WLNL(rtk_t *rtk __attribute((unused)), const obsd_t *obs __attribute((unused)), const int *sat __attribute((unused)), const int *iu __attribute((unused)), const int *ir __attribute((unused)), int ns __attribute__((unused)), const nav_t *nav __attribute((unused)), diff --git a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc index ac047012a..ba21c3359 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc @@ -7,6 +7,7 @@ #include "rtklib_sbas.h" #include "rtklib_solution.h" #include "rtklib_stream.h" +#include /* write solution header to output stream ------------------------------------*/ void writesolhead(stream_t *stream, const solopt_t *solopt) diff --git a/src/algorithms/libs/rtklib/rtklib_sbas.cc b/src/algorithms/libs/rtklib/rtklib_sbas.cc index d4c45aad8..9a780f3ac 100644 --- a/src/algorithms/libs/rtklib/rtklib_sbas.cc +++ b/src/algorithms/libs/rtklib/rtklib_sbas.cc @@ -61,6 +61,7 @@ #include "rtklib_sbas.h" #include "rtklib_rtkcmn.h" +#include /* extract field from line ---------------------------------------------------*/ char *getfield(char *p, int pos) diff --git a/src/algorithms/libs/rtklib/rtklib_solution.cc b/src/algorithms/libs/rtklib/rtklib_solution.cc index e2c19cecd..965166b01 100644 --- a/src/algorithms/libs/rtklib/rtklib_solution.cc +++ b/src/algorithms/libs/rtklib/rtklib_solution.cc @@ -55,6 +55,7 @@ #include "rtklib_rtkcmn.h" #include "rtklib_rtksvr.h" #include +#include /* constants and macros ------------------------------------------------------*/ diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 9b2a0d3e2..53635b2ea 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -50,15 +50,16 @@ * *----------------------------------------------------------------------------*/ +#include "rtklib_stream.h" +#include "rtklib_rtkcmn.h" +#include "rtklib_solution.h" #include #include #include +#include #include #include #include -#include -#include -#include #include #include #include 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 59a8d1ff7..79e64245e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Project setup ######################################################################## -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8.12) set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type: None Debug Release RelWithDebInfo MinSizeRel") project(volk_gnsssdr) enable_language(CXX) @@ -135,7 +135,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 10) +set(VERSION_INFO_MAINT_VERSION 10.git) include(VolkVersion) #setup version info @@ -369,6 +369,10 @@ install( COMPONENT "volk_gnsssdr_devel" ) +install(EXPORT VOLK_GNSSSDR-export FILE VolkGnsssdrTargets.cmake + NAMESPACE VolkGnsssdr:: DESTINATION ${CMAKE_MODULES_DIR}/volk_gnsssdr +) + ######################################################################## # Option to enable QA testing, on by default ######################################################################## diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in index af9e75169..ef8dce6e6 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in @@ -15,33 +15,8 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . -include(FindPkgConfig) -pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr) +get_filename_component(VOLK_GNSSSDR_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) -find_path( - VOLK_GNSSSDR_INCLUDE_DIRS - NAMES volk_gnsssdr/volk_gnsssdr.h - HINTS $ENV{VOLK_DIR}/include - ${PC_VOLK_INCLUDEDIR} - PATHS /usr/local/include - /usr/include - /opt/local/include - "@CMAKE_INSTALL_PREFIX@/include" -) - -find_library( - VOLK_GNSSSDR_LIBRARIES - NAMES volk_gnsssdr - HINTS $ENV{VOLK_DIR}/lib - ${PC_VOLK_LIBDIR} - PATHS /usr/local/lib - /usr/local/lib64 - /usr/lib - /usr/lib64 - /opt/local/lib - "@CMAKE_INSTALL_PREFIX@/lib" -) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) -mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) +if(NOT TARGET VolkGnsssdr::volkgnsssdr) + include("${VOLK_GNSSSDR_CMAKE_DIR}/VolkGnsssdrTargets.cmake") +endif() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/archs.xml b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/archs.xml index 1f741ac02..6d293da91 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/archs.xml +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/archs.xml @@ -6,14 +6,17 @@ -mfloat-abi=softfp + -mfloat-abi=softfp -mfloat-abi=hard + -mfloat-abi=hard -funsafe-math-optimizations + -funsafe-math-optimizations 16 @@ -21,18 +24,22 @@ -mfpu=neon -funsafe-math-optimizations + -mfpu=neon + -funsafe-math-optimizations 16 -funsafe-math-optimizations + -funsafe-math-optimizations 16 -m32 + -m32 diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_kernel_defs.py b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_kernel_defs.py index fb1ae58f9..229d44a7a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_kernel_defs.py +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_kernel_defs.py @@ -53,7 +53,7 @@ def split_into_nested_ifdef_sections(code): header = 'text' in_section_depth = 0 for i, line in enumerate(code.splitlines()): - m = re.match('^(\s*)#(\s*)(\w+)(.*)$', line) + m = re.match(r'^(\s*)#(\s*)(\w+)(.*)$', line) line_is = 'normal' if m: p0, p1, fcn, stuff = m.groups() @@ -121,11 +121,11 @@ def flatten_section_text(sections): class impl_class(object): def __init__(self, kern_name, header, body): #extract LV_HAVE_* - self.deps = set(res.lower() for res in re.findall('LV_HAVE_(\w+)', header)) + self.deps = set(res.lower() for res in re.findall(r'LV_HAVE_(\w+)', header)) #extract function suffix and args body = flatten_section_text(body) try: - fcn_matcher = re.compile('^.*(%s\\w*)\\s*\\((.*)$'%kern_name, re.DOTALL | re.MULTILINE) + fcn_matcher = re.compile(r'^.*(%s\w*)\s*\((.*)$'%kern_name, re.DOTALL | re.MULTILINE) body = body.split('{')[0].rsplit(')', 1)[0] #get the part before the open ){ bracket m = fcn_matcher.match(body) impl_name, the_rest = m.groups() @@ -133,7 +133,7 @@ class impl_class(object): self.args = list() fcn_args = the_rest.split(',') for fcn_arg in fcn_args: - arg_matcher = re.compile('^\s*(.*\\W)\s*(\w+)\s*$', re.DOTALL | re.MULTILINE) + arg_matcher = re.compile(r'^\s*(.*\W)\s*(\w+)\s*$', re.DOTALL | re.MULTILINE) m = arg_matcher.match(fcn_arg) arg_type, arg_name = m.groups() self.args.append((arg_type, arg_name)) @@ -153,7 +153,7 @@ def extract_lv_haves(code): haves = list() for line in code.splitlines(): if not line.strip().startswith('#'): continue - have_set = set(res.lower() for res in re.findall('LV_HAVE_(\w+)', line)) + have_set = set(res.lower() for res in re.findall(r'LV_HAVE_(\w+)', line)) if have_set: haves.append(have_set) return haves 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 48c012c09..5211c1cf5 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 @@ -254,6 +254,8 @@ if(NOT CPU_IS_x86) overrule_arch(sse4_1 "Architecture is not x86 or x86_64") overrule_arch(sse4_2 "Architecture is not x86 or x86_64") overrule_arch(avx "Architecture is not x86 or x86_64") + overrule_arch(avx512f "Architecture is not x86 or x86_64") + overrule_arch(avx512cd "Architecture is not x86 or x86_64") endif() ######################################################################## @@ -477,7 +479,7 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9") endforeach() endif() enable_language(ASM) - set(CMAKE_ASM_FLAGS ${ARCH_ASM_FLAGS}) + set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${ARCH_ASM_FLAGS}") message(STATUS "c flags: ${FULL_C_FLAGS}") message(STATUS "asm flags: ${CMAKE_ASM_FLAGS}") endforeach() @@ -567,71 +569,67 @@ if(MSVC) set_source_files_properties(${volk_gnsssdr_sources} PROPERTIES LANGUAGE CXX) endif() -#Use object library for faster overall build in newer versions of cmake -if(CMAKE_VERSION VERSION_GREATER "2.8.7") - #Create a volk_gnsssdr object library (requires cmake >= 2.8.8) - add_library(volk_gnsssdr_obj OBJECT ${volk_gnsssdr_sources}) +#Create a volk_gnsssdr object library +add_library(volk_gnsssdr_obj OBJECT ${volk_gnsssdr_sources}) +target_include_directories(volk_gnsssdr_obj + PUBLIC $ + PUBLIC $ + PUBLIC $ + PRIVATE ${PROJECT_SOURCE_DIR}/kernels + PRIVATE ${CMAKE_CURRENT_BINARY_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} +) - #Add dynamic library - add_library(volk_gnsssdr SHARED $) - target_link_libraries(volk_gnsssdr ${volk_gnsssdr_libraries} ${Boost_LIBRARIES}) +#Add dynamic library +add_library(volk_gnsssdr SHARED $) +target_link_libraries(volk_gnsssdr ${volk_gnsssdr_libraries} m) +target_include_directories(volk_gnsssdr + PUBLIC $ + PUBLIC $ + PUBLIC $ + PRIVATE ${PROJECT_SOURCE_DIR}/kernels + PRIVATE ${CMAKE_CURRENT_BINARY_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} +) - #Configure target properties - set_target_properties(volk_gnsssdr_obj PROPERTIES COMPILE_FLAGS "-fPIC") - set_target_properties(volk_gnsssdr PROPERTIES SOVERSION ${LIBVER}) - set_target_properties(volk_gnsssdr PROPERTIES DEFINE_SYMBOL "volk_gnsssdr_EXPORTS") +#Configure target properties +set_target_properties(volk_gnsssdr_obj PROPERTIES COMPILE_FLAGS "-fPIC") +set_target_properties(volk_gnsssdr PROPERTIES SOVERSION ${LIBVER}) +set_target_properties(volk_gnsssdr PROPERTIES DEFINE_SYMBOL "volk_gnsssdr_EXPORTS") - #Install locations - install(TARGETS volk_gnsssdr - LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_runtime" # .so file - ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file - RUNTIME DESTINATION bin COMPONENT "volk_gnsssdr_runtime" # .dll file +#Install locations +install(TARGETS volk_gnsssdr + EXPORT VOLK_GNSSSDR-export + LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_runtime" # .so file + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file + RUNTIME DESTINATION bin COMPONENT "volk_gnsssdr_runtime" # .dll file +) + +#Configure static library +if(ENABLE_STATIC_LIBS) + add_library(volk_gnsssdr_static STATIC $) + target_link_libraries(volk_gnsssdr_static ${volk_gnsssdr_libraries} pthread m) + target_include_directories(volk_gnsssdr_static + PUBLIC $ + PUBLIC $ + PUBLIC $ + PRIVATE ${PROJECT_SOURCE_DIR}/kernels + PRIVATE ${CMAKE_CURRENT_BINARY_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) - #Configure static library - if(ENABLE_STATIC_LIBS) - add_library(volk_gnsssdr_static STATIC $) - - set_target_properties(volk_gnsssdr_static PROPERTIES OUTPUT_NAME volk_gnsssdr) - - install(TARGETS volk_gnsssdr_static - ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" - ) - endif() - -#Older cmake versions (slower to build when building dynamic/static libs) -else() - #create the volk_gnsssdr runtime library - add_library(volk_gnsssdr SHARED ${volk_gnsssdr_sources}) - target_link_libraries(volk_gnsssdr ${volk_gnsssdr_libraries}) - set_target_properties(volk_gnsssdr PROPERTIES SOVERSION ${LIBVER}) - set_target_properties(volk_gnsssdr PROPERTIES DEFINE_SYMBOL "volk_gnsssdr_EXPORTS") - - install(TARGETS volk_gnsssdr - LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_runtime" # .so file - ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file - RUNTIME DESTINATION bin COMPONENT "volk_gnsssdr_runtime" # .dll file + install(TARGETS volk_gnsssdr_static + EXPORT VOLK_GNSSSDR-export + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" ) - if(ENABLE_STATIC_LIBS) - add_library(volk_gnsssdr_static STATIC ${volk_gnsssdr_sources}) - - if(NOT WIN32) - set_target_properties(volk_gnsssdr_static - PROPERTIES OUTPUT_NAME volk_gnsssdr) - endif() - - install(TARGETS volk_gnsssdr_static - ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file - ) - endif() + set_target_properties(volk_gnsssdr_static PROPERTIES OUTPUT_NAME volk_gnsssdr) endif() ######################################################################## # Build the QA test application ######################################################################## if(ENABLE_TESTING) - #include Boost headers include_directories(${Boost_INCLUDE_DIRS}) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.unittest) @@ -645,11 +643,11 @@ if(ENABLE_TESTING) SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/testqa.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_utils.cc TARGET_DEPS volk_gnsssdr - ) + ) + foreach(kernel ${h_files}) get_filename_component(kernel ${kernel} NAME) string(REPLACE ".h" "" kernel ${kernel}) volk_add_test(${kernel} "volk_gnsssdr_test_all") endforeach() - endif() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/cfg.py b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/cfg.py index e4f12a62c..26ffc790a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/cfg.py +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/cfg.py @@ -29,7 +29,7 @@ from six.moves import configparser, input class volk_gnsssdr_modtool_config(object): def key_val_sub(self, num, stuff, section): - return re.sub('\$' + 'k' + str(num), stuff[num][0], (re.sub('\$' + str(num), stuff[num][1], section[1][num]))); + return re.sub(r'\$' + 'k' + str(num), stuff[num][0], (re.sub(r'\$' + str(num), stuff[num][1], section[1][num]))); def verify(self): for i in self.verification: @@ -95,4 +95,3 @@ class volk_gnsssdr_modtool_config(object): for i in stuff: retval[i[0]] = i[1] return retval - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/volk_gnsssdr_modtool_generate.py b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/volk_gnsssdr_modtool_generate.py index df613a938..35905ad15 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/volk_gnsssdr_modtool_generate.py +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/volk_gnsssdr_modtool_generate.py @@ -28,13 +28,13 @@ class volk_gnsssdr_modtool(object): def __init__(self, cfg): self.volk_gnsssdr = re.compile('volk_gnsssdr'); self.remove_after_underscore = re.compile("_.*"); - self.volk_gnsssdr_run_tests = re.compile('^\s*VOLK_RUN_TESTS.*\n', re.MULTILINE); - self.volk_gnsssdr_profile = re.compile('^\s*(VOLK_PROFILE|VOLK_PUPPET_PROFILE).*\n', re.MULTILINE); + self.volk_gnsssdr_run_tests = re.compile(r'^\s*VOLK_RUN_TESTS.*\n', re.MULTILINE); + self.volk_gnsssdr_profile = re.compile(r'^\s*(VOLK_PROFILE|VOLK_PUPPET_PROFILE).*\n', re.MULTILINE); self.my_dict = cfg; - self.lastline = re.compile('\s*char path\[1024\];.*'); - self.badassert = re.compile('^\s*assert\(toked\[0\] == "volk_gnsssdr_.*\n', re.MULTILINE); + self.lastline = re.compile(r'\s*char path\[1024\];.*'); + self.badassert = re.compile(r'^\s*assert\(toked\[0\] == "volk_gnsssdr_.*\n', re.MULTILINE); self.goodassert = ' assert(toked[0] == "volk_gnsssdr");\n' - self.baderase = re.compile('^\s*toked.erase\(toked.begin\(\)\);.*\n', re.MULTILINE); + self.baderase = re.compile(r'^\s*toked.erase\(toked.begin\(\)\);.*\n', re.MULTILINE); self.gooderase = ' toked.erase(toked.begin());\n toked.erase(toked.begin());\n'; def get_basename(self, base=None): @@ -65,7 +65,7 @@ class volk_gnsssdr_modtool(object): for line in hdr_files: - subline = re.search(".*\.h.*", os.path.basename(line)) + subline = re.search(r".*\.h.*", os.path.basename(line)) if subline: subsubline = begins.search(subline.group(0)); if subsubline: @@ -81,7 +81,7 @@ class volk_gnsssdr_modtool(object): for dt in datatypes: if dt in line: #subline = re.search("(?<=volk_gnsssdr_)" + dt + ".*(?=\.h)", line); - subline = re.search(begins.pattern[:-2] + dt + ".*(?=\.h)", line); + subline = re.search(begins.pattern[:-2] + dt + r".*(?=\.h)", line); if subline: functions.append(subline.group(0)); @@ -188,8 +188,8 @@ class volk_gnsssdr_modtool(object): inpath = os.path.abspath(base); kernel = re.compile(name) search_kernels = set([kernel]) - profile = re.compile('^\s*VOLK_PROFILE') - puppet = re.compile('^\s*VOLK_PUPPET') + profile = re.compile(r'^\s*VOLK_PROFILE') + puppet = re.compile(r'^\s*VOLK_PUPPET') src_dest = os.path.join(inpath, 'apps/', top[:-1] + '_profile.cc'); infile = open(src_dest); otherlines = infile.readlines(); @@ -257,8 +257,8 @@ class volk_gnsssdr_modtool(object): kernel = re.compile(name) search_kernels = set([kernel]) - profile = re.compile('^\s*VOLK_PROFILE') - puppet = re.compile('^\s*VOLK_PUPPET') + profile = re.compile(r'^\s*VOLK_PROFILE') + puppet = re.compile(r'^\s*VOLK_PUPPET') infile = open(os.path.join(inpath, 'apps/', oldvolk_gnsssdr.pattern + '_profile.cc')); otherinfile = open(os.path.join(self.my_dict['destination'], 'volk_gnsssdr_' + self.my_dict['name'], 'apps/volk_gnsssdr_' + self.my_dict['name'] + '_profile.cc')); dest = os.path.join(self.my_dict['destination'], 'volk_gnsssdr_' + self.my_dict['name'], 'apps/volk_gnsssdr_' + self.my_dict['name'] + '_profile.cc'); diff --git a/src/algorithms/observables/adapters/CMakeLists.txt b/src/algorithms/observables/adapters/CMakeLists.txt index ef0df1d7d..4ef4fd054 100644 --- a/src/algorithms/observables/adapters/CMakeLists.txt +++ b/src/algorithms/observables/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -24,19 +24,26 @@ set(OBS_ADAPTER_HEADERS hybrid_observables.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) +source_group(Headers FILES ${OBS_ADAPTER_HEADERS}) add_library(obs_adapters ${OBS_ADAPTER_SOURCES} ${OBS_ADAPTER_HEADERS}) -source_group(Headers FILES ${OBS_ADAPTER_HEADERS}) -target_link_libraries(obs_adapters obs_gr_blocks ${GNURADIO_RUNTIME_LIBRARIES}) + +target_include_directories(obs_adapters + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/libs +) + +target_link_libraries(obs_adapters + PUBLIC + obs_gr_blocks + gnss_rx + gnss_sp_libs + PRIVATE + Gflags::gflags + Glog::glog +) + +set_property(TARGET obs_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index e829c474d..c937ec741 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -24,42 +24,29 @@ set(OBS_GR_BLOCKS_HEADERS hybrid_observables_cc.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} -) +source_group(Headers FILES ${OBS_GR_BLOCKS_HEADERS}) add_library(obs_gr_blocks ${OBS_GR_BLOCKS_SOURCES} ${OBS_GR_BLOCKS_HEADERS}) -source_group(Headers FILES ${OBS_GR_BLOCKS_HEADERS}) - -if(MATIO_FOUND) - add_dependencies(obs_gr_blocks - gnss_sp_libs - glog-${glog_RELEASE} - armadillo-${armadillo_RELEASE} - ) -else() - add_dependencies(obs_gr_blocks - gnss_sp_libs - glog-${glog_RELEASE} - armadillo-${armadillo_RELEASE} - matio-${GNSSSDR_MATIO_LOCAL_VERSION} - ) -endif() +target_include_directories(obs_gr_blocks + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/libs +) target_link_libraries(obs_gr_blocks - gnss_sp_libs - ${GNURADIO_RUNTIME_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${MATIO_LIBRARIES} + PUBLIC + Boost::boost + Gnuradio::blocks + gnss_system_parameters + PRIVATE + Gflags::gflags + Glog::glog + Boost::filesystem + Matio::matio + gnss_sp_libs +) + +set_property(TARGET obs_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/resampler/adapters/CMakeLists.txt b/src/algorithms/resampler/adapters/CMakeLists.txt index 07e8ddc74..7c702aa47 100644 --- a/src/algorithms/resampler/adapters/CMakeLists.txt +++ b/src/algorithms/resampler/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -27,28 +27,32 @@ set(RESAMPLER_ADAPTER_HEADERS mmse_resampler_conditioner.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/gnuradio_blocks - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} -) - -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") - add_definitions(-DGR_GREATER_38=1) -endif() - list(SORT RESAMPLER_ADAPTER_HEADERS) list(SORT RESAMPLER_ADAPTER_SOURCES) +source_group(Headers FILES ${RESAMPLER_ADAPTER_HEADERS}) + add_library(resampler_adapters ${RESAMPLER_ADAPTER_SOURCES} ${RESAMPLER_ADAPTER_HEADERS} ) -source_group(Headers FILES ${RESAMPLER_ADAPTER_HEADERS}) +target_link_libraries(resampler_adapters + PUBLIC + Gnuradio::runtime + resampler_gr_blocks + gnss_rx + PRIVATE + Gflags::gflags + Glog::glog + Volk::volk +) -target_link_libraries(resampler_adapters resampler_gr_blocks) +if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + target_compile_definitions(resampler_adapters PUBLIC -DGR_GREATER_38=1) +endif() + +set_property(TARGET resampler_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt index ae570d644..5b4c38b99 100644 --- a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -29,22 +29,26 @@ set(RESAMPLER_GR_BLOCKS_HEADERS direct_resampler_conditioner_cb.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} -) - list(SORT RESAMPLER_GR_BLOCKS_HEADERS) list(SORT RESAMPLER_GR_BLOCKS_SOURCES) +source_group(Headers FILES ${RESAMPLER_GR_BLOCKS_HEADERS}) + add_library(resampler_gr_blocks ${RESAMPLER_GR_BLOCKS_SOURCES} ${RESAMPLER_GR_BLOCKS_HEADERS} ) -source_group(Headers FILES ${RESAMPLER_GR_BLOCKS_HEADERS}) +target_link_libraries(resampler_gr_blocks + PUBLIC + Gnuradio::runtime + Volk::volk + PRIVATE + Gflags::gflags + Glog::glog +) -add_dependencies(resampler_gr_blocks glog-${glog_RELEASE}) +set_property(TARGET resampler_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/signal_generator/adapters/CMakeLists.txt b/src/algorithms/signal_generator/adapters/CMakeLists.txt index fe793203b..f82258f93 100644 --- a/src/algorithms/signal_generator/adapters/CMakeLists.txt +++ b/src/algorithms/signal_generator/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -19,29 +19,26 @@ set(SIGNAL_GENERATOR_ADAPTER_SOURCES signal_generator.cc) set(SIGNAL_GENERATOR_ADAPTER_HEADERS signal_generator.h) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_generator/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) +source_group(Headers FILES ${SIGNAL_GENERATOR_ADAPTER_HEADERS}) add_library(signal_generator_adapters ${SIGNAL_GENERATOR_ADAPTER_SOURCES} ${SIGNAL_GENERATOR_ADAPTER_HEADERS} ) -source_group(Headers FILES ${SIGNAL_GENERATOR_ADAPTER_HEADERS}) - target_link_libraries(signal_generator_adapters - gnss_sp_libs - signal_generator_blocks - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} + PUBLIC + signal_generator_blocks + Gnuradio::runtime + Gnuradio::blocks + gnss_rx + PRIVATE + Gflags::gflags + Glog::glog + gnss_sp_libs +) + +set_property(TARGET signal_generator_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/signal_generator/adapters/signal_generator.cc b/src/algorithms/signal_generator/adapters/signal_generator.cc index 19db5e91d..91536357a 100644 --- a/src/algorithms/signal_generator/adapters/signal_generator.cc +++ b/src/algorithms/signal_generator/adapters/signal_generator.cc @@ -31,11 +31,11 @@ #include "signal_generator.h" +#include "Beidou_B1I.h" #include "GLONASS_L1_L2_CA.h" #include "GPS_L1_CA.h" #include "Galileo_E1.h" #include "Galileo_E5a.h" -#include "Beidou_B1I.h" #include "configuration_interface.h" #include #include diff --git a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt index 30ab655e1..8d82e6ee6 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -19,36 +19,29 @@ set(SIGNAL_GENERATOR_BLOCK_SOURCES signal_generator_c.cc) set(SIGNAL_GENERATOR_BLOCK_HEADERS signal_generator_c.h) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} -) +source_group(Headers FILES ${SIGNAL_GENERATOR_BLOCK_HEADERS}) add_library(signal_generator_blocks ${SIGNAL_GENERATOR_BLOCK_SOURCES} ${SIGNAL_GENERATOR_BLOCK_HEADERS} ) -source_group(Headers FILES ${SIGNAL_GENERATOR_BLOCK_HEADERS}) - target_link_libraries(signal_generator_blocks - gnss_system_parameters - gnss_sp_libs - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - ${ORC_LIBRARIES} + PUBLIC + Boost::boost + Gnuradio::runtime + gnss_system_parameters + PRIVATE + gnss_sp_libs + Volkgnsssdr::volkgnsssdr ) -if(VOLKGNSSSDR_FOUND) - # add_dependencies(signal_generator_blocks glog-${glog_RELEASE}) -else() - add_dependencies(signal_generator_blocks volk_gnsssdr_module) -endif() +target_include_directories(signal_generator_blocks + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/libs +) + +set_property(TARGET signal_generator_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h index d47fc558b..0c412432d 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h +++ b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h @@ -33,7 +33,6 @@ #include "gnss_signal.h" #include -//#include #include #include #include diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index 6674cd853..66b580ff3 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -19,20 +19,13 @@ # Optional drivers -if(ENABLE_RAW_UDP) - find_package(PCAP) - if(NOT PCAP_FOUND) - message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)") - endif() - get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS}) +if(ENABLE_RAW_UDP AND PCAP_FOUND) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} custom_udp_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} custom_udp_signal_source.h) endif() + if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) - find_package(GRIIO REQUIRED) if(NOT GRIIO_FOUND) message(STATUS "gnuradio-iio not found, its installation is required.") message(STATUS "Please build and install the following projects:") @@ -41,12 +34,10 @@ if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled.") endif() - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) endif() + if(ENABLE_AD9361) - find_package(LIBIIO REQUIRED) if(NOT LIBIIO_FOUND) message(STATUS "libiio not found, its installation is required.") message(STATUS "Please build and install the following projects:") @@ -55,8 +46,6 @@ if(ENABLE_AD9361) message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled.") endif() - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) endif() @@ -97,33 +86,16 @@ if(ENABLE_GN3S) ############################################## # GN3S (USB dongle) ############################################## - find_package(GRGN3S REQUIRED) if(NOT GRGN3S_FOUND) message(" gr-gn3s not found, install it from https://github.com/gnss-sdr/gr-gn3s ") message(FATAL_ERROR "gr-gn3s required for building gnss-sdr with this option enabled") endif() - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_GN3S_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_GN3S_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gn3s_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gn3s_signal_source.h) endif() -if(ENABLE_FLEXIBAND) - ############################################## - # TELEORBIT FLEXIBAND FRONTEND ADAPTER - ############################################## - find_package(TELEORBIT REQUIRED) - if(NOT TELEORBIT_FOUND) - message(FATAL_ERROR "Teleorbit Flexiband GNU Radio driver required to build gnss-sdr with the optional FLEXIBAND adapter") - endif() - # Set up variables - set(FLEXIBAND_DRIVER_INCLUDE_DIRS - ${OPT_DRIVER_INCLUDE_DIRS} - ${TELEORBIT_INCLUDE_DIR}/teleorbit - ) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${TELEORBIT_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${FLEXIBAND_DRIVER_INCLUDE_DIRS}) +if(ENABLE_FLEXIBAND AND TELEORBIT_FOUND) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} flexiband_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} flexiband_signal_source.h) endif() @@ -133,7 +105,6 @@ if(ENABLE_ARRAY) ############################################## # DBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE ############################################## - find_package(GRDBFCTTC REQUIRED) if(NOT GRDBFCTTC_FOUND) message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc ") message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled") @@ -154,15 +125,8 @@ if(ENABLE_OSMOSDR) list(REMOVE_ITEM SIGNAL_SOURCE_ADAPTER_HEADERS ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters/osmosdr_signal_source.h) endif() else() - # set OSMO include dirs - set(OSMO_DRIVER_INCLUDE_DIRS - ${OPT_DRIVER_INCLUDE_DIRS} - ${GROSMOSDR_INCLUDE_DIR}/osmosdr - ) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} osmosdr_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} osmosdr_signal_source.h) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GROSMOSDR_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${OSMO_DRIVER_INCLUDE_DIRS}) endif() endif() @@ -170,8 +134,6 @@ endif() if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} uhd_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} uhd_signal_source.h) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${UHD_INCLUDE_DIRS}) endif() @@ -197,7 +159,6 @@ set(SIGNAL_SOURCE_ADAPTER_HEADERS ${OPT_DRIVER_HEADERS} ) - if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) set(SIGNAL_SOURCE_ADAPTER_SOURCES ${SIGNAL_SOURCE_ADAPTER_SOURCES} two_bit_cpx_file_signal_source.cc @@ -207,36 +168,90 @@ if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) two_bit_packed_file_signal_source.h) endif() -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${OPT_DRIVER_INCLUDE_DIRS} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} -) - -if(ARCH_64BITS) - add_definitions(-DARCH_64BITS=1) -endif() - -add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") - list(SORT SIGNAL_SOURCE_ADAPTER_HEADERS) list(SORT SIGNAL_SOURCE_ADAPTER_SOURCES) -add_library(signal_source_adapters ${SIGNAL_SOURCE_ADAPTER_SOURCES} ${SIGNAL_SOURCE_ADAPTER_HEADERS}) source_group(Headers FILES ${SIGNAL_SOURCE_ADAPTER_HEADERS}) -target_link_libraries(signal_source_adapters signal_source_gr_blocks - ${Boost_LIBRARIES} - ${GNURADIO_PMT_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${OPT_LIBRARIES} - gnss_sp_libs + +add_library(signal_source_adapters + ${SIGNAL_SOURCE_ADAPTER_SOURCES} + ${SIGNAL_SOURCE_ADAPTER_HEADERS} +) + +target_include_directories(signal_source_adapters + PUBLIC ${CMAKE_SOURCE_DIR}/src/algorithms/libs +) + +target_link_libraries(signal_source_adapters + PUBLIC + Boost::boost + Gnuradio::runtime + Gnuradio::blocks + signal_source_gr_blocks + gnss_sp_libs + gnss_rx + signal_source_lib + PRIVATE + Gflags::gflags + Glog::glog + Volk::volk +) + +if(ENABLE_RAW_UDP AND PCAP_FOUND) + target_link_libraries(signal_source_adapters + PRIVATE + Pcap::pcap + ) +endif() + +if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) + target_link_libraries(signal_source_adapters + PUBLIC + Gnuradio::uhd + PRIVATE + Uhd::uhd + ) +endif() + +if(ENABLE_OSMOSDR AND GROSMOSDR_FOUND) + target_link_libraries(signal_source_adapters + PUBLIC + Gnuradio::osmosdr + ) +endif() + +if(ENABLE_AD9361 AND LIBIIO_FOUND) + target_link_libraries(signal_source_adapters + PRIVATE + Iio::iio + ) +endif() + +if(ENABLE_FLEXIBAND AND TELEORBIT_FOUND) + target_link_libraries(signal_source_adapters + PRIVATE + Gnuradio::teleorbit + ) +endif() + +if(ENABLE_GN3S AND GRGN3S_FOUND) + target_link_libraries(signal_source_adapters + PRIVATE + Gnuradio::gn3s + ) +endif() + +if(ENABLE_ARRAY AND GRDBFCTTC_FOUND) + target_link_libraries(signal_source_adapters + PRIVATE + Gnuradio::dbfcttc + ) +endif() + +target_compile_definitions(signal_source_adapters + PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" +) + +set_property(TARGET signal_source_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc index 5166840f5..85f1a562f 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc @@ -48,10 +48,10 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, unsigned int out_stream, - boost::shared_ptr queue) : role_(std::move(role)), + boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), - queue_(queue) + queue_(std::move(std::move(queue))) { // DUMP PARAMETERS std::string empty = ""; diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index fb94ec51c..d83fd26d5 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -17,14 +17,7 @@ # -if(ENABLE_RAW_UDP) - find_package(PCAP) - if(NOT PCAP_FOUND) - message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source") - endif() - get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS}) +if(ENABLE_RAW_UDP AND PCAP_FOUND) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gr_complex_ip_packet_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gr_complex_ip_packet_source.h) endif() @@ -55,32 +48,33 @@ set(SIGNAL_SOURCE_GR_BLOCKS_HEADERS ${OPT_DRIVER_HEADERS} ) - -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${OPT_DRIVER_INCLUDE_DIRS} -) - list(SORT SIGNAL_SOURCE_GR_BLOCKS_HEADERS) list(SORT SIGNAL_SOURCE_GR_BLOCKS_SOURCES) +source_group(Headers FILES ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS}) + add_library(signal_source_gr_blocks ${SIGNAL_SOURCE_GR_BLOCKS_SOURCES} ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS} ) -source_group(Headers FILES ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS}) - target_link_libraries(signal_source_gr_blocks - signal_source_lib - ${GNURADIO_RUNTIME_LIBRARIES} - ${Boost_LIBRARIES} - ${OPT_LIBRARIES} + PUBLIC + signal_source_lib + Gnuradio::runtime + Boost::thread + PRIVATE + Gflags::gflags + Glog::glog ) -add_dependencies(signal_source_gr_blocks glog-${glog_RELEASE}) +if(ENABLE_RAW_UDP AND PCAP_FOUND) + target_link_libraries(signal_source_gr_blocks + PUBLIC + Pcap::pcap + ) +endif() + +set_property(TARGET signal_source_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index f43f3e90c..5e40880a5 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -333,7 +333,7 @@ int rtl_tcp_signal_source_c::work(int noutput_items, gr_vector_const_void_star & /*input_items*/, gr_vector_void_star &output_items) { - gr_complex *out = reinterpret_cast(output_items[0]); + auto *out = reinterpret_cast(output_items[0]); int i = 0; if (io_service_.stopped()) { diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h index b2148b23b..e91fefd2d 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h @@ -39,7 +39,7 @@ * * Value_0, Value_1, Value_2, ..., Value_n, Value_n+1, Value_n+2, ... * - * \author Cillian O'Driscoll cillian.odriscoll (at) gmail . com + * \author Cillian O'Driscoll cillian.odriscoll (at) gmail . com * ------------------------------------------------------------------------- * * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index 3f2a6bbe5..39a507961 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -17,36 +17,25 @@ # if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) - find_package(GRIIO REQUIRED) - if(NOT GRIIO_FOUND) - message(STATUS "gnuradio-iio not found, its installation is required.") - message(STATUS "Please build and install the following projects:") - message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") - message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") - message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") - message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled") - endif() - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) + if(NOT GRIIO_FOUND) + message(STATUS "gnuradio-iio not found, its installation is required.") + message(STATUS "Please build and install the following projects:") + message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") + message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") + message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") + message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled") + endif() endif() if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) - find_package(LIBIIO REQUIRED) - if(NOT LIBIIO_FOUND) - message(STATUS "libiio not found, its installation is required.") - message(STATUS "Please build and install the following projects:") - message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") - message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") - message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") - message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled") - endif() - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) - - ############################################### - # FMCOMMS2 based SDR Hardware - ############################################### - if(LIBIIO_FOUND) + if(NOT LIBIIO_FOUND) + message(STATUS "libiio not found, its installation is required.") + message(STATUS "Please build and install the following projects:") + message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") + message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") + message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") + message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled") + else() set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) set(OPT_SIGNAL_SOURCE_LIB_HEADERS ad9361_manager.h) endif() @@ -57,14 +46,6 @@ if(ENABLE_FPGA OR ENABLE_AD9361) set(OPT_SIGNAL_SOURCE_LIB_HEADERS ${OPT_SIGNAL_SOURCE_LIB_HEADERS} fpga_switch.h) endif() -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${OPT_DRIVER_INCLUDE_DIRS} -) - set(SIGNAL_SOURCE_LIB_SOURCES rtl_tcp_commands.cc rtl_tcp_dongle_info.cc @@ -80,7 +61,34 @@ set(SIGNAL_SOURCE_LIB_HEADERS list(SORT SIGNAL_SOURCE_LIB_HEADERS) list(SORT SIGNAL_SOURCE_LIB_SOURCES) -add_library(signal_source_lib ${SIGNAL_SOURCE_LIB_SOURCES} ${SIGNAL_SOURCE_LIB_HEADERS}) source_group(Headers FILES ${SIGNAL_SOURCE_LIB_HEADERS}) -target_link_libraries(signal_source_lib ${OPT_LIBRARIES}) -add_dependencies(signal_source_lib glog-${glog_RELEASE}) + +add_library(signal_source_lib ${SIGNAL_SOURCE_LIB_SOURCES} ${SIGNAL_SOURCE_LIB_HEADERS}) + +target_link_libraries(signal_source_lib + PUBLIC + Boost::boost + PRIVATE + Gflags::gflags + Glog::glog +) + +if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) + target_link_libraries(signal_source_lib + PUBLIC + Gnuradio::iio + PRIVATE + Iio::iio + ) +endif() + +if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) + target_link_libraries(signal_source_lib + PUBLIC + Iio::iio + ) +endif() + +set_property(TARGET signal_source_lib APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc b/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc index fab664d28..6ad323015 100644 --- a/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc +++ b/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc @@ -121,7 +121,7 @@ double rtl_tcp_dongle_info::clip_gain(int gain) const } // clip - if (gains.size() == 0) + if (gains.empty()) { // no defined gains to clip to return gain; diff --git a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt index 62874896e..8d2723a50 100644 --- a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -43,32 +43,29 @@ set(TELEMETRY_DECODER_ADAPTER_HEADERS beidou_b3i_telemetry_decoder.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) - list(SORT TELEMETRY_DECODER_ADAPTER_HEADERS) list(SORT TELEMETRY_DECODER_ADAPTER_SOURCES) +source_group(Headers FILES ${TELEMETRY_DECODER_ADAPTER_HEADERS}) + add_library(telemetry_decoder_adapters ${TELEMETRY_DECODER_ADAPTER_SOURCES} ${TELEMETRY_DECODER_ADAPTER_HEADERS} ) -source_group(Headers FILES ${TELEMETRY_DECODER_ADAPTER_HEADERS}) - target_link_libraries(telemetry_decoder_adapters + PUBLIC telemetry_decoder_gr_blocks gnss_system_parameters - ${GNURADIO_RUNTIME_LIBRARIES} + gnss_rx + PRIVATE + Gflags::gflags + Glog::glog + Gnuradio::runtime + telemetry_decoder_lib +) + +set_property(TARGET telemetry_decoder_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/telemetry_decoder/adapters/beidou_b1i_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/beidou_b1i_telemetry_decoder.cc index fa231eb29..a29fdcc01 100644 --- a/src/algorithms/telemetry_decoder/adapters/beidou_b1i_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/beidou_b1i_telemetry_decoder.cc @@ -31,19 +31,19 @@ #include "beidou_b1i_telemetry_decoder.h" -#include "configuration_interface.h" -#include -#include #include "beidou_dnav_almanac.h" #include "beidou_dnav_ephemeris.h" #include "beidou_dnav_iono.h" #include "beidou_dnav_utc_model.h" +#include "configuration_interface.h" +#include +#include using google::LogMessage; BeidouB1iTelemetryDecoder::BeidouB1iTelemetryDecoder(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), @@ -68,9 +68,7 @@ BeidouB1iTelemetryDecoder::BeidouB1iTelemetryDecoder(ConfigurationInterface* con } -BeidouB1iTelemetryDecoder::~BeidouB1iTelemetryDecoder() -{ -} +BeidouB1iTelemetryDecoder::~BeidouB1iTelemetryDecoder() = default; void BeidouB1iTelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) diff --git a/src/algorithms/telemetry_decoder/adapters/beidou_b1i_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/beidou_b1i_telemetry_decoder.h index 6e05c3975..2deb50c27 100644 --- a/src/algorithms/telemetry_decoder/adapters/beidou_b1i_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/beidou_b1i_telemetry_decoder.h @@ -34,9 +34,9 @@ #ifndef GNSS_SDR_BEIDOU_B1I_TELEMETRY_DECODER_H_ #define GNSS_SDR_BEIDOU_B1I_TELEMETRY_DECODER_H_ +#include "beidou_b1i_telemetry_decoder_cc.h" #include "telemetry_decoder_interface.h" #include -#include "beidou_b1i_telemetry_decoder_cc.h" class ConfigurationInterface; @@ -47,7 +47,7 @@ class BeidouB1iTelemetryDecoder : public TelemetryDecoderInterface { public: BeidouB1iTelemetryDecoder(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, unsigned int out_streams); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index fb5a1d414..a270ebdd9 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -37,40 +37,34 @@ set(TELEMETRY_DECODER_GR_BLOCKS_HEADERS glonass_l2_ca_telemetry_decoder_cc.h galileo_telemetry_decoder_cc.h beidou_b1i_telemetry_decoder_cc.h - beidou_b3i_telemetry_decoder_cc.cc -) - -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} + beidou_b3i_telemetry_decoder_cc.h ) list(SORT TELEMETRY_DECODER_GR_BLOCKS_HEADERS) list(SORT TELEMETRY_DECODER_GR_BLOCKS_SOURCES) +source_group(Headers FILES ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS}) + add_library(telemetry_decoder_gr_blocks ${TELEMETRY_DECODER_GR_BLOCKS_SOURCES} ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS} ) -source_group(Headers FILES ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS}) - target_link_libraries(telemetry_decoder_gr_blocks + PUBLIC telemetry_decoder_libswiftcnav telemetry_decoder_lib gnss_system_parameters - ${GNURADIO_RUNTIME_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} + gnss_rx + Gnuradio::runtime + Volkgnsssdr::volkgnsssdr + PRIVATE + Boost::boost + Gflags::gflags + Glog::glog ) -if(NOT VOLKGNSSSDR_FOUND) - add_dependencies(telemetry_decoder_gr_blocks volk_gnsssdr_module) -endif() +set_property(TARGET telemetry_decoder_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.cc index 5965e8099..a838c96ca 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.cc @@ -38,8 +38,8 @@ #include "display.h" #include "gnss_synchro.h" #include -#include #include +#include #include #include @@ -58,66 +58,66 @@ beidou_b1i_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump) beidou_b1i_telemetry_decoder_cc::beidou_b1i_telemetry_decoder_cc( const Gnss_Satellite &satellite, bool dump) : gr::block("beidou_b1i_telemetry_decoder_cc", - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Ephemeris data port out this->message_port_register_out(pmt::mp("telemetry")); // initialize internal vars d_dump = dump; d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - LOG(INFO) << "Initializing BeiDou B1i Telemetry Decoding for satellite "<< this->d_satellite; + LOG(INFO) << "Initializing BeiDou B1i Telemetry Decoding for satellite " << this->d_satellite; d_samples_per_symbol = (BEIDOU_B1I_CODE_RATE_HZ / BEIDOU_B1I_CODE_LENGTH_CHIPS) / BEIDOU_D1NAV_SYMBOL_RATE_SPS; - d_symbols_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS; - d_samples_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS * d_samples_per_symbol; - d_secondary_code_symbols = static_cast(volk_gnsssdr_malloc(BEIDOU_B1I_SECONDARY_CODE_LENGTH * sizeof(int32_t), volk_gnsssdr_get_alignment())); - d_preamble_samples = static_cast(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment())); - d_preamble_period_samples = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS*d_samples_per_symbol; - d_subframe_length_symbols = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; + d_symbols_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS; + d_samples_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS * d_samples_per_symbol; + d_secondary_code_symbols = static_cast(volk_gnsssdr_malloc(BEIDOU_B1I_SECONDARY_CODE_LENGTH * sizeof(int32_t), volk_gnsssdr_get_alignment())); + d_preamble_samples = static_cast(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment())); + d_preamble_period_samples = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS * d_samples_per_symbol; + d_subframe_length_symbols = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; - // Setting samples of secondary code - for (int32_t i = 0; i < BEIDOU_B1I_SECONDARY_CODE_LENGTH; i++) - { - if (BEIDOU_B1I_SECONDARY_CODE.at(i) == '1') - { - d_secondary_code_symbols[i] = 1; - } - else - { - d_secondary_code_symbols[i] = -1; - } - } + // Setting samples of secondary code + for (int32_t i = 0; i < BEIDOU_B1I_SECONDARY_CODE_LENGTH; i++) + { + if (BEIDOU_B1I_SECONDARY_CODE.at(i) == '1') + { + d_secondary_code_symbols[i] = 1; + } + else + { + d_secondary_code_symbols[i] = -1; + } + } - // Setting samples of preamble code - int32_t n = 0; - for (int32_t i = 0; i < d_symbols_per_preamble; i++) - { - int32_t m = 0; - if (BEIDOU_DNAV_PREAMBLE.at(i) == '1') - { - for (uint32_t j = 0; j < d_samples_per_symbol; j++) - { - d_preamble_samples[n] = d_secondary_code_symbols[m]; - n++; - m++; - m = m % BEIDOU_B1I_SECONDARY_CODE_LENGTH; - } - } - else - { - for (uint32_t j = 0; j < d_samples_per_symbol; j++) - { - d_preamble_samples[n] = -d_secondary_code_symbols[m]; - n++; - m++; - m = m % BEIDOU_B1I_SECONDARY_CODE_LENGTH; - } - } - } + // Setting samples of preamble code + int32_t n = 0; + for (int32_t i = 0; i < d_symbols_per_preamble; i++) + { + int32_t m = 0; + if (BEIDOU_DNAV_PREAMBLE.at(i) == '1') + { + for (uint32_t j = 0; j < d_samples_per_symbol; j++) + { + d_preamble_samples[n] = d_secondary_code_symbols[m]; + n++; + m++; + m = m % BEIDOU_B1I_SECONDARY_CODE_LENGTH; + } + } + else + { + for (uint32_t j = 0; j < d_samples_per_symbol; j++) + { + d_preamble_samples[n] = -d_secondary_code_symbols[m]; + n++; + m++; + m = m % BEIDOU_B1I_SECONDARY_CODE_LENGTH; + } + } + } - d_subframe_symbols = static_cast(volk_gnsssdr_malloc(d_subframe_length_symbols * sizeof(double), volk_gnsssdr_get_alignment())); - d_required_symbols = BEIDOU_DNAV_SUBFRAME_SYMBOLS*d_samples_per_symbol + d_samples_per_preamble; + d_subframe_symbols = static_cast(volk_gnsssdr_malloc(d_subframe_length_symbols * sizeof(double), volk_gnsssdr_get_alignment())); + d_required_symbols = BEIDOU_DNAV_SUBFRAME_SYMBOLS * d_samples_per_symbol + d_samples_per_preamble; // Generic settings d_sample_counter = 0; @@ -130,13 +130,12 @@ beidou_b1i_telemetry_decoder_cc::beidou_b1i_telemetry_decoder_cc( d_flag_preamble = false; d_channel = 0; flag_SOW_set = false; - } beidou_b1i_telemetry_decoder_cc::~beidou_b1i_telemetry_decoder_cc() { - volk_gnsssdr_free(d_preamble_samples); + volk_gnsssdr_free(d_preamble_samples); volk_gnsssdr_free(d_secondary_code_symbols); volk_gnsssdr_free(d_subframe_symbols); @@ -154,7 +153,7 @@ beidou_b1i_telemetry_decoder_cc::~beidou_b1i_telemetry_decoder_cc() } -void beidou_b1i_telemetry_decoder_cc::decode_bch15_11_01(int32_t *bits, int32_t *decbits) +void beidou_b1i_telemetry_decoder_cc::decode_bch15_11_01(const int32_t *bits, int32_t *decbits) { int bit, err, reg[4] = {1, 1, 1, 1}; int errind[15] = {14, 13, 10, 12, 6, 9, 4, 11, 0, 5, 7, 8, 1, 3, 2}; @@ -174,7 +173,7 @@ void beidou_b1i_telemetry_decoder_cc::decode_bch15_11_01(int32_t *bits, int32_t reg[1] *= bit; } - err = errind[reg[0] + reg[1]*2 + reg[2]*4 + reg[3]*8]; + err = errind[reg[0] + reg[1] * 2 + reg[2] * 4 + reg[3] * 8]; if (err > 0) { @@ -184,82 +183,80 @@ void beidou_b1i_telemetry_decoder_cc::decode_bch15_11_01(int32_t *bits, int32_t void beidou_b1i_telemetry_decoder_cc::decode_word( - int32_t word_counter, - double* enc_word_symbols, - int32_t* dec_word_symbols) + int32_t word_counter, + const double *enc_word_symbols, + int32_t *dec_word_symbols) { int32_t bitsbch[30], first_branch[15], second_branch[15]; if (word_counter == 1) { for (unsigned int j = 0; j < 30; j++) - { - dec_word_symbols[j] = (int32_t)(enc_word_symbols[j] > 0) ? (1) : (-1); - } - } + { + dec_word_symbols[j] = (int32_t)(enc_word_symbols[j] > 0) ? (1) : (-1); + } + } else { - for (unsigned int r = 0; r < 2; r++) - { - for (unsigned int c = 0; c < 15; c++) + for (unsigned int r = 0; r < 2; r++) + { + for (unsigned int c = 0; c < 15; c++) { - bitsbch[r*15 + c] = (int32_t)(enc_word_symbols[c*2 + r] > 0) ? (1) : (-1); + bitsbch[r * 15 + c] = (int32_t)(enc_word_symbols[c * 2 + r] > 0) ? (1) : (-1); } - } + } decode_bch15_11_01(&bitsbch[0], first_branch); decode_bch15_11_01(&bitsbch[15], second_branch); - for (unsigned int j = 0; j < 11; j++) - { - dec_word_symbols[j] = first_branch[j]; - dec_word_symbols[j + 11] = second_branch[j]; - } + for (unsigned int j = 0; j < 11; j++) + { + dec_word_symbols[j] = first_branch[j]; + dec_word_symbols[j + 11] = second_branch[j]; + } - for (unsigned int j = 0; j < 4; j++) - { - dec_word_symbols[j + 22] = first_branch[11 + j]; - dec_word_symbols[j + 26] = second_branch[11 + j]; - } + for (unsigned int j = 0; j < 4; j++) + { + dec_word_symbols[j + 22] = first_branch[11 + j]; + dec_word_symbols[j + 26] = second_branch[11 + j]; + } } - - } void beidou_b1i_telemetry_decoder_cc::decode_subframe(double *frame_symbols, int32_t frame_length) { - // 1. Transform from symbols to bits + // 1. Transform from symbols to bits std::string data_bits; int32_t dec_word_bits[30]; // Decode each word in subframe - for(uint32_t ii = 0; ii < BEIDOU_DNAV_WORDS_SUBFRAME; ii++) - { - // decode the word - decode_word((ii+1), &frame_symbols[ii*30], dec_word_bits); + for (uint32_t ii = 0; ii < BEIDOU_DNAV_WORDS_SUBFRAME; ii++) + { + // decode the word + decode_word((ii + 1), &frame_symbols[ii * 30], dec_word_bits); - // Save word to string format - for (uint32_t jj = 0; jj < (BEIDOU_DNAV_WORD_LENGTH_BITS); jj++) - { - data_bits.push_back( (dec_word_bits[jj] > 0) ? ('1') : ('0') ); - } - } + // Save word to string format + for (uint32_t jj = 0; jj < (BEIDOU_DNAV_WORD_LENGTH_BITS); jj++) + { + data_bits.push_back((dec_word_bits[jj] > 0) ? ('1') : ('0')); + } + } - if ( d_satellite.get_PRN() > 0 and d_satellite.get_PRN() < 6 ) - { - d_nav.d2_subframe_decoder(data_bits); - } - else - { - d_nav.d1_subframe_decoder(data_bits); - } + if (d_satellite.get_PRN() > 0 and d_satellite.get_PRN() < 6) + { + d_nav.d2_subframe_decoder(data_bits); + } + else + { + d_nav.d1_subframe_decoder(data_bits); + } // 3. Check operation executed correctly if (d_nav.flag_crc_test == true) { - LOG(INFO) << "BeiDou DNAV CRC correct in channel " << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "BeiDou DNAV CRC correct in channel " << d_channel << " from satellite " << d_satellite; } else { @@ -269,7 +266,7 @@ void beidou_b1i_telemetry_decoder_cc::decode_subframe(double *frame_symbols, int if (d_nav.have_new_ephemeris() == true) { // get object for this SV (mandatory) - std::shared_ptr tmp_obj = std::make_shared(d_nav.get_ephemeris()); + std::shared_ptr tmp_obj = std::make_shared(d_nav.get_ephemeris()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); LOG(INFO) << "BEIDOU DNAV Ephemeris have been received in channel" << d_channel << " from satellite " << d_satellite; std::cout << "New BEIDOU B1I DNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << std::endl; @@ -292,9 +289,9 @@ void beidou_b1i_telemetry_decoder_cc::decode_subframe(double *frame_symbols, int } if (d_nav.have_new_almanac() == true) { -// unsigned int slot_nbr = d_nav.i_alm_satellite_PRN; -// std::shared_ptr tmp_obj = std::make_shared(d_nav.get_almanac(slot_nbr)); -// this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); + // unsigned int slot_nbr = d_nav.i_alm_satellite_PRN; + // std::shared_ptr tmp_obj = std::make_shared(d_nav.get_almanac(slot_nbr)); + // this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); LOG(INFO) << "BEIDOU DNAV Almanac have been received in channel" << d_channel << " from satellite " << d_satellite << std::endl; std::cout << "New BEIDOU B1I DNAV almanac received in channel " << d_channel << " from satellite " << d_satellite << std::endl; } @@ -303,7 +300,7 @@ void beidou_b1i_telemetry_decoder_cc::decode_subframe(double *frame_symbols, int void beidou_b1i_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) { - uint32_t sat_prn = 0; + uint32_t sat_prn = 0; d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; DLOG(INFO) << "Navigation Satellite set to " << d_satellite; @@ -314,46 +311,46 @@ void beidou_b1i_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satell d_nav.i_signal_type = 1; //!< BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q) // Update tel dec parameters for D2 NAV Messages - if ( sat_prn > 0 and sat_prn < 6 ) - { - // Clear values from previous declaration - volk_gnsssdr_free(d_preamble_samples); - volk_gnsssdr_free(d_secondary_code_symbols); - volk_gnsssdr_free(d_subframe_symbols); + if (sat_prn > 0 and sat_prn < 6) + { + // Clear values from previous declaration + volk_gnsssdr_free(d_preamble_samples); + volk_gnsssdr_free(d_secondary_code_symbols); + volk_gnsssdr_free(d_subframe_symbols); - d_samples_per_symbol = (BEIDOU_B1I_CODE_RATE_HZ / BEIDOU_B1I_CODE_LENGTH_CHIPS) / BEIDOU_D2NAV_SYMBOL_RATE_SPS; - d_symbols_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS; - d_samples_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS * d_samples_per_symbol; - d_secondary_code_symbols = nullptr; - d_preamble_samples = static_cast(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment())); - d_preamble_period_samples = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS*d_samples_per_symbol; - d_subframe_length_symbols = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; + d_samples_per_symbol = (BEIDOU_B1I_CODE_RATE_HZ / BEIDOU_B1I_CODE_LENGTH_CHIPS) / BEIDOU_D2NAV_SYMBOL_RATE_SPS; + d_symbols_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS; + d_samples_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS * d_samples_per_symbol; + d_secondary_code_symbols = nullptr; + d_preamble_samples = static_cast(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment())); + d_preamble_period_samples = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS * d_samples_per_symbol; + d_subframe_length_symbols = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; - // Setting samples of preamble code - int32_t n = 0; - for (int32_t i = 0; i < d_symbols_per_preamble; i++) - { - if (BEIDOU_DNAV_PREAMBLE.at(i) == '1') - { - for (uint32_t j = 0; j < d_samples_per_symbol; j++) - { - d_preamble_samples[n] = 1; - n++; - } - } - else - { - for (uint32_t j = 0; j < d_samples_per_symbol; j++) - { - d_preamble_samples[n] = -1; - n++; - } - } - } + // Setting samples of preamble code + int32_t n = 0; + for (int32_t i = 0; i < d_symbols_per_preamble; i++) + { + if (BEIDOU_DNAV_PREAMBLE.at(i) == '1') + { + for (uint32_t j = 0; j < d_samples_per_symbol; j++) + { + d_preamble_samples[n] = 1; + n++; + } + } + else + { + for (uint32_t j = 0; j < d_samples_per_symbol; j++) + { + d_preamble_samples[n] = -1; + n++; + } + } + } - d_subframe_symbols = static_cast(volk_gnsssdr_malloc(d_subframe_length_symbols * sizeof(double), volk_gnsssdr_get_alignment())); - d_required_symbols = BEIDOU_DNAV_SUBFRAME_SYMBOLS*d_samples_per_symbol + d_samples_per_preamble; - } + d_subframe_symbols = static_cast(volk_gnsssdr_malloc(d_subframe_length_symbols * sizeof(double), volk_gnsssdr_get_alignment())); + d_required_symbols = BEIDOU_DNAV_SUBFRAME_SYMBOLS * d_samples_per_symbol + d_samples_per_preamble; + } } @@ -369,7 +366,7 @@ void beidou_b1i_telemetry_decoder_cc::set_channel(int channel) try { d_dump_filename = "telemetry"; - d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); @@ -387,17 +384,17 @@ void beidou_b1i_telemetry_decoder_cc::set_channel(int channel) int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { - int32_t corr_value = 0; - int32_t preamble_diff = 0; + int32_t corr_value = 0; + int32_t preamble_diff = 0; - Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // Get the output buffer pointer - const Gnss_Synchro **in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer + auto **out = reinterpret_cast(&output_items[0]); // Get the output buffer pointer + const auto **in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer Gnss_Synchro current_symbol; //structure to save the synchronization information and send the output object to the next block //1. Copy the current tracking output current_symbol = in[0][0]; d_symbol_history.push_back(current_symbol.Prompt_I); //add new symbol to the symbol queue - d_sample_counter++; //count for the processed samples + d_sample_counter++; //count for the processed samples consume_each(1); d_flag_preamble = false; @@ -453,9 +450,9 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ } } } - else if (d_stat == 2) // preamble acquired + else if (d_stat == 2) // preamble acquired { - if (d_sample_counter == d_preamble_index + static_cast(d_preamble_period_samples)) + if (d_sample_counter == d_preamble_index + static_cast(d_preamble_period_samples)) { //******* SAMPLES TO SYMBOLS ******* if (corr_value > 0) //normal PLL lock @@ -463,22 +460,22 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ int k = 0; for (uint32_t i = 0; i < d_subframe_length_symbols; i++) { - d_subframe_symbols[i] = 0; - //integrate samples into symbols + d_subframe_symbols[i] = 0; + //integrate samples into symbols for (uint32_t m = 0; m < d_samples_per_symbol; m++) { - if ( d_satellite.get_PRN() > 0 and d_satellite.get_PRN() < 6 ) - { - // because last symbol of the preamble is just received now! - d_subframe_symbols[i] += d_symbol_history.at(i * d_samples_per_symbol + m); - } - else - { - // because last symbol of the preamble is just received now! - d_subframe_symbols[i] += static_cast(d_secondary_code_symbols[k]) * d_symbol_history.at(i * d_samples_per_symbol + m); - k++; - k = k % BEIDOU_B1I_SECONDARY_CODE_LENGTH; - } + if (d_satellite.get_PRN() > 0 and d_satellite.get_PRN() < 6) + { + // because last symbol of the preamble is just received now! + d_subframe_symbols[i] += d_symbol_history.at(i * d_samples_per_symbol + m); + } + else + { + // because last symbol of the preamble is just received now! + d_subframe_symbols[i] += static_cast(d_secondary_code_symbols[k]) * d_symbol_history.at(i * d_samples_per_symbol + m); + k++; + k = k % BEIDOU_B1I_SECONDARY_CODE_LENGTH; + } } } } @@ -487,22 +484,22 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ int k = 0; for (uint32_t i = 0; i < d_subframe_length_symbols; i++) { - d_subframe_symbols[i] = 0; - //integrate samples into symbols + d_subframe_symbols[i] = 0; + //integrate samples into symbols for (uint32_t m = 0; m < d_samples_per_symbol; m++) { - if ( d_satellite.get_PRN() > 0 and d_satellite.get_PRN() < 6 ) - { - // because last symbol of the preamble is just received now! - d_subframe_symbols[i] -= d_symbol_history.at(i * d_samples_per_symbol + m); - } - else - { - // because last symbol of the preamble is just received now! - d_subframe_symbols[i] -= static_cast(d_secondary_code_symbols[k]) * d_symbol_history.at(i * d_samples_per_symbol + m); - k++; - k = k % BEIDOU_B1I_SECONDARY_CODE_LENGTH; - } + if (d_satellite.get_PRN() > 0 and d_satellite.get_PRN() < 6) + { + // because last symbol of the preamble is just received now! + d_subframe_symbols[i] -= d_symbol_history.at(i * d_samples_per_symbol + m); + } + else + { + // because last symbol of the preamble is just received now! + d_subframe_symbols[i] -= static_cast(d_secondary_code_symbols[k]) * d_symbol_history.at(i * d_samples_per_symbol + m); + k++; + k = k % BEIDOU_B1I_SECONDARY_CODE_LENGTH; + } } } } @@ -541,15 +538,15 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ if (this->d_flag_preamble == true and d_nav.flag_new_SOW_available == true) //update TOW at the preamble instant { - // Reporting sow as gps time of week - d_TOW_at_Preamble_ms = static_cast((d_nav.d_SOW + 14) * 1000.0); - d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((d_required_symbols + 1) * BEIDOU_B1I_CODE_PERIOD_MS); - flag_SOW_set = true; - d_nav.flag_new_SOW_available = false; + // Reporting sow as gps time of week + d_TOW_at_Preamble_ms = static_cast((d_nav.d_SOW + 14) * 1000.0); + d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((d_required_symbols + 1) * BEIDOU_B1I_CODE_PERIOD_MS); + flag_SOW_set = true; + d_nav.flag_new_SOW_available = false; } else //if there is not a new preamble, we define the TOW of the current symbol { - d_TOW_at_current_symbol_ms += static_cast(BEIDOU_B1I_CODE_PERIOD_MS); + d_TOW_at_current_symbol_ms += static_cast(BEIDOU_B1I_CODE_PERIOD_MS); } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.h index b7c4648c8..40bd05b28 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.h @@ -35,14 +35,14 @@ #ifndef GNSS_SDR_BEIDOU_B1I_TELEMETRY_DECODER_CC_H #define GNSS_SDR_BEIDOU_B1I_TELEMETRY_DECODER_CC_H -#include "beidou_dnav_navigation_message.h" -#include "beidou_dnav_ephemeris.h" +#include "Beidou_DNAV.h" +#include "Beidou_B1I.h" #include "beidou_dnav_almanac.h" +#include "beidou_dnav_ephemeris.h" +#include "beidou_dnav_navigation_message.h" #include "beidou_dnav_utc_model.h" #include "gnss_satellite.h" #include "gnss_synchro.h" -#include "Beidou_B1I.h" -#include "Beidou_DNAV.h" #include #include #include @@ -80,8 +80,8 @@ private: beidou_b1i_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); void decode_subframe(double *symbols, int32_t frame_length); - void decode_word(int32_t word_counter, double* enc_word_symbols, int32_t* dec_word_symbols); - void decode_bch15_11_01(int32_t *bits, int32_t *decbits); + void decode_word(int32_t word_counter, const double *enc_word_symbols, int32_t *dec_word_symbols); + void decode_bch15_11_01(const int32_t *bits, int32_t *decbits); //!< Preamble decoding diff --git a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt index e62abe66a..d86e85bae 100644 --- a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -20,32 +20,34 @@ add_subdirectory(libswiftcnav) set(TELEMETRY_DECODER_LIB_SOURCES - viterbi_decoder.cc + viterbi_decoder.cc ) set(TELEMETRY_DECODER_LIB_HEADERS - viterbi_decoder.h - convolutional.h -) - -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} + viterbi_decoder.h + convolutional.h ) list(SORT TELEMETRY_DECODER_LIB_HEADERS) list(SORT TELEMETRY_DECODER_LIB_SOURCES) +source_group(Headers FILES ${TELEMETRY_DECODER_LIB_HEADERS}) + add_library(telemetry_decoder_lib ${TELEMETRY_DECODER_LIB_SOURCES} ${TELEMETRY_DECODER_LIB_HEADERS} ) -source_group(Headers FILES ${TELEMETRY_DECODER_LIB_HEADERS}) -target_link_libraries(telemetry_decoder_lib gnss_system_parameters) +target_link_libraries(telemetry_decoder_lib + PUBLIC + gnss_system_parameters + gnss_rx + PRIVATE + Gflags::gflags + Glog::glog +) + +set_property(TARGET telemetry_decoder_lib + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt index af753c057..ffe8b2c37 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -31,19 +31,21 @@ set(TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS fec.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} -) - list(SORT TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS) list(SORT TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES) +source_group(Headers FILES ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS}) + add_library(telemetry_decoder_libswiftcnav STATIC ${TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES} ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS} ) -source_group(Headers FILES ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS}) +set_property(TARGET telemetry_decoder_libswiftcnav + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) set_target_properties(telemetry_decoder_libswiftcnav - PROPERTIES LINKER_LANGUAGE C) + PROPERTIES LINKER_LANGUAGE C +) diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt index 1b94d0b21..72e21e4d1 100644 --- a/src/algorithms/tracking/adapters/CMakeLists.txt +++ b/src/algorithms/tracking/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -89,34 +89,29 @@ set(TRACKING_ADAPTER_HEADERS ${OPT_TRACKING_ADAPTERS_HEADERS} ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${OPT_TRACKING_INCLUDE_DIRS} -) - list(SORT TRACKING_ADAPTER_HEADERS) list(SORT TRACKING_ADAPTER_SOURCES) +source_group(Headers FILES ${TRACKING_ADAPTER_HEADERS}) + add_library(tracking_adapters ${TRACKING_ADAPTER_SOURCES} ${TRACKING_ADAPTER_HEADERS} ) -source_group(Headers FILES ${TRACKING_ADAPTER_HEADERS}) - target_link_libraries(tracking_adapters + PUBLIC tracking_gr_blocks gnss_sp_libs gnss_sdr_flags ) + +target_include_directories(tracking_adapters + PUBLIC + ${OPT_TRACKING_INCLUDE_DIRS} +) + +set_property(TARGET tracking_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc index 026b27f41..e860da87b 100644 --- a/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc @@ -34,21 +34,21 @@ * ------------------------------------------------------------------------- */ -#include "dll_pll_conf.h" #include "beidou_b1i_dll_pll_tracking.h" -#include "configuration_interface.h" -#include "gnss_sdr_flags.h" -#include "display.h" -#include #include "Beidou_B1I.h" +#include "configuration_interface.h" +#include "display.h" +#include "dll_pll_conf.h" +#include "gnss_sdr_flags.h" +#include using google::LogMessage; BeidouB1iDllPllTracking::BeidouB1iDllPllTracking( - ConfigurationInterface* configuration, std::string role, + ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { - Dll_Pll_Conf trk_param = Dll_Pll_Conf(); + Dll_Pll_Conf trk_param = Dll_Pll_Conf(); DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## std::string default_item_type = "gr_complex"; @@ -118,7 +118,7 @@ BeidouB1iDllPllTracking::BeidouB1iDllPllTracking( trk_param.carrier_lock_th = carrier_lock_th; //################# MAKE TRACKING GNURadio object ################### - if (item_type.compare("gr_complex") == 0) + if (item_type == "gr_complex") { item_size_ = sizeof(gr_complex); tracking_ = dll_pll_veml_make_tracking(trk_param); @@ -141,9 +141,7 @@ BeidouB1iDllPllTracking::BeidouB1iDllPllTracking( } -BeidouB1iDllPllTracking::~BeidouB1iDllPllTracking() -{ -} +BeidouB1iDllPllTracking::~BeidouB1iDllPllTracking() = default; void BeidouB1iDllPllTracking::start_tracking() diff --git a/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.h b/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.h index d6ff5a358..0716c0142 100644 --- a/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.h @@ -37,8 +37,8 @@ #ifndef GNSS_SDR_BEIDOU_B1I_DLL_PLL_TRACKING_H_ #define GNSS_SDR_BEIDOU_B1I_DLL_PLL_TRACKING_H_ -#include "tracking_interface.h" #include "dll_pll_veml_tracking.h" +#include "tracking_interface.h" #include class ConfigurationInterface; @@ -50,7 +50,7 @@ class BeidouB1iDllPllTracking : public TrackingInterface { public: BeidouB1iDllPllTracking(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, unsigned int out_streams); diff --git a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc index 70fdd98a2..f95f76200 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc @@ -48,7 +48,7 @@ using google::LogMessage; GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking( ConfigurationInterface* configuration, const std::string& role, - unsigned int in_streams, unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc index 3000ac8ae..15e7f650b 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc @@ -47,7 +47,7 @@ using google::LogMessage; GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking( ConfigurationInterface* configuration, const std::string& role, - unsigned int in_streams, unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index 2dd5b494f..5451846e2 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -78,59 +78,35 @@ set(TRACKING_GR_BLOCKS_HEADERS ${OPT_TRACKING_BLOCKS_HEADERS} ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${OPT_TRACKING_INCLUDES} - ${MATIO_INCLUDE_DIRS} -) - -if(ENABLE_GENERIC_ARCH) - add_definitions(-DGENERIC_ARCH=1) -endif() - list(SORT TRACKING_GR_BLOCKS_HEADERS) list(SORT TRACKING_GR_BLOCKS_SOURCES) +source_group(Headers FILES ${TRACKING_GR_BLOCKS_HEADERS}) + add_library(tracking_gr_blocks ${TRACKING_GR_BLOCKS_SOURCES} ${TRACKING_GR_BLOCKS_HEADERS} ) -source_group(Headers FILES ${TRACKING_GR_BLOCKS_HEADERS}) - target_link_libraries(tracking_gr_blocks - tracking_lib - ${GNURADIO_RUNTIME_LIBRARIES} - gnss_sdr_flags gnss_sp_libs - ${Boost_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - ${MATIO_LIBRARIES} - ${OPT_TRACKING_LIBRARIES} + PUBLIC + Boost::boost + tracking_lib + Gnuradio::blocks + Volkgnsssdr::volkgnsssdr + gnss_sdr_flags + gnss_sp_libs + gnss_rx + Matio::matio + ${OPT_TRACKING_LIBRARIES} ) -if(NOT VOLKGNSSSDR_FOUND) - if(MATIO_FOUND) - add_dependencies(tracking_gr_blocks volk_gnsssdr_module) - else() - add_dependencies(tracking_gr_blocks volk_gnsssdr_module - matio-${GNSSSDR_MATIO_LOCAL_VERSION} - ) - endif() -else() - if(NOT MATIO_FOUND) - add_dependencies(tracking_gr_blocks - matio-${GNSSSDR_MATIO_LOCAL_VERSION} - ) - endif() -endif() +target_include_directories(tracking_gr_blocks + PUBLIC + ${OPT_TRACKING_INCLUDES} +) + +set_property(TARGET tracking_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) 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 7c06a7d10..c5e83050d 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -35,19 +35,20 @@ */ #include "dll_pll_veml_tracking.h" +#include "Beidou_B1I.h" +#include "Beidou_B3I.h" #include "GPS_L1_CA.h" #include "GPS_L2C.h" #include "GPS_L5.h" #include "Galileo_E1.h" #include "Galileo_E5a.h" #include "Beidou_B1I.h" -#include "Beidou_B3I.h" #include "MATH_CONSTANTS.h" +#include "beidou_b3i_signal_processing.h" +#include "beidou_b1i_signal_processing.h" #include "control_message_factory.h" #include "galileo_e1_signal_processing.h" #include "galileo_e5_signal_processing.h" -#include "beidou_b1i_signal_processing.h" -#include "beidou_b3i_signal_processing.h" #include "gnss_sdr_create_directory.h" #include "gps_l2c_signal.h" #include "gps_l5_signal.h" @@ -612,7 +613,7 @@ void dll_pll_veml_tracking::start_tracking() uint16_t preambles_bits[BEIDOU_B1I_PREAMBLE_LENGTH_BITS] = {1,1,1,0,0,0,1,0,0,1,0}; for (uint16_t preambles_bit : preambles_bits) { - for (uint32_t j = 0; j < d_symbols_per_bit; j++) + for (int32_t j = 0; j < d_symbols_per_bit; j++) { if (preambles_bit == 1) { @@ -653,7 +654,7 @@ void dll_pll_veml_tracking::start_tracking() uint16_t preambles_bits[BEIDOU_B3I_PREAMBLE_LENGTH_BITS] = {1,1,1,0,0,0,1,0,0,1,0}; for (uint16_t preambles_bit : preambles_bits) { - for (uint32_t j = 0; j < d_symbols_per_bit; j++) + for (int32_t j = 0; j < d_symbols_per_bit; j++) { if (preambles_bit == 1) { @@ -669,7 +670,6 @@ void dll_pll_veml_tracking::start_tracking() d_symbol_history.resize(22); // Change fixed buffer size d_symbol_history.clear(); } - } multicorrelator_cpu.set_local_code_and_taps(d_code_samples_per_chip * d_code_length_chips, d_tracking_code, d_local_code_shift_chips); @@ -1569,9 +1569,9 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) d_symbol_history.push_back(d_Prompt->real()); //******* preamble correlation ******** int32_t corr_value = 0; - if ((d_symbol_history.size() == d_preamble_length_symbols)) // and (d_make_correlation or !d_flag_frame_sync)) + if ((static_cast(d_symbol_history.size()) == d_preamble_length_symbols)) // and (d_make_correlation or !d_flag_frame_sync)) { - for (uint32_t i = 0; i < d_preamble_length_symbols; i++) + for (int32_t i = 0; i < d_preamble_length_symbols; i++) { if (d_symbol_history.at(i) < 0) // symbols clipping { diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc index 2c755b088..a79232993 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc @@ -104,7 +104,7 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( d_dump = dump; d_fs_in = fs_in; d_vector_length = vector_length; - d_dump_filename = std::move(dump_filename); + d_dump_filename = dump_filename; // Initialize tracking ========================================== //--- DLL variables -------------------------------------------------------- @@ -270,7 +270,7 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::set_channel(uint32_t channel) { try { - d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); @@ -309,8 +309,8 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder Gnss_Synchro current_synchro_data = Gnss_Synchro(); // Block input data and block output stream pointers - const gr_complex *in = reinterpret_cast(input_items[0]); - Gnss_Synchro **out = reinterpret_cast(&output_items[0]); + const auto *in = reinterpret_cast(input_items[0]); + auto **out = reinterpret_cast(&output_items[0]); if (d_enable_tracking == true) { // Fill the acquisition data diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc index 832e94207..db7a28465 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc @@ -95,7 +95,7 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc( d_dump = dump; d_fs_in = fs_in; d_vector_length = vector_length; - d_dump_filename = std::move(dump_filename); + d_dump_filename = dump_filename; //--- DLL variables -------------------------------------------------------- d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) @@ -300,7 +300,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::set_channel(uint32_t channel) { try { - d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); @@ -341,8 +341,8 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib Gnss_Synchro current_synchro_data = Gnss_Synchro(); // Block input data and block output stream pointers - const gr_complex *in = reinterpret_cast(input_items[0]); - Gnss_Synchro **out = reinterpret_cast(&output_items[0]); + const auto *in = reinterpret_cast(input_items[0]); + auto **out = reinterpret_cast(&output_items[0]); if (d_enable_tracking == true) { diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt index 6991fbd55..3e66cd4e4 100644 --- a/src/algorithms/tracking/libs/CMakeLists.txt +++ b/src/algorithms/tracking/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -66,45 +66,32 @@ if(ENABLE_FPGA) set(TRACKING_LIB_HEADERS ${TRACKING_LIB_HEADERS} fpga_multicorrelator.h dll_pll_conf_fpga.h) endif() -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${OPT_TRACKING_INCLUDES} - ${VOLK_GNSSSDR_INCLUDE_DIRS} -) - -if(ENABLE_GENERIC_ARCH) - add_definitions(-DGENERIC_ARCH=1) -endif() - -if(SSE3_AVAILABLE) - add_definitions(-DHAVE_SSE3=1) -endif() - list(SORT TRACKING_LIB_HEADERS) list(SORT TRACKING_LIB_SOURCES) -add_library(tracking_lib ${TRACKING_LIB_SOURCES} ${TRACKING_LIB_HEADERS}) - source_group(Headers FILES ${TRACKING_LIB_HEADERS}) +add_library(tracking_lib ${TRACKING_LIB_SOURCES} ${TRACKING_LIB_HEADERS}) + target_link_libraries(tracking_lib - ${OPT_TRACKING_LIBRARIES} - ${VOLK_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - ${Boost_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} + PUBLIC + Armadillo::armadillo + Boost::boost + Gnuradio::runtime + Volkgnsssdr::volkgnsssdr + gnss_system_parameters + ${OPT_TRACKING_LIBRARIES} + PRIVATE + Gflags::gflags + Glog::glog ) -if(VOLKGNSSSDR_FOUND) - add_dependencies(tracking_lib glog-${glog_RELEASE}) -else() - add_dependencies(tracking_lib glog-${glog_RELEASE} volk_gnsssdr_module) -endif() +target_include_directories(tracking_lib + PUBLIC + ${OPT_TRACKING_INCLUDES} +) + +set_property(TARGET tracking_lib + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index 9557199c4..30e172792 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -18,10 +18,6 @@ add_subdirectory(supl) -if(OPENSSL_FOUND) - add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif() - set(CORE_LIBS_SOURCES ini.cc INIReader.cc @@ -36,25 +32,27 @@ set(CORE_LIBS_HEADERS gnss_sdr_supl_client.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIR} -) - list(SORT CORE_LIBS_HEADERS) list(SORT CORE_LIBS_SOURCES) -add_library(rx_core_lib ${CORE_LIBS_SOURCES} ${CORE_LIBS_HEADERS}) source_group(Headers FILES ${CORE_LIBS_HEADERS}) -target_link_libraries(rx_core_lib supl_library ${PUGIXML_LIBRARY}) -if(PUGIXML_LOCAL) - add_dependencies(rx_core_lib pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}) -endif() +add_library(rx_core_lib ${CORE_LIBS_SOURCES} ${CORE_LIBS_HEADERS}) + +target_link_libraries(rx_core_lib + PUBLIC + Boost::boost + supl_library + gnss_system_parameters + PRIVATE + Boost::serialization + Gflags::gflags + Glog::glog + Pugixml::pugixml +) + +set_property(TARGET rx_core_lib + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ + $ +) diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index 0311892bd..7f211aa86 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -32,6 +32,7 @@ */ #include "gnss_sdr_supl_client.h" +#include #include #include #include diff --git a/src/core/libs/gnss_sdr_supl_client.h b/src/core/libs/gnss_sdr_supl_client.h index 281d2a82d..3e0a72a3f 100644 --- a/src/core/libs/gnss_sdr_supl_client.h +++ b/src/core/libs/gnss_sdr_supl_client.h @@ -57,7 +57,6 @@ extern "C" #include #include #include -#include #include #include #include diff --git a/src/core/libs/supl/CMakeLists.txt b/src/core/libs/supl/CMakeLists.txt index e8e1e69a6..b09ade6a4 100644 --- a/src/core/libs/supl/CMakeLists.txt +++ b/src/core/libs/supl/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -25,25 +25,28 @@ set(SUPL_SOURCES supl.c ) -if(OPENSSL_FOUND) - add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif() - -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${GNUTLS_INCLUDE_DIR} -) - if(CMAKE_C_COMPILER_ID MATCHES "Clang") if(CMAKE_BUILD_TYPE MATCHES "Release") set(MY_C_FLAGS "${MY_C_FLAGS} -Wno-parentheses-equality") endif() endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS}") add_library(supl_library STATIC ${ASN_RRLP_SOURCES} ${ASN_SUPL_SOURCES} ${SUPL_SOURCES}) -target_link_libraries(supl_library ${GNUTLS_LIBRARIES} ${GNUTLS_OPENSSL_LIBRARY} gnss_system_parameters) -set_target_properties(supl_library PROPERTIES LINKER_LANGUAGE C) + +target_link_libraries(supl_library + PUBLIC + ${GNUTLS_LIBRARIES} + ${GNUTLS_OPENSSL_LIBRARY} + gnss_system_parameters +) + +set_target_properties(supl_library PROPERTIES + LINKER_LANGUAGE C + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl;${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp;${GNUTLS_INCLUDE_DIR}" +) + +if(OPENSSL_FOUND) + target_compile_definitions(supl_library PUBLIC -DUSE_OPENSSL_FALLBACK=1) +endif() diff --git a/src/core/monitor/CMakeLists.txt b/src/core/monitor/CMakeLists.txt index 54ee2a589..a245b7a61 100644 --- a/src/core/monitor/CMakeLists.txt +++ b/src/core/monitor/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -27,25 +27,29 @@ set(CORE_MONITOR_LIBS_HEADERS gnss_synchro_udp_sink.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} -) - list(SORT CORE_MONITOR_LIBS_HEADERS) list(SORT CORE_MONITOR_LIBS_SOURCES) +source_group(Headers FILES ${CORE_MONITOR_LIBS_HEADERS}) + add_library(core_monitor_lib ${CORE_MONITOR_LIBS_SOURCES} ${CORE_MONITOR_LIBS_HEADERS} ) -source_group(Headers FILES ${CORE_MONITOR_LIBS_HEADERS}) +target_link_libraries(core_monitor_lib + PUBLIC + Boost::serialization + Boost::system + Gnuradio::runtime + gnss_system_parameters + PRIVATE + Gflags::gflags + Glog::glog + Gnuradio::pmt +) -target_link_libraries(core_monitor_lib ${Boost_LIBRARIES}) - -add_dependencies(core_monitor_lib glog-${glog_RELEASE}) +set_property(TARGET core_monitor_lib + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/core/monitor/gnss_synchro_monitor.cc b/src/core/monitor/gnss_synchro_monitor.cc index 4f3918d8a..ad9f40e37 100644 --- a/src/core/monitor/gnss_synchro_monitor.cc +++ b/src/core/monitor/gnss_synchro_monitor.cc @@ -36,6 +36,7 @@ #include #include #include +#include using google::LogMessage; @@ -49,7 +50,7 @@ gnss_synchro_monitor_sptr gnss_synchro_make_monitor(unsigned int n_channels, return gnss_synchro_monitor_sptr(new gnss_synchro_monitor(n_channels, output_rate_ms, udp_port, - udp_addresses)); + std::move(udp_addresses))); } @@ -63,7 +64,7 @@ gnss_synchro_monitor::gnss_synchro_monitor(unsigned int n_channels, d_output_rate_ms = output_rate_ms; d_nchannels = n_channels; - udp_sink_ptr = std::unique_ptr(new Gnss_Synchro_Udp_Sink(udp_addresses, udp_port)); + udp_sink_ptr = std::unique_ptr(new Gnss_Synchro_Udp_Sink(std::move(udp_addresses), udp_port)); count = 0; } @@ -75,7 +76,7 @@ gnss_synchro_monitor::~gnss_synchro_monitor() = default; int gnss_synchro_monitor::work(int noutput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items __attribute__((unused))) { - const Gnss_Synchro** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer + const auto** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer for (int epoch = 0; epoch < noutput_items; epoch++) { count++; diff --git a/src/core/monitor/gnss_synchro_udp_sink.cc b/src/core/monitor/gnss_synchro_udp_sink.cc index 46b2d33c9..54f489433 100644 --- a/src/core/monitor/gnss_synchro_udp_sink.cc +++ b/src/core/monitor/gnss_synchro_udp_sink.cc @@ -44,7 +44,7 @@ Gnss_Synchro_Udp_Sink::Gnss_Synchro_Udp_Sink(std::vector addresses, } } -bool Gnss_Synchro_Udp_Sink::write_gnss_synchro(std::vector stocks) +bool Gnss_Synchro_Udp_Sink::write_gnss_synchro(const std::vector& stocks) { std::ostringstream archive_stream; boost::archive::binary_oarchive oa{archive_stream}; diff --git a/src/core/monitor/gnss_synchro_udp_sink.h b/src/core/monitor/gnss_synchro_udp_sink.h index ebfb854a0..8f055e90c 100644 --- a/src/core/monitor/gnss_synchro_udp_sink.h +++ b/src/core/monitor/gnss_synchro_udp_sink.h @@ -39,7 +39,7 @@ class Gnss_Synchro_Udp_Sink { public: Gnss_Synchro_Udp_Sink(std::vector addresses, const uint16_t &port); - bool write_gnss_synchro(std::vector stocks); + bool write_gnss_synchro(const std::vector& stocks); private: boost::asio::io_service io_service; diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 239e8cf00..915e7f545 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -40,137 +40,12 @@ set(GNSS_RECEIVER_HEADERS control_message.h ) -if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) - add_definitions(-DMODERN_GNURADIO=1) -endif() - if(ENABLE_CUDA) - add_definitions(-DCUDA_GPU_ACCEL=1) set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS} ) endif() -if(ENABLE_FPGA) - add_definitions(-DENABLE_FPGA=1) -endif() - -if(ENABLE_RAW_UDP) - add_definitions(-DRAW_UDP=1) -endif() - -if(Boost_VERSION LESS 105000) - add_definitions(-DOLD_BOOST=1) -endif() - -if(OPENSSL_FOUND) - add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif() - -if(ENABLE_GN3S) - add_definitions(-DGN3S_DRIVER=1) -endif() - -if(ENABLE_ARRAY) - add_definitions(-DRAW_ARRAY_DRIVER=1) -endif() - -if(ENABLE_FLEXIBAND) - add_definitions(-DFLEXIBAND_DRIVER=1) -endif() - -if(ENABLE_OSMOSDR) - if(GROSMOSDR_FOUND) - add_definitions(-DOSMOSDR_DRIVER=1) - endif() -endif() - -if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) - add_definitions(-DUHD_DRIVER=1) -endif() - -#Enable OpenCL if found in the system -if(OPENCL_FOUND) - message(STATUS "Adding processing blocks implemented using OpenCL") - add_definitions(-DOPENCL_BLOCKS=1) -else() - add_definitions(-DOPENCL_BLOCKS=0) -endif() - -#enable SDR Hardware based on fmcomms2 -if(ENABLE_PLUTOSDR) - add_definitions(-DPLUTOSDR_DRIVER=1) - set(OPT_RECEIVER_INCLUDE_DIRS - ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS} - ) -endif() - -if(ENABLE_FMCOMMS2) - add_definitions(-DFMCOMMS2_DRIVER=1) - set(OPT_RECEIVER_INCLUDE_DIRS - ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS} - ) -endif() - -if(ENABLE_AD9361) - add_definitions(-DAD9361_DRIVER=1) - set(OPT_RECEIVER_INCLUDE_DIRS - ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS} - ) -endif() - -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") - add_definitions(-DGR_GREATER_38=1) -endif() - - -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/libs - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${CMAKE_SOURCE_DIR}/src/core/monitor - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/conditioner/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${ARMADILLO_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIR} - ${OPT_RECEIVER_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} -) - list(SORT GNSS_RECEIVER_HEADERS) list(SORT GNSS_RECEIVER_SOURCES) @@ -187,38 +62,105 @@ set(GNSS_RECEIVER_INTERFACE_HEADERS list(SORT GNSS_RECEIVER_INTERFACE_HEADERS) +source_group(Headers FILES ${GNSS_RECEIVER_HEADERS} + ${GNSS_RECEIVER_INTERFACE_HEADERS} +) + add_library(gnss_rx ${GNSS_RECEIVER_SOURCES} ${GNSS_RECEIVER_HEADERS} ${GNSS_RECEIVER_INTERFACE_HEADERS} ) -source_group(Headers FILES ${GNSS_RECEIVER_HEADERS} - ${GNSS_RECEIVER_INTERFACE_HEADERS}) +if(ENABLE_FPGA) + target_compile_definitions(gnss_rx PUBLIC -DENABLE_FPGA=1) +endif() + +if(ENABLE_RAW_UDP) + target_compile_definitions(gnss_rx PRIVATE -DRAW_UDP=1) +endif() + +if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) + target_compile_definitions(gnss_rx PRIVATE -DMODERN_GNURADIO=1) +endif() + +if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + target_compile_definitions(gnss_rx PRIVATE -DGR_GREATER_38=1) +endif() + +if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) + target_compile_definitions(gnss_rx PRIVATE -DUHD_DRIVER=1) +endif() + +if(ENABLE_PLUTOSDR) + target_compile_definitions(gnss_rx PRIVATE -DPLUTOSDR_DRIVER=1) +endif() + +if(ENABLE_FMCOMMS2) + target_compile_definitions(gnss_rx PRIVATE -DFMCOMMS2_DRIVER=1) +endif() + +if(ENABLE_AD9361) + target_compile_definitions(gnss_rx PRIVATE -DAD9361_DRIVER=1) +endif() + +if(ENABLE_OSMOSDR) + if(GROSMOSDR_FOUND) + target_compile_definitions(gnss_rx PRIVATE -DOSMOSDR_DRIVER=1) + endif() +endif() + +if(ENABLE_GN3S) + target_compile_definitions(gnss_rx PRIVATE -DGN3S_DRIVER=1) +endif() + +if(ENABLE_ARRAY) + target_compile_definitions(gnss_rx PRIVATE -DRAW_ARRAY_DRIVER=1) +endif() + +if(ENABLE_FLEXIBAND) + target_compile_definitions(gnss_rx PRIVATE -DFLEXIBAND_DRIVER=1) +endif() + +if(OPENCL_FOUND) + message(STATUS "Adding processing blocks implemented using OpenCL") + target_compile_definitions(gnss_rx PRIVATE -DOPENCL_BLOCKS=1) +else() + target_compile_definitions(gnss_rx PRIVATE -DOPENCL_BLOCKS=0) +endif() + +if(ENABLE_CUDA) + target_compile_definitions(gnss_rx PRIVATE -DCUDA_GPU_ACCEL=1) +endif() + target_link_libraries(gnss_rx - ${Boost_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - gnss_system_parameters - gnss_sp_libs - signal_source_adapters - datatype_adapters - input_filter_adapters - conditioner_adapters - resampler_adapters - acq_adapters - tracking_adapters - channel_adapters - telemetry_decoder_libswiftcnav - telemetry_decoder_lib - telemetry_decoder_adapters - obs_adapters - pvt_adapters - pvt_lib - rx_core_lib - core_monitor_lib + PUBLIC + Armadillo::armadillo + Boost::boost + Boost::thread + Gnuradio::runtime + rx_core_lib + core_monitor_lib + PRIVATE + Boost::chrono + Gflags::gflags + Glog::glog + signal_source_adapters + datatype_adapters + input_filter_adapters + conditioner_adapters + resampler_adapters + acq_adapters + tracking_adapters + channel_adapters + telemetry_decoder_adapters + obs_adapters + pvt_adapters +) + +set_property(TARGET gnss_rx APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ + $ + $ ) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 463815bcb..455ba341f 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -94,7 +94,7 @@ ControlThread::ControlThread() ControlThread::ControlThread(std::shared_ptr configuration) { - configuration_ = configuration; + configuration_ = std::move(configuration); delete_configuration_ = false; restart_ = false; init(); @@ -129,7 +129,7 @@ void ControlThread::init() std::string empty_string = ""; std::string ref_location_str = configuration_->property("GNSS-SDR.AGNSS_ref_location", empty_string); std::string ref_time_str = configuration_->property("GNSS-SDR.AGNSS_ref_utc_time", empty_string); - if (ref_location_str.compare(empty_string) != 0) + if (ref_location_str != empty_string) { std::vector vect; std::stringstream ss(ref_location_str); @@ -156,7 +156,7 @@ void ControlThread::init() } } } - if (ref_time_str.compare(empty_string) == 0) + if (ref_time_str == empty_string) { // Make an educated guess time_t rawtime; @@ -191,7 +191,7 @@ void ControlThread::init() ControlThread::~ControlThread() // NOLINT(modernize-use-equals-default) { - if (msqid != -1) msgctl(msqid, IPC_RMID, NULL); + if (msqid != -1) msgctl(msqid, IPC_RMID, nullptr); } @@ -269,24 +269,17 @@ int ControlThread::run() { //TODO re-enable the blocking read messages functions and fork the process read_control_messages(); - if (control_messages_ != 0) process_control_messages(); + if (control_messages_ != nullptr) process_control_messages(); } std::cout << "Stopping GNSS-SDR, please wait!" << std::endl; flowgraph_->stop(); stop_ = true; flowgraph_->disconnect(); -// Join keyboard thread -#ifdef OLD_BOOST - keyboard_thread_.timed_join(boost::posix_time::seconds(1)); - sysv_queue_thread_.timed_join(boost::posix_time::seconds(1)); - cmd_interface_thread_.timed_join(boost::posix_time::seconds(1)); -#endif -#ifndef OLD_BOOST + // Join keyboard thread keyboard_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000)); sysv_queue_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000)); cmd_interface_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000)); -#endif LOG(INFO) << "Flowgraph stopped"; @@ -306,7 +299,7 @@ void ControlThread::set_control_queue(const gr::msg_queue::sptr &control_queue) LOG(WARNING) << "Unable to set control queue while flowgraph is running"; return; } - control_queue_ = std::move(control_queue); + control_queue_ = control_queue; cmd_interface_.set_msg_queue(control_queue_); } @@ -769,7 +762,7 @@ void ControlThread::read_control_messages() { DLOG(INFO) << "Reading control messages from queue"; gr::message::sptr queue_message = control_queue_->delete_head(); - if (queue_message != 0) + if (queue_message != nullptr) { control_messages_ = control_message_factory_->GetControlMessages(queue_message); } @@ -783,20 +776,20 @@ void ControlThread::read_control_messages() // Apply the corresponding control actions void ControlThread::process_control_messages() { - for (unsigned int i = 0; i < control_messages_->size(); i++) + for (auto & i : *control_messages_) { if (stop_) break; - if (control_messages_->at(i)->who == 200) + if (i->who == 200) { - apply_action(control_messages_->at(i)->what); + apply_action(i->what); } else { - if (control_messages_->at(i)->who == 300) // some TC commands require also actions from control_thread + if (i->who == 300) // some TC commands require also actions from control_thread { - apply_action(control_messages_->at(i)->what); + apply_action(i->what); } - flowgraph_->apply_action(control_messages_->at(i)->who, control_messages_->at(i)->what); + flowgraph_->apply_action(i->who, i->what); } processed_control_messages_++; } @@ -888,9 +881,9 @@ std::vector> ControlThread::get_visible_sats(time << "UTC, assuming RX position " << LLH(0) << " [deg], " << LLH(1) << " [deg], " << LLH(2) << " [m]" << std::endl; std::map gps_eph_map = pvt_ptr->get_gps_ephemeris(); - for (std::map::iterator it = gps_eph_map.begin(); it != gps_eph_map.end(); ++it) + for (auto & it : gps_eph_map) { - eph_t rtklib_eph = eph_to_rtklib(it->second); + eph_t rtklib_eph = eph_to_rtklib(it.second); double r_sat[3]; double clock_bias_s; double sat_pos_variance_m2; @@ -903,17 +896,17 @@ std::vector> ControlThread::get_visible_sats(time // push sat if (El > 0) { - std::cout << "Using GPS Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using GPS Ephemeris: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), - (Gnss_Satellite(std::string("GPS"), it->second.i_satellite_PRN)))); - visible_gps.push_back(it->second.i_satellite_PRN); + (Gnss_Satellite(std::string("GPS"), it.second.i_satellite_PRN)))); + visible_gps.push_back(it.second.i_satellite_PRN); } } std::map gal_eph_map = pvt_ptr->get_galileo_ephemeris(); - for (std::map::iterator it = gal_eph_map.begin(); it != gal_eph_map.end(); ++it) + for (auto & it : gal_eph_map) { - eph_t rtklib_eph = eph_to_rtklib(it->second); + eph_t rtklib_eph = eph_to_rtklib(it.second); double r_sat[3]; double clock_bias_s; double sat_pos_variance_m2; @@ -926,17 +919,17 @@ std::vector> ControlThread::get_visible_sats(time // push sat if (El > 0) { - std::cout << "Using Galileo Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using Galileo Ephemeris: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), - (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); - visible_gal.push_back(it->second.i_satellite_PRN); + (Gnss_Satellite(std::string("Galileo"), it.second.i_satellite_PRN)))); + visible_gal.push_back(it.second.i_satellite_PRN); } } std::map gps_alm_map = pvt_ptr->get_gps_almanac(); - for (std::map::iterator it = gps_alm_map.begin(); it != gps_alm_map.end(); ++it) + for (auto & it : gps_alm_map) { - alm_t rtklib_alm = alm_to_rtklib(it->second); + alm_t rtklib_alm = alm_to_rtklib(it.second); double r_sat[3]; double clock_bias_s; gtime_t aux_gtime; @@ -950,20 +943,20 @@ std::vector> ControlThread::get_visible_sats(time std::vector::iterator it2; if (El > 0) { - it2 = std::find(visible_gps.begin(), visible_gps.end(), it->second.i_satellite_PRN); + it2 = std::find(visible_gps.begin(), visible_gps.end(), it.second.i_satellite_PRN); if (it2 == visible_gps.end()) { - std::cout << "Using GPS Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using GPS Almanac: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), - (Gnss_Satellite(std::string("GPS"), it->second.i_satellite_PRN)))); + (Gnss_Satellite(std::string("GPS"), it.second.i_satellite_PRN)))); } } } std::map gal_alm_map = pvt_ptr->get_galileo_almanac(); - for (std::map::iterator it = gal_alm_map.begin(); it != gal_alm_map.end(); ++it) + for (auto & it : gal_alm_map) { - alm_t rtklib_alm = alm_to_rtklib(it->second); + alm_t rtklib_alm = alm_to_rtklib(it.second); double r_sat[3]; double clock_bias_s; gtime_t gal_gtime; @@ -977,12 +970,12 @@ std::vector> ControlThread::get_visible_sats(time std::vector::iterator it2; if (El > 0) { - it2 = std::find(visible_gal.begin(), visible_gal.end(), it->second.i_satellite_PRN); + it2 = std::find(visible_gal.begin(), visible_gal.end(), it.second.i_satellite_PRN); if (it2 == visible_gal.end()) { - std::cout << "Using Galileo Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using Galileo Almanac: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), - (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); + (Gnss_Satellite(std::string("Galileo"), it.second.i_satellite_PRN)))); } } } diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 3766b4044..04aca8f78 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -172,6 +172,7 @@ #include #include #include +#include using google::LogMessage; @@ -184,7 +185,7 @@ GNSSBlockFactory::~GNSSBlockFactory() = default; std::unique_ptr GNSSBlockFactory::GetSignalSource( - std::shared_ptr configuration, gr::msg_queue::sptr queue, int ID) + const std::shared_ptr& configuration, gr::msg_queue::sptr queue, int ID) { std::string default_implementation = "File_Signal_Source"; std::string role = "SignalSource"; //backwards compatibility for old conf files @@ -201,12 +202,12 @@ std::unique_ptr GNSSBlockFactory::GetSignalSource( } std::string implementation = configuration->property(role + ".implementation", default_implementation); LOG(INFO) << "Getting SignalSource with implementation " << implementation; - return GetBlock(configuration, role, implementation, 0, 1, queue); + return GetBlock(configuration, role, implementation, 0, 1, std::move(queue)); } std::unique_ptr GNSSBlockFactory::GetSignalConditioner( - std::shared_ptr configuration, int ID) + const std::shared_ptr& configuration, int ID) { std::string default_implementation = "Pass_Through"; //backwards compatibility for old conf files @@ -274,7 +275,7 @@ std::unique_ptr GNSSBlockFactory::GetSignalConditioner( } -std::unique_ptr GNSSBlockFactory::GetObservables(std::shared_ptr configuration) +std::unique_ptr GNSSBlockFactory::GetObservables(const std::shared_ptr& configuration) { std::string default_implementation = "Hybrid_Observables"; std::string implementation = configuration->property("Observables.implementation", default_implementation); @@ -302,7 +303,7 @@ std::unique_ptr GNSSBlockFactory::GetObservables(std::shared } -std::unique_ptr GNSSBlockFactory::GetPVT(std::shared_ptr configuration) +std::unique_ptr GNSSBlockFactory::GetPVT(const std::shared_ptr& configuration) { std::string default_implementation = "RTKLIB_PVT"; std::string implementation = configuration->property("PVT.implementation", default_implementation); @@ -323,8 +324,8 @@ std::unique_ptr GNSSBlockFactory::GetPVT(std::shared_ptr GNSSBlockFactory::GetChannel_1C( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { //"appendix" is added to the "role" with the aim of Acquisition, Tracking and Telemetry Decoder adapters @@ -383,7 +384,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "1C", queue)); + "Channel", "1C", std::move(queue))); return channel_; } @@ -391,8 +392,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( //********* GPS L2C (M) CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_2S( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { LOG(INFO) << "Instantiating Channel " << channel << " with Acquisition Implementation: " @@ -447,7 +448,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "2S", queue)); + "Channel", "2S", std::move(queue))); return channel_; } @@ -455,8 +456,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( //********* GALILEO E1 B CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_1B( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { std::stringstream stream; @@ -514,7 +515,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "1B", queue)); + "Channel", "1B", std::move(queue))); return channel_; } @@ -522,8 +523,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( //********* GALILEO E5a CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_5X( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { std::stringstream stream; @@ -581,7 +582,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "5X", queue)); + "Channel", "5X", std::move(queue))); return channel_; } @@ -589,8 +590,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( //********* GLONASS L1 C/A CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_1G( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, boost::shared_ptr queue) { std::stringstream stream; @@ -649,7 +650,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "1G", queue)); + "Channel", "1G", std::move(queue))); return channel_; } @@ -657,8 +658,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( //********* GLONASS L2 C/A CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_2G( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, boost::shared_ptr queue) { std::stringstream stream; @@ -717,7 +718,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "2G", queue)); + "Channel", "2G", std::move(queue))); return channel_; } @@ -725,8 +726,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( //********* GPS L5 CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_L5( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { std::stringstream stream; @@ -784,7 +785,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "L5", queue)); + "Channel", "L5", std::move(queue))); return channel_; } @@ -792,8 +793,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( //********* BeiDou B1I CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_B1( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { std::stringstream stream; @@ -803,7 +804,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B1( << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; std::string aux = configuration->property("Acquisition_B1" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; - if (aux.compare("W") != 0) + if (aux != "W") { appendix1 = std::to_string(channel); } @@ -813,7 +814,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B1( } aux = configuration->property("Tracking_B1" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; - if (aux.compare("W") != 0) + if (aux != "W") { appendix2 = std::to_string(channel); } @@ -823,7 +824,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B1( } aux = configuration->property("TelemetryDecoder_B1" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; - if (aux.compare("W") != 0) + if (aux != "W") { appendix3 = std::to_string(channel); } @@ -851,7 +852,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B1( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "B1", queue)); + "Channel", "B1", std::move(queue))); return channel_; } @@ -859,8 +860,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B1( //********* BeiDou B3I CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_B3( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { std::stringstream stream; @@ -870,7 +871,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B3( << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; std::string aux = configuration->property("Acquisition_B3" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; - if (aux.compare("W") != 0) + if (aux != "W") { appendix1 = std::to_string(channel); } @@ -880,7 +881,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B3( } aux = configuration->property("Tracking_B3" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; - if (aux.compare("W") != 0) + if (aux != "W") { appendix2 = std::to_string(channel); } @@ -890,7 +891,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B3( } aux = configuration->property("TelemetryDecoder_B3" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; - if (aux.compare("W") != 0) + if (aux != "W") { appendix3 = std::to_string(channel); } @@ -918,14 +919,14 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B3( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "B3", queue)); + "Channel", "B3", std::move(queue))); return channel_; } std::unique_ptr>> GNSSBlockFactory::GetChannels( - std::shared_ptr configuration, gr::msg_queue::sptr queue) + const std::shared_ptr& configuration, const gr::msg_queue::sptr& queue) { std::string default_implementation = "Pass_Through"; std::string tracking_implementation; @@ -952,7 +953,7 @@ std::unique_ptr>> GNSSBlockFacto Channels_5X_count + Channels_L5_count + Channels_B1_count + - Channels_B3_count; + Channels_B3_count; std::unique_ptr>> channels(new std::vector>(total_channels)); try @@ -1243,10 +1244,10 @@ std::unique_ptr>> GNSSBlockFacto * (see below) */ std::unique_ptr GNSSBlockFactory::GetBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, - unsigned int out_streams, gr::msg_queue::sptr queue) + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, + unsigned int out_streams, const gr::msg_queue::sptr& queue) { std::unique_ptr block; @@ -1710,9 +1711,9 @@ std::unique_ptr GNSSBlockFactory::GetBlock( else if (implementation == "BEIDOU_B3I_PCPS_Acquisition") { std::unique_ptr block_(new BeidouB3iPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); - block = std::move(block_); - } + out_streams)); + block = std::move(block_); + } // TRACKING BLOCKS ------------------------------------------------------------- else if (implementation == "GPS_L1_CA_DLL_PLL_Tracking") @@ -1949,9 +1950,9 @@ std::unique_ptr GNSSBlockFactory::GetBlock( */ std::unique_ptr GNSSBlockFactory::GetAcqBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams) { std::unique_ptr block; @@ -2125,9 +2126,9 @@ std::unique_ptr GNSSBlockFactory::GetAcqBlock( std::unique_ptr GNSSBlockFactory::GetTrkBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams) { std::unique_ptr block; @@ -2282,9 +2283,9 @@ std::unique_ptr GNSSBlockFactory::GetTrkBlock( std::unique_ptr GNSSBlockFactory::GetTlmBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams) { std::unique_ptr block; diff --git a/src/core/receiver/gnss_block_factory.h b/src/core/receiver/gnss_block_factory.h index 9e62e81dc..ba2a8106b 100644 --- a/src/core/receiver/gnss_block_factory.h +++ b/src/core/receiver/gnss_block_factory.h @@ -57,79 +57,79 @@ class GNSSBlockFactory public: GNSSBlockFactory(); virtual ~GNSSBlockFactory(); - std::unique_ptr GetSignalSource(std::shared_ptr configuration, + std::unique_ptr GetSignalSource(const std::shared_ptr& configuration, gr::msg_queue::sptr queue, int ID = -1); - std::unique_ptr GetSignalConditioner(std::shared_ptr configuration, int ID = -1); + std::unique_ptr GetSignalConditioner(const std::shared_ptr& configuration, int ID = -1); - std::unique_ptr GetPVT(std::shared_ptr configuration); + std::unique_ptr GetPVT(const std::shared_ptr& configuration); - std::unique_ptr GetObservables(std::shared_ptr configuration); + std::unique_ptr GetObservables(const std::shared_ptr& configuration); - std::unique_ptr>> GetChannels(std::shared_ptr configuration, - gr::msg_queue::sptr queue); + std::unique_ptr>> GetChannels(const std::shared_ptr& configuration, + const gr::msg_queue::sptr& queue); /* * \brief Returns the block with the required configuration and implementation */ - std::unique_ptr GetBlock(std::shared_ptr configuration, - std::string role, std::string implementation, + std::unique_ptr GetBlock(const std::shared_ptr& configuration, + const std::string& role, const std::string& implementation, unsigned int in_streams, unsigned int out_streams, - gr::msg_queue::sptr queue = nullptr); + const gr::msg_queue::sptr& queue = nullptr); private: - std::unique_ptr GetChannel_1C(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_1C(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue); - std::unique_ptr GetChannel_2S(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_2S(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue); - std::unique_ptr GetChannel_1B(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_1B(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue); - std::unique_ptr GetChannel_5X(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_5X(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue); - std::unique_ptr GetChannel_L5(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_L5(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue); - std::unique_ptr GetChannel_1G(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_1G(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, boost::shared_ptr queue); - std::unique_ptr GetChannel_2G(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_2G(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, boost::shared_ptr queue); - std::unique_ptr GetChannel_B1(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_B1(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, boost::shared_ptr queue); - std::unique_ptr GetChannel_B3(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, - boost::shared_ptr queue); + std::unique_ptr GetChannel_B3(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, + boost::shared_ptr queue); std::unique_ptr GetAcqBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams); std::unique_ptr GetTrkBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams); std::unique_ptr GetTlmBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams); }; diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index cfc6d96d2..f2ee350bc 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -66,8 +66,8 @@ GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configurati { connected_ = false; running_ = false; - configuration_ = configuration; - queue_ = std::move(queue); + configuration_ = std::move(configuration); + queue_ = queue; init(); } @@ -289,7 +289,8 @@ void GNSSFlowgraph::connect() std::cout << "Set GNSS-SDR.internal_fs_sps in configuration file" << std::endl; throw(std::invalid_argument("Set GNSS-SDR.internal_fs_sps in configuration")); } - ch_out_sample_counter = gnss_sdr_make_sample_counter(fs, sig_conditioner_.at(0)->get_right_block()->output_signature()->sizeof_stream_item(0)); + int observable_interval_ms = static_cast(configuration_->property("GNSS-SDR.observable_interval_ms", 20)); + ch_out_sample_counter = gnss_sdr_make_sample_counter(fs, observable_interval_ms, sig_conditioner_.at(0)->get_right_block()->output_signature()->sizeof_stream_item(0)); top_block_->connect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter, 0); top_block_->connect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse } @@ -1040,7 +1041,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) case evBDS_B3: available_BDS_B3_signals_.remove(gs); available_BDS_B3_signals_.push_back(gs); - break; + break; default: LOG(ERROR) << "This should not happen :-("; @@ -1377,11 +1378,11 @@ void GNSSFlowgraph::priorize_satellites(std::vector>::iterator it = visible_satellites.begin(); it != visible_satellites.end(); ++it) + for (auto & visible_satellite : visible_satellites) { - if (it->second.get_system() == "GPS") + if (visible_satellite.second.get_system() == "GPS") { - gs = Gnss_Signal(it->second, "1C"); + gs = Gnss_Signal(visible_satellite.second, "1C"); old_size = available_GPS_1C_signals_.size(); available_GPS_1C_signals_.remove(gs); if (old_size > available_GPS_1C_signals_.size()) @@ -1389,7 +1390,7 @@ void GNSSFlowgraph::priorize_satellites(std::vectorsecond, "2S"); + gs = Gnss_Signal(visible_satellite.second, "2S"); old_size = available_GPS_2S_signals_.size(); available_GPS_2S_signals_.remove(gs); if (old_size > available_GPS_2S_signals_.size()) @@ -1397,7 +1398,7 @@ void GNSSFlowgraph::priorize_satellites(std::vectorsecond, "L5"); + gs = Gnss_Signal(visible_satellite.second, "L5"); old_size = available_GPS_L5_signals_.size(); available_GPS_L5_signals_.remove(gs); if (old_size > available_GPS_L5_signals_.size()) @@ -1405,9 +1406,9 @@ void GNSSFlowgraph::priorize_satellites(std::vectorsecond.get_system() == "Galileo") + else if (visible_satellite.second.get_system() == "Galileo") { - gs = Gnss_Signal(it->second, "1B"); + gs = Gnss_Signal(visible_satellite.second, "1B"); old_size = available_GAL_1B_signals_.size(); available_GAL_1B_signals_.remove(gs); if (old_size > available_GAL_1B_signals_.size()) @@ -1415,7 +1416,7 @@ void GNSSFlowgraph::priorize_satellites(std::vectorsecond, "5X"); + gs = Gnss_Signal(visible_satellite.second, "5X"); old_size = available_GAL_5X_signals_.size(); available_GAL_5X_signals_.remove(gs); if (old_size > available_GAL_5X_signals_.size()) @@ -1438,7 +1439,7 @@ void GNSSFlowgraph::set_configuration(std::shared_ptr co { LOG(WARNING) << "Unable to update configuration while flowgraph connected"; } - configuration_ = configuration; + configuration_ = std::move(configuration); } @@ -1609,7 +1610,7 @@ void GNSSFlowgraph::set_signals_list() std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), boost::lexical_cast); - if (tmp_set.size() > 0) + if (!tmp_set.empty()) { available_galileo_prn = tmp_set; } @@ -1625,7 +1626,7 @@ void GNSSFlowgraph::set_signals_list() std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), boost::lexical_cast); - if (tmp_set.size() > 0) + if (!tmp_set.empty()) { available_gps_prn = tmp_set; } @@ -1641,7 +1642,7 @@ void GNSSFlowgraph::set_signals_list() std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), boost::lexical_cast); - if (tmp_set.size() > 0) + if (!tmp_set.empty()) { available_sbas_prn = tmp_set; } @@ -1657,7 +1658,7 @@ void GNSSFlowgraph::set_signals_list() std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), boost::lexical_cast); - if (tmp_set.size() > 0) + if (!tmp_set.empty()) { available_glonass_prn = tmp_set; } @@ -1665,7 +1666,6 @@ void GNSSFlowgraph::set_signals_list() sv_list = configuration_->property("Beidou.prns", std::string("")); - if (sv_list.length() > 0) { // Reset the available prns: @@ -1674,7 +1674,7 @@ void GNSSFlowgraph::set_signals_list() std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), boost::lexical_cast); - if (tmp_set.size() > 0) + if (!tmp_set.empty()) { available_beidou_prn = tmp_set; } @@ -1816,7 +1816,6 @@ void GNSSFlowgraph::set_signals_list() } } - } diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 5facab350..1d3fcfdce 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -55,7 +55,6 @@ #include #include #include -#include #if ENABLE_FPGA #include "gnss_sdr_fpga_sample_counter.h" @@ -196,8 +195,8 @@ private: evGAL_5X, evGLO_1G, evGLO_2G, - evBDS_B1, - evBDS_B3 + evBDS_B1, + evBDS_B3 }; std::map mapStringValues_; diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 57b274757..0096c26a1 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -33,6 +33,7 @@ #include "control_message_factory.h" #include #include +#include TcpCmdInterface::TcpCmdInterface() @@ -64,7 +65,7 @@ void TcpCmdInterface::register_functions() void TcpCmdInterface::set_pvt(std::shared_ptr PVT_sptr) { - PVT_sptr_ = PVT_sptr; + PVT_sptr_ = std::move(PVT_sptr); } @@ -284,7 +285,7 @@ std::string TcpCmdInterface::set_ch_satellite(const std::vector &co void TcpCmdInterface::set_msg_queue(gr::msg_queue::sptr control_queue) { - control_queue_ = control_queue; + control_queue_ = std::move(control_queue); } @@ -330,7 +331,7 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) std::vector cmd_vector(std::istream_iterator{iss}, std::istream_iterator()); - if (cmd_vector.size() > 0) + if (!cmd_vector.empty()) { try { diff --git a/src/core/receiver/tcp_cmd_interface.h b/src/core/receiver/tcp_cmd_interface.h index 4cafb898d..2e75298ec 100644 --- a/src/core/receiver/tcp_cmd_interface.h +++ b/src/core/receiver/tcp_cmd_interface.h @@ -34,7 +34,6 @@ #include "pvt_interface.h" #include #include -#include #include #include #include diff --git a/src/core/system_parameters/Beidou_B1I.h b/src/core/system_parameters/Beidou_B1I.h index d8652e480..e114dee6e 100644 --- a/src/core/system_parameters/Beidou_B1I.h +++ b/src/core/system_parameters/Beidou_B1I.h @@ -32,9 +32,9 @@ #ifndef GNSS_SDR_BEIDOU_B1I_H_ #define GNSS_SDR_BEIDOU_B1I_H_ -#include -#include // std::pair #include "MATH_CONSTANTS.h" +#include // std::pair +#include // Physical constants const double BEIDOU_C_m_s = 299792458.0; //!< The speed of light, [m/s] diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index d594fcac9..47b800c90 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -102,26 +102,27 @@ set(SYSTEM_PARAMETERS_HEADERS MATH_CONSTANTS.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${GLOG_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} -) - list(SORT SYSTEM_PARAMETERS_HEADERS) list(SORT SYSTEM_PARAMETERS_SOURCES) +source_group(Headers FILES ${SYSTEM_PARAMETERS_HEADERS}) + add_library(gnss_system_parameters ${SYSTEM_PARAMETERS_SOURCES} ${SYSTEM_PARAMETERS_HEADERS} ) -source_group(Headers FILES ${SYSTEM_PARAMETERS_HEADERS}) +target_link_libraries(gnss_system_parameters + PUBLIC + Boost::date_time + Boost::serialization + Glog::glog + gnss_rx + PRIVATE + Gflags::gflags +) -add_dependencies(gnss_system_parameters rtklib_lib glog-${glog_RELEASE}) - -target_link_libraries(gnss_system_parameters rtklib_lib ${Boost_LIBRARIES}) +set_property(TARGET gnss_system_parameters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/core/system_parameters/MATH_CONSTANTS.h b/src/core/system_parameters/MATH_CONSTANTS.h index 7acb8270a..3e7fa3c16 100644 --- a/src/core/system_parameters/MATH_CONSTANTS.h +++ b/src/core/system_parameters/MATH_CONSTANTS.h @@ -46,7 +46,7 @@ const double PI = 3.1415926535897932; //!< pi const double PI_2 = 2.0 * PI; //!< 2 * pi -const double TWO_P3 = (8); //!< 2^3 +const double TWO_P3 = (8); //!< 2^3 const double TWO_P4 = (16); //!< 2^4 const double TWO_P11 = (2048); //!< 2^11 const double TWO_P12 = (4096); //!< 2^12 @@ -92,14 +92,14 @@ const double TWO_N44 = (5.684341886080802e-14); //!< 2^-44 const double TWO_N46 = (1.4210854715202e-014); //!< 2^-46 const double TWO_N48 = (3.552713678800501e-15); //!< 2^-46 -const double TWO_N50 = (8.881784197001252e-016); //!< 2^-50 -const double TWO_N51 = (4.44089209850063e-016); //!< 2^-51 -const double TWO_N55 = (2.775557561562891e-017); //!< 2^-55 -const double TWO_N57 = (6.938893903907228e-18); //!< 2^-57 -const double TWO_N59 = (1.73472347597681e-018); //!< 2^-59 -const double TWO_N60 = (8.673617379884036e-19); //!< 2^-60 -const double TWO_N66 = (1.3552527156068805425093160010874271392822265625e-20); //!< 2^-66 -const double TWO_N68 = (3.388131789017201e-21); //!< 2^-68 +const double TWO_N50 = (8.881784197001252e-016); //!< 2^-50 +const double TWO_N51 = (4.44089209850063e-016); //!< 2^-51 +const double TWO_N55 = (2.775557561562891e-017); //!< 2^-55 +const double TWO_N57 = (6.938893903907228e-18); //!< 2^-57 +const double TWO_N59 = (1.73472347597681e-018); //!< 2^-59 +const double TWO_N60 = (8.673617379884036e-19); //!< 2^-60 +const double TWO_N66 = (1.3552527156068805425093160010874271392822265625e-20); //!< 2^-66 +const double TWO_N68 = (3.388131789017201e-21); //!< 2^-68 const double PI_TWO_N19 = (5.992112452678286e-006); //!< Pi*2^-19 diff --git a/src/core/system_parameters/beidou_dnav_ephemeris.cc b/src/core/system_parameters/beidou_dnav_ephemeris.cc index c2e941c32..bb9bcde71 100644 --- a/src/core/system_parameters/beidou_dnav_ephemeris.cc +++ b/src/core/system_parameters/beidou_dnav_ephemeris.cc @@ -30,11 +30,9 @@ */ #include "beidou_dnav_ephemeris.h" - -#include - #include "Beidou_B1I.h" #include "gnss_satellite.h" +#include Beidou_Dnav_Ephemeris::Beidou_Dnav_Ephemeris() { @@ -63,27 +61,27 @@ Beidou_Dnav_Ephemeris::Beidou_Dnav_Ephemeris() d_AODE = 0; d_TGD1 = 0; d_TGD2 = 0; - d_AODC = 0; // Issue of Data, Clock - i_AODO = 0; // Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] + d_AODC = 0; // Issue of Data, Clock + i_AODO = 0; // Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] d_AODC = 0; - b_fit_interval_flag = false; // indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. + b_fit_interval_flag = false; // indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. d_spare1 = 0; d_spare2 = 0; i_sig_type = 0; i_nav_type = 0; - d_A_f0 = 0; // Coefficient 0 of code phase offset model [s] - d_A_f1 = 0; // Coefficient 1 of code phase offset model [s/s] - d_A_f2 = 0; // Coefficient 2 of code phase offset model [s/s^2] + d_A_f0 = 0; // Coefficient 0 of code phase offset model [s] + d_A_f1 = 0; // Coefficient 1 of code phase offset model [s/s] + d_A_f2 = 0; // Coefficient 2 of code phase offset model [s/s^2] b_integrity_status_flag = false; b_alert_flag = false; // If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. b_antispoofing_flag = false; // If true, the AntiSpoofing mode is ON in that SV auto gnss_sat = Gnss_Satellite(); - std::string _system ("Beidou"); - for(unsigned int i = 1; i < 36; i++) + std::string _system("Beidou"); + for (unsigned int i = 1; i < 36; i++) { satelliteBlock[i] = gnss_sat.what_block(_system, i); } @@ -102,7 +100,7 @@ Beidou_Dnav_Ephemeris::Beidou_Dnav_Ephemeris() double Beidou_Dnav_Ephemeris::check_t(double time) { double corrTime; - double half_week = 302400.0; // seconds + double half_week = 302400.0; // seconds corrTime = time; if (time > half_week) { @@ -166,9 +164,9 @@ double Beidou_Dnav_Ephemeris::sv_clock_relativistic_term(double transmitTime) // --- Iteratively compute eccentric anomaly ---------------------------- for (int ii = 1; ii < 20; ii++) { - E_old = E; - E = M + d_eccentricity * sin(E); - dE = fmod(E - E_old, 2.0 * BEIDOU_PI); + E_old = E; + E = M + d_eccentricity * sin(E); + dE = fmod(E - E_old, 2.0 * BEIDOU_PI); if (fabs(dE) < 1e-12) { //Necessary precision is reached, exit from the loop @@ -225,9 +223,9 @@ double Beidou_Dnav_Ephemeris::satellitePosition(double transmitTime) // --- Iteratively compute eccentric anomaly ---------------------------- for (int ii = 1; ii < 20; ii++) { - E_old = E; - E = M + d_eccentricity * sin(E); - dE = fmod(E - E_old, 2.0 * BEIDOU_PI); + E_old = E; + E = M + d_eccentricity * sin(E); + dE = fmod(E - E_old, 2.0 * BEIDOU_PI); if (fabs(dE) < 1e-12) { //Necessary precision is reached, exit from the loop @@ -247,16 +245,16 @@ double Beidou_Dnav_Ephemeris::satellitePosition(double transmitTime) phi = fmod((phi), (2.0 * BEIDOU_PI)); // Correct argument of latitude - u = phi + d_Cuc * cos(2.0 * phi) + d_Cus * sin(2.0 * phi); + u = phi + d_Cuc * cos(2.0 * phi) + d_Cus * sin(2.0 * phi); // Correct radius - r = a * (1.0 - d_eccentricity*cos(E)) + d_Crc * cos(2.0 * phi) + d_Crs * sin(2.0 * phi); + r = a * (1.0 - d_eccentricity * cos(E)) + d_Crc * cos(2.0 * phi) + d_Crs * sin(2.0 * phi); // Correct inclination i = d_i_0 + d_IDOT * tk + d_Cic * cos(2.0 * phi) + d_Cis * sin(2.0 * phi); // Compute the angle between the ascending node and the Greenwich meridian - Omega = d_OMEGA0 + (d_OMEGA_DOT - BEIDOU_OMEGA_EARTH_DOT)*tk - BEIDOU_OMEGA_EARTH_DOT * d_Toe; + Omega = d_OMEGA0 + (d_OMEGA_DOT - BEIDOU_OMEGA_EARTH_DOT) * tk - BEIDOU_OMEGA_EARTH_DOT * d_Toe; // Reduce to between 0 and 2*pi rad Omega = fmod((Omega + 2.0 * BEIDOU_PI), (2.0 * BEIDOU_PI)); @@ -268,7 +266,7 @@ double Beidou_Dnav_Ephemeris::satellitePosition(double transmitTime) // Satellite's velocity. Can be useful for Vector Tracking loops double Omega_dot = d_OMEGA_DOT - BEIDOU_OMEGA_EARTH_DOT; - d_satvel_X = - Omega_dot * (cos(u) * r + sin(u) * r * cos(i)) + d_satpos_X * cos(Omega) - d_satpos_Y * cos(i) * sin(Omega); + d_satvel_X = -Omega_dot * (cos(u) * r + sin(u) * r * cos(i)) + d_satpos_X * cos(Omega) - d_satpos_Y * cos(i) * sin(Omega); d_satvel_Y = Omega_dot * (cos(u) * r * cos(Omega) - sin(u) * r * cos(i) * sin(Omega)) + d_satpos_X * sin(Omega) + d_satpos_Y * cos(i) * cos(Omega); d_satvel_Z = d_satpos_Y * sin(i); diff --git a/src/core/system_parameters/beidou_dnav_ephemeris.h b/src/core/system_parameters/beidou_dnav_ephemeris.h index aae35a412..238a0a728 100644 --- a/src/core/system_parameters/beidou_dnav_ephemeris.h +++ b/src/core/system_parameters/beidou_dnav_ephemeris.h @@ -32,12 +32,9 @@ #ifndef GNSS_SDR_BEIDOU_DNAV_EPHEMERIS_H_ #define GNSS_SDR_BEIDOU_DNAV_EPHEMERIS_H_ - +#include #include #include -#include "boost/assign.hpp" -#include - /*! @@ -56,45 +53,46 @@ private: * \param[out] - corrected time, in seconds */ double check_t(double time); + public: - unsigned int i_satellite_PRN; // SV PRN NUMBER - double d_TOW; //!< Time of BEIDOU Week of the ephemeris set (taken from subframes TOW) [s] - double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - 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-200E) [s] - double d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [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] - double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] - double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - 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-200E) + unsigned int i_satellite_PRN; // SV PRN NUMBER + double d_TOW; //!< Time of BEIDOU Week of the ephemeris set (taken from subframes TOW) [s] + double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] + double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] + double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + 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-200E) [s] + double d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [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] + double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] + double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + double d_OMEGA; //!< Argument of Perigee [semi-cicles] + 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-200E) int i_SV_health; - double d_TGD1; //!< Estimated Group Delay Differential on B1I [s] - double d_TGD2; //!< Estimated Group Delay Differential on B2I [s] - double d_AODC; //!< Age of Data, Clock - double d_AODE; //!< Age of Data, Ephemeris - int i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] + double d_TGD1; //!< Estimated Group Delay Differential on B1I [s] + double d_TGD2; //!< Estimated Group Delay Differential on B2I [s] + double d_AODC; //!< Age of Data, Clock + double d_AODE; //!< Age of Data, Ephemeris + int i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - int i_sig_type; //!< BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q) */ - int i_nav_type; //!< BDS: nav type (0:unknown,1:IGSO/MEO,2:GEO) */ + int i_sig_type; //!< BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q) */ + int i_nav_type; //!< BDS: nav type (0:unknown,1:IGSO/MEO,2:GEO) */ - bool b_fit_interval_flag;//!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. + bool b_fit_interval_flag; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. double d_spare1; double d_spare2; - 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] + 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] /*! \brief If true, enhanced level of integrity assurance. * @@ -111,22 +109,22 @@ public: bool b_antispoofing_flag; //!< If true, the AntiSpoofing mode is ON in that SV // clock terms derived from ephemeris data - double d_satClkDrift; //!< GPS clock error - double d_dtr; //!< relativistic clock correction term + double d_satClkDrift; //!< GPS clock error + double d_dtr; //!< relativistic clock correction term // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] - std::map satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus + std::map satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus - template + template /*! * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file. @@ -134,47 +132,49 @@ public: void serialize(Archive& archive, const unsigned int version) { using boost::serialization::make_nvp; - if(version){}; + if (version) + { + }; - archive & make_nvp("i_satellite_PRN", i_satellite_PRN); // SV PRN NUMBER - archive & make_nvp("d_TOW", d_TOW); //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] - archive & make_nvp("d_AODE", d_AODE); - archive & make_nvp("d_Crs", d_Crs); //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - archive & make_nvp("d_Delta_n", d_Delta_n); //!< Mean Motion Difference From Computed Value [semi-circles/s] - archive & make_nvp("d_M_0", d_M_0); //!< Mean Anomaly at Reference Time [semi-circles] - 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_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-200E) [s] - archive & make_nvp("d_Toc", d_Toe); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [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] - archive & make_nvp("d_i_0", d_i_0); //!< Inclination Angle at Reference Time [semi-circles] - archive & make_nvp("d_Crc", d_Crc); //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - archive & make_nvp("d_OMEGA", d_OMEGA); //!< Argument of Perigee [semi-cicles] - 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-200E) - 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] - archive & make_nvp("d_TGD2", d_TGD2); //!< 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("i_AODO", i_AODO); //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] + archive& make_nvp("i_satellite_PRN", i_satellite_PRN); // SV PRN NUMBER + archive& make_nvp("d_TOW", d_TOW); //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] + archive& make_nvp("d_AODE", d_AODE); + archive& make_nvp("d_Crs", d_Crs); //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + archive& make_nvp("d_Delta_n", d_Delta_n); //!< Mean Motion Difference From Computed Value [semi-circles/s] + archive& make_nvp("d_M_0", d_M_0); //!< Mean Anomaly at Reference Time [semi-circles] + 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_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-200E) [s] + archive& make_nvp("d_Toc", d_Toe); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [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] + archive& make_nvp("d_i_0", d_i_0); //!< Inclination Angle at Reference Time [semi-circles] + archive& make_nvp("d_Crc", d_Crc); //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + archive& make_nvp("d_OMEGA", d_OMEGA); //!< Argument of Perigee [semi-cicles] + 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-200E) + 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] + archive& make_nvp("d_TGD2", d_TGD2); //!< 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("i_AODO", i_AODO); //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - archive & make_nvp("b_fit_interval_flag", b_fit_interval_flag);//!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. - archive & make_nvp("d_spare1", d_spare1); - archive & make_nvp("d_spare2", d_spare2); + archive& make_nvp("b_fit_interval_flag", b_fit_interval_flag); //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. + archive& make_nvp("d_spare1", d_spare1); + archive& make_nvp("d_spare2", d_spare2); - archive & make_nvp("d_A_f0", d_A_f0); //!< Coefficient 0 of code phase offset model [s] - archive & make_nvp("d_A_f1", d_A_f1); //!< Coefficient 1 of code phase offset model [s/s] - archive & make_nvp("d_A_f2", d_A_f2); //!< Coefficient 2 of code phase offset model [s/s^2] + archive& make_nvp("d_A_f0", d_A_f0); //!< Coefficient 0 of code phase offset model [s] + archive& make_nvp("d_A_f1", d_A_f1); //!< Coefficient 1 of code phase offset model [s/s] + archive& make_nvp("d_A_f2", d_A_f2); //!< Coefficient 2 of code phase offset model [s/s^2] - archive & make_nvp("b_integrity_status_flag", b_integrity_status_flag); - archive & make_nvp("b_alert_flag", b_alert_flag); //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - archive & make_nvp("b_antispoofing_flag", b_antispoofing_flag); //!< If true, the AntiSpoofing mode is ON in that SV + archive& make_nvp("b_integrity_status_flag", b_integrity_status_flag); + archive& make_nvp("b_alert_flag", b_alert_flag); //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. + archive& make_nvp("b_antispoofing_flag", b_antispoofing_flag); //!< If true, the AntiSpoofing mode is ON in that SV } /*! diff --git a/src/core/system_parameters/beidou_dnav_iono.cc b/src/core/system_parameters/beidou_dnav_iono.cc index e67f6f4f2..b7d4ebb7e 100644 --- a/src/core/system_parameters/beidou_dnav_iono.cc +++ b/src/core/system_parameters/beidou_dnav_iono.cc @@ -43,4 +43,3 @@ Beidou_Dnav_Iono::Beidou_Dnav_Iono() d_beta2 = 0.0; d_beta3 = 0.0; } - diff --git a/src/core/system_parameters/beidou_dnav_iono.h b/src/core/system_parameters/beidou_dnav_iono.h index cd67b1c37..b7a11faf6 100644 --- a/src/core/system_parameters/beidou_dnav_iono.h +++ b/src/core/system_parameters/beidou_dnav_iono.h @@ -32,8 +32,6 @@ #ifndef GNSS_SDR_BEIDOU_DNAV_IONO_H_ #define GNSS_SDR_BEIDOU_DNAV_IONO_H_ - -#include "boost/assign.hpp" #include @@ -44,20 +42,20 @@ class Beidou_Dnav_Iono { public: - bool valid; //!< Valid flag + bool valid; //!< Valid flag // Ionospheric parameters - double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] - double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] - double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] - double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] - double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] - double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] - double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] - double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] + double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] + double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] + double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] + double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] + double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] + double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] + double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] + double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] - Beidou_Dnav_Iono(); //!< Default constructor + Beidou_Dnav_Iono(); //!< Default constructor - template + template /*! * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file. @@ -65,15 +63,17 @@ public: void serialize(Archive& archive, const unsigned int version) { using boost::serialization::make_nvp; - if(version){}; - archive & make_nvp("d_alpha0",d_alpha0); - archive & make_nvp("d_alpha1",d_alpha1); - archive & make_nvp("d_alpha2",d_alpha2); - archive & make_nvp("d_alpha3",d_alpha3); - archive & make_nvp("d_beta0",d_beta0); - archive & make_nvp("d_beta1",d_beta1); - archive & make_nvp("d_beta2",d_beta2); - archive & make_nvp("d_beta3",d_beta3); + if (version) + { + }; + archive& make_nvp("d_alpha0", d_alpha0); + archive& make_nvp("d_alpha1", d_alpha1); + archive& make_nvp("d_alpha2", d_alpha2); + archive& make_nvp("d_alpha3", d_alpha3); + archive& make_nvp("d_beta0", d_beta0); + archive& make_nvp("d_beta1", d_beta1); + archive& make_nvp("d_beta2", d_beta2); + archive& make_nvp("d_beta3", d_beta3); } }; diff --git a/src/core/system_parameters/beidou_dnav_navigation_message.cc b/src/core/system_parameters/beidou_dnav_navigation_message.cc index ac63aa7fa..19e87cd0f 100644 --- a/src/core/system_parameters/beidou_dnav_navigation_message.cc +++ b/src/core/system_parameters/beidou_dnav_navigation_message.cc @@ -30,15 +30,14 @@ */ #include "beidou_dnav_navigation_message.h" - -#include -#include -#include -#include +#include "gnss_satellite.h" #include // for boost::crc_basic, boost::crc_optimal #include #include -#include +#include +#include +#include +#include void Beidou_Dnav_Navigation_Message::reset() @@ -228,7 +227,7 @@ void Beidou_Dnav_Navigation_Message::print_beidou_word_bytes(unsigned int BEIDOU std::cout << std::endl; } -bool Beidou_Dnav_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector> parameter) +bool Beidou_Dnav_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector>& parameter) { bool value; @@ -243,7 +242,7 @@ bool Beidou_Dnav_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector> parameter) +unsigned long int Beidou_Dnav_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector>& parameter) { unsigned long int value = 0; int num_of_slices = parameter.size(); @@ -261,7 +260,7 @@ unsigned long int Beidou_Dnav_Navigation_Message::read_navigation_unsigned(std:: return value; } -signed long int Beidou_Dnav_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector> parameter) +signed long int Beidou_Dnav_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector>& parameter) { signed long int value = 0; int num_of_slices = parameter.size(); @@ -655,7 +654,6 @@ int Beidou_Dnav_Navigation_Message::d1_subframe_decoder(std::string const &subfr d_M0_ALMANAC = static_cast(read_navigation_signed(subframe_bits, D1_M0)); d_M0_ALMANAC = d_M0_ALMANAC * D1_M0_ALMANAC_LSB; - } if (SV_page_5 == 7) @@ -1022,8 +1020,6 @@ Beidou_Dnav_Ephemeris Beidou_Dnav_Navigation_Message::get_ephemeris() eph.d_A_f2 = d_A_f2; - - eph.d_TGD1 = d_TGD1; eph.d_TGD2 = d_TGD2; } diff --git a/src/core/system_parameters/beidou_dnav_navigation_message.h b/src/core/system_parameters/beidou_dnav_navigation_message.h index dcfc056a6..5a5ff9f55 100644 --- a/src/core/system_parameters/beidou_dnav_navigation_message.h +++ b/src/core/system_parameters/beidou_dnav_navigation_message.h @@ -34,19 +34,18 @@ #define GNSS_SDR_BEIDOU_DNAV_NAVIGATION_MESSAGE_H_ +#include "Beidou_B1I.h" +#include "Beidou_B3I.h" +#include "Beidou_DNAV.h" +#include "beidou_dnav_almanac.h" +#include "beidou_dnav_ephemeris.h" +#include "beidou_dnav_iono.h" +#include "beidou_dnav_utc_model.h" #include #include #include #include #include -#include "beidou_dnav_almanac.h" -#include "beidou_dnav_ephemeris.h" -#include "beidou_dnav_iono.h" -#include "beidou_dnav_utc_model.h" -#include "Beidou_B1I.h" -#include "Beidou_B3I.h" -#include "Beidou_DNAV.h" - /*! @@ -57,9 +56,9 @@ class Beidou_Dnav_Navigation_Message { private: - unsigned long int read_navigation_unsigned(std::bitset bits, const std::vector> parameter); - signed long int read_navigation_signed(std::bitset bits, const std::vector> parameter); - bool read_navigation_bool(std::bitset bits, const std::vector> parameter); + unsigned long int read_navigation_unsigned(std::bitset bits, const std::vector>& parameter); + signed long int read_navigation_signed(std::bitset bits, const std::vector>& parameter); + bool read_navigation_bool(std::bitset bits, const std::vector>& parameter); void print_beidou_word_bytes(unsigned int BEIDOU_word); /* * Accounts for the beginning or end of week crossover diff --git a/src/core/system_parameters/beidou_dnav_utc_model.cc b/src/core/system_parameters/beidou_dnav_utc_model.cc index 6ba96238d..e56d2c1b8 100644 --- a/src/core/system_parameters/beidou_dnav_utc_model.cc +++ b/src/core/system_parameters/beidou_dnav_utc_model.cc @@ -49,4 +49,3 @@ Beidou_Dnav_Utc_Model::Beidou_Dnav_Utc_Model() d_A0_GLO = 0; d_A1_GLO = 0; } - diff --git a/src/core/system_parameters/beidou_dnav_utc_model.h b/src/core/system_parameters/beidou_dnav_utc_model.h index 11f456beb..8ca6a1929 100644 --- a/src/core/system_parameters/beidou_dnav_utc_model.h +++ b/src/core/system_parameters/beidou_dnav_utc_model.h @@ -33,7 +33,6 @@ #ifndef GNSS_SDR_BEIDOU_DNAV_UTC_MODEL_H_ #define GNSS_SDR_BEIDOU_DNAV_UTC_MODEL_H_ -#include #include @@ -48,24 +47,24 @@ public: bool valid; // BeiDou UTC parameters - double d_A0_UTC; //!< BDT clock bias relative to UTC [s] - double d_A1_UTC; //!< BDT clock rate relative to UTC [s/s] + double d_A0_UTC; //!< BDT clock bias relative to UTC [s] + double d_A1_UTC; //!< BDT clock rate relative to UTC [s/s] double d_DeltaT_LS; //!< Delta time due to leap seconds before the new leap second effective int i_WN_LSF; //!< Week number of the new leap second int i_DN; //!< Day number of week of the new leap second double d_DeltaT_LSF; //!< Delta time due to leap seconds after the new leap second effective [s] // BeiDou to GPS time corrections - double d_A0_GPS; //!< BDT clock bias relative to GPS time [s] - double d_A1_GPS; //!< BDT clock rate relative to GPS time [s/s] + double d_A0_GPS; //!< BDT clock bias relative to GPS time [s] + double d_A1_GPS; //!< BDT clock rate relative to GPS time [s/s] // BeiDou to Galileo time corrections - double d_A0_GAL; //!< BDT clock bias relative to GAL time [s] - double d_A1_GAL; //!< BDT clock rate relative to GAL time [s/s] + double d_A0_GAL; //!< BDT clock bias relative to GAL time [s] + double d_A1_GAL; //!< BDT clock rate relative to GAL time [s/s] // BeiDou to GLONASS time corrections - double d_A0_GLO; //!< BDT clock bias relative to GLO time [s] - double d_A1_GLO; //!< BDT clock rate relative to GLO time [s/s] + double d_A0_GLO; //!< BDT clock bias relative to GLO time [s] + double d_A1_GLO; //!< BDT clock rate relative to GLO time [s/s] Beidou_Dnav_Utc_Model(); @@ -93,7 +92,6 @@ public: archive& make_nvp("d_A0_GPS", d_A0_GLO); archive& make_nvp("d_A0_GPS", d_A1_GLO); } - }; #endif diff --git a/src/core/system_parameters/galileo_ephemeris.h b/src/core/system_parameters/galileo_ephemeris.h index 75d2bdbd9..42e4288a4 100644 --- a/src/core/system_parameters/galileo_ephemeris.h +++ b/src/core/system_parameters/galileo_ephemeris.h @@ -33,7 +33,6 @@ #ifndef GNSS_SDR_GALILEO_EPHEMERIS_H_ #define GNSS_SDR_GALILEO_EPHEMERIS_H_ -#include #include #include diff --git a/src/core/system_parameters/rtcm.cc b/src/core/system_parameters/rtcm.cc index 31640ce0a..a5c02d4d4 100644 --- a/src/core/system_parameters/rtcm.cc +++ b/src/core/system_parameters/rtcm.cc @@ -35,7 +35,6 @@ #include #include #include -#include #include // for std::reverse #include // std::chrono::seconds #include // for std::fmod @@ -186,7 +185,7 @@ bool Rtcm::check_CRC(const std::string& message) const std::string Rtcm::bin_to_binary_data(const std::string& s) const { std::string s_aux; - int32_t remainder = static_cast(std::fmod(s.length(), 8)); + auto remainder = static_cast(std::fmod(s.length(), 8)); std::vector c; c.reserve(s.length()); @@ -239,7 +238,7 @@ std::string Rtcm::bin_to_hex(const std::string& s) const { std::string s_aux; std::stringstream ss; - int32_t remainder = static_cast(std::fmod(s.length(), 4)); + auto remainder = static_cast(std::fmod(s.length(), 4)); if (remainder != 0) { @@ -439,7 +438,7 @@ std::bitset<64> Rtcm::get_MT1001_4_header(uint32_t msg_number, double obs_time, uint32_t ref_id, uint32_t smooth_int, bool sync_flag, bool divergence_free) { uint32_t reference_station_id = ref_id; // Max: 4095 - const std::map observables_ = observables; + const std::map& observables_ = observables; bool synchronous_GNSS_flag = sync_flag; bool divergence_free_smoothing_indicator = divergence_free; uint32_t smoothing_interval = smooth_int; @@ -501,7 +500,7 @@ std::string Rtcm::print_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, co { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -550,7 +549,7 @@ std::string Rtcm::print_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, co { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -623,11 +622,11 @@ std::string Rtcm::print_MT1003(const Gps_Ephemeris& ephL1, const Gps_CNAV_Epheme { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_ == "G") && (sig_ == "2S")) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -732,11 +731,11 @@ std::string Rtcm::print_MT1004(const Gps_Ephemeris& ephL1, const Gps_CNAV_Epheme { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_ == "G") && (sig_ == "2S")) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -1066,9 +1065,8 @@ std::string Rtcm::print_MT1008(uint32_t ref_id, const std::string& antenna_descr DF029 = std::bitset<8>(len); std::string DF030_str_; - for (auto it = ant_descriptor.cbegin(); it != ant_descriptor.cend(); it++) + for (char c : ant_descriptor) { - char c = *it; std::bitset<8> character = std::bitset<8>(c); DF030_str_ += character.to_string(); } @@ -1085,9 +1083,8 @@ std::string Rtcm::print_MT1008(uint32_t ref_id, const std::string& antenna_descr DF032 = std::bitset<8>(len2); std::string DF033_str_; - for (auto it = ant_sn.cbegin(); it != ant_sn.cend(); it++) + for (char c : ant_sn) { - char c = *it; std::bitset<8> character = std::bitset<8>(c); DF033_str_ += character.to_string(); } @@ -1118,7 +1115,7 @@ std::bitset<61> Rtcm::get_MT1009_12_header(uint32_t msg_number, double obs_time, uint32_t ref_id, uint32_t smooth_int, bool sync_flag, bool divergence_free) { uint32_t reference_station_id = ref_id; // Max: 4095 - const std::map observables_ = observables; + const std::map& observables_ = observables; bool synchronous_GNSS_flag = sync_flag; bool divergence_free_smoothing_indicator = divergence_free; uint32_t smoothing_interval = smooth_int; @@ -1182,7 +1179,7 @@ std::string Rtcm::print_MT1009(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, d { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "R") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -1231,7 +1228,7 @@ std::string Rtcm::print_MT1010(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, d { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "R") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -1308,11 +1305,11 @@ std::string Rtcm::print_MT1011(const Glonass_Gnav_Ephemeris& ephL1, const Glonas { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "R") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("R") == 0) && (sig_.compare("2C") == 0)) + if ((system_ == "R") && (sig_ == "2C")) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -1419,11 +1416,11 @@ std::string Rtcm::print_MT1012(const Glonass_Gnav_Ephemeris& ephL1, const Glonas { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "R") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("R") == 0) && (sig_.compare("2C") == 0)) + if ((system_ == "R") && (sig_ == "2C")) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -2013,9 +2010,8 @@ std::string Rtcm::print_MT1029(uint32_t ref_id, const Gps_Ephemeris& gps_eph, do uint32_t i = 0; bool first = true; std::string text_binary; - for (auto it = message.cbegin(); it != message.cend(); it++) + for (char c : message) { - char c = *it; if (isgraph(c)) { i++; @@ -2337,7 +2333,7 @@ std::string Rtcm::get_MSM_header(uint32_t msg_number, bool more_messages) { // Find first element in observables block and define type of message - std::map::const_iterator observables_iter = observables.begin(); + auto observables_iter = observables.begin(); std::string sys(observables_iter->second.System, 1); Rtcm::set_DF002(msg_number); @@ -3383,33 +3379,33 @@ uint32_t Rtcm::lock_time(const Galileo_Ephemeris& eph, double obs_time, const Gn boost::posix_time::ptime last_lock_time; std::string sig_(gnss_synchro.Signal); - if (sig_.compare("1B") == 0) + if (sig_ == "1B") { last_lock_time = Rtcm::gal_E1_last_lock_time[65 - gnss_synchro.PRN]; } - if ((sig_.compare("5X") == 0) || (sig_.compare("8X") == 0) || (sig_.compare("7X") == 0)) + if ((sig_ == "5X") || (sig_ == "8X") || (sig_ == "7X")) { last_lock_time = Rtcm::gal_E5_last_lock_time[65 - gnss_synchro.PRN]; } if (last_lock_time.is_not_a_date_time()) // || CHECK LLI!!......) { - if (sig_.compare("1B") == 0) + if (sig_ == "1B") { Rtcm::gal_E1_last_lock_time[65 - gnss_synchro.PRN] = current_time; } - if ((sig_.compare("5X") == 0) || (sig_.compare("8X") == 0) || (sig_.compare("7X") == 0)) + if ((sig_ == "5X") || (sig_ == "8X") || (sig_ == "7X")) { Rtcm::gal_E5_last_lock_time[65 - gnss_synchro.PRN] = current_time; } } boost::posix_time::time_duration lock_duration = current_time - current_time; - if (sig_.compare("1B") == 0) + if (sig_ == "1B") { lock_duration = current_time - Rtcm::gal_E1_last_lock_time[65 - gnss_synchro.PRN]; } - if ((sig_.compare("5X") == 0) || (sig_.compare("8X") == 0) || (sig_.compare("7X") == 0)) + if ((sig_ == "5X") || (sig_ == "8X") || (sig_ == "7X")) { lock_duration = current_time - Rtcm::gal_E5_last_lock_time[65 - gnss_synchro.PRN]; } @@ -3426,33 +3422,33 @@ uint32_t Rtcm::lock_time(const Glonass_Gnav_Ephemeris& eph, double obs_time, con boost::posix_time::ptime last_lock_time; std::string sig_(gnss_synchro.Signal); - if (sig_.compare("1C") == 0) + if (sig_ == "1C") { last_lock_time = Rtcm::glo_L1_last_lock_time[65 - gnss_synchro.PRN]; } - if (sig_.compare("2C") == 0) + if (sig_ == "2C") { last_lock_time = Rtcm::glo_L2_last_lock_time[65 - gnss_synchro.PRN]; } if (last_lock_time.is_not_a_date_time()) // || CHECK LLI!!......) { - if (sig_.compare("1C") == 0) + if (sig_ == "1C") { Rtcm::glo_L1_last_lock_time[65 - gnss_synchro.PRN] = current_time; } - if (sig_.compare("2C") == 0) + if (sig_ == "2C") { Rtcm::glo_L2_last_lock_time[65 - gnss_synchro.PRN] = current_time; } } boost::posix_time::time_duration lock_duration = current_time - current_time; - if (sig_.compare("1C") == 0) + if (sig_ == "1C") { lock_duration = current_time - Rtcm::glo_L1_last_lock_time[65 - gnss_synchro.PRN]; } - if (sig_.compare("2C") == 0) + if (sig_ == "2C") { lock_duration = current_time - Rtcm::glo_L2_last_lock_time[65 - gnss_synchro.PRN]; } @@ -4548,7 +4544,7 @@ int32_t Rtcm::set_DF126(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) int32_t Rtcm::set_DF127(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - uint32_t P4 = static_cast(std::round(glonass_gnav_eph.d_P_4)); + auto P4 = static_cast(std::round(glonass_gnav_eph.d_P_4)); DF127 = std::bitset<1>(P4); return 0; } @@ -4620,7 +4616,7 @@ int32_t Rtcm::set_DF135(const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model) int32_t Rtcm::set_DF136(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - uint32_t l_n = static_cast(std::round(glonass_gnav_eph.d_l5th_n)); + auto l_n = static_cast(std::round(glonass_gnav_eph.d_l5th_n)); DF136 = std::bitset<1>(l_n); return 0; } @@ -4913,7 +4909,7 @@ int32_t Rtcm::set_DF394(const std::map& gnss_synchro) int32_t Rtcm::set_DF395(const std::map& gnss_synchro) { DF395.reset(); - if (gnss_synchro.size() == 0) + if (gnss_synchro.empty()) { return 1; } @@ -4929,44 +4925,44 @@ int32_t Rtcm::set_DF395(const std::map& gnss_synchro) std::string sys(&gnss_synchro_iter->second.System, 1); - if ((sig.compare("1C") == 0) && (sys.compare("G") == 0)) + if ((sig == "1C") && (sys == "G")) { mask_position = 32 - 2; DF395.set(mask_position, true); } - if ((sig.compare("2S") == 0) && (sys.compare("G") == 0)) + if ((sig == "2S") && (sys == "G")) { mask_position = 32 - 15; DF395.set(mask_position, true); } - if ((sig.compare("5X") == 0) && (sys.compare("G") == 0)) + if ((sig == "5X") && (sys == "G")) { mask_position = 32 - 24; DF395.set(mask_position, true); } - if ((sig.compare("1B") == 0) && (sys.compare("E") == 0)) + if ((sig == "1B") && (sys == "E")) { mask_position = 32 - 4; DF395.set(mask_position, true); } - if ((sig.compare("5X") == 0) && (sys.compare("E") == 0)) + if ((sig == "5X") && (sys == "E")) { mask_position = 32 - 24; DF395.set(mask_position, true); } - if ((sig.compare("7X") == 0) && (sys.compare("E") == 0)) + if ((sig == "7X") && (sys == "E")) { mask_position = 32 - 16; DF395.set(mask_position, true); } - if ((sig.compare("1C") == 0) && (sys.compare("R") == 0)) + if ((sig == "1C") && (sys == "R")) { mask_position = 32 - 2; DF395.set(mask_position, true); } - if ((sig.compare("2C") == 0) && (sys.compare("R") == 0)) + if ((sig == "2C") && (sys == "R")) { mask_position = 32 - 8; DF395.set(mask_position, true); @@ -5008,29 +5004,29 @@ std::string Rtcm::set_DF396(const std::map& observables) std::string sys(&observables_iter->second.System, 1); - if ((sig.compare("1C") == 0) && (sys.compare("G") == 0)) + if ((sig == "1C") && (sys == "G")) { list_of_signals.push_back(32 - 2); } - if ((sig.compare("2S") == 0) && (sys.compare("G") == 0)) + if ((sig == "2S") && (sys == "G")) { list_of_signals.push_back(32 - 15); } - if ((sig.compare("5X") == 0) && (sys.compare("G") == 0)) + if ((sig == "5X") && (sys == "G")) { list_of_signals.push_back(32 - 24); } - if ((sig.compare("1B") == 0) && (sys.compare("E") == 0)) + if ((sig == "1B") && (sys == "E")) { list_of_signals.push_back(32 - 4); } - if ((sig.compare("5X") == 0) && (sys.compare("E") == 0)) + if ((sig == "5X") && (sys == "E")) { list_of_signals.push_back(32 - 24); } - if ((sig.compare("7X") == 0) && (sys.compare("E") == 0)) + if ((sig == "7X") && (sys == "E")) { list_of_signals.push_back(32 - 16); } @@ -5059,32 +5055,32 @@ std::string Rtcm::set_DF396(const std::map& observables) sig = sig_.substr(0, 2); std::string sys(&observables_iter->second.System, 1); - if ((sig.compare("1C") == 0) && (sys.compare("G") == 0) && (list_of_signals.at(row) == 32 - 2) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "1C") && (sys == "G") && (list_of_signals.at(row) == 32 - 2) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("2S") == 0) && (sys.compare("G") == 0) && (list_of_signals.at(row) == 32 - 15) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "2S") && (sys == "G") && (list_of_signals.at(row) == 32 - 15) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("5X") == 0) && (sys.compare("G") == 0) && (list_of_signals.at(row) == 32 - 24) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "5X") && (sys == "G") && (list_of_signals.at(row) == 32 - 24) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("1B") == 0) && (sys.compare("E") == 0) && (list_of_signals.at(row) == 32 - 4) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "1B") && (sys == "E") && (list_of_signals.at(row) == 32 - 4) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("5X") == 0) && (sys.compare("E") == 0) && (list_of_signals.at(row) == 32 - 24) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "5X") && (sys == "E") && (list_of_signals.at(row) == 32 - 24) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("7X") == 0) && (sys.compare("E") == 0) && (list_of_signals.at(row) == 32 - 16) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "7X") && (sys == "E") && (list_of_signals.at(row) == 32 - 16) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } @@ -5298,11 +5294,11 @@ int32_t Rtcm::set_DF402(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& e uint32_t lock_time_indicator; std::string sig_(gnss_synchro.Signal); std::string sys(&gnss_synchro.System, 1); - if ((sig_.compare("1C") == 0) && (sys.compare("G") == 0)) + if ((sig_ == "1C") && (sys == "G")) { lock_time_period_s = Rtcm::lock_time(ephNAV, obs_time, gnss_synchro); } - if ((sig_.compare("2S") == 0) && (sys.compare("G") == 0)) + if ((sig_ == "2S") && (sys == "G")) { lock_time_period_s = Rtcm::lock_time(ephCNAV, obs_time, gnss_synchro); } @@ -5311,11 +5307,11 @@ int32_t Rtcm::set_DF402(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& e { lock_time_period_s = Rtcm::lock_time(ephFNAV, obs_time, gnss_synchro); } - if ((sig_.compare("1C") == 0) && (sys.compare("R") == 0)) + if ((sig_ == "1C") && (sys == "R")) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } - if ((sig_.compare("2C") == 0) && (sys.compare("R") == 0)) + if ((sig_ == "2C") && (sys == "R")) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } @@ -5342,31 +5338,31 @@ int32_t Rtcm::set_DF404(const Gnss_Synchro& gnss_synchro) int32_t fine_phaserange_rate; std::string sys_(&gnss_synchro.System, 1); - if ((sig_.compare("1C") == 0) && (sys_.compare("G") == 0)) + if ((sig_ == "1C") && (sys_ == "G")) { lambda = GPS_C_m_s / GPS_L1_FREQ_HZ; } - if ((sig_.compare("2S") == 0) && (sys_.compare("G") == 0)) + if ((sig_ == "2S") && (sys_ == "G")) { lambda = GPS_C_m_s / GPS_L2_FREQ_HZ; } - if ((sig_.compare("5X") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "5X") && (sys_ == "E")) { lambda = GPS_C_m_s / Galileo_E5a_FREQ_HZ; } - if ((sig_.compare("1B") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "1B") && (sys_ == "E")) { lambda = GPS_C_m_s / Galileo_E1_FREQ_HZ; } - if ((sig_.compare("7X") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "7X") && (sys_ == "E")) { lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ; } - if ((sig_.compare("1C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "1C") && (sys_ == "R")) { lambda = GLONASS_C_m_s / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))); } - if ((sig_.compare("2C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "2C") && (sys_ == "R")) { //TODO Need to add slot number and freq number to gnss syncro lambda = GLONASS_C_m_s / (GLONASS_L2_CA_FREQ_HZ); @@ -5429,31 +5425,31 @@ int32_t Rtcm::set_DF406(const Gnss_Synchro& gnss_synchro) sig_ = sig_.substr(0, 2); std::string sys_(&gnss_synchro.System, 1); - if ((sig_.compare("1C") == 0) && (sys_.compare("G") == 0)) + if ((sig_ == "1C") && (sys_ == "G")) { lambda = GPS_C_m_s / GPS_L1_FREQ_HZ; } - if ((sig_.compare("2S") == 0) && (sys_.compare("G") == 0)) + if ((sig_ == "2S") && (sys_ == "G")) { lambda = GPS_C_m_s / GPS_L2_FREQ_HZ; } - if ((sig_.compare("5X") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "5X") && (sys_ == "E")) { lambda = GPS_C_m_s / Galileo_E5a_FREQ_HZ; } - if ((sig_.compare("1B") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "1B") && (sys_ == "E")) { lambda = GPS_C_m_s / Galileo_E1_FREQ_HZ; } - if ((sig_.compare("7X") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "7X") && (sys_ == "E")) { lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ; } - if ((sig_.compare("1C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "1C") && (sys_ == "R")) { lambda = GLONASS_C_m_s / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))); } - if ((sig_.compare("2C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "2C") && (sys_ == "R")) { //TODO Need to add slot number and freq number to gnss syncro lambda = GLONASS_C_m_s / (GLONASS_L2_CA_FREQ_HZ); @@ -5494,23 +5490,23 @@ int32_t Rtcm::set_DF407(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& e std::string sig_(gnss_synchro.Signal); std::string sys_(&gnss_synchro.System, 1); - if ((sig_.compare("1C")) && (sys_.compare("G") == 0)) + if ((sig_.compare("1C")) && (sys_ == "G")) { lock_time_period_s = Rtcm::lock_time(ephNAV, obs_time, gnss_synchro); } - if ((sig_.compare("2S")) && (sys_.compare("G") == 0)) + if ((sig_.compare("2S")) && (sys_ == "G")) { lock_time_period_s = Rtcm::lock_time(ephCNAV, obs_time, gnss_synchro); } - if ((sig_.compare("1B") || sig_.compare("5X") || sig_.compare("7X") || sig_.compare("8X")) && (sys_.compare("E") == 0)) + if ((sig_.compare("1B") || sig_.compare("5X") || sig_.compare("7X") || sig_.compare("8X")) && (sys_ == "E")) { lock_time_period_s = Rtcm::lock_time(ephFNAV, obs_time, gnss_synchro); } - if ((sig_.compare("1C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "1C") && (sys_ == "R")) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } - if ((sig_.compare("2C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "2C") && (sys_ == "R")) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 85b250e91..b154cb855 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -16,90 +16,60 @@ # along with GNSS-SDR. If not, see . # -set(GNSS_SDR_OPTIONAL_LIBS "") -set(GNSS_SDR_OPTIONAL_HEADERS "") - -if(ENABLE_GPERFTOOLS) - if(GPERFTOOLS_FOUND) - set(GNSS_SDR_OPTIONAL_LIBS "${GNSS_SDR_OPTIONAL_LIBS};${GPERFTOOLS_PROFILER};${GPERFTOOLS_TCMALLOC}") - set(GNSS_SDR_OPTIONAL_HEADERS "${GNSS_SDR_OPTIONAL_HEADERS};${GPERFTOOLS_INCLUDE_DIR}") - endif() -endif() - -if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) - set(GNSS_SDR_OPTIONAL_LIBS ${GNSS_SDR_OPTIONAL_LIBS} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES}) - set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${UHD_INCLUDE_DIRS}) -endif() - -if(OPENSSL_FOUND) - add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif() - -if(ENABLE_CUDA) - add_definitions(-DCUDA_GPU_ACCEL=1) - set(GNSS_SDR_OPTIONAL_LIBS ${GNSS_SDR_OPTIONAL_LIBS} ${CUDA_LIBRARIES}) - set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${CUDA_INCLUDE_DIRS}) -endif() - -if(ORC_FOUND) - set(GNSS_SDR_OPTIONAL_LIBS ${GNSS_SDR_OPTIONAL_LIBS} ${ORC_LIBRARIES}) - set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${ORC_INCLUDE_DIRS}) -endif() - -include_directories( - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/core/monitor - ${CMAKE_SOURCE_DIR}/src/core/libs - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIR} - ${GNSS_SDR_OPTIONAL_HEADERS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${OPT_GNSSSDR_INCLUDE_DIRS} -) - -add_definitions(-DGNSS_SDR_VERSION="${VERSION}") if(OS_IS_MACOSX) if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(MAC_LIBRARIES "-framework Accelerate -lc++") + set(MAC_LIBRARIES "-lc++") endif() endif() add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) +target_link_libraries(gnss-sdr + PUBLIC + Boost::filesystem + Boost::system + Gflags::gflags + Glog::glog + gnss_rx + gnss_sdr_flags + ${THREAD_LIBRARIES} + ${MAC_LIBRARIES} +) + +target_compile_definitions(gnss-sdr PUBLIC -DGNSS_SDR_VERSION="${VERSION}") + +if(ENABLE_CUDA) + target_link_libraries(gnss-sdr + PUBLIC + ${CUDA_LIBRARIES} + ) + target_include_directories(gnss-sdr + PUBLIC + ${CUDA_INCLUDE_DIRS} + ) + target_compile_definitions(gnss-sdr PRIVATE -DCUDA_GPU_ACCEL=1) +endif() + +if(ENABLE_GPERFTOOLS) + if(GPERFTOOLS_FOUND) + target_link_libraries(gnss-sdr + PUBLIC + ${GPERFTOOLS_PROFILER} + ${GPERFTOOLS_TCMALLOC} + ) + target_include_directories(gnss-sdr + PRIVATE + ${GPERFTOOLS_INCLUDE_DIR} + ) + endif() +endif() + add_custom_command(TARGET gnss-sdr POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/install/$ ) -target_link_libraries(gnss-sdr - ${MAC_LIBRARIES} - ${THREAD_LIBRARIES} - ${Boost_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - ${GNSS_SDR_OPTIONAL_LIBS} - gnss_sp_libs - gnss_sdr_flags - gnss_rx -) - install(TARGETS gnss-sdr RUNTIME DESTINATION bin COMPONENT "gnss-sdr") diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index de39387b7..b22ee1314 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -110,7 +110,7 @@ else() add_library(gtest ${GTEST_DIR}/src/gtest-all.cc ${GTEST_DIR}/src/gtest_main.cc) set(GTEST_LIBRARIES gtest) endif() - target_link_libraries(gtest ${THREAD_LIBRARIES}) + target_link_libraries(gtest PUBLIC ${THREAD_LIBRARIES}) endif() @@ -133,18 +133,11 @@ if(ENABLE_GPERFTOOLS) endif() endif() -if(Boost_VERSION LESS 105000) - add_definitions(-DOLD_BOOST=1) -endif() if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") add_definitions(-DGR_GREATER_38=1) endif() -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.15") - add_definitions(-DGR_GREATER_38=1) -endif() - if(OPENSSL_FOUND) add_definitions(-DUSE_OPENSSL_FALLBACK=1) endif() @@ -234,7 +227,6 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") endif() include(GNUInstallDirs) - string(REGEX REPLACE /[^/]*$ "" LIBDIR ${CMAKE_INSTALL_LIBDIR}) if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add( gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} @@ -254,29 +246,33 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF - BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} + BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} UPDATE_COMMAND "" PATCH_COMMAND "" ) endif() set(GPSTK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GPSTK headers") - set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) set(GPSTK_BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/) add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") set(OWN_GPSTK True) + add_library(Gpstk::gpstk SHARED IMPORTED) + add_dependencies(Gpstk::gpstk gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) + file(MAKE_DIRECTORY ${GPSTK_INCLUDE_DIRS}) + file(MAKE_DIRECTORY ${GPSTK_INCLUDE_DIRS}/gpstk) + set_target_properties(Gpstk::gpstk PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GPSTK_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${GPSTK_INCLUDE_DIRS};${GPSTK_INCLUDE_DIRS}/gpstk" + INTERFACE_LINK_LIBRARIES "${GPSTK_LIBRARY}" + ) else() - set(GPSTK_INCLUDE_DIRS ${GPSTK_INCLUDE_DIR}) - set(GPSTK_BINDIR ${GPSTK_LIBRARY}/../bin/) + set(GPSTK_BINDIR ${GPSTK_INCLUDE_DIR}/../bin/) add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") endif() endif() -if(ENABLE_UNIT_TESTING_EXTRA) - set(GNSS_SDR_TEST_OPTIONAL_LIBS ${GNSS_SDR_TEST_OPTIONAL_LIBS} ${GPSTK_LIBRARY}) - set(GNSS_SDR_TEST_OPTIONAL_HEADERS ${GNSS_SDR_TEST_OPTIONAL_HEADERS} ${GPSTK_INCLUDE_DIRS} ${GPSTK_INCLUDE_DIRS}/gpstk) -endif() - if(ENABLE_UNIT_TESTING_EXTRA) add_definitions(-DEXTRA_TESTS) if(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat) @@ -317,52 +313,7 @@ endif() set(LIST_INCLUDE_DIRS ${GTEST_INCLUDE_DIRECTORIES} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/core/libs - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${CMAKE_SOURCE_DIR}/src/core/monitor - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_generator/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_generator/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/tests/unit-tests/signal-processing-blocks/libs - ${CMAKE_SOURCE_DIR}/src/tests/system-tests/libs ${CMAKE_SOURCE_DIR}/src/tests/common-files - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIR} ${GNSS_SDR_TEST_OPTIONAL_HEADERS} ) @@ -374,34 +325,49 @@ include_directories(${LIST_INCLUDE_DIRS}) if(ENABLE_UNIT_TESTING) add_executable(run_tests ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cc) - target_link_libraries(run_tests ${CLANG_FLAGS} - ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_LIBRARIES} - channel_fsm - gnss_sp_libs - gnss_rx - gnss_system_parameters - signal_generator_blocks - signal_generator_adapters - pvt_gr_blocks - signal_processing_testing_lib - system_testing_lib - ${VOLK_GNSSSDR_LIBRARIES} - ${MATIO_LIBRARIES} - ${GNSS_SDR_TEST_OPTIONAL_LIBS} + target_link_libraries(run_tests + PUBLIC + ${CLANG_FLAGS} + Boost::chrono + Boost::filesystem + Boost::system + Armadillo::armadillo + Gflags::gflags + Glog::glog + Gnuradio::runtime + Gnuradio::blocks + Gnuradio::filter + Gnuradio::analog + Matio::matio + Volk::volk + Volkgnsssdr::volkgnsssdr + ${GTEST_LIBRARIES} + gnss_sp_libs + gnss_rx + gnss_system_parameters + core_monitor_lib + signal_source_adapters + datatype_adapters + input_filter_adapters + resampler_adapters + channel_adapters + acq_adapters + tracking_adapters + tracking_lib + telemetry_decoder_adapters + obs_adapters + signal_generator_adapters + pvt_adapters + signal_processing_testing_lib + system_testing_lib + ${GNSS_SDR_TEST_OPTIONAL_LIBS} ) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(run_tests gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) endif() - + if(ENABLE_UNIT_TESTING_EXTRA) + target_link_libraries(run_tests PUBLIC Gpstk::gpstk) + endif() if(ENABLE_INSTALL_TESTS) if(EXISTS ${CMAKE_SOURCE_DIR}/install/run_tests) file(REMOVE ${CMAKE_SOURCE_DIR}/install/run_tests) @@ -420,20 +386,23 @@ if(ENABLE_FPGA) ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc ) target_link_libraries(gps_l1_ca_dll_pll_tracking_test_fpga - ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_LIBRARIES} - ${MATIO_LIBRARIES} - channel_fsm - gnss_sp_libs - gnss_rx - gnss_system_parameters - signal_processing_testing_lib + PUBLIC + ${Boost_LIBRARIES} + Gflags::gflags + Glog::glog + ${GTEST_LIBRARIES} + Gnuradio::runtime + Gnuradio::blocks + Armadillo::armadillo + Volk::volk + Matio::matio + channel_fsm + gnss_sp_libs + gnss_rx + datatype_adapters + gnss_system_parameters + signal_processing_testing_lib + tracking_adapters ) install(TARGETS gps_l1_ca_dll_pll_tracking_test_fpga RUNTIME DESTINATION bin @@ -442,7 +411,6 @@ if(ENABLE_FPGA) endif() - ################################################################################ # System testing ################################################################################ @@ -462,8 +430,8 @@ function(add_system_test executable) add_dependencies(${executable} gtest) endif() - include_directories(${OPT_INCLUDES_}) - target_link_libraries(${executable} ${OPT_LIBS_}) + target_include_directories(${executable} PUBLIC ${OPT_INCLUDES_} ${CMAKE_SOURCES_DIR}/src/algorithms/libs) + target_link_libraries(${executable} PUBLIC ${OPT_LIBS_} gnss_sp_libs) if(ENABLE_INSTALL_TESTS) if(EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) @@ -491,22 +459,21 @@ if(ENABLE_SYSTEM_TESTING) add_definitions(-DHOST_SYSTEM="${HOST_SYSTEM}") #### TTFF - set(OPT_LIBS_ ${Boost_LIBRARIES} ${THREAD_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} ${GTEST_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} gnss_sp_libs + set(OPT_LIBS_ ${Boost_LIBRARIES} ${THREAD_LIBRARIES} Gflags::gflags Glog::glog + Gnuradio::runtime ${GTEST_LIBRARIES} + Gnuradio::blocks Gnuradio::filter + Gnuradio::analog gnss_sp_libs gnss_rx gnss_system_parameters) - add_system_test(ttff) if(ENABLE_SYSTEM_TESTING_EXTRA) #### POSITION_TEST - set(OPT_LIBS_ ${Boost_LIBRARIES} ${THREAD_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} + set(OPT_LIBS_ ${Boost_LIBRARIES} ${THREAD_LIBRARIES} Gflags::gflags Glog::glog + ${GTEST_LIBRARIES} Gnuradio::runtime + Gnuradio::blocks Gnuradio::filter + Gnuradio::analog Matio::matio Volkgnsssdr::volkgnsssdr gnss_sp_libs gnss_rx gnss_system_parameters - system_testing_lib) + system_testing_lib signal_processing_testing_lib) add_system_test(position_test) else() # Avoid working with old executables if they were switched ON and then OFF @@ -534,17 +501,23 @@ add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) add_executable(flowgraph_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_flowgraph_test.cc) -target_link_libraries(flowgraph_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} +target_link_libraries(flowgraph_test PUBLIC ${Boost_LIBRARIES} + Gflags::gflags + Glog::glog + Gnuradio::runtime ${GTEST_LIBRARIES} gnss_sp_libs gnss_rx gnss_system_parameters - ${VOLK_GNSSSDR_LIBRARIES} + signal_source_adapters + signal_source_gr_blocks + input_filter_adapters + channel_adapters + Volkgnsssdr::volkgnsssdr ) +target_include_directories(flowgraph_test PUBLIC ${CMAKE_SOURCE_DIR}/src/algorithms/libs) + add_test(flowgraph_test flowgraph_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(flowgraph_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) @@ -565,19 +538,24 @@ add_executable(gnss_block_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/adapter_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_block_factory_test.cc ) -target_link_libraries(gnss_block_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} +target_link_libraries(gnss_block_test PUBLIC ${Boost_LIBRARIES} + Gflags::gflags + Glog::glog ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} + Gnuradio::runtime + Gnuradio::blocks + Gnuradio::filter + Gnuradio::analog + signal_source_adapters + datatype_adapters + input_filter_adapters + channel_adapters gnss_sp_libs gnss_rx gnss_system_parameters - ${VOLK_GNSSSDR_LIBRARIES} + Volkgnsssdr::volkgnsssdr ) +target_include_directories(gnss_block_test PUBLIC ${CMAKE_SOURCE_DIR}/src/algorithms/libs) add_test(gnss_block_test gnss_block_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(gnss_block_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) @@ -592,17 +570,18 @@ add_executable(gnuradio_block_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main. ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc ) target_link_libraries(gnuradio_block_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} + Gflags::gflags + Glog::glog ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} + Gnuradio::runtime + Gnuradio::blocks + Gnuradio::filter + Gnuradio::analog gnss_sp_libs gnss_rx gnss_system_parameters - ${VOLK_GNSSSDR_LIBRARIES} + signal_source_gr_blocks + Volkgnsssdr::volkgnsssdr ) add_test(gnuradio_block_test gnuradio_block_test) if(NOT ${GTEST_DIR_LOCAL}) @@ -617,27 +596,18 @@ set_property(TEST gnuradio_block_test PROPERTY TIMEOUT 30) add_executable(matio_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/arithmetic/matio_test.cc ) -target_link_libraries(matio_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${MATIO_LIBRARIES} - gnss_system_parameters +target_link_libraries(matio_test + PUBLIC + Gflags::gflags + Glog::glog + gnss_rx + ${GTEST_LIBRARIES} + gnss_system_parameters + Matio::matio ) + add_test(matio_test matio_test) -if(NOT ${GTEST_DIR_LOCAL}) - if(MATIO_FOUND) - add_dependencies(matio_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) - else() - add_dependencies(matio_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION} matio-${GNSSSDR_MATIO_LOCAL_VERSION}) - endif() -else() - if(MATIO_FOUND) - add_dependencies(matio_test gtest) - else() - add_dependencies(matio_test gtest matio-${GNSSSDR_MATIO_LOCAL_VERSION}) - endif() -endif() + set_property(TEST matio_test PROPERTY TIMEOUT 30) ######################################################### @@ -645,20 +615,25 @@ set_property(TEST matio_test PROPERTY TIMEOUT 30) add_executable(acq_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc) -target_link_libraries(acq_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} - gnss_sp_libs - gnss_rx - gnss_system_parameters - signal_generator_blocks - signal_processing_testing_lib - ${VOLK_GNSSSDR_LIBRARIES}) +target_link_libraries(acq_test + PUBLIC + ${Boost_LIBRARIES} + Gflags::gflags + Glog::glog + ${GTEST_LIBRARIES} + Gnuradio::runtime + Gnuradio::blocks + Gnuradio::filter + Gnuradio::analog + gnss_sp_libs + gnss_rx + gnss_system_parameters + signal_generator_blocks + acq_adapters + signal_processing_testing_lib + Volkgnsssdr::volkgnsssdr +) + add_test(acq_test acq_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(acq_test acq_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) @@ -676,19 +651,22 @@ add_executable(trk_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc ) -target_link_libraries(trk_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} - gnss_sp_libs - gnss_rx - gnss_system_parameters - signal_generator_blocks - ${VOLK_GNSSSDR_LIBRARIES} +target_link_libraries(trk_test + PUBLIC + ${Boost_LIBRARIES} + Gflags::gflags + Glog::glog + ${GTEST_LIBRARIES} + Gnuradio::runtime + Gnuradio::blocks + Gnuradio::filter + Gnuradio::analog + gnss_sp_libs + gnss_rx + tracking_adapters + gnss_system_parameters + signal_generator_blocks + Volkgnsssdr::volkgnsssdr ) add_test(trk_test trk_test) if(NOT ${GTEST_DIR_LOCAL}) @@ -708,8 +686,10 @@ if(NOT ENABLE_PACKAGING) ) target_link_libraries(control_thread_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} + Gflags::gflags + Glog::glog + signal_source_adapters + gnss_sp_libs ${GTEST_LIBRARIES} gnss_rx ) @@ -726,8 +706,7 @@ endif() ######################################################### if(ENABLE_PACKAGING) - add_dependencies(check flowgraph_test gnss_block_test - gnuradio_block_test acq_test trk_test matio_test) + add_dependencies(check matio_test) else() add_dependencies(check control_thread_test flowgraph_test gnss_block_test gnuradio_block_test acq_test trk_test matio_test) diff --git a/src/tests/system-tests/libs/CMakeLists.txt b/src/tests/system-tests/libs/CMakeLists.txt index 178f83479..921d3cbf0 100644 --- a/src/tests/system-tests/libs/CMakeLists.txt +++ b/src/tests/system-tests/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -22,15 +22,6 @@ set(SYSTEM_TESTING_LIB_SOURCES rtklib_solver_dump_reader.cc ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} -) - file(GLOB SYSTEM_TESTING_LIB_HEADERS "*.h") list(SORT SYSTEM_TESTING_LIB_HEADERS) @@ -41,11 +32,16 @@ add_library(system_testing_lib source_group(Headers FILES ${SYSTEM_TESTING_LIB_HEADERS}) -if(NOT MATIO_FOUND) - add_dependencies(system_testing_lib - armadillo-${armadillo_RELEASE} - matio-${GNSSSDR_MATIO_LOCAL_VERSION} - ) -else() - add_dependencies(system_testing_lib armadillo-${armadillo_RELEASE}) -endif() +target_link_libraries(system_testing_lib + PUBLIC + Armadillo::armadillo + Gflags::gflags + PRIVATE + Boost::boost + Matio::matio +) + +set_property(TARGET system_testing_lib + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index b719dba55..e1ac453be 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -305,12 +305,12 @@ int PositionSystemTest::configure_receiver() config->set_property("PVT.AR_GPS", "PPP-AR"); config->set_property("PVT.elevation_mask", std::to_string(15)); - config_f = 0; + config_f = nullptr; } else { config_f = std::make_shared(FLAGS_config_file_ptest); - config = 0; + config = nullptr; } return 0; } @@ -374,8 +374,8 @@ bool PositionSystemTest::save_mat_xy(std::vector* x, std::vector matvar_t* matvar; filename.append(".mat"); std::cout << "save_mat_xy write " << filename << std::endl; - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT5); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT5); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, x->size()}; matvar = Mat_VarCreate("x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, &x[0], 0); @@ -409,8 +409,8 @@ bool PositionSystemTest::save_mat_x(std::vector* x, std::string filename matvar_t* matvar; filename.append(".mat"); std::cout << "save_mat_x write " << filename << std::endl; - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT5); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT5); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, x->size()}; matvar = Mat_VarCreate("x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, &x[0], 0); diff --git a/src/tests/system-tests/ttff.cc b/src/tests/system-tests/ttff.cc index e9a51e762..c5a7ca707 100644 --- a/src/tests/system-tests/ttff.cc +++ b/src/tests/system-tests/ttff.cc @@ -79,7 +79,7 @@ class TtffTest : public ::testing::Test public: void config_1(); void config_2(); - void print_TTFF_report(const std::vector &ttff_v, std::shared_ptr config_); + void print_TTFF_report(const std::vector &ttff_v, const std::shared_ptr& config_); std::shared_ptr config; std::shared_ptr config2; @@ -297,7 +297,7 @@ void receive_msg() } -void TtffTest::print_TTFF_report(const std::vector &ttff_v, std::shared_ptr config_) +void TtffTest::print_TTFF_report(const std::vector &ttff_v, const std::shared_ptr& config_) { std::ofstream ttff_report_file; std::string filename = "ttff_report"; @@ -388,7 +388,7 @@ void TtffTest::print_TTFF_report(const std::vector &ttff_v, std::shared_ for (double ttff_ : ttff) stm << ttff_ << " "; stm << std::endl; stm << "TTFF mean: " << mean << " [s]" << std::endl; - if (ttff.size() > 0) + if (!ttff.empty()) { stm << "TTFF max: " << *max_ttff << " [s]" << std::endl; stm << "TTFF min: " << *min_ttff << " [s]" << std::endl; @@ -629,7 +629,7 @@ int main(int argc, char **argv) msgsend_size = sizeof(msg.ttff); msgsnd(sysv_msqid, &msg, msgsend_size, IPC_NOWAIT); receive_msg_thread.join(); - msgctl(sysv_msqid, IPC_RMID, NULL); + msgctl(sysv_msqid, IPC_RMID, nullptr); google::ShutDownCommandLineFlags(); return res; diff --git a/src/tests/test_main.cc b/src/tests/test_main.cc index 721178fdd..5c62f9f9c 100644 --- a/src/tests/test_main.cc +++ b/src/tests/test_main.cc @@ -119,7 +119,7 @@ DECLARE_string(log_dir); #include "unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc" #include "unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc" // #include "unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc" -#include "unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc" +// #include "unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc" #if OPENCL_BLOCKS_TEST #include "unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc" 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 8b738eebf..56c7411e4 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 @@ -636,12 +636,7 @@ int AcquisitionPerformanceTest::run_receiver() top_block->run(); // Start threads and wait -#ifdef OLD_BOOST - ch_thread.timed_join(boost::posix_time::seconds(1)); -#endif -#ifndef OLD_BOOST ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); -#endif return 0; } 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 611c53d45..959d73fed 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 @@ -31,27 +31,27 @@ */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "Beidou_B1I.h" +#include "acquisition_dump_reader.h" +#include "beidou_b1i_pcps_acquisition.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "gnss_sdr_valve.h" #include "gnss_synchro.h" #include "gnuplot_i.h" +#include "in_memory_configuration.h" #include "test_flags.h" -#include "acquisition_dump_reader.h" -#include "beidou_b1i_pcps_acquisition.h" -#include "../../../../core/system_parameters/Beidou_B1I.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // ######## GNURADIO BLOCK MESSAGE RECEVER ######### diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc index 3388bf162..df2d68e1f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc @@ -551,16 +551,10 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults) { EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; } -#ifdef OLD_BOOST - ASSERT_NO_THROW({ - ch_thread.timed_join(boost::posix_time::seconds(1)); - }) << "Failure while waiting the queue to stop"; -#endif -#ifndef OLD_BOOST + ASSERT_NO_THROW({ ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); }) << "Failure while waiting the queue to stop"; -#endif } } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc index 70ad8e25e..cf515debb 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc @@ -553,16 +553,10 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResults) { EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; } -#ifdef OLD_BOOST - ASSERT_NO_THROW({ - ch_thread.timed_join(boost::posix_time::seconds(1)); - }) << "Failure while waiting the queue to stop."; -#endif -#ifndef OLD_BOOST + ASSERT_NO_THROW({ ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); }) << "Failure while waiting the queue to stop"; -#endif } delete acquisition; @@ -649,18 +643,11 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResultsProbabilities) std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; } -#ifdef OLD_BOOST - ASSERT_NO_THROW({ - ch_thread.timed_join(boost::posix_time::seconds(1)); - }) << "Failure while waiting the queue to stop" - << std::endl; -#endif -#ifndef OLD_BOOST + ASSERT_NO_THROW({ ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); }) << "Failure while waiting the queue to stop" << std::endl; -#endif } delete acquisition; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc index a8f668f69..6409a8d19 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc @@ -549,16 +549,10 @@ TEST_F(GlonassL2CaPcpsAcquisitionTest, ValidationOfResults) { EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; } -#ifdef OLD_BOOST - ASSERT_NO_THROW({ - ch_thread.timed_join(boost::posix_time::seconds(1)); - }) << "Failure while waiting the queue to stop."; -#endif -#ifndef OLD_BOOST + ASSERT_NO_THROW({ ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); }) << "Failure while waiting the queue to stop"; -#endif } delete acquisition; @@ -645,16 +639,10 @@ TEST_F(GlonassL2CaPcpsAcquisitionTest, ValidationOfResultsProbabilities) std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; } -#ifdef OLD_BOOST - ASSERT_NO_THROW({ - ch_thread.timed_join(boost::posix_time::seconds(1)); - }) << "Failure while waiting the queue to stop"; -#endif -#ifndef OLD_BOOST + ASSERT_NO_THROW({ ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); }) << "Failure while waiting the queue to stop"; -#endif } delete acquisition; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc index af4f5b6a5..641672a9a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc @@ -546,16 +546,10 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults) { EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; } -#ifdef OLD_BOOST - ASSERT_NO_THROW({ - ch_thread.timed_join(boost::posix_time::seconds(1)); - }) << "Failure while waiting the queue to stop"; -#endif -#ifndef OLD_BOOST + ASSERT_NO_THROW({ ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); }) << "Failure while waiting the queue to stop"; -#endif } delete acquisition; @@ -642,16 +636,10 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResultsProbabilities) std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; } -#ifdef OLD_BOOST - ASSERT_NO_THROW({ - ch_thread.timed_join(boost::posix_time::seconds(1)); - }) << "Failure while waiting the queue to stop"; -#endif -#ifndef OLD_BOOST + ASSERT_NO_THROW({ ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); }) << "Failure while waiting the queue to stop"; -#endif } delete acquisition; diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt index d0bd655d7..b98390b27 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt +++ b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt @@ -27,16 +27,6 @@ set(SIGNAL_PROCESSING_TESTING_LIB_SOURCES true_observables_reader.cc ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) - - file(GLOB SIGNAL_PROCESSING_TESTING_LIB_HEADERS "*.h") list(SORT SIGNAL_PROCESSING_TESTING_LIB_HEADERS) @@ -47,10 +37,18 @@ add_library(signal_processing_testing_lib source_group(Headers FILES ${SIGNAL_PROCESSING_TESTING_LIB_HEADERS}) -if(NOT MATIO_FOUND) - add_dependencies(signal_processing_testing_lib - matio-${GNSSSDR_MATIO_LOCAL_VERSION} glog-${glog_RELEASE} - ) -else() - add_dependencies(signal_processing_testing_lib glog-${glog_RELEASE}) -endif() +target_link_libraries(signal_processing_testing_lib + PUBLIC + Armadillo::armadillo + Gflags::gflags + Gnuradio::runtime + PRIVATE + Boost::boost + Matio::matio + Glog::glog +) + +set_property(TARGET signal_processing_testing_lib + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc b/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc index 344d1c1bc..dd1020249 100644 --- a/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc @@ -31,7 +31,6 @@ #include "file_signal_source.h" #include "in_memory_configuration.h" -#include #include #include #include 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 ffaeffc76..fc7b028fe 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 @@ -70,7 +70,7 @@ #define FIVE_SECONDS 5000000 // five seconds in microseconds void send_tracking_gps_input_samples(FILE *rx_signal_file, - int num_remaining_samples, const gr::top_block_sptr& top_block) + int num_remaining_samples, const gr::top_block_sptr &top_block) { int num_samples_transferred = 0; // number of samples that have been transferred to the DMA so far static int flowgraph_stopped = 0; // flag to indicate if the flowgraph is stopped already 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 0c4683d7a..44cb83374 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 @@ -31,6 +31,7 @@ */ #include "GPS_L1_CA.h" +#include "acquisition_msg_rx.h" #include "galileo_e5a_noncoherent_iq_acquisition_caf.h" #include "galileo_e5a_pcps_acquisition.h" #include "gnss_block_factory.h" @@ -60,59 +61,6 @@ #include -// ######## GNURADIO ACQUISITION BLOCK MESSAGE RECEVER ######### -class Acquisition_msg_rx; - -typedef boost::shared_ptr Acquisition_msg_rx_sptr; - -Acquisition_msg_rx_sptr Acquisition_msg_rx_make(); - - -class Acquisition_msg_rx : public gr::block -{ -private: - friend Acquisition_msg_rx_sptr Acquisition_msg_rx_make(); - void msg_handler_events(pmt::pmt_t msg); - Acquisition_msg_rx(); - -public: - int rx_message; - gr::top_block_sptr top_block; - ~Acquisition_msg_rx(); //!< Default destructor -}; - - -Acquisition_msg_rx_sptr Acquisition_msg_rx_make() -{ - return Acquisition_msg_rx_sptr(new Acquisition_msg_rx()); -} - - -void Acquisition_msg_rx::msg_handler_events(pmt::pmt_t msg) -{ - try - { - int64_t message = pmt::to_long(msg); - rx_message = message; - top_block->stop(); //stop the flowgraph - } - catch (boost::bad_any_cast& e) - { - LOG(WARNING) << "msg_handler_acquisition Bad cast!\n"; - rx_message = 0; - } -} - - -Acquisition_msg_rx::Acquisition_msg_rx() : gr::block("Acquisition_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) -{ - this->message_port_register_in(pmt::mp("events")); - this->set_msg_handler(pmt::mp("events"), boost::bind(&Acquisition_msg_rx::msg_handler_events, this, _1)); - rx_message = 0; -} - - -Acquisition_msg_rx::~Acquisition_msg_rx() {} // ######## GNURADIO TRACKING BLOCK MESSAGE RECEVER ######### class TrackingPullInTestFpga_msg_rx; diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index 16dfa40be..f96f0158c 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -17,85 +17,54 @@ # -if(OPENSSL_FOUND) - add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif() - set(FRONT_END_CAL_SOURCES front_end_cal.cc) set(FRONT_END_CAL_HEADERS front_end_cal.h) -include_directories( - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/core/libs - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${GNURADIO_BLOCKS_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIR} - ${VOLK_GNSSSDR_INCLUDE_DIRS} -) - add_library(front_end_cal_lib ${FRONT_END_CAL_SOURCES} ${FRONT_END_CAL_HEADERS}) source_group(Headers FILES ${FRONT_END_CAL_HEADERS}) target_link_libraries(front_end_cal_lib - ${MAC_LIBRARIES} - ${THREAD_LIBRARIES} - ${Boost_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} - ${GNSS_SDR_OPTIONAL_LIBS} - rx_core_lib - gnss_sdr_flags - gnss_rx - channel_fsm + PUBLIC + Armadillo::armadillo + ${THREAD_LIBRARIES} + acq_adapters + Volkgnsssdr::volkgnsssdr ${ORC_LIBRARIES} + rx_core_lib + gnss_sdr_flags + gnss_rx + channel_fsm + gnss_sp_libs + PRIVATE + Glog::glog + Gnuradio::blocks + Gnuradio::runtime + Boost::serialization + Boost::thread ) -add_dependencies(front_end_cal_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE}) - -add_definitions(-DGNSS_SDR_VERSION="${VERSION}") -add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") - add_executable(front-end-cal ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) +target_link_libraries(front-end-cal + PUBLIC + Volkgnsssdr::volkgnsssdr ${ORC_LIBRARIES} + rx_core_lib + gnss_rx + front_end_cal_lib + gnss_sdr_flags + PRIVATE + Glog::glog + Armadillo::armadillo +) + +target_compile_definitions(front-end-cal + PUBLIC -DGNSS_SDR_VERSION="${VERSION}" + PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" +) + add_custom_command(TARGET front-end-cal POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/install/$) -target_link_libraries(front-end-cal - ${MAC_LIBRARIES} - ${Boost_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} - ${GNSS_SDR_OPTIONAL_LIBS} - rx_core_lib - gnss_rx - front_end_cal_lib -) - install(TARGETS front-end-cal RUNTIME DESTINATION bin COMPONENT "front-end-cal" diff --git a/src/utils/matlab/dll_pll_veml_plot_sample.m b/src/utils/matlab/dll_pll_veml_plot_sample.m index 084ad56b6..011044a9f 100644 --- a/src/utils/matlab/dll_pll_veml_plot_sample.m +++ b/src/utils/matlab/dll_pll_veml_plot_sample.m @@ -34,15 +34,15 @@ if ~exist('dll_pll_veml_read_tracking_dump.m', 'file') addpath('./libs') end -samplingFreq = 25000000; %[Hz] -coherent_integration_time_ms = 1; %[ms] -channels = 10; % Number of channels +samplingFreq = 5000000; %[Hz] +coherent_integration_time_ms = 20; %[ms] +channels = 5; % Number of channels first_channel = 0; % Number of the first channel -path = '/home/dmiralles/Documents/gnss-sdr/';%#'; %% CHANGE THIS PATH +path = '/dump_dir/'; %% CHANGE THIS PATH for N=1:1:channels - tracking_log_path = [path 'epl_tracking_ch_' num2str(N+first_channel-1) '.dat']; %% CHANGE track_ch_ BY YOUR dump_filename + tracking_log_path = [path 'track_ch_' num2str(N+first_channel-1) '.dat']; %% CHANGE track_ch_ BY YOUR dump_filename GNSS_tracking(N) = dll_pll_veml_read_tracking_dump(tracking_log_path); end diff --git a/src/utils/matlab/gps_l1_ca_dll_pll_plot_sample.m b/src/utils/matlab/gps_l1_ca_dll_pll_plot_sample.m index f78151a36..e2f1f544b 100644 --- a/src/utils/matlab/gps_l1_ca_dll_pll_plot_sample.m +++ b/src/utils/matlab/gps_l1_ca_dll_pll_plot_sample.m @@ -38,7 +38,7 @@ samplingFreq = 6625000; %[Hz] channels = 5; first_channel = 0; -path = '/home/sergi/gnss/gnss-sdr/install/'; %% CHANGE THIS PATH +path = '/archive/'; %% CHANGE THIS PATH for N=1:1:channels tracking_log_path = [path 'epl_tracking_ch_' num2str(N+first_channel-1) '.dat']; %% CHANGE epl_tracking_ch_ BY YOUR dump_filename @@ -65,7 +65,7 @@ for N=1:1:channels trackResults(N).Q_L = zeros(1,length(GNSS_tracking(N).E)); trackResults(N).PRN = ones(1,length(GNSS_tracking(N).E)); trackResults(N).CNo = GNSS_tracking(N).CN0_SNV_dB_Hz.'; - + % Use original MATLAB tracking plot function settings.numberOfChannels = channels; settings.msToProcess = length(GNSS_tracking(N).E); diff --git a/src/utils/matlab/hybrid_observables_plot_sample.m b/src/utils/matlab/hybrid_observables_plot_sample.m index 2a8a784e5..9105c5bbd 100644 --- a/src/utils/matlab/hybrid_observables_plot_sample.m +++ b/src/utils/matlab/hybrid_observables_plot_sample.m @@ -29,10 +29,10 @@ clearvars; close all; addpath('./libs'); -samplingFreq = 25000000; %[Hz] -channels=10; -path='/home/dmiralles/Documents/gnss-sdr/'; -observables_log_path=[path 'observables.dat']; +samplingFreq = 6625000; %[Hz] +channels=5; +path='/archive/'; +observables_log_path=[path 'glo_observables.dat']; GNSS_observables= read_hybrid_observables_dump(channels,observables_log_path); %% diff --git a/src/utils/matlab/octave-workspace b/src/utils/matlab/octave-workspace deleted file mode 100644 index 97ac6a5bf..000000000 Binary files a/src/utils/matlab/octave-workspace and /dev/null differ diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index 344c0694b..4f859566d 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -19,14 +19,34 @@ find_package(GPSTK QUIET) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) include(GNUInstallDirs) - string(REGEX REPLACE /[^/]*$ "" LIBDIR ${CMAKE_INSTALL_LIBDIR}) - set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) + #string(REGEX REPLACE /[^/]*$ "" LIBDIR ${CMAKE_INSTALL_LIBDIR}) + set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) set(GPSTK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include) endif() -set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GPSTK_INCLUDE_DIR}/gpstk) find_package(Boost COMPONENTS iostreams serialization QUIET) +if(CMAKE_VERSION VERSION_LESS 3.5) + if(NOT TARGET Boost::iostreams) + add_library(Boost::iostreams IMPORTED SHARED) + set_property(TARGET Boost::iostreams PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::iostreams PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_IOSTREAMS_LIBRARIES}) + set_property(TARGET Boost::iostreams PROPERTY + IMPORTED_LOCATION ${Boost_IOSTREAMS_LIBRARIES}) + endif() + if(NOT TARGET Boost::serialization) + add_library(Boost::serialization IMPORTED SHARED) + set_property(TARGET Boost::serialization PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::serialization PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_SERIALIZARION_LIBRARIES}) + set_property(TARGET Boost::serialization PROPERTY + IMPORTED_LOCATION ${Boost_SERIALIZARION_LIBRARIES}) + endif() +endif() + find_program(UNCOMPRESS_EXECUTABLE uncompress PATHS /bin @@ -34,33 +54,34 @@ find_program(UNCOMPRESS_EXECUTABLE uncompress /usr/sbin ) -if(NOT UNCOMPRESS_EXECUTABLE-NOTFOUND) - add_definitions(-DUNCOMPRESS_EXECUTABLE="${UNCOMPRESS_EXECUTABLE}") -else() - add_definitions(-DUNCOMPRESS_EXECUTABLE="") -endif() - if(Boost_FOUND) - include_directories( - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GPSTK_INCLUDE_DIR}/gpstk - ${GPSTK_INCLUDE_DIR} - ) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") add_executable(rinex2assist ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) target_link_libraries(rinex2assist - ${Boost_LIBRARIES} - ${GPSTK_LIBRARY} - ${GFlags_LIBS} - gnss_sp_libs - gnss_rx + PUBLIC + Boost::iostreams + Boost::serialization + ${GPSTK_LIBRARY} + Gflags::gflags + gnss_system_parameters + gnss_sp_libs + gnss_rx ) + target_include_directories(rinex2assist + PUBLIC + ${GPSTK_INCLUDE_DIR}/gpstk + ${GPSTK_INCLUDE_DIR} + ) + + if(NOT UNCOMPRESS_EXECUTABLE-NOTFOUND) + target_compile_definitions(rinex2assist PUBLIC -DUNCOMPRESS_EXECUTABLE="${UNCOMPRESS_EXECUTABLE}") + else() + target_compile_definitions(rinex2assist PUBLIC -DUNCOMPRESS_EXECUTABLE="") + endif() + if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) endif()