1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 20:50:33 +00:00

Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into fpga

This commit is contained in:
Marc Majoral 2019-02-25 19:21:00 +01:00
commit cf0a37300a
679 changed files with 16967 additions and 9804 deletions

View File

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

View File

@ -1,4 +1,4 @@
# Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # 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 ../' ") message(WARNING "In-tree build is bad practice. Try 'cd build && cmake ../' ")
endif() endif()
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8.12)
project(gnss-sdr CXX C) project(gnss-sdr CXX C)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
file(RELATIVE_PATH RELATIVE_CMAKE_CALL ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) file(RELATIVE_PATH RELATIVE_CMAKE_CALL ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
@ -41,7 +41,7 @@ endif()
######################################################################## ########################################################################
# Determine optional blocks/libraries to be built (default: not built) # Determine optional blocks/libraries to be built (default: not built)
# Enable them at the command line by doing 'cmake -DENABLE_XXX=ON ../' # Enable them at the command line by doing 'cmake -DENABLE_XXX=ON ..'
######################################################################## ########################################################################
# Support of optional RF front-ends # Support of optional RF front-ends
option(ENABLE_UHD "Enable the use of UHD (driver for all USRP devices)" ON) option(ENABLE_UHD "Enable the use of UHD (driver for all USRP devices)" ON)
@ -58,6 +58,9 @@ option(ENABLE_RAW_UDP "Enable the use of high-optimized custom UDP packet sample
option(ENABLE_GPERFTOOLS "Enable linking to Gperftools libraries (tcmalloc and profiler)" OFF) option(ENABLE_GPERFTOOLS "Enable linking to Gperftools libraries (tcmalloc and profiler)" OFF)
option(ENABLE_GPROF "Enable the use of the GNU profiler tool 'gprof'" OFF) option(ENABLE_GPROF "Enable the use of the GNU profiler tool 'gprof'" OFF)
# Code correctness
option(ENABLE_CLANG_TIDY "Enable the use of clang-tidy when compiling" OFF)
# Acceleration # Acceleration
option(ENABLE_PROFILING "Enable execution of volk_gnsssdr_profile at the end of the building" OFF) option(ENABLE_PROFILING "Enable execution of volk_gnsssdr_profile at the end of the building" OFF)
option(ENABLE_OPENCL "Enable building of processing blocks implemented with OpenCL (experimental)" OFF) option(ENABLE_OPENCL "Enable building of processing blocks implemented with OpenCL (experimental)" OFF)
@ -324,12 +327,12 @@ endif()
################################################################################ ################################################################################
# Minimum required versions # 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_GCC_MIN_VERSION "4.7.2")
set(GNSSSDR_CLANG_MIN_VERSION "3.4.0") set(GNSSSDR_CLANG_MIN_VERSION "3.4.0")
set(GNSSSDR_APPLECLANG_MIN_VERSION "500") set(GNSSSDR_APPLECLANG_MIN_VERSION "500")
set(GNSSSDR_GNURADIO_MIN_VERSION "3.7.3") 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_PYTHON_MIN_VERSION "2.7")
set(GNSSSDR_PYTHON3_MIN_VERSION "3.4") set(GNSSSDR_PYTHON3_MIN_VERSION "3.4")
set(GNSSSDR_MAKO_MIN_VERSION "0.4.2") set(GNSSSDR_MAKO_MIN_VERSION "0.4.2")
@ -407,12 +410,62 @@ endif()
################################################################################
# Set C and C++ standard
################################################################################
if(NOT (CMAKE_VERSION VERSION_LESS "3.1"))
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)
else()
add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,C>:-std=gnu11>")
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++11>")
else()
add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++14>")
endif()
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(OS_IS_MACOSX)
if(CLANG_VERSION VERSION_LESS "600")
add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++11>")
else()
add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++14>")
endif()
else()
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0")
add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++11>")
else()
add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++14>")
endif()
endif()
endif()
endif()
# Visibility
# See https://gcc.gnu.org/wiki/Visibility
if(POLICY CMP0053)
cmake_policy(SET CMP0063 NEW)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
else()
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
add_definitions(-fvisibility=hidden)
endif()
endif()
################################################################################ ################################################################################
# Check if the compiler defines the architecture as ARM # Check if the compiler defines the architecture as ARM
################################################################################ ################################################################################
if(NOT OS_IS_MACOSX) if(NOT OS_IS_MACOSX)
if(CMAKE_CROSSCOMPILING) if(CMAKE_CROSSCOMPILING)
set(IS_ARM TRUE) set(IS_ARM TRUE)
if(NOT CMAKE_NO_SYSTEM_FROM_IMPORTED)
set(CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE)
endif()
else() else()
include(TestForARM) include(TestForARM)
endif() endif()
@ -420,21 +473,25 @@ endif()
################################################################################
# Check for availability of SSE
################################################################################
if(NOT ENABLE_GENERIC_ARCH)
include(TestForSSE)
endif()
################################################################################ ################################################################################
# Find the POSIX thread (pthread) libraries # Find the POSIX thread (pthread) libraries
################################################################################ ################################################################################
if(CMAKE_VERSION VERSION_LESS 3.1) if(CMAKE_VERSION VERSION_LESS 3.1)
# Workaround for CMake < 3.1
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
set(THREAD_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) add_library(Threads::Threads SHARED IMPORTED)
set_property(TARGET Threads::Threads PROPERTY INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
set_property(TARGET Threads::Threads PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")
include(GNUInstallDirs)
# Fix bug in Debian 8.11
if(${LINUX_DISTRIBUTION} MATCHES "Debian")
if(${LINUX_VER} VERSION_LESS 8.12)
if(ARCH_64BITS)
set(FIX_PTHREADS_LOCATION "x86_64-linux-gnu/")
endif()
endif()
endif()
set_property(TARGET Threads::Threads PROPERTY IMPORTED_LOCATION /usr/${CMAKE_INSTALL_LIBDIR}/${FIX_PTHREADS_LOCATION}${CMAKE_FIND_LIBRARY_PREFIXES}pthread${CMAKE_SHARED_LIBRARY_SUFFIX})
else() else()
set(CMAKE_THREAD_PREFER_PTHREAD TRUE) set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
if(CMAKE_CROSSCOMPILING) if(CMAKE_CROSSCOMPILING)
@ -443,7 +500,6 @@ else()
set(THREADS_PREFER_PTHREAD_FLAG TRUE) set(THREADS_PREFER_PTHREAD_FLAG TRUE)
endif() endif()
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
set(THREAD_LIBRARIES Threads::Threads)
endif() endif()
@ -458,13 +514,13 @@ if(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING)
endif() endif()
if(GTEST_DIR) if(GTEST_DIR)
message(STATUS "Googletest root folder set at ${GTEST_DIR}") message(STATUS "Googletest root folder set at ${GTEST_DIR}")
find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS ${GTEST_DIR}) find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS ${GTEST_DIR} ${GTEST_DIR}/googletest)
if(LIBGTEST_DEV_DIR) if(LIBGTEST_DEV_DIR)
message(STATUS "Googletest has been found.") message(STATUS "Googletest has been found.")
else() else()
message(FATAL_ERROR " Googletest source code has not been found at ${GTEST_DIR}.") message(FATAL_ERROR " Googletest source code has not been found at ${GTEST_DIR}.")
endif() endif()
find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS ${GTEST_DIR}/include) find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS ${GTEST_DIR}/googletest/include)
else() else()
find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS /usr/src/googletest/googletest /usr/src/gtest /usr/include/gtest /opt/local/src/gtest-1.7.0) find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS /usr/src/googletest/googletest /usr/src/gtest /usr/include/gtest /opt/local/src/gtest-1.7.0)
find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS /usr/include /opt/local/src/gtest-1.7.0/include) find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS /usr/include /opt/local/src/gtest-1.7.0/include)
@ -487,8 +543,7 @@ if(UNIX AND EXISTS "/usr/lib64")
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") # Fedora 64-bit fix list(APPEND BOOST_LIBRARYDIR "/usr/lib64") # Fedora 64-bit fix
endif() endif()
set(Boost_ADDITIONAL_VERSIONS 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.53.0" "1.53" "1.54.0" "1.54"
"1.50.0" "1.50" "1.51.0" "1.51" "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.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.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" "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 +553,84 @@ set(Boost_ADDITIONAL_VERSIONS
) )
set(Boost_USE_MULTITHREAD ON) set(Boost_USE_MULTITHREAD ON)
set(Boost_USE_STATIC_LIBS OFF) 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) if(NOT Boost_FOUND)
message(FATAL_ERROR "Fatal error: Boost (version >=${GNSSSDR_BOOST_MIN_VERSION}) required.") message(FATAL_ERROR "Fatal error: Boost (version >=${GNSSSDR_BOOST_MIN_VERSION}) required.")
endif() 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 +658,98 @@ if(NOT GNURADIO_RUNTIME_FOUND)
message(" brew install gnuradio") message(" brew install gnuradio")
message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr")
endif() 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() endif()
if(NOT GNURADIO_ANALOG_FOUND) 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") 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() endif()
if(NOT GNURADIO_BLOCKS_FOUND) 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") 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() endif()
if(NOT GNURADIO_FILTER_FOUND) 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") 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() endif()
if(NOT GNURADIO_FFT_FOUND) 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") 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() endif()
if(NOT GNURADIO_PMT_FOUND) 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") 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() endif()
@ -695,6 +899,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_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}) 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) if(CMAKE_VERSION VERSION_LESS 3.2)
add_custom_command(TARGET volk_gnsssdr_module POST_BUILD 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 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile
@ -756,16 +973,23 @@ if(NOT GFLAGS_FOUND)
${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include CACHE PATH "Local Gflags headers" ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include CACHE PATH "Local Gflags headers"
) )
add_library(gflags UNKNOWN IMPORTED) file(GLOB GFlags_SHARED_LIBS
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}) "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_SHARED_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}*") if(NOT TARGET Gflags::gflags)
set(GFlags_LIBRARY gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include)
set(GFlags_LIBRARY_PATH ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib) add_library(Gflags::gflags STATIC IMPORTED)
link_directories(${GFlags_LIBRARY_PATH}) add_dependencies(Gflags::gflags gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION})
set(GFlags_lib ${GFlags_LIBS} CACHE FILEPATH "Local Gflags library") set_target_properties(Gflags::gflags PROPERTIES
set(GFlags_LIBRARY_PATH ${GFlags_LIBS}) 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) set(LOCAL_GFLAGS true CACHE STRING "GFlags downloaded and built automatically" FORCE)
endif() endif()
@ -899,6 +1123,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c
INSTALL_COMMAND "" INSTALL_COMMAND ""
) )
endif() endif()
add_dependencies(glog-${GNSSSDR_GLOG_LOCAL_VERSION} Gflags::gflags)
# Set up variables # Set up variables
set(GLOG_INCLUDE_DIRS set(GLOG_INCLUDE_DIRS
@ -908,15 +1133,27 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c
set(GLOG_LIBRARIES set(GLOG_LIBRARIES
${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} ${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) 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() endif()
if(NOT ENABLE_LOG) if(NOT ENABLE_LOG)
message(STATUS "Logging is not enabled") message(STATUS "Logging is not enabled")
add_definitions(-DGOOGLE_STRIP_LOG=1)
endif() endif()
@ -967,6 +1204,14 @@ if(ARMADILLO_FOUND)
if(${ARMADILLO_VERSION_STRING} VERSION_LESS ${GNSSSDR_ARMADILLO_MIN_VERSION}) if(${ARMADILLO_VERSION_STRING} VERSION_LESS ${GNSSSDR_ARMADILLO_MIN_VERSION})
set(ARMADILLO_FOUND false) set(ARMADILLO_FOUND false)
set(ENABLE_OWN_ARMADILLO true) 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()
endif() endif()
@ -1028,17 +1273,22 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO)
# Set up variables # Set up variables
ExternalProject_Get_Property(armadillo-${armadillo_RELEASE} binary_dir) 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) if(NOT GFORTRAN)
set(GFORTRAN "") set(GFORTRAN "")
endif() endif()
set(ARMADILLO_LIBRARIES ${BLAS} ${LAPACK} ${GFORTRAN} ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}) 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(LOCAL_ARMADILLO true CACHE STRING "Armadillo downloaded and built automatically" FORCE)
set(ARMADILLO_VERSION_STRING ${armadillo_RELEASE}) set(ARMADILLO_VERSION_STRING ${armadillo_RELEASE})
else() file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include)
set(armadillo_RELEASE ${ARMADILLO_VERSION_STRING}) add_library(Armadillo::armadillo STATIC IMPORTED)
add_library(armadillo-${armadillo_RELEASE} UNKNOWN IMPORTED) add_dependencies(Armadillo::armadillo armadillo-${armadillo_RELEASE})
set_property(TARGET armadillo-${armadillo_RELEASE} PROPERTY IMPORTED_LOCATION "${ARMADILLO_LIBRARIES}") 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() endif()
@ -1165,6 +1415,7 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS
set(HDF5_BASE_DIR /usr/local) set(HDF5_BASE_DIR /usr/local)
endif() endif()
endif() endif()
if(CMAKE_VERSION VERSION_LESS 3.2) if(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION} ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio
@ -1173,7 +1424,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} 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 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=<INSTALL_DIR> 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=<INSTALL_DIR>
BUILD_COMMAND make BUILD_COMMAND $(MAKE)
) )
else() else()
ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION} ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION}
@ -1183,13 +1434,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} 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 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=<INSTALL_DIR> 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=<INSTALL_DIR>
BUILD_COMMAND make BUILD_COMMAND $(MAKE)
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX}
) )
endif() 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) 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() else()
message(STATUS " The hdf5 library has not been found in your system.") message(STATUS " The hdf5 library has not been found in your system.")
message(STATUS " Please try to install it by doing:") message(STATUS " Please try to install it by doing:")
@ -1250,37 +1511,30 @@ else()
INSTALL_COMMAND "" INSTALL_COMMAND ""
) )
endif() 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()
if(NOT TARGET Pugixml::pugixml)
################################################################################ file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src)
# USRP Hardware Driver (UHD) - OPTIONAL add_library(Pugixml::pugixml STATIC IMPORTED)
################################################################################ add_dependencies(Pugixml::pugixml pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION})
if(ENABLE_UHD) set_target_properties(Pugixml::pugixml PROPERTIES
find_package(UHD) IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
if(NOT UHD_FOUND) IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}"
set(ENABLE_UHD OFF) INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src"
message(STATUS " The USRP Hardware Driver (UHD) signal source will not be built,") INTERFACE_LINK_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}"
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)
endif() endif()
endif() endif()
################################################################################ ################################################################################
# Doxygen - http://www.stack.nl/~dimitri/doxygen/index.html (OPTIONAL, used if found) # Doxygen - http://www.stack.nl/~dimitri/doxygen/index.html (OPTIONAL, used if found)
################################################################################ ################################################################################
find_package(Doxygen) find_package(Doxygen)
if(DOXYGEN_FOUND) if(DOXYGEN_FOUND)
message(STATUS "Doxygen found.") message(STATUS "Doxygen found.")
message(STATUS "You can build the documentation with '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc'.") message(STATUS " You can build the documentation with '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc'.")
message(STATUS "When done, point your browser to ${CMAKE_BINARY_DIR}/html/index.html") message(STATUS " When done, point your browser to ${CMAKE_BINARY_DIR}/html/index.html")
set(HAVE_DOT ${DOXYGEN_DOT_FOUND}) set(HAVE_DOT ${DOXYGEN_DOT_FOUND})
file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir) file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir)
file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} top_builddir) file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} top_builddir)
@ -1302,7 +1556,7 @@ if(DOXYGEN_FOUND)
COMMENT "Generating API documentation with Doxygen." VERBATIM COMMENT "Generating API documentation with Doxygen." VERBATIM
) )
if(LATEX_COMPILER) if(LATEX_COMPILER)
message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} pdfmanual' will generate a manual at ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf") message(STATUS " '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} pdfmanual' will generate a manual at ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf")
add_custom_target(pdfmanual add_custom_target(pdfmanual
COMMAND ${CMAKE_MAKE_PROGRAM} COMMAND ${CMAKE_MAKE_PROGRAM}
COMMAND ${CMAKE_COMMAND} -E copy refman.pdf ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf COMMAND ${CMAKE_COMMAND} -E copy refman.pdf ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf
@ -1312,7 +1566,7 @@ if(DOXYGEN_FOUND)
COMMENT "Generating PDF manual with Doxygen." VERBATIM COMMENT "Generating PDF manual with Doxygen." VERBATIM
) )
endif() endif()
message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.") message(STATUS " '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.")
add_custom_target(doc-clean add_custom_target(doc-clean
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/html COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/html
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/latex COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/latex
@ -1350,7 +1604,7 @@ if(ENABLE_OPENCL)
else() else()
if(OPENCL_FOUND) if(OPENCL_FOUND)
message(STATUS "OpenCL has been found and will be used by some processing blocks") message(STATUS "OpenCL has been found and will be used by some processing blocks")
message(STATUS "You can disable OpenCL use by doing 'cmake -DENABLE_OPENCL=OFF ../' ") message(STATUS " You can disable OpenCL use by doing 'cmake -DENABLE_OPENCL=OFF ..' ")
endif() endif()
endif() endif()
if(ENABLE_GENERIC_ARCH) if(ENABLE_GENERIC_ARCH)
@ -1377,10 +1631,10 @@ endif()
if(ENABLE_CUDA) if(ENABLE_CUDA)
find_package(CUDA REQUIRED) find_package(CUDA REQUIRED)
message(STATUS "NVIDIA CUDA GPU Acceleration will be enabled.") message(STATUS "NVIDIA CUDA GPU Acceleration will be enabled.")
message(STATUS "You can disable it with 'cmake -DENABLE_CUDA=OFF ../'") message(STATUS " You can disable it with 'cmake -DENABLE_CUDA=OFF ..'")
else() else()
message(STATUS "NVIDIA CUDA GPU Acceleration will be not enabled.") message(STATUS "NVIDIA CUDA GPU Acceleration will be not enabled.")
message(STATUS "Enable it with 'cmake -DENABLE_CUDA=ON ../' to add support for GPU-based acceleration using CUDA.") message(STATUS " Enable it with 'cmake -DENABLE_CUDA=ON ..' to add support for GPU-based acceleration using CUDA.")
endif() endif()
@ -1389,23 +1643,25 @@ endif()
# CUSTOM UDP PACKET SOURCE (OPTIONAL) # CUSTOM UDP PACKET SOURCE (OPTIONAL)
############################################################################### ###############################################################################
if(ENABLE_RAW_UDP) if(ENABLE_RAW_UDP)
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 ../'") message(STATUS " You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ..'")
else() find_package(PCAP)
message(STATUS "High-optimized custom UDP ip packet source will be enabled.") if(NOT PCAP_FOUND)
message(STATUS "You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ../'") message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (with ENABLE_RAW_UDP=ON)")
endif()
endif() endif()
############################################################################### ###############################################################################
# FPGA (OPTIONAL) # FPGA (OPTIONAL)
############################################################################### ###############################################################################
if(ENABLE_FPGA) if(ENABLE_FPGA)
message(STATUS "FPGA Acceleration will be enabled.") message(STATUS "FPGA Acceleration will be enabled.")
message(STATUS "You can disable it with 'cmake -DENABLE_FPGA=OFF ../'") message(STATUS " You can disable it with 'cmake -DENABLE_FPGA=OFF ..'")
else() else()
message(STATUS "Fpga Acceleration will be not enabled.") message(STATUS "Fpga Acceleration will be not enabled.")
message(STATUS "Enable it with 'cmake -DENABLE_FPGA=ON ../' to add support for GPU-based acceleration using the FPGA.") message(STATUS " Enable it with 'cmake -DENABLE_FPGA=ON ..' to add support for GPU-based acceleration using the FPGA.")
endif() endif()
@ -1413,40 +1669,39 @@ endif()
################################################################################ ################################################################################
# Setup of optional drivers # Setup of optional drivers
################################################################################ ################################################################################
if($ENV{GN3S_DRIVER})
message(STATUS "GN3S_DRIVER environment variable found.") ########################################
set(ENABLE_GN3S ON) # USRP Hardware Driver (UHD) - OPTIONAL
endif() ########################################
if(GN3S_DRIVER) if(ENABLE_UHD)
set(ENABLE_GN3S ON) find_package(UHD)
endif() if(NOT UHD_FOUND)
if(ENABLE_GN3S) set(ENABLE_UHD OFF)
message(STATUS "The GN3S driver will be compiled.") message(STATUS " The USRP Hardware Driver (UHD) signal source will not be built,")
message(STATUS "You can disable it with 'cmake -DENABLE_GN3S=OFF ../'") message(STATUS " so all USRP-based front-ends will not be usable.")
else() message(STATUS " Please check https://files.ettus.com/manual/")
message(STATUS "The (optional and experimental) GN3S driver is not enabled.") else()
message(STATUS "Enable it with 'cmake -DENABLE_GN3S=ON ../' to add support for the GN3S dongle.") 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() 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}) if($ENV{RTLSDR_DRIVER})
message(STATUS "RTLSDR_DRIVER environment variable found.") message(STATUS "RTLSDR_DRIVER environment variable found.")
set(ENABLE_OSMOSDR ON) set(ENABLE_OSMOSDR ON)
@ -1456,7 +1711,7 @@ if(ENABLE_OSMOSDR)
find_package(GROSMOSDR) find_package(GROSMOSDR)
if(GROSMOSDR_FOUND) if(GROSMOSDR_FOUND)
message(STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled.") message(STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled.")
message(STATUS "You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ../'") message(STATUS " You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ..'")
else() else()
if(ENABLE_PACKAGING) if(ENABLE_PACKAGING)
message(WARNING "gr-osmosdr has not been found. Source blocks depending on it will NOT be built.") message(WARNING "gr-osmosdr has not been found. Source blocks depending on it will NOT be built.")
@ -1466,9 +1721,34 @@ if(ENABLE_OSMOSDR)
endif() endif()
else() else()
message(STATUS "The (optional) driver for OsmoSDR and related front-ends is not enabled.") message(STATUS "The (optional) driver for OsmoSDR and related front-ends is not enabled.")
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.)") 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() endif()
##############################################
# gr-iio - OPTIONAL
# IIO blocks for GNU Radio
# https://github.com/analogdevicesinc/gr-iio
##############################################
if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
find_package(GRIIO)
find_package(LIBIIO)
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}) if($ENV{FLEXIBAND_DRIVER})
message(STATUS "FLEXIBAND_DRIVER environment variable found.") message(STATUS "FLEXIBAND_DRIVER environment variable found.")
set(ENABLE_FLEXIBAND ON) set(ENABLE_FLEXIBAND ON)
@ -1480,26 +1760,74 @@ endif()
if(ENABLE_FLEXIBAND) if(ENABLE_FLEXIBAND)
message(STATUS "The Teleorbit Flexiband front-end source will be compiled.") message(STATUS "The Teleorbit Flexiband front-end source will be compiled.")
message(STATUS "You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ../'") message(STATUS " You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ..'")
else() else()
message(STATUS "The (optional) Teleorbit Flexiband front-end driver adapter is not enabled.") 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.") 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() endif()
################################################################################ ################################################################################
# GPerftools - https://github.com/gperftools/gperftools (OPTIONAL) # GPerftools - https://github.com/gperftools/gperftools - OPTIONAL)
################################################################################ ################################################################################
if(ENABLE_GPERFTOOLS) if(ENABLE_GPERFTOOLS)
find_package(GPERFTOOLS) find_package(GPERFTOOLS)
if(NOT GPERFTOOLS_FOUND) if(NOT GPERFTOOLS_FOUND)
message(STATUS "Although ENABLE_GPERFTOOLS has been set to ON, GPerftools has not been found.") message(STATUS "Although ENABLE_GPERFTOOLS has been set to ON, GPerftools has not been found.")
message(STATUS "Binaries will be compiled without 'tcmalloc' and 'profiler' libraries.") message(STATUS " Binaries will be compiled without 'tcmalloc' and 'profiler' libraries.")
message(STATUS "You can install GPerftools from https://github.com/gperftools/gperftools") message(STATUS " You can install GPerftools from https://github.com/gperftools/gperftools")
else() else()
message(STATUS "GPerftools libraries found.") message(STATUS "GPerftools libraries found.")
message(STATUS "Binaries will be compiled with 'tcmalloc' and 'profiler' libraries.") message(STATUS " Binaries will be compiled with 'tcmalloc' and 'profiler' libraries.")
endif() endif()
endif() endif()
if(ENABLE_GPERFTOOLS) if(ENABLE_GPERFTOOLS)
@ -1507,10 +1835,10 @@ if(ENABLE_GPERFTOOLS)
# See https://github.com/gperftools/gperftools/blob/master/README # See https://github.com/gperftools/gperftools/blob/master/README
if(GPERFTOOLS_FOUND) if(GPERFTOOLS_FOUND)
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free") add_compile_options(-fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free)
endif() endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin") add_compile_options(-fno-builtin)
endif() endif()
endif() endif()
endif() endif()
@ -1521,7 +1849,7 @@ endif()
# GNU gprof (OPTIONAL) - https://sourceware.org/binutils/docs/gprof/ # GNU gprof (OPTIONAL) - https://sourceware.org/binutils/docs/gprof/
######################################################################## ########################################################################
if(ENABLE_GPROF) if(ENABLE_GPROF)
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -pg") add_compile_options(-pg)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg")
endif() endif()
@ -1530,92 +1858,48 @@ endif()
######################################################################## ########################################################################
# Set compiler flags # Set compiler flags
######################################################################## ########################################################################
# Support of C++17 is still not possible due to pm_remez.h (solved in GNU Radio 3.8)
# Enable C++14 support in GCC >= 6.1.1
# Fallback to C++11 when using GCC < 6.1.1
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") # Add warning flags
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") # For "-Wall" see https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
set(cxx_warning_flags -Wall -Wextra)
if(NOT (CMAKE_VERSION VERSION_LESS "3.3"))
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:${cxx_warning_flags}>")
else() else()
# if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:${cxx_warning_flags}>")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14")
# else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0")
# set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17")
# endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0")
endif() endif()
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wall -Wextra") #Add warning flags: For "-Wall" see https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0")
endif() add_compile_options(-Wno-missing-field-initializers)
# Support of C++17 is still not possible due to pm_remez.h (solved in GNU Radio 3.8)
# Enable C++14 support in Clang >= 3.5.0 or AppleClang >= 600
# Fallback to C++11 if older version
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(OS_IS_MACOSX)
# See https://trac.macports.org/wiki/XcodeVersionInfo for Apple Clang version equivalences
if(CLANG_VERSION VERSION_LESS "600")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11")
else()
# if(CLANG_VERSION VERSION_LESS "900")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14")
# else(CLANG_VERSION VERSION_LESS "900")
# set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17")
# endif(CLANG_VERSION VERSION_LESS "900")
endif() endif()
else() if(CMAKE_CROSSCOMPILING)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") add_compile_options(-Wno-psabi)
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11")
else()
# if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14")
# else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0")
# set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17")
# endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0")
endif()
endif()
if(OS_IS_MACOSX)
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -stdlib=libc++")
endif()
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)
endif() endif()
endif() endif()
# Processor-architecture related flags # Processor-architecture related flags
# See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html # See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
if(NOT ARCH_COMPILER_FLAGS) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
if(OS_IS_MACOSX) if(OS_IS_MACOSX)
set(ARCH_COMPILER_FLAGS "-march=corei7 -mfpmath=sse") add_compile_options(-march=corei7 -mfpmath=sse)
else() else()
if(NOT ${ENABLE_GENERIC_ARCH}) if(NOT ENABLE_GENERIC_ARCH)
if(IS_ARM) # ARM-specific options (https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html) if(IS_ARM)
# ARM-specific options
# See https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
if(NOT CMAKE_CROSSCOMPILING) if(NOT CMAKE_CROSSCOMPILING)
if(ARM_VERSION STREQUAL "arm") if(ARM_VERSION STREQUAL "arm")
# Unknown arm version - try our best to detect # Unknown arm version - try our best to detect
set(ARCH_COMPILER_FLAGS "-mcpu=native") add_compile_options(-mcpu=native)
else() else()
set(ARCH_COMPILER_FLAGS "-march=${ARM_VERSION}") add_compile_options(-march=${ARM_VERSION})
endif() endif()
endif() endif()
else() else()
set(ARCH_COMPILER_FLAGS "-march=native -mfpmath=sse") add_compile_options(-march=native -mfpmath=sse)
endif()
endif() endif()
endif() endif()
endif() endif()
endif() endif()
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} ${ARCH_COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS}")
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
# https://gcc.gnu.org/wiki/Visibility
add_definitions(-fvisibility=hidden)
endif()
######################################################################## ########################################################################
@ -1632,7 +1916,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message(STATUS "clang-tidy not found.") message(STATUS "clang-tidy not found.")
else() else()
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*") if(ENABLE_CLANG_TIDY)
message(STATUS " clang-tidy will be used in compilation. You can disable it with 'cmake -DENABLE_CLANG_TIDY=OFF ..'")
else()
message(STATUS " You can enable clang-tidy usage in compilation with 'cmake -DENABLE_CLANG_TIDY=ON ..'")
endif()
set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-fix")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
endif() endif()
endif() endif()

View File

@ -112,12 +112,12 @@ Once you have installed these packages, you can jump directly to [download the s
#### Arch Linux #### Arch Linux
If you are using Arch Linux (with base-devel group installed): If you are using Arch Linux:
~~~~~~ ~~~~~~
$ pacman -S cmake git boost boost-libs log4cpp libvolk gnuradio gnuradio-osmosdr \ $ pacman -S gcc make cmake git boost boost-libs log4cpp libvolk gnuradio \
blas lapack gflags google-glog openssl pugixml python-mako python-six \ gnuradio-osmosdr blas lapack gflags google-glog openssl pugixml \
libmatio libpcap gtest python-mako python-six libmatio libpcap gtest
~~~~~~ ~~~~~~
Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux). Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux).
@ -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)" $ /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: Install pip:
@ -584,17 +584,26 @@ $ sudo easy_install pip
Install the required dependencies: Install the required dependencies:
~~~~~~ ~~~~~~
$ brew tap homebrew/science $ brew install cmake
$ brew install cmake hdf5 arpack superlu $ brew install hdf5 arpack superlu armadillo
$ brew install armadillo $ brew install glog gflags
$ brew install glog gflags gnutls
$ brew install gnuradio $ brew install gnuradio
$ brew install libmatio $ brew install libmatio
$ brew install log4cpp
$ brew install pugixml $ brew install pugixml
$ pip install mako $ pip install mako
$ pip install six $ pip install six
$ brew install openssl
~~~~~~ ~~~~~~
In the last step, Homebrew installs OpenSSL but it does not link it to `/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 #### Build GNSS-SDR
Finally, you are ready to clone the GNSS-SDR repository, configure and build the software: Finally, you are ready to clone the GNSS-SDR repository, configure and build the software:

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -26,6 +26,10 @@
# GFlags_INCLUDE_DIRS # GFlags_INCLUDE_DIRS
# GFlags_LIBS # GFlags_LIBS
# GFlags_LIBRARY_DIRS # GFlags_LIBRARY_DIRS
#
# Provides the following imported target:
# Gflags::gflags
#
if(APPLE) if(APPLE)
find_path(GFlags_ROOT_DIR find_path(GFlags_ROOT_DIR
@ -95,9 +99,6 @@ if(GFlags_ROOT_DIR)
else() else()
set(GFLAGS_GREATER_20 FALSE) set(GFLAGS_GREATER_20 FALSE)
endif() 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}") message(STATUS "gflags library found at ${GFlags_lib}")
set(GFlags_LIBS ${GFlags_lib}) set(GFlags_LIBS ${GFlags_lib})
set(GFlags_FOUND true) set(GFlags_FOUND true)
@ -109,3 +110,13 @@ endif()
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GFLAGS DEFAULT_MSG GFlags_LIBS GFlags_INCLUDE_DIRS) 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()

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -27,6 +27,9 @@
# #
# GLOG_ROOT - Can be set to Glog install path or Windows build path # 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) if(NOT DEFINED GLOG_ROOT)
set(GLOG_ROOT /usr /usr/local) set(GLOG_ROOT /usr /usr/local)
@ -135,6 +138,12 @@ else()
string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES})
endif() endif()
if(GLOG_FOUND) if(GLOG_FOUND AND NOT TARGET Glog::glog)
# _GLOG_APPEND_LIBRARIES(GLOG GLOG_LIBRARIES) 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() endif()

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -33,6 +33,12 @@
# GPERFTOOLS_FOUND System has Gperftools libs/headers # GPERFTOOLS_FOUND System has Gperftools libs/headers
# GPERFTOOLS_LIBRARIES The Gperftools libraries (tcmalloc & profiler) # GPERFTOOLS_LIBRARIES The Gperftools libraries (tcmalloc & profiler)
# GPERFTOOLS_INCLUDE_DIR The location of Gperftools headers # GPERFTOOLS_INCLUDE_DIR The location of Gperftools headers
#
# Provides the following imported targets:
# Gperftools::tcmalloc
# Gperftools::profiler
# Gperftools::gperftools
#
find_library(GPERFTOOLS_TCMALLOC find_library(GPERFTOOLS_TCMALLOC
NAMES tcmalloc NAMES tcmalloc
@ -41,6 +47,8 @@ find_library(GPERFTOOLS_TCMALLOC
$ENV{GPERFTOOLS_ROOT}/lib $ENV{GPERFTOOLS_ROOT}/lib
${GPERFTOOLS_ROOT}/lib64 ${GPERFTOOLS_ROOT}/lib64
$ENV{GPERFTOOLS_ROOT}/lib64 $ENV{GPERFTOOLS_ROOT}/lib64
/usr/lib
/usr/lib64
) )
find_library(GPERFTOOLS_PROFILER find_library(GPERFTOOLS_PROFILER
@ -50,6 +58,8 @@ find_library(GPERFTOOLS_PROFILER
$ENV{GPERFTOOLS_ROOT}/lib $ENV{GPERFTOOLS_ROOT}/lib
${GPERFTOOLS_ROOT}/lib64 ${GPERFTOOLS_ROOT}/lib64
$ENV{GPERFTOOLS_ROOT}/lib64 $ENV{GPERFTOOLS_ROOT}/lib64
/usr/lib
/usr/lib64
) )
find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER
@ -59,6 +69,8 @@ find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER
$ENV{GPERFTOOLS_ROOT}/lib $ENV{GPERFTOOLS_ROOT}/lib
${GPERFTOOLS_ROOT}/lib64 ${GPERFTOOLS_ROOT}/lib64
$ENV{GPERFTOOLS_ROOT}/lib64 $ENV{GPERFTOOLS_ROOT}/lib64
/usr/lib
/usr/lib64
) )
find_path(GPERFTOOLS_INCLUDE_DIR find_path(GPERFTOOLS_INCLUDE_DIR
@ -66,6 +78,7 @@ find_path(GPERFTOOLS_INCLUDE_DIR
HINTS ${Gperftools_ROOT_DIR}/include HINTS ${Gperftools_ROOT_DIR}/include
${GPERFTOOLS_ROOT}/include ${GPERFTOOLS_ROOT}/include
$ENV{GPERFTOOLS_ROOT}/include $ENV{GPERFTOOLS_ROOT}/include
/usr/include
) )
set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER}) set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER})
@ -76,10 +89,42 @@ find_package_handle_standard_args(
DEFAULT_MSG DEFAULT_MSG
GPERFTOOLS_LIBRARIES GPERFTOOLS_LIBRARIES
GPERFTOOLS_INCLUDE_DIR GPERFTOOLS_INCLUDE_DIR
GPERFTOOLS_TCMALLOC
GPERFTOOLS_PROFILER
) )
if(GPERFTOOLS_FOUND AND NOT TARGET Gperftools::tcmalloc)
add_library(Gperftools::tcmalloc SHARED IMPORTED)
set_target_properties(Gperftools::tcmalloc PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GPERFTOOLS_TCMALLOC}"
INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${GPERFTOOLS_TCMALLOC}"
)
endif()
if(GPERFTOOLS_FOUND AND NOT TARGET Gperftools::profiler)
add_library(Gperftools::profiler SHARED IMPORTED)
set_target_properties(Gperftools::profiler PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GPERFTOOLS_PROFILER}"
INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${GPERFTOOLS_PROFILER}"
)
endif()
if(GPERFTOOLS_FOUND AND NOT TARGET Gperftools::gperftools)
add_library(Gperftools::gperftools SHARED IMPORTED)
set_target_properties(Gperftools::gperftools PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GPERFTOOLS_TCMALLOC_AND_PROFILER}"
INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${GPERFTOOLS_TCMALLOC_AND_PROFILER}"
)
endif()
mark_as_advanced( mark_as_advanced(
Gperftools_ROOT_DIR
GPERFTOOLS_TCMALLOC GPERFTOOLS_TCMALLOC
GPERFTOOLS_PROFILER GPERFTOOLS_PROFILER
GPERFTOOLS_TCMALLOC_AND_PROFILER GPERFTOOLS_TCMALLOC_AND_PROFILER

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # 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) set(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk)
include(GNUInstallDirs)
find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES}
HINTS /usr/lib HINTS /usr/lib
/usr/local/lib /usr/local/lib
/usr/${CMAKE_INSTALL_LIBDIR}
/usr/local/${CMAKE_INSTALL_LIBDIR}
/opt/local/lib /opt/local/lib
${GPSTK_ROOT}/lib ${GPSTK_ROOT}/${CMAKE_INSTALL_LIBDIR}
$ENV{GPSTK_ROOT}/lib $ENV{GPSTK_ROOT}/${CMAKE_INSTALL_LIBDIR}
${GPSTK_ROOT}/lib64
$ENV{GPSTK_ROOT}/lib64
) )
# handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR) 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()

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -53,4 +53,15 @@ find_library(
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GRDBFCTTC DEFAULT_MSG GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) 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) mark_as_advanced(GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -53,4 +53,15 @@ find_library(
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GRGN3S DEFAULT_MSG GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) 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) mark_as_advanced(GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -15,6 +15,12 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
# Provides the following imported target:
# Gnuradio::iio
#
include(FindPkgConfig) include(FindPkgConfig)
pkg_check_modules(PC_IIO gnuradio-iio) pkg_check_modules(PC_IIO gnuradio-iio)
@ -69,4 +75,15 @@ find_library(IIO_LIBRARIES
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GRIIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS) 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) mark_as_advanced(IIO_LIBRARIES IIO_INCLUDE_DIRS)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -33,6 +33,11 @@
# GROSMOSDR_FOUND System has gr-osmosdr libs/headers # GROSMOSDR_FOUND System has gr-osmosdr libs/headers
# GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr) # GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr)
# GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers # GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers
#
# Provides the following imported target:
# Gnuradio::osmosdr
#
include(FindPkgConfig) include(FindPkgConfig)
pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr) pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr)
@ -89,4 +94,15 @@ find_library(GROSMOSDR_LIBRARIES
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GROSMOSDR DEFAULT_MSG GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR) 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) mark_as_advanced(GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -15,6 +15,11 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
# Provides the following imported target:
# Iio::iio
#
include(FindPkgConfig) include(FindPkgConfig)
pkg_check_modules(PC_LIBIIO libiio) pkg_check_modules(PC_LIBIIO libiio)
@ -73,4 +78,15 @@ find_library(
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBIIO DEFAULT_MSG LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) 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) mark_as_advanced(LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS)

View File

@ -27,6 +27,10 @@
# LIBOSMOSDR_FOUND System has libosmosdr libs/headers # LIBOSMOSDR_FOUND System has libosmosdr libs/headers
# LIBOSMOSDR_LIBRARIES The libosmosdr libraries # LIBOSMOSDR_LIBRARIES The libosmosdr libraries
# LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers # LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers
#
# Provides the following imported target:
# Osmosdr::osmosdr
#
include(FindPkgConfig) include(FindPkgConfig)
pkg_check_modules(LIBOSMOSDR_PKG libosmosdr) pkg_check_modules(LIBOSMOSDR_PKG libosmosdr)
@ -77,4 +81,15 @@ find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBOSMOSDR DEFAULT_MSG LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) 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) mark_as_advanced(LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -21,7 +21,10 @@
# LOG4CPP_INCLUDE_DIR - where to find LOG4CPP.h, etc. # LOG4CPP_INCLUDE_DIR - where to find LOG4CPP.h, etc.
# LOG4CPP_LIBRARIES - List of libraries when using LOG4CPP. # LOG4CPP_LIBRARIES - List of libraries when using LOG4CPP.
# LOG4CPP_FOUND - True if LOG4CPP found. # LOG4CPP_FOUND - True if LOG4CPP found.
#
# Provides the following imported target:
# Log4cpp::log4cpp
#
if(LOG4CPP_INCLUDE_DIR) if(LOG4CPP_INCLUDE_DIR)
# Already in cache, be silent # Already in cache, be silent
@ -90,3 +93,18 @@ endif()
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LOG4CPP DEFAULT_MSG LOG4CPP_INCLUDE_DIRS LOG4CPP_LIBRARIES) 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
)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -26,6 +26,9 @@
# MATIO_INCLUDE_DIRS - where to find matio.h, etc.. # MATIO_INCLUDE_DIRS - where to find matio.h, etc..
# MATIO_VERSION_STRING - version number as a string (e.g.: "1.3.4") # MATIO_VERSION_STRING - version number as a string (e.g.: "1.3.4")
# #
# Provides the following imported target:
# Matio::matio
#
#============================================================================= #=============================================================================
# Copyright 2015 Avtech Scientific <http://avtechscientific.com> # Copyright 2015 Avtech Scientific <http://avtechscientific.com>
# #
@ -127,3 +130,13 @@ else()
set(MATIO_LIBRARIES) set(MATIO_LIBRARIES)
set(MATIO_INCLUDE_DIRS) set(MATIO_INCLUDE_DIRS)
endif() 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()

View File

@ -43,7 +43,10 @@
# PCAP_INCLUDE_DIRS - where to find pcap.h, etc. # PCAP_INCLUDE_DIRS - where to find pcap.h, etc.
# PCAP_LIBRARIES - List of libraries when using pcap. # PCAP_LIBRARIES - List of libraries when using pcap.
# PCAP_FOUND - True if pcap found. # PCAP_FOUND - True if pcap found.
#
# Provides the following imported target:
# Pcap::pcap
#
if(EXISTS $ENV{PCAPDIR}) if(EXISTS $ENV{PCAPDIR})
find_path(PCAP_INCLUDE_DIR 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_open_dead" HAVE_PCAP_OPEN_DEAD)
check_function_exists("pcap_set_datalink" HAVE_PCAP_SET_DATALINK) 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( mark_as_advanced(
PCAP_LIBRARIES PCAP_LIBRARIES
PCAP_INCLUDE_DIRS PCAP_INCLUDE_DIRS
) )
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -22,15 +22,22 @@
# PUGIXML_INCLUDE_DIR - header location # PUGIXML_INCLUDE_DIR - header location
# PUGIXML_LIBRARIES - library to link against # PUGIXML_LIBRARIES - library to link against
# PUGIXML_FOUND - true if pugixml was found. # PUGIXML_FOUND - true if pugixml was found.
#
# Provides the following imported target:
# Pugixml::pugixml
#
find_path(PUGIXML_INCLUDE_DIR find_path(PUGIXML_INCLUDE_DIR
NAMES pugixml.hpp NAMES pugixml.hpp
PATHS ${PUGIXML_HOME}/include PATHS ${PUGIXML_HOME}/include
/usr/include /usr/include
/usr/local/include /usr/local/include
/usr/local/include/pugixml-1.9
/opt/local/include /opt/local/include
${PUGIXML_ROOT}/include ${PUGIXML_ROOT}/include
$ENV{PUGIXML_ROOT}/include $ENV{PUGIXML_ROOT}/include
${PUGIXML_ROOT}/include/pugixml-1.9
$ENV{PUGIXML_ROOT}/include/pugixml-1.9
) )
find_library(PUGIXML_LIBRARY find_library(PUGIXML_LIBRARY
@ -47,6 +54,7 @@ find_library(PUGIXML_LIBRARY
/usr/lib/powerpc64le-linux-gnu /usr/lib/powerpc64le-linux-gnu
/usr/lib/s390x-linux-gnu /usr/lib/s390x-linux-gnu
/usr/local/lib /usr/local/lib
/usr/local/lib/pugixml-1.9
/opt/local/lib /opt/local/lib
/usr/lib /usr/lib
/usr/lib64 /usr/lib64
@ -55,6 +63,10 @@ find_library(PUGIXML_LIBRARY
$ENV{PUGIXML_ROOT}/lib $ENV{PUGIXML_ROOT}/lib
${PUGIXML_ROOT}/lib64 ${PUGIXML_ROOT}/lib64
$ENV{PUGIXML_ROOT}/lib64 $ENV{PUGIXML_ROOT}/lib64
${PUGIXML_ROOT}/lib/pugixml-1.9
$ENV{PUGIXML_ROOT}/lib/pugixml-1.9
${PUGIXML_ROOT}/lib64/pugixml-1.9
$ENV{PUGIXML_ROOT}/lib64/pugixml-1.9
) )
# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found. # Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found.
@ -73,3 +85,13 @@ else()
endif() endif()
mark_as_advanced(PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR) mark_as_advanced(PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)
if(PUGIXML_FOUND AND NOT TARGET Pugixml::pugixml)
add_library(Pugixml::pugixml SHARED IMPORTED)
set_target_properties(Pugixml::pugixml PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${PUGIXML_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${PUGIXML_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${PUGIXML_LIBRARY}"
)
endif()

View File

@ -47,4 +47,15 @@ find_library(TELEORBIT_LIBRARIES
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TELEORBIT DEFAULT_MSG TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) 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) mark_as_advanced(TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -15,10 +15,14 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
# Provides the following imported target:
# Iio::iio
#
######################################################################## ########################################################################
# Find the library for the USRP Hardware Driver # Find the library for the USRP Hardware Driver
######################################################################## ########################################################################
include(FindPkgConfig) include(FindPkgConfig)
pkg_check_modules(PC_UHD uhd) pkg_check_modules(PC_UHD uhd)
@ -72,4 +76,15 @@ find_library(UHD_LIBRARIES
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS) 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) mark_as_advanced(UHD_LIBRARIES UHD_INCLUDE_DIRS)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -15,6 +15,11 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
# Provides the following imported target:
# Volk::volk
#
######################################################################## ########################################################################
# Find VOLK (Vector-Optimized Library of Kernels) # Find VOLK (Vector-Optimized Library of Kernels)
######################################################################## ########################################################################
@ -74,3 +79,13 @@ find_library(VOLK_LIBRARIES
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS) find_package_handle_standard_args(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS)
mark_as_advanced(VOLK_LIBRARIES VOLK_INCLUDE_DIRS VOLK_VERSION) mark_as_advanced(VOLK_LIBRARIES VOLK_INCLUDE_DIRS VOLK_VERSION)
if(VOLK_FOUND AND NOT TARGET Volk::volk)
add_library(Volk::volk SHARED IMPORTED)
set_target_properties(Volk::volk PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${VOLK_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${VOLK_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${VOLK_LIBRARIES}"
)
endif()

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -15,6 +15,12 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
# Provides the following imported target:
# Volkgnsssdr::volkgnsssdr
#
######################################################################## ########################################################################
# Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library # Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library
######################################################################## ########################################################################
@ -51,3 +57,14 @@ find_library(VOLK_GNSSSDR_LIBRARIES
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) 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) mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS)
if(VOLKGNSSSDR_FOUND AND NOT TARGET Volkgnsssdr::volkgnsssdr)
add_library(Volkgnsssdr::volkgnsssdr SHARED IMPORTED)
set_target_properties(Volkgnsssdr::volkgnsssdr PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${VOLK_GNSSSDR_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${VOLK_GNSSSDR_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${VOLK_GNSSSDR_LIBRARIES}"
)
endif()

View File

@ -1,8 +1,27 @@
## [Unreleased](https://github.com/gnss-sdr/gnss-sdr/tree/next) ## [Unreleased](https://github.com/gnss-sdr/gnss-sdr/tree/next)
### Improvements in Efficiency
- Applied clang-tidy checks and fixes related to performance.
### Improvements in Interoperability: ### Improvements in Interoperability:
- Added the BeiDou B1I receiver chain. - Added the BeiDou B1I receiver chain.
- Fix bug in GLONASS dual frequency receiver.
### Improvements in Maintainability:
- Usage of clang-tidy integrated into CMake scripts. New option -DENABLE_CLANG_TIDY=ON executes clang-tidy along with compilation. Requires clang compiler.
- Applied clang-tidy checks and fixes related to readability.
### Improvements in Portability:
- CMake scripts now follow a modern approach (targets and properties) but still work in 2.8.12
## Improvements in Reliability
- Applied clang-tidy checks and fixes related to High Integrity C++.
## [0.0.10](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.10) ## [0.0.10](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.10)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # 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 set(PVT_ADAPTER_SOURCES
rtklib_pvt.cc rtklib_pvt.cc
) )
@ -29,28 +25,40 @@ set(PVT_ADAPTER_HEADERS
rtklib_pvt.h rtklib_pvt.h
) )
include_directories( source_group(Headers FILES ${PVT_ADAPTER_HEADERS})
${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}
)
add_library(pvt_adapters ${PVT_ADAPTER_SOURCES} ${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 target_link_libraries(pvt_adapters
PUBLIC
Armadillo::armadillo
Gnuradio::runtime
pvt_gr_blocks pvt_gr_blocks
${ARMADILLO_LIBRARIES} pvt_libs
${GNURADIO_RUNTIME_LIBRARIES} core_system_parameters
PRIVATE
Boost::serialization
)
target_include_directories(pvt_adapters
PUBLIC
${CMAKE_SOURCE_DIR}/src/core/interfaces
)
if(Boost_VERSION LESS 105800)
target_compile_definitions(pvt_adapters PRIVATE -DOLD_BOOST=1)
endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(pvt_adapters
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
set_property(TARGET pvt_adapters
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
) )

View File

@ -42,6 +42,7 @@
namespace bc = boost::math; namespace bc = boost::math;
#else #else
#include <boost/integer/common_factor_rt.hpp> #include <boost/integer/common_factor_rt.hpp>
#include <utility>
namespace bc = boost::integer; namespace bc = boost::integer;
#endif #endif
@ -52,7 +53,7 @@ using google::LogMessage;
RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
const std::string& role, const std::string& role,
unsigned int in_streams, unsigned int in_streams,
unsigned int out_streams) : role_(std::move(role)), unsigned int out_streams) : role_(role),
in_streams_(in_streams), in_streams_(in_streams),
out_streams_(out_streams) out_streams_(out_streams)
{ {
@ -190,58 +191,174 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
int glo_2G_count = configuration->property("Channels_2G.count", 0); int glo_2G_count = configuration->property("Channels_2G.count", 0);
int bds_B1_count = configuration->property("Channels_B1.count", 0); int bds_B1_count = configuration->property("Channels_B1.count", 0);
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 1; // L1 if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 2; {
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 3; // L5 pvt_output_parameters.type_of_receiver = 1; // L1
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 4; // E1 }
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 5; // E5a if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 6; {
pvt_output_parameters.type_of_receiver = 2;
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 7; }
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 8; // L1+L5 if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 9; // L1+E1 {
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 10; pvt_output_parameters.type_of_receiver = 3; // L5
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 11; }
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 12; if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 13; // L5+E5a {
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 14; pvt_output_parameters.type_of_receiver = 4; // E1
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 15; }
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 5; // E5a
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 6;
}
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 7;
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 8; // L1+L5
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 9; // L1+E1
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 10;
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 11;
}
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 12;
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 13; // L5+E5a
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 14;
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 15;
}
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 16; //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 16;
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 17; if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 18; {
pvt_output_parameters.type_of_receiver = 17;
}
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 18;
}
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 19; //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 19;
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 20; //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 20;
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 21; if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 21;
}
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count = 0)) pvt_output_parameters.type_of_receiver = 22; //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count = 0)) pvt_output_parameters.type_of_receiver = 22;
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 23; if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (bds_B1_count == 0))
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 24; {
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 25; pvt_output_parameters.type_of_receiver = 23;
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 26; }
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 27; if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0))
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 28; {
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 29; pvt_output_parameters.type_of_receiver = 24;
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 30; }
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 31; if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 25;
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 26;
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 27;
}
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 28;
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 29;
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 30;
}
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 31;
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 32; // L1+E1+L5+E5a if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0))
{
pvt_output_parameters.type_of_receiver = 32; // L1+E1+L5+E5a
}
// BeiDou B1I Receiver // BeiDou B1I Receiver
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) pvt_output_parameters.type_of_receiver = 50; if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0))
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) pvt_output_parameters.type_of_receiver = 51; {
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) pvt_output_parameters.type_of_receiver = 52; pvt_output_parameters.type_of_receiver = 50;
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) pvt_output_parameters.type_of_receiver = 53; }
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) pvt_output_parameters.type_of_receiver = 54; if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0))
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) pvt_output_parameters.type_of_receiver = 55; {
pvt_output_parameters.type_of_receiver = 51;
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0))
{
pvt_output_parameters.type_of_receiver = 52;
}
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count != 0))
{
pvt_output_parameters.type_of_receiver = 53;
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0))
{
pvt_output_parameters.type_of_receiver = 54;
}
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count != 0))
{
pvt_output_parameters.type_of_receiver = 55;
}
// RTKLIB PVT solver options // RTKLIB PVT solver options
// Settings 1 // Settings 1
int positioning_mode = -1; int positioning_mode = -1;
std::string default_pos_mode("Single"); 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 std::string positioning_mode_str = configuration->property(role + ".positioning_mode", default_pos_mode); // (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h
if (positioning_mode_str == "Single") positioning_mode = PMODE_SINGLE; if (positioning_mode_str == "Single")
if (positioning_mode_str == "Static") positioning_mode = PMODE_STATIC; {
if (positioning_mode_str == "Kinematic") positioning_mode = PMODE_KINEMA; positioning_mode = PMODE_SINGLE;
if (positioning_mode_str == "PPP_Static") positioning_mode = PMODE_PPP_STATIC; }
if (positioning_mode_str == "PPP_Kinematic") positioning_mode = PMODE_PPP_KINEMA; if (positioning_mode_str == "Static")
{
positioning_mode = PMODE_STATIC;
}
if (positioning_mode_str == "Kinematic")
{
positioning_mode = PMODE_KINEMA;
}
if (positioning_mode_str == "PPP_Static")
{
positioning_mode = PMODE_PPP_STATIC;
}
if (positioning_mode_str == "PPP_Kinematic")
{
positioning_mode = PMODE_PPP_KINEMA;
}
if (positioning_mode == -1) if (positioning_mode == -1)
{ {
@ -255,10 +372,22 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
int num_bands = 0; int num_bands = 0;
if ((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0) || (bds_B1_count > 0)) num_bands = 1; if ((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0) || (bds_B1_count > 0))
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; num_bands = 1;
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 3; }
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((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) */ 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)) if ((number_of_frequencies < 1) || (number_of_frequencies > 3))
@ -286,12 +415,30 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
std::string default_iono_model("OFF"); 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 */ 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; int iono_model = -1;
if (iono_model_str == "OFF") iono_model = IONOOPT_OFF; if (iono_model_str == "OFF")
if (iono_model_str == "Broadcast") iono_model = IONOOPT_BRDC; {
if (iono_model_str == "SBAS") iono_model = IONOOPT_SBAS; iono_model = IONOOPT_OFF;
if (iono_model_str == "Iono-Free-LC") iono_model = IONOOPT_IFLC; }
if (iono_model_str == "Estimate_STEC") iono_model = IONOOPT_EST; if (iono_model_str == "Broadcast")
if (iono_model_str == "IONEX") iono_model = IONOOPT_TEC; {
iono_model = IONOOPT_BRDC;
}
if (iono_model_str == "SBAS")
{
iono_model = IONOOPT_SBAS;
}
if (iono_model_str == "Iono-Free-LC")
{
iono_model = IONOOPT_IFLC;
}
if (iono_model_str == "Estimate_STEC")
{
iono_model = IONOOPT_EST;
}
if (iono_model_str == "IONEX")
{
iono_model = IONOOPT_TEC;
}
if (iono_model == -1) if (iono_model == -1)
{ {
//warn user and set the default //warn user and set the default
@ -305,11 +452,26 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
std::string default_trop_model("OFF"); std::string default_trop_model("OFF");
int trop_model = -1; 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 */ std::string trop_model_str = configuration->property(role + ".trop_model", default_trop_model); /* (TROPOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */
if (trop_model_str == "OFF") trop_model = TROPOPT_OFF; if (trop_model_str == "OFF")
if (trop_model_str == "Saastamoinen") trop_model = TROPOPT_SAAS; {
if (trop_model_str == "SBAS") trop_model = TROPOPT_SBAS; trop_model = TROPOPT_OFF;
if (trop_model_str == "Estimate_ZTD") trop_model = TROPOPT_EST; }
if (trop_model_str == "Estimate_ZTD_Grad") trop_model = TROPOPT_ESTG; if (trop_model_str == "Saastamoinen")
{
trop_model = TROPOPT_SAAS;
}
if (trop_model_str == "SBAS")
{
trop_model = TROPOPT_SBAS;
}
if (trop_model_str == "Estimate_ZTD")
{
trop_model = TROPOPT_EST;
}
if (trop_model_str == "Estimate_ZTD_Grad")
{
trop_model = TROPOPT_ESTG;
}
if (trop_model == -1) if (trop_model == -1)
{ {
//warn user and set the default //warn user and set the default
@ -339,10 +501,22 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
int earth_tide = configuration->property(role + ".earth_tide", 0); int earth_tide = configuration->property(role + ".earth_tide", 0);
int nsys = 0; int nsys = 0;
if ((gps_1C_count > 0) || (gps_2S_count > 0) || (gps_L5_count > 0)) nsys += SYS_GPS; if ((gps_1C_count > 0) || (gps_2S_count > 0) || (gps_L5_count > 0))
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; nsys += SYS_GPS;
if ((bds_B1_count > 0)) nsys += SYS_BDS; }
if ((gal_1B_count > 0) || (gal_E5a_count > 0) || (gal_E5b_count > 0))
{
nsys += SYS_GAL;
}
if ((glo_1G_count > 0) || (glo_2G_count > 0))
{
nsys += SYS_GLO;
}
if ((bds_B1_count > 0))
{
nsys += SYS_BDS;
}
int navigation_system = configuration->property(role + ".navigation_system", nsys); /* (SYS_XXX) see src/algorithms/libs/rtklib/rtklib.h */ 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 */ 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 */
@ -356,11 +530,26 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
std::string default_gps_ar("Continuous"); 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) */ 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; int integer_ambiguity_resolution_gps = -1;
if (integer_ambiguity_resolution_gps_str == "OFF") integer_ambiguity_resolution_gps = ARMODE_OFF; if (integer_ambiguity_resolution_gps_str == "OFF")
if (integer_ambiguity_resolution_gps_str == "Continuous") integer_ambiguity_resolution_gps = ARMODE_CONT; {
if (integer_ambiguity_resolution_gps_str == "Instantaneous") integer_ambiguity_resolution_gps = ARMODE_INST; integer_ambiguity_resolution_gps = ARMODE_OFF;
if (integer_ambiguity_resolution_gps_str == "Fix-and-Hold") integer_ambiguity_resolution_gps = ARMODE_FIXHOLD; }
if (integer_ambiguity_resolution_gps_str == "PPP-AR") integer_ambiguity_resolution_gps = ARMODE_PPPAR; if (integer_ambiguity_resolution_gps_str == "Continuous")
{
integer_ambiguity_resolution_gps = ARMODE_CONT;
}
if (integer_ambiguity_resolution_gps_str == "Instantaneous")
{
integer_ambiguity_resolution_gps = ARMODE_INST;
}
if (integer_ambiguity_resolution_gps_str == "Fix-and-Hold")
{
integer_ambiguity_resolution_gps = ARMODE_FIXHOLD;
}
if (integer_ambiguity_resolution_gps_str == "PPP-AR")
{
integer_ambiguity_resolution_gps = ARMODE_PPPAR;
}
if (integer_ambiguity_resolution_gps == -1) if (integer_ambiguity_resolution_gps == -1)
{ {
//warn user and set the default //warn user and set the default
@ -520,6 +709,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.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); 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 // make PVT object
pvt_ = rtklib_make_pvt_cc(in_streams_, pvt_output_parameters, rtk); pvt_ = rtklib_make_pvt_cc(in_streams_, pvt_output_parameters, rtk);
DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")"; DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")";
@ -609,5 +803,5 @@ gr::basic_block_sptr RtklibPvt::get_left_block()
gr::basic_block_sptr RtklibPvt::get_right_block() gr::basic_block_sptr RtklibPvt::get_right_block()
{ {
return pvt_; // this is a sink, nothing downstream return nullptr; // this is a sink, nothing downstream
} }

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -16,11 +16,6 @@
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
# #
if(Boost_VERSION LESS 105800)
add_definitions(-DOLD_BOOST=1)
endif()
set(PVT_GR_BLOCKS_SOURCES set(PVT_GR_BLOCKS_SOURCES
rtklib_pvt_cc.cc rtklib_pvt_cc.cc
) )
@ -29,21 +24,43 @@ set(PVT_GR_BLOCKS_HEADERS
rtklib_pvt_cc.h rtklib_pvt_cc.h
) )
include_directories( source_group(Headers FILES ${PVT_GR_BLOCKS_HEADERS})
${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}
)
add_library(pvt_gr_blocks ${PVT_GR_BLOCKS_SOURCES} ${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
Gnuradio::runtime
pvt_libs
PRIVATE
Gflags::gflags
Glog::glog
Boost::filesystem
Boost::system
core_system_parameters
)
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(pvt_gr_blocks
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
target_include_directories(pvt_gr_blocks
PUBLIC
${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs
)
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
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/core/system_parameters>
)

File diff suppressed because it is too large Load Diff

View File

@ -35,6 +35,7 @@
#include "gps_ephemeris.h" #include "gps_ephemeris.h"
#include "gpx_printer.h" #include "gpx_printer.h"
#include "kml_printer.h" #include "kml_printer.h"
#include "monitor_pvt_udp_sink.h"
#include "nmea_printer.h" #include "nmea_printer.h"
#include "pvt_conf.h" #include "pvt_conf.h"
#include "rinex_printer.h" #include "rinex_printer.h"
@ -55,9 +56,9 @@
class rtklib_pvt_cc; class rtklib_pvt_cc;
typedef boost::shared_ptr<rtklib_pvt_cc> rtklib_pvt_cc_sptr; using rtklib_pvt_cc_sptr = boost::shared_ptr<rtklib_pvt_cc>;
rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t n_channels, rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels,
const Pvt_Conf& conf_, const Pvt_Conf& conf_,
const rtk_t& rtk); const rtk_t& rtk);
@ -71,7 +72,7 @@ private:
const Pvt_Conf& conf_, const Pvt_Conf& conf_,
const rtk_t& rtk); 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;
bool d_dump_mat; bool d_dump_mat;
@ -84,15 +85,15 @@ private:
bool b_rtcm_writing_started; bool b_rtcm_writing_started;
bool b_rtcm_enabled; bool b_rtcm_enabled;
int32_t d_rtcm_MT1045_rate_ms; //!< Galileo Broadcast Ephemeris int32_t d_rtcm_MT1045_rate_ms; // Galileo Broadcast Ephemeris
int32_t d_rtcm_MT1019_rate_ms; //!< GPS Broadcast Ephemeris (orbits) int32_t d_rtcm_MT1019_rate_ms; // GPS Broadcast Ephemeris (orbits)
int32_t d_rtcm_MT1020_rate_ms; //!< GLONASS Broadcast Ephemeris (orbits) int32_t d_rtcm_MT1020_rate_ms; // GLONASS Broadcast Ephemeris (orbits)
int32_t d_rtcm_MT1077_rate_ms; //!< The type 7 Multiple Signal Message format for the USAs GPS system, popular int32_t d_rtcm_MT1077_rate_ms; // The type 7 Multiple Signal Message format for the USAs GPS system, popular
int32_t d_rtcm_MT1087_rate_ms; //!< GLONASS MSM7. The type 7 Multiple Signal Message format for the Russian GLONASS system int32_t d_rtcm_MT1087_rate_ms; // GLONASS MSM7. The type 7 Multiple Signal Message format for the Russian GLONASS system
int32_t d_rtcm_MT1097_rate_ms; //!< Galileo MSM7. The type 7 Multiple Signal Message format for Europes Galileo system int32_t d_rtcm_MT1097_rate_ms; // Galileo MSM7. The type 7 Multiple Signal Message format for Europes Galileo system
int32_t d_rtcm_MSM_rate_ms; int32_t d_rtcm_MSM_rate_ms;
int32_t d_last_status_print_seg; //for status printer int32_t d_last_status_print_seg; // for status printer
uint32_t d_nchannels; uint32_t d_nchannels;
std::string d_dump_filename; std::string d_dump_filename;
@ -113,7 +114,7 @@ private:
bool d_kml_output_enabled; bool d_kml_output_enabled;
bool d_nmea_output_file_enabled; bool d_nmea_output_file_enabled;
std::shared_ptr<rtklib_solver> d_pvt_solver; std::shared_ptr<Rtklib_Solver> d_pvt_solver;
std::map<int, Gnss_Synchro> gnss_observables_map; std::map<int, Gnss_Synchro> gnss_observables_map;
bool observables_pairCompare_min(const std::pair<int, Gnss_Synchro>& a, const std::pair<int, Gnss_Synchro>& b); bool observables_pairCompare_min(const std::pair<int, Gnss_Synchro>& a, const std::pair<int, Gnss_Synchro>& b);
@ -131,26 +132,31 @@ private:
bool send_sys_v_ttff_msg(ttff_msgbuf ttff); bool send_sys_v_ttff_msg(ttff_msgbuf ttff);
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start, end;
bool save_gnss_synchro_map_xml(const std::string& file_name); //debug helper function bool save_gnss_synchro_map_xml(const std::string& file_name); // debug helper function
bool load_gnss_synchro_map_xml(const std::string& file_name); //debug helper function bool load_gnss_synchro_map_xml(const std::string& file_name); // debug helper function
bool d_xml_storage; bool d_xml_storage;
std::string xml_base_path; std::string xml_base_path;
inline std::time_t to_time_t(boost::posix_time::ptime pt) inline std::time_t convert_to_time_t(const boost::posix_time::ptime pt) const
{ {
return (pt - boost::posix_time::ptime(boost::gregorian::date(1970, 1, 1))).total_seconds(); return (pt - boost::posix_time::ptime(boost::gregorian::date(1970, 1, 1))).total_seconds();
} }
bool flag_monitor_pvt_enabled;
std::unique_ptr<Monitor_Pvt_Udp_Sink> udp_sink_ptr;
std::vector<std::string> split_string(const std::string& s, char delim);
public: public:
rtklib_pvt_cc(uint32_t nchannels, rtklib_pvt_cc(uint32_t nchannels,
const Pvt_Conf& conf_, const Pvt_Conf& conf_,
const rtk_t& rtk); const rtk_t& rtk);
~rtklib_pvt_cc(); //!< Default destructor
/*! /*!
* \brief Get latest set of ephemeris from PVT block * \brief Get latest set of GPS ephemeris from PVT block
* *
*/ */
std::map<int, Gps_Ephemeris> get_gps_ephemeris_map() const; std::map<int, Gps_Ephemeris> get_gps_ephemeris_map() const;
@ -179,9 +185,7 @@ public:
double* height_m, double* height_m,
double* ground_speed_kmh, double* ground_speed_kmh,
double* course_over_ground_deg, double* course_over_ground_deg,
time_t* UTC_time); time_t* UTC_time) const;
~rtklib_pvt_cc(); //!< Default destructor
int work(int noutput_items, gr_vector_const_void_star& input_items, int work(int noutput_items, gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items); //!< PVT Signal Processing gr_vector_void_star& output_items); //!< PVT Signal Processing

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -16,7 +16,6 @@
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
# #
add_definitions(-DGNSS_SDR_VERSION="${VERSION}")
set(PVT_LIB_SOURCES set(PVT_LIB_SOURCES
pvt_solution.cc pvt_solution.cc
@ -30,6 +29,7 @@ set(PVT_LIB_SOURCES
geojson_printer.cc geojson_printer.cc
rtklib_solver.cc rtklib_solver.cc
pvt_conf.cc pvt_conf.cc
monitor_pvt_udp_sink.cc
) )
set(PVT_LIB_HEADERS set(PVT_LIB_HEADERS
@ -44,50 +44,53 @@ set(PVT_LIB_HEADERS
geojson_printer.h geojson_printer.h
rtklib_solver.h rtklib_solver.h
pvt_conf.h pvt_conf.h
) monitor_pvt_udp_sink.h
monitor_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/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}
) )
list(SORT PVT_LIB_HEADERS) list(SORT PVT_LIB_HEADERS)
list(SORT PVT_LIB_SOURCES) list(SORT PVT_LIB_SOURCES)
add_library(pvt_lib ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS})
source_group(Headers FILES ${PVT_LIB_HEADERS}) source_group(Headers FILES ${PVT_LIB_HEADERS})
if(MATIO_FOUND) add_library(pvt_libs ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS})
add_dependencies(pvt_lib
glog-${glog_RELEASE} target_link_libraries(pvt_libs
armadillo-${armadillo_RELEASE} PUBLIC
) Armadillo::armadillo
else() Boost::date_time
add_dependencies(pvt_lib algorithms_libs
glog-${glog_RELEASE} algorithms_libs_rtklib
armadillo-${armadillo_RELEASE} core_system_parameters
matio-${GNSSSDR_MATIO_LOCAL_VERSION} PRIVATE
Boost::filesystem
Boost::system
Gflags::gflags
Glog::glog
Matio::matio
)
target_include_directories(pvt_libs
PUBLIC
${CMAKE_SOURCE_DIR}/src/algorithms/libs
${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib
${CMAKE_SOURCE_DIR}/src/core/receiver
)
target_compile_definitions(pvt_libs PRIVATE -DGNSS_SDR_VERSION="${VERSION}")
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(pvt_libs
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
) )
endif()
endif() endif()
target_link_libraries(pvt_lib set_property(TARGET pvt_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
rtklib_lib $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
gnss_sdr_flags $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/algorithms/libs>
gnss_sp_libs $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib>
${Boost_LIBRARIES} $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/core/system_parameters>
${GLOG_LIBRARIES}
${ARMADILLO_LIBRARIES}
${BLAS}
${LAPACK}
${MATIO_LIBRARIES}
) )

View File

@ -36,6 +36,7 @@
#include <boost/filesystem/path.hpp> // for path, operator<< #include <boost/filesystem/path.hpp> // for path, operator<<
#include <boost/filesystem/path_traits.hpp> // for filesystem #include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h> #include <glog/logging.h>
#include <exception>
#include <iomanip> #include <iomanip>
#include <sstream> #include <sstream>
@ -79,7 +80,14 @@ GeoJSON_Printer::GeoJSON_Printer(const std::string& base_path)
GeoJSON_Printer::~GeoJSON_Printer() GeoJSON_Printer::~GeoJSON_Printer()
{ {
try
{
GeoJSON_Printer::close_file(); GeoJSON_Printer::close_file();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
} }
@ -213,7 +221,10 @@ bool GeoJSON_Printer::close_file()
// if nothing is written, erase the file // if nothing is written, erase the file
if (first_pos == true) if (first_pos == true)
{ {
if (remove(filename_.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; if (remove(filename_.c_str()) != 0)
{
LOG(INFO) << "Error deleting temporary file";
}
} }
return true; return true;
} }

View File

@ -36,6 +36,7 @@
#include <boost/filesystem/path.hpp> // for path, operator<< #include <boost/filesystem/path.hpp> // for path, operator<<
#include <boost/filesystem/path_traits.hpp> // for filesystem #include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h> #include <glog/logging.h>
#include <exception>
#include <sstream> #include <sstream>
using google::LogMessage; using google::LogMessage;
@ -154,14 +155,14 @@ bool Gpx_Printer::set_headers(const std::string& filename, bool time_tag_name)
} }
bool Gpx_Printer::print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values) bool Gpx_Printer::print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values)
{ {
double latitude; double latitude;
double longitude; double longitude;
double height; double height;
positions_printed = true; positions_printed = true;
const std::shared_ptr<rtklib_solver>& position_ = position; const std::shared_ptr<Rtklib_Solver>& position_ = position;
double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s
double course_over_ground = position_->get_course_over_ground(); // expressed in deg double course_over_ground = position_->get_course_over_ground(); // expressed in deg
@ -170,7 +171,10 @@ bool Gpx_Printer::print_position(const std::shared_ptr<rtklib_solver>& position,
double vdop = position_->get_vdop(); double vdop = position_->get_vdop();
double pdop = position_->get_pdop(); double pdop = position_->get_pdop();
std::string utc_time = to_iso_extended_string(position_->get_position_UTC_time()); std::string utc_time = to_iso_extended_string(position_->get_position_UTC_time());
if (utc_time.length() < 23) utc_time += "."; if (utc_time.length() < 23)
{
utc_time += ".";
}
utc_time.resize(23, '0'); // time up to ms utc_time.resize(23, '0'); // time up to ms
utc_time.append("Z"); // UTC time zone utc_time.append("Z"); // UTC time zone
@ -218,9 +222,19 @@ bool Gpx_Printer::close_file()
Gpx_Printer::~Gpx_Printer() Gpx_Printer::~Gpx_Printer()
{ {
try
{
close_file(); close_file();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
if (!positions_printed) if (!positions_printed)
{ {
if (remove(gpx_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary GPX file"; if (remove(gpx_filename.c_str()) != 0)
{
LOG(INFO) << "Error deleting temporary GPX file";
}
} }
} }

View File

@ -58,7 +58,7 @@ public:
Gpx_Printer(const std::string& base_path = "."); Gpx_Printer(const std::string& base_path = ".");
~Gpx_Printer(); ~Gpx_Printer();
bool set_headers(const std::string& filename, bool time_tag_name = true); bool set_headers(const std::string& filename, bool time_tag_name = true);
bool print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values); bool print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values);
bool close_file(); bool close_file();
}; };

View File

@ -40,7 +40,7 @@
using google::LogMessage; using google::LogMessage;
hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file) : Ls_Pvt() Hybrid_Ls_Pvt::Hybrid_Ls_Pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file) : Ls_Pvt()
{ {
// init empty ephemeris for all the available GNSS channels // init empty ephemeris for all the available GNSS channels
d_nchannels = nchannels; d_nchannels = nchannels;
@ -69,7 +69,7 @@ hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag
} }
hybrid_ls_pvt::~hybrid_ls_pvt() Hybrid_Ls_Pvt::~Hybrid_Ls_Pvt()
{ {
if (d_dump_file.is_open() == true) if (d_dump_file.is_open() == true)
{ {
@ -85,7 +85,7 @@ hybrid_ls_pvt::~hybrid_ls_pvt()
} }
bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, double hybrid_current_time, bool flag_averaging) bool Hybrid_Ls_Pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, double hybrid_current_time, bool flag_averaging)
{ {
std::map<int, Gnss_Synchro>::iterator gnss_observables_iter; std::map<int, Gnss_Synchro>::iterator gnss_observables_iter;
std::map<int, Galileo_Ephemeris>::iterator galileo_ephemeris_iter; std::map<int, Galileo_Ephemeris>::iterator galileo_ephemeris_iter;
@ -133,7 +133,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// COMMON RX TIME PVT ALGORITHM // COMMON RX TIME PVT ALGORITHM
double Rx_time = hybrid_current_time; double Rx_time = hybrid_current_time;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GALILEO_C_m_s; double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GALILEO_C_M_S;
// 2- compute the clock drift using the clock model (broadcast) for this SV // 2- compute the clock drift using the clock model (broadcast) for this SV
SV_clock_bias_s = galileo_ephemeris_iter->second.sv_clock_drift(Tx_time); SV_clock_bias_s = galileo_ephemeris_iter->second.sv_clock_drift(Tx_time);
@ -150,7 +150,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// 4- fill the observations vector with the corrected observables // 4- fill the observations vector with the corrected observables
obs.resize(valid_obs + 1, 1); obs.resize(valid_obs + 1, 1);
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_m_s - this->get_time_offset_s() * GALILEO_C_m_s; obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_M_S - this->get_time_offset_s() * GALILEO_C_M_S;
Galileo_week_number = galileo_ephemeris_iter->second.WN_5; //for GST Galileo_week_number = galileo_ephemeris_iter->second.WN_5; //for GST
GST = galileo_ephemeris_iter->second.Galileo_System_Time(Galileo_week_number, hybrid_current_time); GST = galileo_ephemeris_iter->second.Galileo_System_Time(Galileo_week_number, hybrid_current_time);
@ -188,7 +188,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files) // COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files)
// first estimate of transmit time // first estimate of transmit time
double Rx_time = hybrid_current_time; double Rx_time = hybrid_current_time;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_m_s; double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_M_S;
// 2- compute the clock drift using the clock model (broadcast) for this SV, not including relativistic effect // 2- compute the clock drift using the clock model (broadcast) for this SV, not including relativistic effect
SV_clock_bias_s = gps_ephemeris_iter->second.sv_clock_drift(Tx_time); //- gps_ephemeris_iter->second.d_TGD; SV_clock_bias_s = gps_ephemeris_iter->second.sv_clock_drift(Tx_time); //- gps_ephemeris_iter->second.d_TGD;
@ -208,10 +208,10 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// See IS-GPS-200E section 20.3.3.3.3.2 // See IS-GPS-200E section 20.3.3.3.3.2
double sqrt_Gamma = GPS_L1_FREQ_HZ / GPS_L2_FREQ_HZ; double sqrt_Gamma = GPS_L1_FREQ_HZ / GPS_L2_FREQ_HZ;
double Gamma = sqrt_Gamma * sqrt_Gamma; double Gamma = sqrt_Gamma * sqrt_Gamma;
double P1_P2 = (1.0 - Gamma) * (gps_ephemeris_iter->second.d_TGD * GPS_C_m_s); double P1_P2 = (1.0 - Gamma) * (gps_ephemeris_iter->second.d_TGD * GPS_C_M_S);
double Code_bias_m = P1_P2 / (1.0 - Gamma); double Code_bias_m = P1_P2 / (1.0 - Gamma);
obs.resize(valid_obs + 1, 1); obs.resize(valid_obs + 1, 1);
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s - Code_bias_m - this->get_time_offset_s() * GPS_C_m_s; obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_M_S - Code_bias_m - this->get_time_offset_s() * GPS_C_M_S;
// SV ECEF DEBUG OUTPUT // SV ECEF DEBUG OUTPUT
LOG(INFO) << "(new)ECEF GPS L1 CA satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN LOG(INFO) << "(new)ECEF GPS L1 CA satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN
@ -243,7 +243,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files) // COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files)
// first estimate of transmit time // first estimate of transmit time
double Rx_time = hybrid_current_time; double Rx_time = hybrid_current_time;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_m_s; double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_M_S;
// 2- compute the clock drift using the clock model (broadcast) for this SV // 2- compute the clock drift using the clock model (broadcast) for this SV
SV_clock_bias_s = gps_cnav_ephemeris_iter->second.sv_clock_drift(Tx_time); SV_clock_bias_s = gps_cnav_ephemeris_iter->second.sv_clock_drift(Tx_time);
@ -261,7 +261,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// 4- fill the observations vector with the corrected observables // 4- fill the observations vector with the corrected observables
obs.resize(valid_obs + 1, 1); obs.resize(valid_obs + 1, 1);
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s + SV_clock_bias_s * GPS_C_m_s; obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_M_S + SV_clock_bias_s * GPS_C_M_S;
GPS_week = gps_cnav_ephemeris_iter->second.i_GPS_week; GPS_week = gps_cnav_ephemeris_iter->second.i_GPS_week;
GPS_week = GPS_week % 1024; //Necessary due to the increase of WN bits in CNAV message (10 in GPS NAV and 13 in CNAV) GPS_week = GPS_week % 1024; //Necessary due to the increase of WN bits in CNAV message (10 in GPS NAV and 13 in CNAV)
@ -311,17 +311,17 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
DLOG(INFO) << " Executing Bancroft algorithm..."; DLOG(INFO) << " Executing Bancroft algorithm...";
rx_position_and_time = bancroftPos(satpos.t(), obs); rx_position_and_time = bancroftPos(satpos.t(), obs);
this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration
this->set_time_offset_s(rx_position_and_time(3) / GPS_C_m_s); // save time for the next iteration [meters]->[seconds] this->set_time_offset_s(rx_position_and_time(3) / GPS_C_M_S); // save time for the next iteration [meters]->[seconds]
} }
// Execute WLS using previous position as the initialization point // Execute WLS using previous position as the initialization point
rx_position_and_time = leastSquarePos(satpos, obs, W); rx_position_and_time = leastSquarePos(satpos, obs, W);
this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration
this->set_time_offset_s(this->get_time_offset_s() + rx_position_and_time(3) / GPS_C_m_s); // accumulate the rx time error for the next iteration [meters]->[seconds] this->set_time_offset_s(this->get_time_offset_s() + rx_position_and_time(3) / GPS_C_M_S); // accumulate the rx time error for the next iteration [meters]->[seconds]
DLOG(INFO) << "Hybrid Position at TOW=" << hybrid_current_time << " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time; DLOG(INFO) << "Hybrid Position at TOW=" << hybrid_current_time << " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time;
DLOG(INFO) << "Accumulated rx clock error=" << this->get_time_offset_s() << " clock error for this iteration=" << rx_position_and_time(3) / GPS_C_m_s << " [s]"; DLOG(INFO) << "Accumulated rx clock error=" << this->get_time_offset_s() << " clock error for this iteration=" << rx_position_and_time(3) / GPS_C_M_S << " [s]";
// Compute GST and Gregorian time // Compute GST and Gregorian time
if (GST != 0.0) if (GST != 0.0)

View File

@ -46,7 +46,7 @@
/*! /*!
* \brief This class implements a simple PVT Least Squares solution * \brief This class implements a simple PVT Least Squares solution
*/ */
class hybrid_ls_pvt : public Ls_Pvt class Hybrid_Ls_Pvt : public Ls_Pvt
{ {
private: private:
int count_valid_position; int count_valid_position;
@ -57,10 +57,10 @@ private:
double d_galileo_current_time; double d_galileo_current_time;
public: public:
hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file); Hybrid_Ls_Pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file);
~hybrid_ls_pvt(); ~Hybrid_Ls_Pvt();
bool get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, double Rx_time, bool flag_averaging); bool get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, double hybrid_current_time, bool flag_averaging);
std::map<int, Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris std::map<int, Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris
std::map<int, Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris std::map<int, Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris

View File

@ -36,6 +36,7 @@
#include <boost/filesystem/path.hpp> // for path, operator<< #include <boost/filesystem/path.hpp> // for path, operator<<
#include <boost/filesystem/path_traits.hpp> // for filesystem #include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h> #include <glog/logging.h>
#include <exception>
#include <sstream> #include <sstream>
using google::LogMessage; using google::LogMessage;
@ -211,7 +212,7 @@ bool Kml_Printer::set_headers(const std::string& filename, bool time_tag_name)
} }
bool Kml_Printer::print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values) bool Kml_Printer::print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values)
{ {
double latitude; double latitude;
double longitude; double longitude;
@ -219,7 +220,7 @@ bool Kml_Printer::print_position(const std::shared_ptr<rtklib_solver>& position,
positions_printed = true; positions_printed = true;
const std::shared_ptr<rtklib_solver>& position_ = position; const std::shared_ptr<Rtklib_Solver>& position_ = position;
double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s
double course_over_ground = position_->get_course_over_ground(); // expressed in deg double course_over_ground = position_->get_course_over_ground(); // expressed in deg
@ -228,7 +229,10 @@ bool Kml_Printer::print_position(const std::shared_ptr<rtklib_solver>& position,
double vdop = position_->get_vdop(); double vdop = position_->get_vdop();
double pdop = position_->get_pdop(); double pdop = position_->get_pdop();
std::string utc_time = to_iso_extended_string(position_->get_position_UTC_time()); std::string utc_time = to_iso_extended_string(position_->get_position_UTC_time());
if (utc_time.length() < 23) utc_time += "."; if (utc_time.length() < 23)
{
utc_time += ".";
}
utc_time.resize(23, '0'); // time up to ms utc_time.resize(23, '0'); // time up to ms
utc_time.append("Z"); // UTC time zone utc_time.append("Z"); // UTC time zone
@ -319,9 +323,19 @@ bool Kml_Printer::close_file()
Kml_Printer::~Kml_Printer() Kml_Printer::~Kml_Printer()
{ {
try
{
close_file(); close_file();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
if (!positions_printed) if (!positions_printed)
{ {
if (remove(kml_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary KML file"; if (remove(kml_filename.c_str()) != 0)
{
LOG(INFO) << "Error deleting temporary KML file";
}
} }
} }

View File

@ -61,7 +61,7 @@ public:
Kml_Printer(const std::string& base_path = std::string(".")); Kml_Printer(const std::string& base_path = std::string("."));
~Kml_Printer(); ~Kml_Printer();
bool set_headers(const std::string& filename, bool time_tag_name = true); bool set_headers(const std::string& filename, bool time_tag_name = true);
bool print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values); bool print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values);
bool close_file(); bool close_file();
}; };

View File

@ -95,7 +95,7 @@ arma::vec Ls_Pvt::bancroftPos(const arma::mat& satpos, const arma::vec& obs)
{ {
int z = B(i, 2); int z = B(i, 2);
double rho = (x - pos(0)) * (x - pos(0)) + (y - pos(1)) * (y - pos(1)) + (z - pos(2)) * (z - pos(2)); double rho = (x - pos(0)) * (x - pos(0)) + (y - pos(1)) * (y - pos(1)) + (z - pos(2)) * (z - pos(2));
traveltime = sqrt(rho) / GPS_C_m_s; traveltime = sqrt(rho) / GPS_C_M_S;
} }
double angle = traveltime * 7.292115147e-5; double angle = traveltime * 7.292115147e-5;
double cosa = cos(angle); double cosa = cos(angle);
@ -228,7 +228,7 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs,
(X(1, i) - pos(1)) + (X(1, i) - pos(1)) +
(X(2, i) - pos(2)) * (X(2, i) - pos(2)) *
(X(2, i) - pos(2)); (X(2, i) - pos(2));
traveltime = sqrt(rho2) / GPS_C_m_s; traveltime = sqrt(rho2) / GPS_C_M_S;
//--- Correct satellite position (do to earth rotation) -------- //--- Correct satellite position (do to earth rotation) --------
Rot_X = Ls_Pvt::rotateSatellite(traveltime, X.col(i)); //armadillo Rot_X = Ls_Pvt::rotateSatellite(traveltime, X.col(i)); //armadillo
@ -253,7 +253,10 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs,
{ {
//--- Find delay due to troposphere (in meters) //--- Find delay due to troposphere (in meters)
Ls_Pvt::tropo(&trop, sin(*elev * GPS_PI / 180.0), h / 1000.0, 1013.0, 293.0, 50.0, 0.0, 0.0, 0.0); Ls_Pvt::tropo(&trop, sin(*elev * GPS_PI / 180.0), h / 1000.0, 1013.0, 293.0, 50.0, 0.0, 0.0, 0.0);
if (trop > 5.0) trop = 0.0; //check for erratic values if (trop > 5.0)
{
trop = 0.0; //check for erratic values
}
} }
} }
} }
@ -280,9 +283,9 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs,
} }
// check the consistency of the PVT solution // check the consistency of the PVT solution
if (((fabs(pos(3)) * 1000.0) / GPS_C_m_s) > GPS_STARTOFFSET_ms * 2) if (((fabs(pos(3)) * 1000.0) / GPS_C_M_S) > GPS_STARTOFFSET_MS * 2)
{ {
LOG(WARNING) << "Receiver time offset out of range! Estimated RX Time error [s]:" << pos(3) / GPS_C_m_s; LOG(WARNING) << "Receiver time offset out of range! Estimated RX Time error [s]:" << pos(3) / GPS_C_M_S;
throw std::runtime_error("Receiver time offset out of range!"); throw std::runtime_error("Receiver time offset out of range!");
} }
return pos; return pos;

View File

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

View File

@ -0,0 +1,98 @@
/*!
* \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 <https://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#include "monitor_pvt_udp_sink.h"
#include <boost/archive/binary_oarchive.hpp>
#include <iostream>
#include <sstream>
Monitor_Pvt_Udp_Sink::Monitor_Pvt_Udp_Sink(std::vector<std::string> addresses, const uint16_t& port) : socket{io_service}
{
for (const auto& address : addresses)
{
boost::asio::ip::udp::endpoint endpoint(boost::asio::ip::address::from_string(address, error), port);
endpoints.push_back(endpoint);
}
monitor_pvt.TOW_at_current_symbol_ms = 0U;
monitor_pvt.week = 0U;
monitor_pvt.RX_time = 0.0;
monitor_pvt.user_clk_offset = 0.0;
monitor_pvt.pos_x = 0.0;
monitor_pvt.pos_y = 0.0;
monitor_pvt.pos_z = 0.0;
monitor_pvt.vel_x = 0.0;
monitor_pvt.vel_y = 0.0;
monitor_pvt.vel_z = 0.0;
monitor_pvt.cov_xx = 0.0;
monitor_pvt.cov_yy = 0.0;
monitor_pvt.cov_zz = 0.0;
monitor_pvt.cov_xy = 0.0;
monitor_pvt.cov_yz = 0.0;
monitor_pvt.cov_zx = 0.0;
monitor_pvt.latitude = 0.0;
monitor_pvt.longitude = 0.0;
monitor_pvt.height = 0.0;
monitor_pvt.valid_sats = 0;
monitor_pvt.solution_status = 0;
monitor_pvt.solution_type = 0;
monitor_pvt.AR_ratio_factor = 0.0;
monitor_pvt.AR_ratio_threshold = 0.0;
monitor_pvt.gdop = 0.0;
monitor_pvt.pdop = 0.0;
monitor_pvt.hdop = 0.0;
monitor_pvt.vdop = 0.0;
}
bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(const 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 (const auto& endpoint : endpoints)
{
socket.open(endpoint.protocol(), error);
socket.connect(endpoint, error);
try
{
socket.send(boost::asio::buffer(outbound_data));
}
catch (boost::system::system_error const& e)
{
return false;
}
}
return true;
}

View File

@ -0,0 +1,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 <https://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_MONITOR_PVT_UDP_SINK_H_
#define GNSS_SDR_MONITOR_PVT_UDP_SINK_H_
#include "monitor_pvt.h"
#include <boost/asio.hpp>
class Monitor_Pvt_Udp_Sink
{
public:
Monitor_Pvt_Udp_Sink(std::vector<std::string> addresses, const uint16_t &port);
bool write_monitor_pvt(const Monitor_Pvt &monitor_pvt);
private:
boost::asio::io_service io_service;
boost::asio::ip::udp::socket socket;
boost::system::error_code error;
std::vector<boost::asio::ip::udp::endpoint> endpoints;
Monitor_Pvt monitor_pvt;
};
#endif /* GNSS_SDR_MONITOR_PVT_UDP_SINK_H_ */

View File

@ -41,6 +41,7 @@
#include <boost/filesystem/path_traits.hpp> // for filesystem #include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h> #include <glog/logging.h>
#include <cstdint> #include <cstdint>
#include <exception>
#include <fcntl.h> #include <fcntl.h>
#include <termios.h> #include <termios.h>
@ -118,11 +119,29 @@ Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_fi
Nmea_Printer::~Nmea_Printer() Nmea_Printer::~Nmea_Printer()
{ {
try
{
if (nmea_file_descriptor.is_open()) if (nmea_file_descriptor.is_open())
{ {
nmea_file_descriptor.close(); nmea_file_descriptor.close();
} }
}
catch (const std::ofstream::failure& e)
{
std::cerr << "Problem closing NMEA dump file: " << nmea_filename << '\n';
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
try
{
close_serial(); close_serial();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
} }
@ -142,9 +161,15 @@ int Nmea_Printer::init_serial(const std::string& serial_device)
int64_t PARITY; int64_t PARITY;
fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY | O_CLOEXEC); fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY | O_CLOEXEC);
if (fd == -1) return fd; // failed to open TTY port if (fd == -1)
{
return fd; // failed to open TTY port
}
if (fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O if (fcntl(fd, F_SETFL, 0) == -1)
{
LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O
}
tcgetattr(fd, &options); // read serial port options tcgetattr(fd, &options); // read serial port options
BAUD = B9600; BAUD = B9600;
@ -174,7 +199,7 @@ void Nmea_Printer::close_serial()
} }
bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr<rtklib_solver>& pvt_data, bool print_average_values) bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr<Rtklib_Solver>& pvt_data, bool print_average_values)
{ {
std::string GPRMC; std::string GPRMC;
std::string GPGGA; std::string GPGGA;
@ -348,13 +373,22 @@ std::string Nmea_Printer::get_UTC_NMEA_time(boost::posix_time::ptime d_position_
utc_seconds = td.seconds(); utc_seconds = td.seconds();
utc_milliseconds = td.total_milliseconds() - td.total_seconds() * 1000; utc_milliseconds = td.total_milliseconds() - td.total_seconds() * 1000;
if (utc_hours < 10) sentence_str << "0"; // two digits for hours if (utc_hours < 10)
{
sentence_str << "0"; // two digits for hours
}
sentence_str << utc_hours; sentence_str << utc_hours;
if (utc_mins < 10) sentence_str << "0"; // two digits for minutes if (utc_mins < 10)
{
sentence_str << "0"; // two digits for minutes
}
sentence_str << utc_mins; sentence_str << utc_mins;
if (utc_seconds < 10) sentence_str << "0"; // two digits for seconds if (utc_seconds < 10)
{
sentence_str << "0"; // two digits for seconds
}
sentence_str << utc_seconds; sentence_str << utc_seconds;
if (utc_milliseconds < 10) if (utc_milliseconds < 10)

View File

@ -38,6 +38,7 @@
#include "rtklib_solver.h" #include "rtklib_solver.h"
#include <fstream> #include <fstream>
#include <memory>
#include <string> #include <string>
@ -58,7 +59,7 @@ public:
/*! /*!
* \brief Print NMEA PVT and satellite info to the initialized device * \brief Print NMEA PVT and satellite info to the initialized device
*/ */
bool Print_Nmea_Line(const std::shared_ptr<rtklib_solver>& pvt_data, bool print_average_values); bool Print_Nmea_Line(const std::shared_ptr<Rtklib_Solver>& pvt_data, bool print_average_values);
/*! /*!
* \brief Default destructor. * \brief Default destructor.
@ -71,7 +72,7 @@ private:
std::ofstream nmea_file_descriptor; // Output file stream for NMEA log file std::ofstream nmea_file_descriptor; // Output file stream for NMEA log file
std::string nmea_devname; std::string nmea_devname;
int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port) int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port)
std::shared_ptr<rtklib_solver> d_PVT_data; std::shared_ptr<Rtklib_Solver> d_PVT_data;
int init_serial(const std::string& serial_device); //serial port control int init_serial(const std::string& serial_device); //serial port control
void close_serial(); void close_serial();
std::string get_GPGGA(); // fix data std::string get_GPGGA(); // fix data

View File

@ -67,4 +67,7 @@ Pvt_Conf::Pvt_Conf()
kml_output_path = std::string("."); kml_output_path = std::string(".");
xml_output_path = std::string("."); xml_output_path = std::string(".");
rtcm_output_file_path = std::string("."); rtcm_output_file_path = std::string(".");
monitor_enabled = false;
udp_port = 0;
} }

View File

@ -80,6 +80,10 @@ public:
std::string xml_output_path; std::string xml_output_path;
std::string rtcm_output_file_path; std::string rtcm_output_file_path;
bool monitor_enabled;
std::string udp_addresses;
int udp_port;
Pvt_Conf(); Pvt_Conf();
}; };

View File

@ -37,8 +37,6 @@
#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/posix_time/posix_time.hpp>
#include <deque> #include <deque>
const unsigned int PVT_MAX_CHANNELS = 90;
const unsigned int PVT_MAX_PRN = 127; // 126 is SBAS
/*! /*!
* \brief Base class for a PVT solution * \brief Base class for a PVT solution

File diff suppressed because it is too large Load Diff

View File

@ -186,17 +186,17 @@ public:
/*! /*!
* \brief Generates the Mixed (GPS L1 C/A /GLONASS) Observation data header. Example: galileo_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". * \brief Generates the Mixed (GPS L1 C/A /GLONASS) Observation data header. Example: galileo_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B".
*/ */
void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glo_bands = "1C"); void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands = "1C");
/*! /*!
* \brief Generates the Mixed (Galileo/GLONASS) Observation data header. Example: galileo_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". * \brief Generates the Mixed (Galileo/GLONASS) Observation data header. Example: galileo_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B".
*/ */
void rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& galileo_bands = "1B", const std::string& glo_bands = "1C"); void rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& galileo_bands = "1B", const std::string& glonass_bands = "1C");
/*! /*!
* \brief Generates the Mixed (GPS L2C/GLONASS) Observation data header. Example: galileo_bands("1G")... Default: "1G". * \brief Generates the Mixed (GPS L2C/GLONASS) Observation data header. Example: galileo_bands("1G")... Default: "1G".
*/ */
void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glo_bands = "1G"); void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands = "1G");
/*! /*!
* \brief Generates the a Beidou B1I Observation data header. Example: beidou_bands("B1") * \brief Generates the a Beidou B1I Observation data header. Example: beidou_bands("B1")
@ -351,12 +351,12 @@ public:
/*! /*!
* \brief Writes Mixed GPS L2C - GLONASS observables into the RINEX file * \brief Writes Mixed GPS L2C - GLONASS observables into the RINEX file
*/ */
void log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables); void log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
/*! /*!
* \brief Writes Mixed Galileo/GLONASS observables into the RINEX file * \brief Writes Mixed Galileo/GLONASS observables into the RINEX file
*/ */
void log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables); void log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double galileo_obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
/*! /*!
* \brief Writes BDS B1I observables into the RINEX file * \brief Writes BDS B1I observables into the RINEX file
@ -374,7 +374,7 @@ public:
*/ */
//void log_rinex_sbs(std::fstream & out, const Sbas_Raw_Msg & sbs_message); //void log_rinex_sbs(std::fstream & out, const Sbas_Raw_Msg & sbs_message);
void update_nav_header(std::fstream& out, const Gps_Utc_Model& gps_utc, const Gps_Iono& gps_iono); void update_nav_header(std::fstream& out, const Gps_Utc_Model& utc_model, const Gps_Iono& gps_iono);
void update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Model& utc_model, const Gps_CNAV_Iono& iono); void update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Model& utc_model, const Gps_CNAV_Iono& iono);
@ -388,11 +388,11 @@ public:
void update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); void update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac);
void update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_cnav_iono, const Gps_CNAV_Utc_Model& gps_cnav_utc, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); void update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_iono, const Gps_CNAV_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac);
void update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); void update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac);
void update_nav_header(std::fstream& out, const Beidou_Dnav_Utc_Model& beidou_dnav_utc, const Beidou_Dnav_Iono& beidou_dnav_iono); void update_nav_header(std::fstream& out, const Beidou_Dnav_Utc_Model& utc_model, const Beidou_Dnav_Iono& beidou_dnav_iono);
void update_obs_header(std::fstream& out, const Gps_Utc_Model& utc_model); void update_obs_header(std::fstream& out, const Gps_Utc_Model& utc_model);
@ -676,8 +676,15 @@ inline std::string Rinex_Printer::doub2for(const double& d,
short exponentLength = expLen; short exponentLength = expLen;
/* Validate the assumptions regarding the input arguments */ /* Validate the assumptions regarding the input arguments */
if (exponentLength < 0) exponentLength = 1; if (exponentLength < 0)
if (exponentLength > 3 && checkSwitch) exponentLength = 3; {
exponentLength = 1;
}
if (exponentLength > 3 && checkSwitch)
{
exponentLength = 3;
}
std::string toReturn = doub2sci(d, length, exponentLength, true, checkSwitch); std::string toReturn = doub2sci(d, length, exponentLength, true, checkSwitch);
sci2for(toReturn, 0, length, exponentLength, checkSwitch); sci2for(toReturn, 0, length, exponentLength, checkSwitch);
@ -696,8 +703,15 @@ inline std::string Rinex_Printer::doub2sci(const double& d,
short exponentLength = expLen; short exponentLength = expLen;
/* Validate the assumptions regarding the input arguments */ /* Validate the assumptions regarding the input arguments */
if (exponentLength < 0) exponentLength = 1; if (exponentLength < 0)
if (exponentLength > 3 && checkSwitch) exponentLength = 3; {
exponentLength = 1;
}
if (exponentLength > 3 && checkSwitch)
{
exponentLength = 3;
}
std::stringstream c; std::stringstream c;
c.setf(std::ios::scientific, std::ios::floatfield); c.setf(std::ios::scientific, std::ios::floatfield);
@ -709,7 +723,10 @@ inline std::string Rinex_Printer::doub2sci(const double& d,
// an extra -1 for '-' or ' ' if it's positive or negative // an extra -1 for '-' or ' ' if it's positive or negative
int expSize = 0; int expSize = 0;
if (showSign) if (showSign)
{
expSize = 1; expSize = 1;
}
c.precision(length - 3 - exponentLength - 1 - expSize); c.precision(length - 3 - exponentLength - 1 - expSize);
c << d; c << d;
c >> toReturn; c >> toReturn;
@ -751,8 +768,10 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr,
aStr[idx - 1] = '.'; aStr[idx - 1] = '.';
// Only add one to the exponent if the number is non-zero // Only add one to the exponent if the number is non-zero
if (asDouble(aStr.substr(startPos, length)) != 0.0) if (asDouble(aStr.substr(startPos, length)) != 0.0)
{
expAdd = 1; expAdd = 1;
} }
}
idx = aStr.find('e', startPos); idx = aStr.find('e', startPos);
if (idx == std::string::npos) if (idx == std::string::npos)
@ -766,9 +785,13 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr,
// Change the exponent character to D normally, or E of checkSwitch is false. // Change the exponent character to D normally, or E of checkSwitch is false.
if (checkSwitch) if (checkSwitch)
{
aStr[idx] = 'D'; aStr[idx] = 'D';
}
else else
{
aStr[idx] = 'E'; aStr[idx] = 'E';
}
// Change the exponent itself // Change the exponent itself
if (redoexp) if (redoexp)
@ -784,7 +807,10 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr,
iexp -= iexp * 2; iexp -= iexp * 2;
} }
else else
{
aStr += "+"; aStr += "+";
}
aStr += Rinex_Printer::rightJustify(asString(iexp), expLen, '0'); aStr += Rinex_Printer::rightJustify(asString(iexp), expLen, '0');
} }

View File

@ -38,6 +38,7 @@
#include <boost/filesystem/path_traits.hpp> // for filesystem #include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h> #include <glog/logging.h>
#include <cstdint> #include <cstdint>
#include <exception>
#include <fcntl.h> // for O_RDWR #include <fcntl.h> // for O_RDWR
#include <iomanip> #include <iomanip>
#include <termios.h> // for tcgetattr #include <termios.h> // for tcgetattr
@ -143,7 +144,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) if (flag_rtcm_tty_port == true)
{ {
rtcm_dev_descriptor = init_serial(rtcm_devname.c_str()); rtcm_dev_descriptor = init_serial(rtcm_devname.c_str());
@ -190,13 +191,30 @@ Rtcm_Printer::~Rtcm_Printer()
{ {
int64_t pos; int64_t pos;
pos = rtcm_file_descriptor.tellp(); pos = rtcm_file_descriptor.tellp();
try
{
rtcm_file_descriptor.close(); rtcm_file_descriptor.close();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
if (pos == 0) if (pos == 0)
{ {
if (remove(rtcm_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary RTCM file"; if (remove(rtcm_filename.c_str()) != 0)
{
LOG(INFO) << "Error deleting temporary RTCM file";
} }
} }
}
try
{
close_serial(); close_serial();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
} }
@ -353,9 +371,15 @@ int Rtcm_Printer::init_serial(const std::string& serial_device)
int64_t PARITY; int64_t PARITY;
fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY | O_CLOEXEC); fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY | O_CLOEXEC);
if (fd == -1) return fd; // failed to open TTY port if (fd == -1)
{
return fd; // failed to open TTY port
}
if (fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O if (fcntl(fd, F_SETFL, 0) == -1)
{
LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O
}
tcgetattr(fd, &options); // read serial port options tcgetattr(fd, &options); // read serial port options
BAUD = B9600; BAUD = B9600;

View File

@ -36,9 +36,9 @@
#include "rtcm.h" #include "rtcm.h"
#include <fstream> // std::ofstream #include <fstream> // std::ofstream
#include <map>
#include <memory> // std::shared_ptr #include <memory> // std::shared_ptr
/*! /*!
* \brief This class provides a implementation of a subset of the RTCM Standard 10403.2 messages * \brief This class provides a implementation of a subset of the RTCM Standard 10403.2 messages
*/ */
@ -48,7 +48,7 @@ public:
/*! /*!
* \brief Default constructor. * \brief Default constructor.
*/ */
Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, const std::string& rtcm_dump_filename, bool time_tag_name = true, const std::string& base_path = "."); Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, const std::string& rtcm_dump_devname, bool time_tag_name = true, const std::string& base_path = ".");
/*! /*!
* \brief Default destructor. * \brief Default destructor.
@ -112,7 +112,7 @@ public:
* \param utc_model GLONASS GNAV Clock Information broadcast in string 5 * \param utc_model GLONASS GNAV Clock Information broadcast in string 5
* \return true or false upon operation success * \return true or false upon operation success
*/ */
bool Print_Rtcm_MT1020(const Glonass_Gnav_Ephemeris& glo_gnav_eph, const Glonass_Gnav_Utc_Model& utc_model); bool Print_Rtcm_MT1020(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const Glonass_Gnav_Utc_Model& utc_model);
bool Print_Rtcm_MSM(uint32_t msm_number, bool Print_Rtcm_MSM(uint32_t msm_number,
const Gps_Ephemeris& gps_eph, const Gps_Ephemeris& gps_eph,

View File

@ -60,12 +60,13 @@
#include "rtklib_solution.h" #include "rtklib_solution.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <matio.h> #include <matio.h>
#include <exception>
#include <utility> #include <utility>
using google::LogMessage; using google::LogMessage;
rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t &rtk) Rtklib_Solver::Rtklib_Solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t &rtk)
{ {
// init empty ephemeris for all the available GNSS channels // init empty ephemeris for all the available GNSS channels
d_nchannels = nchannels; d_nchannels = nchannels;
@ -75,7 +76,10 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag
count_valid_position = 0; count_valid_position = 0;
this->set_averaging_flag(false); this->set_averaging_flag(false);
rtk_ = rtk; rtk_ = rtk;
for (double &i : dop_) i = 0.0; for (double &i : dop_)
{
i = 0.0;
}
pvt_sol = {{0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, '0', '0', '0', 0, 0, 0}; pvt_sol = {{0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, '0', '0', '0', 0, 0, 0};
ssat_t ssat0 = {0, 0, {0.0}, {0.0}, {0.0}, {'0'}, {'0'}, {'0'}, {'0'}, {'0'}, {}, {}, {}, {}, 0.0, 0.0, 0.0, 0.0, {{{0, 0}}, {{0, 0}}}, {{}, {}}}; ssat_t ssat0 = {0, 0, {0.0}, {0.0}, {0.0}, {'0'}, {'0'}, {'0'}, {'0'}, {'0'}, {}, {}, {}, {}, 0.0, 0.0, 0.0, 0.0, {{{0, 0}}, {{0, 0}}}, {{}, {}}};
for (auto &i : pvt_ssat) for (auto &i : pvt_ssat)
@ -89,19 +93,48 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag
{ {
try try
{ {
d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit);
d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary);
LOG(INFO) << "PVT lib dump enabled Log file: " << d_dump_filename.c_str(); LOG(INFO) << "PVT lib dump enabled Log file: " << d_dump_filename.c_str();
} }
catch (const std::ifstream::failure &e) catch (const std::ofstream::failure &e)
{ {
LOG(WARNING) << "Exception opening RTKLIB dump file " << e.what(); LOG(WARNING) << "Exception opening RTKLIB dump file " << e.what();
} }
} }
} }
// PVT MONITOR
monitor_pvt.TOW_at_current_symbol_ms = 0U;
monitor_pvt.week = 0U;
monitor_pvt.RX_time = 0.0;
monitor_pvt.user_clk_offset = 0.0;
monitor_pvt.pos_x = 0.0;
monitor_pvt.pos_y = 0.0;
monitor_pvt.pos_z = 0.0;
monitor_pvt.vel_x = 0.0;
monitor_pvt.vel_y = 0.0;
monitor_pvt.vel_z = 0.0;
monitor_pvt.cov_xx = 0.0;
monitor_pvt.cov_yy = 0.0;
monitor_pvt.cov_zz = 0.0;
monitor_pvt.cov_xy = 0.0;
monitor_pvt.cov_yz = 0.0;
monitor_pvt.cov_zx = 0.0;
monitor_pvt.latitude = 0.0;
monitor_pvt.longitude = 0.0;
monitor_pvt.height = 0.0;
monitor_pvt.valid_sats = 0;
monitor_pvt.solution_status = 0;
monitor_pvt.solution_type = 0;
monitor_pvt.AR_ratio_factor = 0.0;
monitor_pvt.AR_ratio_threshold = 0.0;
monitor_pvt.gdop = 0.0;
monitor_pvt.pdop = 0.0;
monitor_pvt.hdop = 0.0;
monitor_pvt.vdop = 0.0;
} }
bool rtklib_solver::save_matfile() bool Rtklib_Solver::save_matfile()
{ {
// READ DUMP FILE // READ DUMP FILE
std::string dump_filename = d_dump_filename; std::string dump_filename = d_dump_filename;
@ -397,7 +430,8 @@ bool rtklib_solver::save_matfile()
return true; return true;
} }
rtklib_solver::~rtklib_solver()
Rtklib_Solver::~Rtklib_Solver()
{ {
if (d_dump_file.is_open() == true) if (d_dump_file.is_open() == true)
{ {
@ -411,37 +445,48 @@ rtklib_solver::~rtklib_solver()
} }
} }
if (d_flag_dump_mat_enabled) if (d_flag_dump_mat_enabled)
{
try
{ {
save_matfile(); save_matfile();
} }
catch (const std::exception &ex)
{
LOG(WARNING) << "Exception in destructor saving the PVT .mat dump file " << ex.what();
}
}
} }
double rtklib_solver::get_gdop() const double Rtklib_Solver::get_gdop() const
{ {
return dop_[0]; return dop_[0];
} }
double rtklib_solver::get_pdop() const double Rtklib_Solver::get_pdop() const
{ {
return dop_[1]; return dop_[1];
} }
double rtklib_solver::get_hdop() const double Rtklib_Solver::get_hdop() const
{ {
return dop_[2]; return dop_[2];
} }
double rtklib_solver::get_vdop() const double Rtklib_Solver::get_vdop() const
{ {
return dop_[3]; return dop_[3];
} }
Monitor_Pvt Rtklib_Solver::get_monitor_pvt() const
{
return monitor_pvt;
}
bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_map, bool flag_averaging) bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_map, bool flag_averaging)
{ {
std::map<int, Gnss_Synchro>::const_iterator gnss_observables_iter; std::map<int, Gnss_Synchro>::const_iterator gnss_observables_iter;
std::map<int, Galileo_Ephemeris>::const_iterator galileo_ephemeris_iter; std::map<int, Galileo_Ephemeris>::const_iterator galileo_ephemeris_iter;
@ -492,7 +537,10 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
} }
} }
} }
if (band1 == true and band2 == true) gps_dual_band = true; if (band1 == true and band2 == true)
{
gps_dual_band = true;
}
for (gnss_observables_iter = gnss_observables_map.cbegin(); for (gnss_observables_iter = gnss_observables_map.cbegin();
gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter != gnss_observables_map.cend();
@ -851,7 +899,10 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
} }
} }
if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_.data()); if (index_aux > 0)
{
dops(index_aux, azel.data(), 0.0, dop_.data());
}
this->set_valid_position(true); this->set_valid_position(true);
arma::vec rx_position_and_time(4); arma::vec rx_position_and_time(4);
rx_position_and_time(0) = pvt_sol.rr[0]; // [m] rx_position_and_time(0) = pvt_sol.rr[0]; // [m]
@ -865,7 +916,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
} }
else else
{ {
rx_position_and_time(3) = pvt_sol.dtr[0] / GPS_C_m_s; // the receiver clock offset is expressed in [meters], so we convert it into [s] rx_position_and_time(3) = pvt_sol.dtr[0] / GPS_C_M_S; // the receiver clock offset is expressed in [meters], so we convert it into [s]
} }
this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration
@ -880,7 +931,10 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
if (ground_speed_ms >= 1.0) if (ground_speed_ms >= 1.0)
{ {
new_cog = atan2(enuv[0], enuv[1]) * R2D; new_cog = atan2(enuv[0], enuv[1]) * R2D;
if (new_cog < 0.0) new_cog += 360.0; if (new_cog < 0.0)
{
new_cog += 360.0;
}
this->set_course_over_ground(new_cog); this->set_course_over_ground(new_cog);
} }
@ -907,6 +961,58 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
<< " [deg], Height= " << this->get_height() << " [m]" << " [deg], Height= " << this->get_height() << " [m]"
<< " RX time offset= " << this->get_time_offset_s() << " [s]"; << " 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 ######### // ######## LOG FILE #########
if (d_flag_dump_enabled == true) if (d_flag_dump_enabled == true)
{ {

View File

@ -62,6 +62,7 @@
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "gps_cnav_navigation_message.h" #include "gps_cnav_navigation_message.h"
#include "gps_navigation_message.h" #include "gps_navigation_message.h"
#include "monitor_pvt.h"
#include "pvt_solution.h" #include "pvt_solution.h"
#include "rtklib_rtkpos.h" #include "rtklib_rtkpos.h"
#include <array> #include <array>
@ -73,7 +74,7 @@
/*! /*!
* \brief This class implements a simple PVT Least Squares solution * \brief This class implements a simple PVT Least Squares solution
*/ */
class rtklib_solver : public Pvt_Solution class Rtklib_Solver : public Pvt_Solution
{ {
private: private:
rtk_t rtk_; rtk_t rtk_;
@ -85,18 +86,20 @@ private:
bool d_flag_dump_mat_enabled; bool d_flag_dump_mat_enabled;
int d_nchannels; // Number of available channels for positioning int d_nchannels; // Number of available channels for positioning
std::array<double, 4> dop_; std::array<double, 4> dop_;
Monitor_Pvt monitor_pvt;
public: public:
sol_t pvt_sol; sol_t pvt_sol;
ssat_t pvt_ssat[MAXSAT]; ssat_t pvt_ssat[MAXSAT];
rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t& rtk); Rtklib_Solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t& rtk);
~rtklib_solver(); ~Rtklib_Solver();
bool get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_map, bool flag_averaging); bool get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_map, bool flag_averaging);
double get_hdop() const; double get_hdop() const;
double get_vdop() const; double get_vdop() const;
double get_pdop() const; double get_pdop() const;
double get_gdop() const; double get_gdop() const;
Monitor_Pvt get_monitor_pvt() const;
std::map<int, Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris std::map<int, Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris
std::map<int, Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris std::map<int, Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -83,33 +83,43 @@ if(OPENCL_FOUND)
) )
endif() 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_HEADERS)
list(SORT ACQ_ADAPTER_SOURCES) list(SORT ACQ_ADAPTER_SOURCES)
add_library(acq_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS})
source_group(Headers FILES ${ACQ_ADAPTER_HEADERS}) source_group(Headers FILES ${ACQ_ADAPTER_HEADERS})
target_link_libraries(acq_adapters
acquisition_lib add_library(acquisition_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS})
gnss_sp_libs
target_link_libraries(acquisition_adapters
PUBLIC
Gnuradio::blocks
algorithms_libs
gnss_sdr_flags gnss_sdr_flags
acq_gr_blocks acquisition_gr_blocks
${Boost_LIBRARIES} core_system_parameters
${GNURADIO_RUNTIME_LIBRARIES} PRIVATE
${GNURADIO_BLOCKS_LIBRARIES} Boost::boost
Gflags::gflags
Glog::glog
Volkgnsssdr::volkgnsssdr
acquisition_libs
)
target_include_directories(acquisition_adapters
PUBLIC
${CMAKE_SOURCE_DIR}/src/core/interfaces
)
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(acquisition_adapters
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
set_property(TARGET acquisition_adapters
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
) )

View File

@ -68,7 +68,10 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition(
blocking_ = configuration_->property(role + ".blocking", true); blocking_ = configuration_->property(role + ".blocking", true);
acq_parameters.blocking = blocking_; acq_parameters.blocking = blocking_;
doppler_max_ = configuration_->property(role + ".doppler_max", 5000); doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
acq_parameters.doppler_max = doppler_max_; acq_parameters.doppler_max = doppler_max_;
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
acq_parameters.sampled_ms = sampled_ms_; acq_parameters.sampled_ms = sampled_ms_;
@ -81,7 +84,7 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition(
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
acq_parameters.dump_filename = dump_filename_; acq_parameters.dump_filename = dump_filename_;
//--- Find number of samples per spreading code ------------------------- //--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::round(static_cast<double>(fs_in_) / (BEIDOU_B1I_CODE_RATE_HZ / BEIDOU_B1I_CODE_LENGTH_CHIPS))); code_length_ = static_cast<uint32_t>(std::round(static_cast<double>(fs_in_) / (BEIDOU_B1I_CODE_RATE_HZ / BEIDOU_B1I_CODE_LENGTH_CHIPS)));
vector_length_ = code_length_ * sampled_ms_; vector_length_ = code_length_ * sampled_ms_;
@ -144,7 +147,7 @@ void BeidouB1iPcpsAcquisition::stop_acquisition()
{ {
} }
void BeidouB1iPcpsAcquisition::set_channel(unsigned int channel) void BeidouB1iPcpsAcquisition::set_channel(uint32_t channel)
{ {
channel_ = channel; channel_ = channel;
acquisition_->set_channel(channel_); acquisition_->set_channel(channel_);
@ -170,7 +173,7 @@ void BeidouB1iPcpsAcquisition::set_threshold(float threshold)
} }
void BeidouB1iPcpsAcquisition::set_doppler_max(unsigned int doppler_max) void BeidouB1iPcpsAcquisition::set_doppler_max(uint32_t doppler_max)
{ {
doppler_max_ = doppler_max; doppler_max_ = doppler_max;
@ -178,7 +181,7 @@ void BeidouB1iPcpsAcquisition::set_doppler_max(unsigned int doppler_max)
} }
void BeidouB1iPcpsAcquisition::set_doppler_step(unsigned int doppler_step) void BeidouB1iPcpsAcquisition::set_doppler_step(uint32_t doppler_step)
{ {
doppler_step_ = doppler_step; doppler_step_ = doppler_step;
@ -213,7 +216,7 @@ void BeidouB1iPcpsAcquisition::set_local_code()
beidou_b1i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); beidou_b1i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0);
for (unsigned int i = 0; i < sampled_ms_; i++) for (uint32_t i = 0; i < sampled_ms_; i++)
{ {
memcpy(&(code_[i * code_length_]), code, memcpy(&(code_[i * code_length_]), code,
sizeof(gr_complex) * code_length_); sizeof(gr_complex) * code_length_);
@ -239,7 +242,7 @@ void BeidouB1iPcpsAcquisition::set_state(int state)
float BeidouB1iPcpsAcquisition::calculate_threshold(float pfa) float BeidouB1iPcpsAcquisition::calculate_threshold(float pfa)
{ {
//Calculate the threshold //Calculate the threshold
unsigned int frequency_bins = 0; uint32_t frequency_bins = 0;
/* /*
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_) for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
{ {
@ -250,7 +253,7 @@ float BeidouB1iPcpsAcquisition::calculate_threshold(float pfa)
frequency_bins = (2 * doppler_max_ + doppler_step_) / doppler_step_; frequency_bins = (2 * doppler_max_ + doppler_step_) / doppler_step_;
DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa;
unsigned int ncells = vector_length_ * frequency_bins; uint32_t ncells = vector_length_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells); double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent); double val = pow(1.0 - pfa, exponent);
auto lambda = static_cast<double>(vector_length_); auto lambda = static_cast<double>(vector_length_);
@ -315,7 +318,7 @@ gr::basic_block_sptr BeidouB1iPcpsAcquisition::get_left_block()
{ {
return acquisition_; return acquisition_;
} }
else if (item_type_ == "cshort") if (item_type_ == "cshort")
{ {
return acquisition_; return acquisition_;
} }

View File

@ -34,7 +34,6 @@
#ifndef GNSS_SDR_BEIDOU_B1I_PCPS_ACQUISITION_H_ #ifndef GNSS_SDR_BEIDOU_B1I_PCPS_ACQUISITION_H_
#define GNSS_SDR_BEIDOU_B1I_PCPS_ACQUISITION_H_ #define GNSS_SDR_BEIDOU_B1I_PCPS_ACQUISITION_H_
#include "acq_conf.h"
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "complex_byte_to_float_x2.h" #include "complex_byte_to_float_x2.h"
#include "gnss_synchro.h" #include "gnss_synchro.h"
@ -42,6 +41,7 @@
#include <gnuradio/blocks/float_to_complex.h> #include <gnuradio/blocks/float_to_complex.h>
#include <gnuradio/blocks/stream_to_vector.h> #include <gnuradio/blocks/stream_to_vector.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <cstdint>
#include <string> #include <string>
@ -93,7 +93,7 @@ public:
/*! /*!
* \brief Set acquisition channel unique ID * \brief Set acquisition channel unique ID
*/ */
void set_channel(unsigned int channel) override; void set_channel(uint32_t channel) override;
/*! /*!
* \brief Set statistics threshold of PCPS algorithm * \brief Set statistics threshold of PCPS algorithm
@ -103,12 +103,12 @@ public:
/*! /*!
* \brief Set maximum Doppler off grid search * \brief Set maximum Doppler off grid search
*/ */
void set_doppler_max(unsigned int doppler_max) override; void set_doppler_max(uint32_t doppler_max) override;
/*! /*!
* \brief Set Doppler steps for the grid search * \brief Set Doppler steps for the grid search
*/ */
void set_doppler_step(unsigned int doppler_step) override; void set_doppler_step(uint32_t doppler_step) override;
/*! /*!
* \brief Initializes acquisition algorithm. * \brief Initializes acquisition algorithm.
@ -154,25 +154,25 @@ private:
complex_byte_to_float_x2_sptr cbyte_to_float_x2_; complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
size_t item_size_; size_t item_size_;
std::string item_type_; std::string item_type_;
unsigned int vector_length_; uint32_t vector_length_;
unsigned int code_length_; uint32_t code_length_;
bool bit_transition_flag_; bool bit_transition_flag_;
bool use_CFAR_algorithm_flag_; bool use_CFAR_algorithm_flag_;
unsigned int channel_; uint32_t channel_;
float threshold_; float threshold_;
unsigned int doppler_max_; uint32_t doppler_max_;
unsigned int doppler_step_; uint32_t doppler_step_;
unsigned int sampled_ms_; uint32_t sampled_ms_;
unsigned int max_dwells_; uint32_t max_dwells_;
long fs_in_; int64_t fs_in_;
bool dump_; bool dump_;
bool blocking_; bool blocking_;
std::string dump_filename_; std::string dump_filename_;
std::complex<float>* code_; std::complex<float>* code_;
Gnss_Synchro* gnss_synchro_; Gnss_Synchro* gnss_synchro_;
std::string role_; std::string role_;
unsigned int in_streams_; uint32_t in_streams_;
unsigned int out_streams_; uint32_t out_streams_;
float calculate_threshold(float pfa); float calculate_threshold(float pfa);
}; };

View File

@ -61,7 +61,10 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_ = configuration_->property(role + ".dump", false); dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000); doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
if (sampled_ms_ % 4 != 0) if (sampled_ms_ % 4 != 0)
@ -79,7 +82,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
//--- Find number of samples per spreading code (4 ms) ----------------- //--- Find number of samples per spreading code (4 ms) -----------------
code_length_ = round( code_length_ = round(
fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS));
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4); vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);
@ -145,7 +148,10 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold)
{ {
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0);
if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); if (pfa == 0.0)
{
pfa = configuration_->property(role_ + ".pfa", 0.0);
}
if (pfa == 0.0) if (pfa == 0.0)
{ {

View File

@ -62,7 +62,10 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
acq_parameters_.fs_in = fs_in_; acq_parameters_.fs_in = fs_in_;
doppler_max_ = configuration_->property(role + ".doppler_max", 5000); doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
acq_parameters_.doppler_max = doppler_max_; acq_parameters_.doppler_max = doppler_max_;
acq_parameters_.ms_per_code = 4; acq_parameters_.ms_per_code = 4;
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", acq_parameters_.ms_per_code); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", acq_parameters_.ms_per_code);
@ -95,10 +98,10 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
} }
if (acq_parameters_.use_automatic_resampler) if (acq_parameters_.use_automatic_resampler)
{ {
if (acq_parameters_.fs_in > Galileo_E1_OPT_ACQ_FS_HZ) if (acq_parameters_.fs_in > GALILEO_E1_OPT_ACQ_FS_HZ)
{ {
acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / Galileo_E1_OPT_ACQ_FS_HZ); acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / GALILEO_E1_OPT_ACQ_FS_HZ);
uint32_t decimation = acq_parameters_.fs_in / Galileo_E1_OPT_ACQ_FS_HZ; uint32_t decimation = acq_parameters_.fs_in / GALILEO_E1_OPT_ACQ_FS_HZ;
while (acq_parameters_.fs_in % decimation > 0) while (acq_parameters_.fs_in % decimation > 0)
{ {
decimation--; decimation--;
@ -107,19 +110,19 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast<int>(acq_parameters_.resampler_ratio); acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast<int>(acq_parameters_.resampler_ratio);
} }
//--- Find number of samples per spreading code (4 ms) ----------------- //--- Find number of samples per spreading code (4 ms) -----------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001; acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs))); acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GALILEO_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
} }
else else
{ {
//--- Find number of samples per spreading code (4 ms) ----------------- //--- Find number of samples per spreading code (4 ms) -----------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001; acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in))); acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GALILEO_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
} }
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(Galileo_E1_CODE_PERIOD_MS); acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GALILEO_E1_CODE_PERIOD_MS);
vector_length_ = sampled_ms_ * acq_parameters_.samples_per_ms; vector_length_ = sampled_ms_ * acq_parameters_.samples_per_ms;
if (bit_transition_flag_) if (bit_transition_flag_)
{ {
@ -187,7 +190,10 @@ void GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold)
{ {
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0);
if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); if (pfa == 0.0)
{
pfa = configuration_->property(role_ + ".pfa", 0.0);
}
if (pfa == 0.0) if (pfa == 0.0)
{ {

View File

@ -105,7 +105,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
// dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); // dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
// acq_parameters.dump_filename = dump_filename_; // acq_parameters.dump_filename = dump_filename_;
//--- Find number of samples per spreading code (4 ms) ----------------- //--- Find number of samples per spreading code (4 ms) -----------------
auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
//acq_parameters.samples_per_code = code_length_; //acq_parameters.samples_per_code = code_length_;
//int samples_per_ms = static_cast<int>(std::round(static_cast<double>(fs_in_) * 0.001)); //int samples_per_ms = static_cast<int>(std::round(static_cast<double>(fs_in_) * 0.001));
//acq_parameters.samples_per_ms = samples_per_ms; //acq_parameters.samples_per_ms = samples_per_ms;
@ -117,8 +117,8 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
// } // }
//printf("fs_in = %d\n", fs_in); //printf("fs_in = %d\n", fs_in);
//printf("Galileo_E1_B_CODE_LENGTH_CHIPS = %f\n", Galileo_E1_B_CODE_LENGTH_CHIPS); //printf("GALILEO_E1_B_CODE_LENGTH_CHIPS = %f\n", GALILEO_E1_B_CODE_LENGTH_CHIPS);
//printf("Galileo_E1_CODE_CHIP_RATE_HZ = %f\n", Galileo_E1_CODE_CHIP_RATE_HZ); //printf("GALILEO_E1_CODE_CHIP_RATE_HZ = %f\n", GALILEO_E1_CODE_CHIP_RATE_HZ);
//printf("acq adapter code_length = %d\n", code_length); //printf("acq adapter code_length = %d\n", code_length);
acq_parameters.code_length = code_length; acq_parameters.code_length = code_length;
// The FPGA can only use FFT lengths that are a power of two. // The FPGA can only use FFT lengths that are a power of two.
@ -136,19 +136,19 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
acq_parameters.device_name = device_name; acq_parameters.device_name = device_name;
acq_parameters.samples_per_ms = nsamples_total / sampled_ms; acq_parameters.samples_per_ms = nsamples_total / sampled_ms;
acq_parameters.samples_per_code = nsamples_total; acq_parameters.samples_per_code = nsamples_total;
acq_parameters.excludelimit = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / Galileo_E1_CODE_CHIP_RATE_HZ)); acq_parameters.excludelimit = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / GALILEO_E1_CODE_CHIP_RATE_HZ));
// compute all the GALILEO E1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // compute all the GALILEO E1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time
// a channel is assigned) // a channel is assigned)
auto* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT auto* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT
auto* code = new std::complex<float>[nsamples_total]; // buffer for the local code auto* code = new std::complex<float>[nsamples_total]; // buffer for the local code
auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E1_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32 d_all_fft_codes_ = new lv_16sc_t[nsamples_total * GALILEO_E1_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search float max; // temporary maxima search
//int tmp_re, tmp_im; //int tmp_re, tmp_im;
for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++) for (unsigned int PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++)
{ {
//code_ = new gr_complex[vector_length_]; //code_ = new gr_complex[vector_length_];
@ -288,7 +288,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
} }
// for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++) // for (unsigned int PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++)
// { // {
// // debug // // debug
// char filename2[25]; // char filename2[25];

View File

@ -60,7 +60,10 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_ = configuration_->property(role + ".dump", false); dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000); doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
if (sampled_ms_ % 4 != 0) if (sampled_ms_ % 4 != 0)
@ -79,7 +82,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
//--- Find number of samples per spreading code (4 ms) ----------------- //--- Find number of samples per spreading code (4 ms) -----------------
code_length_ = round( code_length_ = round(
fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS));
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4); vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);

View File

@ -61,12 +61,15 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_ = configuration_->property(role + ".dump", false); dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000); doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 8); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 8);
/*--- Find number of samples per spreading code (4 ms) -----------------*/ /*--- Find number of samples per spreading code (4 ms) -----------------*/
code_length_ = round( code_length_ = round(
fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS));
int samples_per_ms = round(code_length_ / 4.0); int samples_per_ms = round(code_length_ / 4.0);
@ -179,7 +182,10 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold)
{ {
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0);
if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); if (pfa == 0.0)
{
pfa = configuration_->property(role_ + ".pfa", 0.0);
}
if (pfa == 0.0) if (pfa == 0.0)
{ {

View File

@ -61,7 +61,10 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_ = configuration_->property(role + ".dump", false); dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000); doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
if (sampled_ms_ % 4 != 0) if (sampled_ms_ % 4 != 0)
@ -82,7 +85,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
//--- Find number of samples per spreading code (4 ms) ----------------- //--- Find number of samples per spreading code (4 ms) -----------------
code_length_ = round( code_length_ = round(
fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS));
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4); vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);
@ -149,7 +152,10 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold)
{ {
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0);
if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); if (pfa == 0.0)
{
pfa = configuration_->property(role_ + ".pfa", 0.0);
}
if (pfa == 0.0) if (pfa == 0.0)
{ {

View File

@ -66,7 +66,10 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_ = configuration_->property(role + ".dump", false); dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000); doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
CAF_window_hz_ = configuration_->property(role + ".CAF_window_hz", 0); CAF_window_hz_ = configuration_->property(role + ".CAF_window_hz", 0);
Zero_padding = configuration_->property(role + ".Zero_padding", 0); Zero_padding = configuration_->property(role + ".Zero_padding", 0);
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
@ -88,7 +91,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
//--- Find number of samples per spreading code (1ms)------------------------- //--- Find number of samples per spreading code (1ms)-------------------------
code_length_ = round(static_cast<double>(fs_in_) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS)); code_length_ = round(static_cast<double>(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS));
vector_length_ = code_length_ * sampled_ms_; vector_length_ = code_length_ * sampled_ms_;
@ -155,7 +158,10 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold)
{ {
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0);
if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); if (pfa == 0.0)
{
pfa = configuration_->property(role_ + ".pfa", 0.0);
}
if (pfa == 0.0) if (pfa == 0.0)
{ {

View File

@ -70,7 +70,10 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
acq_parameters_.dump = dump_; acq_parameters_.dump = dump_;
acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0); acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000); doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
acq_parameters_.doppler_max = doppler_max_; acq_parameters_.doppler_max = doppler_max_;
sampled_ms_ = 1; sampled_ms_ = 1;
max_dwells_ = configuration_->property(role + ".max_dwells", 1); max_dwells_ = configuration_->property(role + ".max_dwells", 1);
@ -93,10 +96,10 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
} }
if (acq_parameters_.use_automatic_resampler) if (acq_parameters_.use_automatic_resampler)
{ {
if (acq_parameters_.fs_in > Galileo_E5a_OPT_ACQ_FS_HZ) if (acq_parameters_.fs_in > GALILEO_E5A_OPT_ACQ_FS_HZ)
{ {
acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / Galileo_E5a_OPT_ACQ_FS_HZ); acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / GALILEO_E5A_OPT_ACQ_FS_HZ);
uint32_t decimation = acq_parameters_.fs_in / Galileo_E5a_OPT_ACQ_FS_HZ; uint32_t decimation = acq_parameters_.fs_in / GALILEO_E5A_OPT_ACQ_FS_HZ;
while (acq_parameters_.fs_in % decimation > 0) while (acq_parameters_.fs_in % decimation > 0)
{ {
decimation--; decimation--;
@ -106,21 +109,21 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
} }
//--- Find number of samples per spreading code ------------------------- //--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001; acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs))); acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GALILEO_E5A_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
} }
else else
{ {
acq_parameters_.resampled_fs = fs_in_; acq_parameters_.resampled_fs = fs_in_;
//--- Find number of samples per spreading code ------------------------- //--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001; acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in))); acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GALILEO_E5A_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
} }
//--- Find number of samples per spreading code (1ms)------------------------- //--- Find number of samples per spreading code (1ms)-------------------------
code_length_ = static_cast<unsigned int>(std::round(static_cast<double>(fs_in_) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::round(static_cast<double>(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS)));
vector_length_ = code_length_ * sampled_ms_; vector_length_ = code_length_ * sampled_ms_;
code_ = new gr_complex[vector_length_]; code_ = new gr_complex[vector_length_];
@ -141,7 +144,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
acq_parameters_.it_size = item_size_; acq_parameters_.it_size = item_size_;
acq_parameters_.sampled_ms = sampled_ms_; acq_parameters_.sampled_ms = sampled_ms_;
acq_parameters_.ms_per_code = 1; acq_parameters_.ms_per_code = 1;
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GALILEO_E5a_CODE_PERIOD_MS); acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GALILEO_E5A_CODE_PERIOD_MS);
acq_parameters_.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4); acq_parameters_.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4);
acq_parameters_.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0); acq_parameters_.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0);
acq_parameters_.make_2_steps = configuration_->property(role + ".make_two_steps", false); acq_parameters_.make_2_steps = configuration_->property(role + ".make_two_steps", false);

View File

@ -98,7 +98,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
acq_pilot_ = false; acq_pilot_ = false;
} }
auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS))); auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS)));
acq_parameters.code_length = code_length; acq_parameters.code_length = code_length;
// The FPGA can only use FFT lengths that are a power of two. // The FPGA can only use FFT lengths that are a power of two.
float nbits = ceilf(log2f((float)code_length*2)); float nbits = ceilf(log2f((float)code_length*2));
@ -117,7 +117,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
acq_parameters.samples_per_code = nsamples_total; acq_parameters.samples_per_code = nsamples_total;
acq_parameters.excludelimit = static_cast<unsigned int>(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters.fs_in))); acq_parameters.excludelimit = static_cast<unsigned int>(ceil((1.0 / GALILEO_E5A_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters.fs_in)));
//vector_length_ = code_length_ * sampled_ms_; //vector_length_ = code_length_ * sampled_ms_;
@ -126,15 +126,13 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
auto* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT auto* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT
auto* code = new std::complex<float>[nsamples_total]; // buffer for the local code auto* code = new std::complex<float>[nsamples_total]; // buffer for the local code
auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E5a_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32 d_all_fft_codes_ = new lv_16sc_t[nsamples_total * GALILEO_E5A_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search float max; // temporary maxima search
//printf("creating the E5A acquisition CONT"); //printf("creating the E5A acquisition CONT");
//printf("nsamples_total = %d\n", nsamples_total); //printf("nsamples_total = %d\n", nsamples_total);
//printf("number of codes = %d\n", Galileo_E5a_NUMBER_OF_CODES); for (unsigned int PRN = 1; PRN <= GALILEO_E5A_NUMBER_OF_CODES; PRN++)
for (unsigned int PRN = 1; PRN <= Galileo_E5a_NUMBER_OF_CODES; PRN++)
{ {
// gr_complex* code = new gr_complex[code_length_]; // gr_complex* code = new gr_complex[code_length_];
char signal_[3]; char signal_[3];

View File

@ -71,7 +71,10 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition(
blocking_ = configuration_->property(role + ".blocking", true); blocking_ = configuration_->property(role + ".blocking", true);
acq_parameters.blocking = blocking_; acq_parameters.blocking = blocking_;
doppler_max_ = configuration_->property(role + ".doppler_max", 5000); doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
acq_parameters.doppler_max = doppler_max_; acq_parameters.doppler_max = doppler_max_;
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
acq_parameters.sampled_ms = sampled_ms_; acq_parameters.sampled_ms = sampled_ms_;

View File

@ -70,7 +70,10 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition(
blocking_ = configuration_->property(role + ".blocking", true); blocking_ = configuration_->property(role + ".blocking", true);
acq_parameters.blocking = blocking_; acq_parameters.blocking = blocking_;
doppler_max_ = configuration_->property(role + ".doppler_max", 5000); doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
acq_parameters.doppler_max = doppler_max_; acq_parameters.doppler_max = doppler_max_;
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);

View File

@ -70,7 +70,10 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
blocking_ = configuration_->property(role + ".blocking", true); blocking_ = configuration_->property(role + ".blocking", true);
acq_parameters_.blocking = blocking_; acq_parameters_.blocking = blocking_;
doppler_max_ = configuration_->property(role + ".doppler_max", 5000); doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
acq_parameters_.doppler_max = doppler_max_; acq_parameters_.doppler_max = doppler_max_;
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
acq_parameters_.sampled_ms = sampled_ms_; acq_parameters_.sampled_ms = sampled_ms_;

View File

@ -67,7 +67,10 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
acq_parameters.dump_filename = dump_filename_; acq_parameters.dump_filename = dump_filename_;
doppler_max_ = configuration->property(role + ".doppler_max", 5000); doppler_max_ = configuration->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
acq_parameters.doppler_max = doppler_max_; acq_parameters.doppler_max = doppler_max_;
sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1); sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1);
acq_parameters.sampled_ms = sampled_ms_; acq_parameters.sampled_ms = sampled_ms_;

View File

@ -193,7 +193,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
delete fft_if; delete fft_if;
delete[] fft_codes_padded; delete[] fft_codes_padded;
acq_parameters.total_block_exp = 10; acq_parameters.total_block_exp = 14;
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters); acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters);
DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")"; DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")";

View File

@ -61,7 +61,10 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_ = configuration->property(role + ".dump", false); dump_ = configuration->property(role + ".dump", false);
doppler_max_ = configuration->property(role + ".doppler_max", 5000); doppler_max_ = configuration->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
doppler_min_ = configuration->property(role + ".doppler_min", -doppler_max_); doppler_min_ = configuration->property(role + ".doppler_min", -doppler_max_);
sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1); sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1);
max_dwells_ = configuration->property(role + ".max_dwells", 1); max_dwells_ = configuration->property(role + ".max_dwells", 1);

View File

@ -61,7 +61,10 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_ = configuration_->property(role + ".dump", false); dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration->property(role + ".doppler_max", 5000); doppler_max_ = configuration->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
//--- Find number of samples per spreading code ------------------------- //--- Find number of samples per spreading code -------------------------

View File

@ -61,7 +61,10 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_ = configuration_->property(role + ".dump", false); dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration->property(role + ".doppler_max", 5000); doppler_max_ = configuration->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
tong_init_val_ = configuration->property(role + ".tong_init_val", 1); tong_init_val_ = configuration->property(role + ".tong_init_val", 1);

View File

@ -68,7 +68,10 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
blocking_ = configuration_->property(role + ".blocking", true); blocking_ = configuration_->property(role + ".blocking", true);
acq_parameters_.blocking = blocking_; acq_parameters_.blocking = blocking_;
doppler_max_ = configuration->property(role + ".doppler_max", 5000); doppler_max_ = configuration->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
acq_parameters_.doppler_max = doppler_max_; acq_parameters_.doppler_max = doppler_max_;
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
acq_parameters_.bit_transition_flag = bit_transition_flag_; acq_parameters_.bit_transition_flag = bit_transition_flag_;

View File

@ -69,7 +69,10 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition(
blocking_ = configuration_->property(role + ".blocking", true); blocking_ = configuration_->property(role + ".blocking", true);
acq_parameters_.blocking = blocking_; acq_parameters_.blocking = blocking_;
doppler_max_ = configuration->property(role + ".doppler_max", 5000); doppler_max_ = configuration->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
acq_parameters_.doppler_max = doppler_max_; acq_parameters_.doppler_max = doppler_max_;
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
acq_parameters_.bit_transition_flag = bit_transition_flag_; acq_parameters_.bit_transition_flag = bit_transition_flag_;
@ -118,20 +121,20 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition(
} }
//--- Find number of samples per spreading code ------------------------- //--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L5I_CODE_RATE_HZ / GPS_L5I_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001; acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs))); acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5I_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
} }
else else
{ {
acq_parameters_.resampled_fs = fs_in_; acq_parameters_.resampled_fs = fs_in_;
//--- Find number of samples per spreading code ------------------------- //--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GPS_L5I_CODE_RATE_HZ / GPS_L5I_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001; acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in))); acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5I_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
} }
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GPS_L5i_PERIOD * 1000.0); acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GPS_L5I_PERIOD * 1000.0);
vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1);
code_ = new gr_complex[vector_length_]; code_ = new gr_complex[vector_length_];
acquisition_ = pcps_make_acquisition(acq_parameters_); acquisition_ = pcps_make_acquisition(acq_parameters_);

View File

@ -96,7 +96,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
//dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); //dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
//acq_parameters.dump_filename = dump_filename_; //acq_parameters.dump_filename = dump_filename_;
//--- Find number of samples per spreading code ------------------------- //--- Find number of samples per spreading code -------------------------
auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L5i_CODE_RATE_HZ / static_cast<double>(GPS_L5i_CODE_LENGTH_CHIPS)))); auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L5I_CODE_RATE_HZ / static_cast<double>(GPS_L5I_CODE_LENGTH_CHIPS))));
acq_parameters.code_length = code_length; acq_parameters.code_length = code_length;
// The FPGA can only use FFT lengths that are a power of two. // The FPGA can only use FFT lengths that are a power of two.
float nbits = ceilf(log2f((float)code_length*2)); float nbits = ceilf(log2f((float)code_length*2));
@ -115,7 +115,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
acq_parameters.samples_per_code = nsamples_total; acq_parameters.samples_per_code = nsamples_total;
//acq_parameters.excludelimit = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / GPS_L5i_CODE_RATE_HZ)); //acq_parameters.excludelimit = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / GPS_L5i_CODE_RATE_HZ));
acq_parameters.excludelimit = static_cast<unsigned int>(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast<float>(acq_parameters.fs_in))); acq_parameters.excludelimit = static_cast<unsigned int>(ceil((1.0 / GPS_L5I_CODE_RATE_HZ) * static_cast<float>(acq_parameters.fs_in)));
//printf("L5 ACQ CLASS MID 01\n"); //printf("L5 ACQ CLASS MID 01\n");
// compute all the GPS L5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // compute all the GPS L5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # 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) set(ACQ_GR_BLOCKS_HEADERS ${ACQ_GR_BLOCKS_HEADERS} pcps_opencl_acquisition_cc.h)
endif() 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) if(OPENCL_FOUND)
include_directories(${OPENCL_INCLUDE_DIRS}) include_directories(${OPENCL_INCLUDE_DIRS})
@ -76,35 +61,49 @@ endif()
list(SORT ACQ_GR_BLOCKS_HEADERS) list(SORT ACQ_GR_BLOCKS_HEADERS)
list(SORT ACQ_GR_BLOCKS_SOURCES) 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}) source_group(Headers FILES ${ACQ_GR_BLOCKS_HEADERS})
if(ENABLE_FPGA) add_library(acquisition_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS})
target_link_libraries(acq_gr_blocks
acquisition_lib target_link_libraries(acquisition_gr_blocks
gnss_sp_libs PUBLIC
gnss_system_parameters Gnuradio::runtime
${GNURADIO_RUNTIME_LIBRARIES} Gnuradio::fft
${GNURADIO_FFT_LIBRARIES} Volk::volk
${VOLK_LIBRARIES} acquisition_libs
${VOLK_GNSSSDR_LIBRARIES} core_system_parameters
${OPT_LIBRARIES} ${OPT_LIBRARIES}
${OPT_ACQUISITION_LIBRARIES} PRIVATE
) Boost::filesystem
else() Gflags::gflags
target_link_libraries(acq_gr_blocks Glog::glog
gnss_sp_libs Matio::matio
gnss_system_parameters Volkgnsssdr::volkgnsssdr
${GNURADIO_RUNTIME_LIBRARIES} algorithms_libs
${GNURADIO_FFT_LIBRARIES} )
${VOLK_LIBRARIES}
${VOLK_GNSSSDR_LIBRARIES} target_include_directories(acquisition_gr_blocks
${OPT_LIBRARIES} PUBLIC
${MATIO_LIBRARIES} ${CMAKE_SOURCE_DIR}/src/algorithms/libs
${OPT_ACQUISITION_LIBRARIES} PRIVATE
) ${CMAKE_SOURCE_DIR}/src/core/receiver
)
if(OPENCL_FOUND)
target_include_directories(acquisition_gr_blocks PUBLIC ${OPENCL_INCLUDE_DIRS})
endif() endif()
if(NOT VOLKGNSSSDR_FOUND) if(ENABLE_CLANG_TIDY)
add_dependencies(acq_gr_blocks volk_gnsssdr_module) if(CLANG_TIDY_EXE)
set_target_properties(acquisition_gr_blocks
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif() endif()
set_property(TARGET acquisition_gr_blocks
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

View File

@ -36,11 +36,11 @@
*/ */
#include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h" #include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h"
#include "control_message_factory.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <exception>
#include <sstream> #include <sstream>
#include <utility> #include <utility>
@ -214,10 +214,21 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::~galileo_e5a_noncoherentIQ_acquisi
delete d_fft_if; delete d_fft_if;
delete d_ifft; delete d_ifft;
try
{
if (d_dump) if (d_dump)
{ {
d_dump_file.close(); d_dump_file.close();
} }
}
catch (const std::ofstream::failure &e)
{
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
} }

View File

@ -47,7 +47,7 @@
class galileo_e5a_noncoherentIQ_acquisition_caf_cc; class galileo_e5a_noncoherentIQ_acquisition_caf_cc;
typedef boost::shared_ptr<galileo_e5a_noncoherentIQ_acquisition_caf_cc> galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr; using galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr = boost::shared_ptr<galileo_e5a_noncoherentIQ_acquisition_caf_cc>;
galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr
galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(unsigned int sampled_ms, galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(unsigned int sampled_ms,

View File

@ -30,11 +30,11 @@
*/ */
#include "galileo_pcps_8ms_acquisition_cc.h" #include "galileo_pcps_8ms_acquisition_cc.h"
#include "control_message_factory.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <exception>
#include <sstream> #include <sstream>
#include <utility> #include <utility>
@ -54,6 +54,7 @@ galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc(
samples_per_code, dump, std::move(dump_filename))); samples_per_code, dump, std::move(dump_filename)));
} }
galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc( galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc(
uint32_t sampled_ms, uint32_t sampled_ms,
uint32_t max_dwells, uint32_t max_dwells,
@ -126,10 +127,21 @@ galileo_pcps_8ms_acquisition_cc::~galileo_pcps_8ms_acquisition_cc()
delete d_ifft; delete d_ifft;
delete d_fft_if; delete d_fft_if;
try
{
if (d_dump) if (d_dump)
{ {
d_dump_file.close(); d_dump_file.close();
} }
}
catch (const std::ofstream::failure &e)
{
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
} }

View File

@ -41,7 +41,7 @@
class galileo_pcps_8ms_acquisition_cc; class galileo_pcps_8ms_acquisition_cc;
typedef boost::shared_ptr<galileo_pcps_8ms_acquisition_cc> galileo_pcps_8ms_acquisition_cc_sptr; using galileo_pcps_8ms_acquisition_cc_sptr = boost::shared_ptr<galileo_pcps_8ms_acquisition_cc>;
galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_acquisition_cc_sptr
galileo_pcps_8ms_make_acquisition_cc(uint32_t sampled_ms, galileo_pcps_8ms_make_acquisition_cc(uint32_t sampled_ms,

View File

@ -317,7 +317,10 @@ void pcps_acquisition::init()
d_num_doppler_bins = static_cast<uint32_t>(std::ceil(static_cast<double>(static_cast<int32_t>(acq_parameters.doppler_max) - static_cast<int32_t>(-acq_parameters.doppler_max)) / static_cast<double>(d_doppler_step))); d_num_doppler_bins = static_cast<uint32_t>(std::ceil(static_cast<double>(static_cast<int32_t>(acq_parameters.doppler_max) - static_cast<int32_t>(-acq_parameters.doppler_max)) / static_cast<double>(d_doppler_step)));
// Create the carrier Doppler wipeoff signals // Create the carrier Doppler wipeoff signals
if (d_grid_doppler_wipeoffs == nullptr) d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; if (d_grid_doppler_wipeoffs == nullptr)
{
d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins];
}
if (acq_parameters.make_2_steps && (d_grid_doppler_wipeoffs_step_two == nullptr)) if (acq_parameters.make_2_steps && (d_grid_doppler_wipeoffs_step_two == nullptr))
{ {
d_grid_doppler_wipeoffs_step_two = new gr_complex*[d_num_doppler_bins_step2]; d_grid_doppler_wipeoffs_step_two = new gr_complex*[d_num_doppler_bins_step2];
@ -629,7 +632,10 @@ float pcps_acquisition::first_vs_second_peak_statistic(uint32_t& indext, int32_t
{ {
d_tmp_buffer[idx] = 0.0; d_tmp_buffer[idx] = 0.0;
idx++; idx++;
if (idx == static_cast<int32_t>(d_fft_size)) idx = 0; if (idx == static_cast<int32_t>(d_fft_size))
{
idx = 0;
}
} }
while (idx != excludeRangeIndex2); while (idx != excludeRangeIndex2);
@ -842,7 +848,10 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count)
if (d_num_noncoherent_integrations_counter == acq_parameters.max_dwells) if (d_num_noncoherent_integrations_counter == acq_parameters.max_dwells)
{ {
if (d_state != 0) send_negative_acquisition(); if (d_state != 0)
{
send_negative_acquisition();
}
d_state = 0; d_state = 0;
d_active = false; d_active = false;
d_step_two = false; d_step_two = false;

View File

@ -63,7 +63,7 @@
class pcps_acquisition; class pcps_acquisition;
typedef boost::shared_ptr<pcps_acquisition> pcps_acquisition_sptr; using pcps_acquisition_sptr = boost::shared_ptr<pcps_acquisition>;
pcps_acquisition_sptr pcps_acquisition_sptr
pcps_make_acquisition(const Acq_Conf& conf_); pcps_make_acquisition(const Acq_Conf& conf_);

View File

@ -32,7 +32,6 @@
#include "pcps_acquisition_fine_doppler_cc.h" #include "pcps_acquisition_fine_doppler_cc.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "control_message_factory.h"
#include "gnss_sdr_create_directory.h" #include "gnss_sdr_create_directory.h"
#include "gps_sdr_signal_processing.h" #include "gps_sdr_signal_processing.h"
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>
@ -314,7 +313,10 @@ double pcps_acquisition_fine_doppler_cc::compute_CAF()
{ {
d_grid_data[index_doppler][idx] = 0.0; d_grid_data[index_doppler][idx] = 0.0;
idx++; idx++;
if (idx == static_cast<int>(d_fft_size)) idx = 0; if (idx == static_cast<int>(d_fft_size))
{
idx = 0;
}
} }
while (idx != excludeRangeIndex2); while (idx != excludeRangeIndex2);

View File

@ -55,13 +55,13 @@
#include <gnuradio/block.h> #include <gnuradio/block.h>
#include <gnuradio/fft/fft.h> #include <gnuradio/fft/fft.h>
#include <gnuradio/gr_complex.h> #include <gnuradio/gr_complex.h>
#include <cstdint>
#include <fstream> #include <fstream>
#include <string> #include <string>
class pcps_acquisition_fine_doppler_cc; class pcps_acquisition_fine_doppler_cc;
typedef boost::shared_ptr<pcps_acquisition_fine_doppler_cc> using pcps_acquisition_fine_doppler_cc_sptr = boost::shared_ptr<pcps_acquisition_fine_doppler_cc>;
pcps_acquisition_fine_doppler_cc_sptr;
pcps_acquisition_fine_doppler_cc_sptr pcps_acquisition_fine_doppler_cc_sptr
pcps_make_acquisition_fine_doppler_cc(const Acq_Conf& conf_); pcps_make_acquisition_fine_doppler_cc(const Acq_Conf& conf_);
@ -87,7 +87,7 @@ private:
bool start(); bool start();
Acq_Conf acq_parameters; Acq_Conf acq_parameters;
long d_fs_in; int64_t d_fs_in;
int d_samples_per_ms; int d_samples_per_ms;
int d_max_dwells; int d_max_dwells;
int d_gnuradio_forecast_samples; int d_gnuradio_forecast_samples;

View File

@ -33,16 +33,16 @@
#include "pcps_assisted_acquisition_cc.h" #include "pcps_assisted_acquisition_cc.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "concurrent_map.h" #include "concurrent_map.h"
#include "control_message_factory.h"
#include "gps_acq_assist.h" #include "gps_acq_assist.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <exception>
#include <sstream> #include <sstream>
#include <utility> #include <utility>
extern concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map; extern Concurrent_Map<Gps_Acq_Assist> global_gps_acq_assist_map;
using google::LogMessage; using google::LogMessage;
@ -132,10 +132,21 @@ pcps_assisted_acquisition_cc::~pcps_assisted_acquisition_cc()
volk_gnsssdr_free(d_fft_codes); volk_gnsssdr_free(d_fft_codes);
delete d_ifft; delete d_ifft;
delete d_fft_if; delete d_fft_if;
try
{
if (d_dump) if (d_dump)
{ {
d_dump_file.close(); d_dump_file.close();
} }
}
catch (const std::ofstream::failure &e)
{
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
} }
@ -381,7 +392,10 @@ int pcps_assisted_acquisition_cc::general_work(int noutput_items,
switch (d_state) switch (d_state)
{ {
case 0: // S0. StandBy case 0: // S0. StandBy
if (d_active == true) d_state = 1; if (d_active == true)
{
d_state = 1;
}
d_sample_counter += static_cast<uint64_t>(ninput_items[0]); // sample counter d_sample_counter += static_cast<uint64_t>(ninput_items[0]); // sample counter
consume_each(ninput_items[0]); consume_each(ninput_items[0]);
break; break;

View File

@ -57,8 +57,7 @@
class pcps_assisted_acquisition_cc; class pcps_assisted_acquisition_cc;
typedef boost::shared_ptr<pcps_assisted_acquisition_cc> using pcps_assisted_acquisition_cc_sptr = boost::shared_ptr<pcps_assisted_acquisition_cc>;
pcps_assisted_acquisition_cc_sptr;
pcps_assisted_acquisition_cc_sptr pcps_assisted_acquisition_cc_sptr
pcps_make_assisted_acquisition_cc( pcps_make_assisted_acquisition_cc(

View File

@ -36,11 +36,11 @@
#include "pcps_cccwsr_acquisition_cc.h" #include "pcps_cccwsr_acquisition_cc.h"
#include "GPS_L1_CA.h" // GPS_TWO_PI #include "GPS_L1_CA.h" // GPS_TWO_PI
#include "control_message_factory.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <exception>
#include <sstream> #include <sstream>
#include <utility> #include <utility>
@ -118,6 +118,7 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc(
d_channel = 0; d_channel = 0;
} }
pcps_cccwsr_acquisition_cc::~pcps_cccwsr_acquisition_cc() pcps_cccwsr_acquisition_cc::~pcps_cccwsr_acquisition_cc()
{ {
if (d_num_doppler_bins > 0) if (d_num_doppler_bins > 0)
@ -140,12 +141,24 @@ pcps_cccwsr_acquisition_cc::~pcps_cccwsr_acquisition_cc()
delete d_ifft; delete d_ifft;
delete d_fft_if; delete d_fft_if;
try
{
if (d_dump) if (d_dump)
{ {
d_dump_file.close(); d_dump_file.close();
} }
}
catch (const std::ofstream::failure &e)
{
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
} }
void pcps_cccwsr_acquisition_cc::set_local_code(std::complex<float> *code_data, void pcps_cccwsr_acquisition_cc::set_local_code(std::complex<float> *code_data,
std::complex<float> *code_pilot) std::complex<float> *code_pilot)
{ {
@ -166,6 +179,7 @@ void pcps_cccwsr_acquisition_cc::set_local_code(std::complex<float> *code_data,
volk_32fc_conjugate_32fc(d_fft_code_pilot, d_fft_if->get_outbuf(), d_fft_size); volk_32fc_conjugate_32fc(d_fft_code_pilot, d_fft_if->get_outbuf(), d_fft_size);
} }
void pcps_cccwsr_acquisition_cc::init() void pcps_cccwsr_acquisition_cc::init()
{ {
d_gnss_synchro->Flag_valid_acquisition = false; d_gnss_synchro->Flag_valid_acquisition = false;

View File

@ -47,7 +47,7 @@
class pcps_cccwsr_acquisition_cc; class pcps_cccwsr_acquisition_cc;
typedef boost::shared_ptr<pcps_cccwsr_acquisition_cc> pcps_cccwsr_acquisition_cc_sptr; using pcps_cccwsr_acquisition_cc_sptr = boost::shared_ptr<pcps_cccwsr_acquisition_cc>;
pcps_cccwsr_acquisition_cc_sptr pcps_cccwsr_acquisition_cc_sptr
pcps_cccwsr_make_acquisition_cc( pcps_cccwsr_make_acquisition_cc(

View File

@ -50,7 +50,6 @@
#include "pcps_opencl_acquisition_cc.h" #include "pcps_opencl_acquisition_cc.h"
#include "GPS_L1_CA.h" //GPS_TWO_PI #include "GPS_L1_CA.h" //GPS_TWO_PI
#include "control_message_factory.h"
#include "opencl/fft_base_kernels.h" #include "opencl/fft_base_kernels.h"
#include "opencl/fft_internal.h" #include "opencl/fft_internal.h"
#include <glog/logging.h> #include <glog/logging.h>
@ -58,6 +57,7 @@
#include <volk/volk.h> #include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <algorithm> #include <algorithm>
#include <exception>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
@ -187,10 +187,21 @@ pcps_opencl_acquisition_cc::~pcps_opencl_acquisition_cc()
delete d_fft_if; delete d_fft_if;
} }
try
{
if (d_dump) if (d_dump)
{ {
d_dump_file.close(); d_dump_file.close();
} }
}
catch (const std::ofstream::failure &e)
{
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
} }

View File

@ -30,12 +30,12 @@
#include "pcps_quicksync_acquisition_cc.h" #include "pcps_quicksync_acquisition_cc.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "control_message_factory.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath> #include <cmath>
#include <exception>
#include <sstream> #include <sstream>
#include <utility> #include <utility>
@ -159,11 +159,21 @@ pcps_quicksync_acquisition_cc::~pcps_quicksync_acquisition_cc()
delete d_corr_output_f; delete d_corr_output_f;
delete[] d_code_folded; delete[] d_code_folded;
try
{
if (d_dump) if (d_dump)
{ {
d_dump_file.close(); d_dump_file.close();
} }
// DLOG(INFO) << "END DESTROYER"; }
catch (const std::ofstream::failure& e)
{
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
} }
@ -208,7 +218,10 @@ void pcps_quicksync_acquisition_cc::init()
d_mag = 0.0; d_mag = 0.0;
d_input_power = 0.0; d_input_power = 0.0;
if (d_doppler_step == 0) d_doppler_step = 250; if (d_doppler_step == 0)
{
d_doppler_step = 250;
}
// Count the number of bins // Count the number of bins
d_num_doppler_bins = 0; d_num_doppler_bins = 0;
@ -535,7 +548,10 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
DLOG(INFO) << "test statistics threshold " << d_threshold; DLOG(INFO) << "test statistics threshold " << d_threshold;
DLOG(INFO) << "folding factor " << d_folding_factor; DLOG(INFO) << "folding factor " << d_folding_factor;
DLOG(INFO) << "possible delay correlation output"; DLOG(INFO) << "possible delay correlation output";
for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor); i++)
{
DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i];
}
DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples;
DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz;
DLOG(INFO) << "magnitude folded " << d_mag; DLOG(INFO) << "magnitude folded " << d_mag;
@ -564,7 +580,10 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
DLOG(INFO) << "test statistics threshold " << d_threshold; DLOG(INFO) << "test statistics threshold " << d_threshold;
DLOG(INFO) << "folding factor " << d_folding_factor; DLOG(INFO) << "folding factor " << d_folding_factor;
DLOG(INFO) << "possible delay corr output"; DLOG(INFO) << "possible delay corr output";
for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor); i++)
{
DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i];
}
DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples;
DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz;
DLOG(INFO) << "magnitude folded " << d_mag; DLOG(INFO) << "magnitude folded " << d_mag;

View File

@ -63,8 +63,7 @@
class pcps_quicksync_acquisition_cc; class pcps_quicksync_acquisition_cc;
typedef boost::shared_ptr<pcps_quicksync_acquisition_cc> using pcps_quicksync_acquisition_cc_sptr = boost::shared_ptr<pcps_quicksync_acquisition_cc>;
pcps_quicksync_acquisition_cc_sptr;
pcps_quicksync_acquisition_cc_sptr pcps_quicksync_acquisition_cc_sptr
pcps_quicksync_make_acquisition_cc( pcps_quicksync_make_acquisition_cc(

View File

@ -50,11 +50,11 @@
#include "pcps_tong_acquisition_cc.h" #include "pcps_tong_acquisition_cc.h"
#include "GPS_L1_CA.h" // for GPS_TWO_PI #include "GPS_L1_CA.h" // for GPS_TWO_PI
#include "control_message_factory.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <exception>
#include <sstream> #include <sstream>
#include <utility> #include <utility>
@ -76,6 +76,7 @@ pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc(
tong_init_val, tong_max_val, tong_max_dwells, dump, std::move(dump_filename))); tong_init_val, tong_max_val, tong_max_dwells, dump, std::move(dump_filename)));
} }
pcps_tong_acquisition_cc::pcps_tong_acquisition_cc( pcps_tong_acquisition_cc::pcps_tong_acquisition_cc(
uint32_t sampled_ms, uint32_t sampled_ms,
uint32_t doppler_max, uint32_t doppler_max,
@ -153,12 +154,24 @@ pcps_tong_acquisition_cc::~pcps_tong_acquisition_cc()
delete d_ifft; delete d_ifft;
delete d_fft_if; delete d_fft_if;
try
{
if (d_dump) if (d_dump)
{ {
d_dump_file.close(); d_dump_file.close();
} }
}
catch (const std::ofstream::failure &e)
{
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
} }
void pcps_tong_acquisition_cc::set_local_code(std::complex<float> *code) void pcps_tong_acquisition_cc::set_local_code(std::complex<float> *code)
{ {
memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size); memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size);
@ -169,6 +182,7 @@ void pcps_tong_acquisition_cc::set_local_code(std::complex<float> *code)
volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size); volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
} }
void pcps_tong_acquisition_cc::init() void pcps_tong_acquisition_cc::init()
{ {
d_gnss_synchro->Flag_valid_acquisition = false; d_gnss_synchro->Flag_valid_acquisition = false;
@ -213,6 +227,7 @@ void pcps_tong_acquisition_cc::init()
} }
} }
void pcps_tong_acquisition_cc::set_state(int32_t state) void pcps_tong_acquisition_cc::set_state(int32_t state)
{ {
d_state = state; d_state = state;
@ -245,6 +260,7 @@ void pcps_tong_acquisition_cc::set_state(int32_t state)
} }
} }
int pcps_tong_acquisition_cc::general_work(int noutput_items, int pcps_tong_acquisition_cc::general_work(int noutput_items,
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items __attribute__((unused))) gr_vector_void_star &output_items __attribute__((unused)))

View File

@ -61,7 +61,7 @@
class pcps_tong_acquisition_cc; class pcps_tong_acquisition_cc;
typedef boost::shared_ptr<pcps_tong_acquisition_cc> pcps_tong_acquisition_cc_sptr; using pcps_tong_acquisition_cc_sptr = boost::shared_ptr<pcps_tong_acquisition_cc>;
pcps_tong_acquisition_cc_sptr pcps_tong_acquisition_cc_sptr
pcps_tong_make_acquisition_cc( pcps_tong_make_acquisition_cc(

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -19,17 +19,6 @@
if(ENABLE_FPGA) if(ENABLE_FPGA)
set(ACQUISITION_LIB_SOURCES fpga_acquisition.cc) set(ACQUISITION_LIB_SOURCES fpga_acquisition.cc)
set(ACQUISITION_LIB_HEADERS fpga_acquisition.h) 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() endif()
set(ACQUISITION_LIB_HEADERS ${ACQUISITION_LIB_HEADERS} acq_conf.h) set(ACQUISITION_LIB_HEADERS ${ACQUISITION_LIB_HEADERS} acq_conf.h)
@ -38,21 +27,34 @@ set(ACQUISITION_LIB_SOURCES ${ACQUISITION_LIB_SOURCES} acq_conf.cc)
list(SORT ACQUISITION_LIB_HEADERS) list(SORT ACQUISITION_LIB_HEADERS)
list(SORT ACQUISITION_LIB_SOURCES) list(SORT ACQUISITION_LIB_SOURCES)
add_library(acquisition_lib source_group(Headers FILES ${ACQUISITION_LIB_HEADERS})
add_library(acquisition_libs
${ACQUISITION_LIB_SOURCES} ${ACQUISITION_LIB_SOURCES}
${ACQUISITION_LIB_HEADERS} ${ACQUISITION_LIB_HEADERS}
) )
source_group(Headers FILES ${ACQUISITION_LIB_HEADERS}) target_link_libraries(acquisition_libs
PUBLIC
target_link_libraries(acquisition_lib Volk::volk
${VOLK_LIBRARIES} Gnuradio::fft
${VOLK_GNSSSDR_LIBRARIES} PRIVATE
${GNURADIO_RUNTIME_LIBRARIES} Gflags::gflags
Glog::glog
algorithms_libs
core_system_parameters
) )
if(VOLKGNSSSDR_FOUND) if(ENABLE_CLANG_TIDY)
add_dependencies(acquisition_lib glog-${glog_RELEASE}) if(CLANG_TIDY_EXE)
else() set_target_properties(acquisition_libs
add_dependencies(acquisition_lib glog-${glog_RELEASE} volk_gnsssdr_module) PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif() endif()
set_property(TARGET acquisition_libs
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -19,19 +19,6 @@
set(CHANNEL_ADAPTER_SOURCES channel.cc) set(CHANNEL_ADAPTER_SOURCES channel.cc)
set(CHANNEL_ADAPTER_HEADERS channel.h) 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 add_library(channel_adapters
${CHANNEL_ADAPTER_SOURCES} ${CHANNEL_ADAPTER_SOURCES}
${CHANNEL_ADAPTER_HEADERS} ${CHANNEL_ADAPTER_HEADERS}
@ -40,8 +27,30 @@ add_library(channel_adapters
source_group(Headers FILES ${CHANNEL_ADAPTER_HEADERS}) source_group(Headers FILES ${CHANNEL_ADAPTER_HEADERS})
target_link_libraries(channel_adapters target_link_libraries(channel_adapters
channel_fsm PUBLIC
${GNURADIO_RUNTIME_LIBRARIES} Gnuradio::runtime
${Boost_LIBRARIES} channel_libs
PRIVATE
Gflags::gflags
Glog::glog
gnss_sdr_flags gnss_sdr_flags
) )
target_include_directories(channel_adapters
PUBLIC
${CMAKE_SOURCE_DIR}/src/core/interfaces
)
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(channel_adapters
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
set_property(TARGET channel_adapters
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

View File

@ -75,14 +75,23 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::s
// IMPORTANT: Do not change the order between set_doppler_step and set_threshold // IMPORTANT: Do not change the order between set_doppler_step and set_threshold
uint32_t doppler_step = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".doppler_step", 0); uint32_t doppler_step = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".doppler_step", 0);
if (doppler_step == 0) doppler_step = configuration->property("Acquisition_" + implementation_ + ".doppler_step", 500); if (doppler_step == 0)
if (FLAGS_doppler_step != 0) doppler_step = static_cast<uint32_t>(FLAGS_doppler_step); {
doppler_step = configuration->property("Acquisition_" + implementation_ + ".doppler_step", 500);
}
if (FLAGS_doppler_step != 0)
{
doppler_step = static_cast<uint32_t>(FLAGS_doppler_step);
}
DLOG(INFO) << "Channel " << channel_ << " Doppler_step = " << doppler_step; DLOG(INFO) << "Channel " << channel_ << " Doppler_step = " << doppler_step;
acq_->set_doppler_step(doppler_step); acq_->set_doppler_step(doppler_step);
float threshold = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".threshold", 0.0); float threshold = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".threshold", 0.0);
if (threshold == 0.0) threshold = configuration->property("Acquisition_" + implementation_ + ".threshold", 0.0); if (threshold == 0.0)
{
threshold = configuration->property("Acquisition_" + implementation_ + ".threshold", 0.0);
}
acq_->set_threshold(threshold); acq_->set_threshold(threshold);

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -26,23 +26,33 @@ set(CHANNEL_FSM_HEADERS
channel_msg_receiver_cc.h 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_HEADERS)
list(SORT CHANNEL_FSM_SOURCES) list(SORT CHANNEL_FSM_SOURCES)
add_library(channel_fsm ${CHANNEL_FSM_SOURCES} ${CHANNEL_FSM_HEADERS})
source_group(Headers FILES ${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_libs ${CHANNEL_FSM_SOURCES} ${CHANNEL_FSM_HEADERS})
target_link_libraries(channel_libs
PUBLIC
Gnuradio::runtime
core_system_parameters
PRIVATE
Gflags::gflags
Glog::glog
core_receiver
)
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(channel_libs
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
set_property(TARGET channel_libs
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

View File

@ -36,7 +36,7 @@
class channel_msg_receiver_cc; class channel_msg_receiver_cc;
typedef boost::shared_ptr<channel_msg_receiver_cc> channel_msg_receiver_cc_sptr; using channel_msg_receiver_cc_sptr = boost::shared_ptr<channel_msg_receiver_cc>;
channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr<ChannelFsm> channel_fsm, bool repeat); channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr<ChannelFsm> channel_fsm, bool repeat);

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -27,21 +27,36 @@ set(COND_ADAPTER_HEADERS
array_signal_conditioner.h 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_HEADERS)
list(SORT COND_ADAPTER_SOURCES) list(SORT COND_ADAPTER_SOURCES)
add_library(conditioner_adapters ${COND_ADAPTER_SOURCES} ${COND_ADAPTER_HEADERS})
source_group(Headers FILES ${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
Gnuradio::runtime
PRIVATE
Gflags::gflags
Glog::glog
)
target_include_directories(conditioner_adapters
PUBLIC
${CMAKE_SOURCE_DIR}/src/core/interfaces
)
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(conditioner_adapters
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
set_property(TARGET conditioner_adapters
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -35,30 +35,44 @@ set(DATATYPE_ADAPTER_HEADERS
ishort_to_complex.h 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_HEADERS)
list(SORT DATATYPE_ADAPTER_SOURCES) list(SORT DATATYPE_ADAPTER_SOURCES)
add_library(datatype_adapters source_group(Headers FILES ${DATATYPE_ADAPTER_HEADERS})
add_library(data_type_adapters
${DATATYPE_ADAPTER_SOURCES} ${DATATYPE_ADAPTER_SOURCES}
${DATATYPE_ADAPTER_HEADERS} ${DATATYPE_ADAPTER_HEADERS}
) )
source_group(Headers FILES ${DATATYPE_ADAPTER_HEADERS}) target_link_libraries(data_type_adapters
add_dependencies(datatype_adapters glog-${glog_RELEASE}) PUBLIC
target_link_libraries(datatype_adapters Gnuradio::blocks
data_type_gr_blocks data_type_gr_blocks
${GNURADIO_RUNTIME_LIBRARIES} algorithms_libs
${GNURADIO_BLOCKS_LIBRARIES} core_system_parameters
PRIVATE
Gflags::gflags
Glog::glog
Volk::volk
)
target_include_directories(data_type_adapters
PUBLIC
${CMAKE_SOURCE_DIR}/src/algorithms/libs
${CMAKE_SOURCE_DIR}/src/core/interfaces
)
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(data_type_adapters
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
set_property(TARGET data_type_adapters
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
) )

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) # Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
# #
# This file is part of GNSS-SDR. # This file is part of GNSS-SDR.
# #
@ -29,23 +29,26 @@ set(DATA_TYPE_GR_BLOCKS_HEADERS
interleaved_byte_to_complex_short.h 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_HEADERS)
list(SORT DATA_TYPE_GR_BLOCKS_SOURCES) list(SORT DATA_TYPE_GR_BLOCKS_SOURCES)
source_group(Headers FILES ${DATA_TYPE_GR_BLOCKS_HEADERS})
add_library(data_type_gr_blocks add_library(data_type_gr_blocks
${DATA_TYPE_GR_BLOCKS_SOURCES} ${DATA_TYPE_GR_BLOCKS_SOURCES}
${DATA_TYPE_GR_BLOCKS_HEADERS} ${DATA_TYPE_GR_BLOCKS_HEADERS}
) )
source_group(Headers FILES ${DATA_TYPE_GR_BLOCKS_HEADERS})
target_link_libraries(data_type_gr_blocks target_link_libraries(data_type_gr_blocks
${GNURADIO_RUNTIME_LIBRARIES} PUBLIC
${VOLK_LIBRARIES} Gnuradio::runtime
Boost::boost
algorithms_libs
PRIVATE
Volk::volk
)
set_property(TARGET data_type_gr_blocks
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
) )

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