1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-04-02 16:57:03 +00:00

Merge remote-tracking branch 'gnss-sdr/next' into next

This commit is contained in:
Unknown 2017-10-13 11:14:36 +02:00
commit 4dd128f633
454 changed files with 16013 additions and 10735 deletions

View File

@ -22,6 +22,7 @@
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(WARNING "In-tree build is bad practice. Try 'cd build && cmake ../' ")
endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
cmake_minimum_required(VERSION 2.8)
project(gnss-sdr CXX C)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
@ -83,6 +84,7 @@ if(ENABLE_FPGA)
endif(ENABLE_FPGA)
###############################
# GNSS-SDR version information
###############################
@ -279,32 +281,87 @@ if(UNIX)
)
endif(UNIX)
################################################################################
# Checkout cmake version
################################################################################
if(CMAKE_VERSION VERSION_LESS 2.8.8)
message(STATUS "Your CMake version is too old and does not support some features required by GNSS-SDR. CMake version must be at least 2.8.8. For more information check https://github.com/joakimkarlsson/bandit/issues/40")
message(FATAL_ERROR "Fatal error: CMake >= 2.8.8 required.")
endif(CMAKE_VERSION VERSION_LESS 2.8.8)
# Determine if we are using make or ninja
if(CMAKE_MAKE_PROGRAM MATCHES "make")
set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "make")
endif(CMAKE_MAKE_PROGRAM MATCHES "make")
if(CMAKE_MAKE_PROGRAM MATCHES "ninja")
set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "ninja")
endif(CMAKE_MAKE_PROGRAM MATCHES "ninja")
if(NOT CMAKE_MAKE_PROGRAM_PRETTY_NAME)
set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "${CMAKE_MAKE_PROGRAM}")
endif(NOT CMAKE_MAKE_PROGRAM_PRETTY_NAME)
################################################################################
# Checkout compiler version
# Minimum required versions
################################################################################
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
message(STATUS "Your GCC version is too old and does not support some C++11 features required by GNSS-SDR. GCC version must be at least 4.7")
set(GNSSSDR_CMAKE_MIN_VERSION "2.8.8")
set(GNSSSDR_GCC_MIN_VERSION "4.7.2")
set(GNSSSDR_CLANG_MIN_VERSION "3.4.0")
set(GNSSSDR_APPLECLANG_MIN_VERSION "500")
set(GNSSSDR_GNURADIO_MIN_VERSION "3.7.3")
set(GNSSSDR_BOOST_MIN_VERSION "1.45")
set(GNSSSDR_PYTHON_MIN_VERSION "2.7")
set(GNSSSDR_MAKO_MIN_VERSION "0.4.2")
set(GNSSSDR_ARMADILLO_MIN_VERSION "4.200.0")
################################################################################
# Check cmake version
################################################################################
if(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION})
message(STATUS "Your CMake version is too old and does not support some features required by GNSS-SDR. CMake version must be at least ${GNSSSDR_CMAKE_MIN_VERSION}. For more information check https://github.com/joakimkarlsson/bandit/issues/40")
message(FATAL_ERROR "Fatal error: CMake >= ${GNSSSDR_CMAKE_MIN_VERSION} required.")
endif(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION})
################################################################################
# Check compiler version
################################################################################
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GNSSSDR_GCC_MIN_VERSION})
message(STATUS "Your GCC version is too old and does not support some C++ features required by GNSS-SDR. GCC version must be at least ${GNSSSDR_GCC_MIN_VERSION}")
if(${LINUX_DISTRIBUTION} MATCHES "Ubuntu")
if(${LINUX_VER} MATCHES "12.04")
message(STATUS "For instructions on how to upgrade GCC, check http://askubuntu.com/a/271561")
endif(${LINUX_VER} MATCHES "12.04")
endif(${LINUX_DISTRIBUTION} MATCHES "Ubuntu")
message(FATAL_ERROR "Fatal error: GCC >= 4.7 required.")
endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
message(FATAL_ERROR "Fatal error: GCC >= ${GNSSSDR_GCC_MIN_VERSION} required.")
endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GNSSSDR_GCC_MIN_VERSION})
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
execute_process(COMMAND
${CMAKE_CXX_COMPILER} -v
RESULT_VARIABLE _res ERROR_VARIABLE _err
ERROR_STRIP_TRAILING_WHITESPACE)
if(${_res} STREQUAL "0")
# output is in error stream
string(REGEX MATCH "^Apple.*" IS_APPLE ${_err})
if("${IS_APPLE}" STREQUAL "")
set(MIN_VERSION ${GNSSSDR_CLANG_MIN_VERSION})
set(APPLE_STR "")
# retrieve the compiler's version from it
string(REGEX MATCH "clang version [0-9.]+" CLANG_OTHER_VERSION ${_err})
string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_OTHER_VERSION})
else("${IS_APPLE}" STREQUAL "")
set(MIN_VERSION ${GNSSSDR_APPLECLANG_MIN_VERSION})
set(APPLE_STR "Apple ")
# retrieve the compiler's version from it
string(REGEX MATCH "(clang-[0-9.]+)" CLANG_APPLE_VERSION ${_err})
string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_APPLE_VERSION})
endif("${IS_APPLE}" STREQUAL "")
if(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}")
message(WARNING "\nThe compiler selected to build GNSS-SDR (${APPLE_STR}Clang version ${CLANG_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${MIN_VERSION} minimum). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.")
endif(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}")
else(${_res} STREQUAL "0")
message(WARNING "\nCannot determine the version of the compiler selected to build GNSS-SDR (${APPLE_STR}Clang : ${CMAKE_CXX_COMPILER}). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.")
endif(${_res} STREQUAL "0")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
@ -339,6 +396,7 @@ if(OS_IS_LINUX)
endif(OS_IS_LINUX)
################################################################################
# Googletest - https://github.com/google/googletest
################################################################################
@ -364,7 +422,7 @@ if(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING)
else(LIBGTEST_DEV_DIR)
message (STATUS " Googletest has not been found.")
message (STATUS " Googletest will be downloaded and built automatically ")
message (STATUS " when doing 'make'. ")
message (STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ")
endif(LIBGTEST_DEV_DIR)
endif(GTEST_DIR)
endif(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING)
@ -384,12 +442,13 @@ set(Boost_ADDITIONAL_VERSIONS
"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.70.0" "1.70" "1.71.0" "1.71" "1.72.0" "1.72" "1.73.0" "1.73" "1.74.0" "1.74"
"1.75.0" "1.75" "1.76.0" "1.76" "1.77.0" "1.77" "1.78.0" "1.78" "1.79.0" "1.79"
)
set(Boost_USE_MULTITHREAD ON)
set(Boost_USE_STATIC_LIBS OFF)
find_package(Boost COMPONENTS date_time system filesystem thread serialization chrono unit_test_framework program_options REQUIRED)
if(NOT Boost_FOUND)
message(FATAL_ERROR "Fatal error: Boost (version >=1.45.0) required.")
message(FATAL_ERROR "Fatal error: Boost (version >=${GNSSSDR_BOOST_MIN_VERSION}) required.")
endif(NOT Boost_FOUND)
@ -400,17 +459,17 @@ endif(NOT Boost_FOUND)
set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS FFT FILTER PMT)
find_package(Gnuradio)
if(PC_GNURADIO_RUNTIME_VERSION)
if(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS 3.7.3)
if(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION})
set(GNURADIO_RUNTIME_FOUND)
message(STATUS "The GNU Radio version installed in your system is too old.")
endif(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS 3.7.3)
endif(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION})
endif(PC_GNURADIO_RUNTIME_VERSION)
if(NOT GNURADIO_RUNTIME_FOUND)
message(STATUS "CMake cannot find GNU Radio >= 3.7.3")
message(STATUS "CMake cannot find GNU Radio >= ${GNSSSDR_GNURADIO_MIN_VERSION}")
if(OS_IS_LINUX)
message("Go to https://github.com/gnuradio/pybombs")
message("and follow the instructions to install GNU Radio in your system.")
message(FATAL_ERROR "GNU Radio 3.7.3 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(OS_IS_LINUX)
if(OS_IS_MACOSX)
message("You can install it easily via Macports:")
@ -418,24 +477,24 @@ if(NOT GNURADIO_RUNTIME_FOUND)
message("Alternatively, you can use homebrew:")
message(" brew tap odrisci/gnuradio")
message(" brew install gnuradio" )
message(FATAL_ERROR "GNU Radio 3.7.3 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(OS_IS_MACOSX)
endif(NOT GNURADIO_RUNTIME_FOUND)
if(NOT GNURADIO_ANALOG_FOUND)
message(FATAL_ERROR "*** The gnuradio-analog library v3.7.3 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")
endif()
if(NOT GNURADIO_BLOCKS_FOUND)
message(FATAL_ERROR "*** The gnuradio-blocks library v3.7.3 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")
endif()
if(NOT GNURADIO_FILTER_FOUND)
message(FATAL_ERROR "*** The gnuradio-filter library v3.7.3 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")
endif()
if(NOT GNURADIO_FFT_FOUND)
message(FATAL_ERROR "*** The gnuradio-fft library v3.7.3 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")
endif()
if(NOT GNURADIO_PMT_FOUND)
message(FATAL_ERROR "*** The gnuradio-pmt library v3.7.3 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")
endif()
@ -466,17 +525,17 @@ endif()
find_package(VolkGnssSdr)
if(NOT VOLK_GNSSSDR_FOUND)
message(STATUS " volk_gnsssdr will be built along with gnss-sdr when doing 'make'")
message(STATUS " volk_gnsssdr will be built along with gnss-sdr when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'")
###############################
# Find Python required modules
###############################
include(SetupPython) #sets PYTHON_EXECUTABLE and PYTHON_DASH_B
GNSSSDR_PYTHON_CHECK_MODULE("python >= 2.7" sys "sys.version.split()[0] >= '2.7'" PYTHON_MIN_VER_FOUND)
GNSSSDR_PYTHON_CHECK_MODULE("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND)
GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
if(NOT PYTHON_MIN_VER_FOUND)
message(FATAL_ERROR "Python 2.7 or greater required to build VOLK_GNSSSDR")
message(FATAL_ERROR "Python ${GNSSSDR_PYTHON_MIN_VERSION} or greater required to build VOLK_GNSSSDR")
endif()
# Mako
@ -509,11 +568,11 @@ if(NOT VOLK_GNSSSDR_FOUND)
if(ENABLE_PACKAGING)
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON")
set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON -DCMAKE_VERBOSE_MAKEFILE=ON")
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
endif(ENABLE_PACKAGING)
set(VOLK_GNSSSDR_BUILD_COMMAND "make")
set(VOLK_GNSSSDR_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}")
if(PYTHON_EXECUTABLE)
set(USE_THIS_PYTHON "-DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}")
endif(PYTHON_EXECUTABLE)
@ -523,8 +582,6 @@ if(NOT VOLK_GNSSSDR_FOUND)
endif(CMAKE_GENERATOR STREQUAL Xcode)
endif(OS_IS_MACOSX)
set(CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
if(CMAKE_CROSSCOMPILING)
set(VOLK_GNSSSDR_COMPILER "")
else(CMAKE_CROSSCOMPILING)
@ -534,8 +591,6 @@ if(NOT VOLK_GNSSSDR_FOUND)
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install
-DENABLE_STATIC_LIBS=ON
-DENABLE_PROFILING=${ENABLE_PROFILING}
-DCMAKE_CXX_FLAGS=${CXX_FLAGS}
-DCMAKE_C_FLAGS=${C_FLAGS}
-DCMAKE_INCLUDE_PATH=${Boost_INCLUDE_DIR}
-DENABLE_ORC=OFF
${STRIP_VOLK_GNSSSDR_PROFILE}
@ -545,7 +600,8 @@ if(NOT VOLK_GNSSSDR_FOUND)
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake
-DCROSSCOMPILE_MULTILIB=TRUE )
endif(EXISTS $ENV{OECORE_TARGET_SYSROOT})
ExternalProject_Add(volk_gnsssdr_module
if(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(volk_gnsssdr_module
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build
@ -556,6 +612,21 @@ if(NOT VOLK_GNSSSDR_FOUND)
BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install
)
else(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(volk_gnsssdr_module
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build
CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS}
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
PATCH_COMMAND ""
BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX}
${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install
)
endif(CMAKE_VERSION VERSION_LESS 3.2)
find_package(ORC)
if(NOT ORC_FOUND)
set(ORC_LIBRARIES "")
@ -563,13 +634,20 @@ if(NOT VOLK_GNSSSDR_FOUND)
endif(NOT ORC_FOUND)
add_library(volk_gnsssdr UNKNOWN IMPORTED)
set_property(TARGET volk_gnsssdr PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/libvolk_gnsssdr.a)
set_property(TARGET volk_gnsssdr PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/libvolk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX})
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})
add_custom_command(TARGET volk_gnsssdr_module POST_BUILD
if(CMAKE_VERSION VERSION_LESS 3.2)
add_custom_command(TARGET volk_gnsssdr_module POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile
${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile)
${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile)
else(CMAKE_VERSION VERSION_LESS 3.2)
add_custom_command(TARGET volk_gnsssdr_module POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile
${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile
BYPRODUCTS ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile)
endif(CMAKE_VERSION VERSION_LESS 3.2)
add_custom_command(TARGET volk_gnsssdr_module POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr-config-info
@ -582,13 +660,28 @@ endif(NOT VOLK_GNSSSDR_FOUND)
# gflags - https://github.com/gflags/gflags
################################################################################
set(LOCAL_GFLAGS false)
set(gflags_RELEASE 2.2.0)
set(gflags_RELEASE 2.2.1)
find_package(GFlags)
if (NOT GFlags_FOUND)
message (STATUS " gflags library has not been found.")
message (STATUS " gflags will be downloaded and built automatically ")
message (STATUS " when doing 'make'. ")
if(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(
gflags-${gflags_RELEASE}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
GIT_REPOSITORY git://github.com/gflags/gflags.git
GIT_TAG v${gflags_RELEASE}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${gflags_RELEASE}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
UPDATE_COMMAND ""
PATCH_COMMAND ""
INSTALL_COMMAND ""
)
else(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(
gflags-${gflags_RELEASE}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
@ -597,18 +690,20 @@ if (NOT GFlags_FOUND)
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${gflags_RELEASE}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
BUILD_COMMAND make
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}
UPDATE_COMMAND ""
PATCH_COMMAND ""
INSTALL_COMMAND ""
)
endif(CMAKE_VERSION VERSION_LESS 3.2)
set(GFlags_INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/include CACHE PATH "Local Gflags headers"
)
add_library(gflags UNKNOWN IMPORTED)
set_property(TARGET gflags PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags.a)
set_property(TARGET gflags PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX})
add_dependencies(gflags gflags-${gflags_RELEASE})
set(GFlags_LIBS gflags)
file(GLOB GFlags_SHARED_LIBS "${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_SHARED_LIBRARY_SUFFIX}*")
@ -721,7 +816,8 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
endif(EXISTS "/usr/bin/libtoolize")
endif(OS_IS_LINUX)
ExternalProject_Add(
if(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(
glog-${glog_RELEASE}
DEPENDS ${TARGET_GFLAGS}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
@ -730,11 +826,28 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix=<INSTALL_DIR>
BUILD_COMMAND make
BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}"
UPDATE_COMMAND ""
PATCH_COMMAND ""
INSTALL_COMMAND ""
)
)
else(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(
glog-${glog_RELEASE}
DEPENDS ${TARGET_GFLAGS}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
GIT_REPOSITORY https://github.com/google/glog/
GIT_TAG v${glog_RELEASE}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix=<INSTALL_DIR>
BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}"
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}
UPDATE_COMMAND ""
PATCH_COMMAND ""
INSTALL_COMMAND ""
)
endif(CMAKE_VERSION VERSION_LESS 3.2)
# Set up variables
set(GLOG_INCLUDE_DIRS
@ -742,7 +855,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/src
)
set(GLOG_LIBRARIES
${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog.a
${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}
)
set(LOCAL_GLOG true CACHE STRING "Glog downloaded and built automatically" FORCE)
else(NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
@ -882,6 +995,28 @@ if(OS_IS_LINUX)
/usr/lib/gcc/sparc64-linux-gnu/6
/usr/lib/gcc/x86_64-linux-gnux32/6
/usr/lib/gcc/sh4-linux-gnu/6
/usr/lib/gcc/x86_64-linux-gnu/7 # Debian 9 Buster
/usr/lib/gcc/alpha-linux-gnu/7
/usr/lib/gcc/aarch64-linux-gnu/7
/usr/lib/gcc/arm-linux-gnueabi/7
/usr/lib/gcc/arm-linux-gnueabihf/7
/usr/lib/gcc/hppa-linux-gnu/7
/usr/lib/gcc/i686-gnu/7
/usr/lib/gcc/i686-linux-gnu/7
/usr/lib/gcc/x86_64-kfreebsd-gnu/7
/usr/lib/gcc/i686-kfreebsd-gnu/7
/usr/lib/gcc/m68k-linux-gnu/7
/usr/lib/gcc/mips-linux-gnu/7
/usr/lib/gcc/mips64el-linux-gnuabi64/7
/usr/lib/gcc/mipsel-linux-gnu/7
/usr/lib/gcc/powerpc-linux-gnu/7
/usr/lib/gcc/powerpc-linux-gnuspe/7
/usr/lib/gcc/powerpc64-linux-gnu/7
/usr/lib/gcc/powerpc64le-linux-gnu/7
/usr/lib/gcc/s390x-linux-gnu/7
/usr/lib/gcc/sparc64-linux-gnu/7
/usr/lib/gcc/x86_64-linux-gnux32/7
/usr/lib/gcc/sh4-linux-gnu/7
)
if(NOT GFORTRAN)
message(STATUS "The gfortran library has not been found.")
@ -897,14 +1032,22 @@ if(OS_IS_LINUX)
endif(OS_IS_LINUX)
find_package(Armadillo)
if(ARMADILLO_FOUND)
if(${ARMADILLO_VERSION_STRING} VERSION_LESS ${GNSSSDR_ARMADILLO_MIN_VERSION})
set(ARMADILLO_FOUND false)
set(ENABLE_OWN_ARMADILLO true)
endif(${ARMADILLO_VERSION_STRING} VERSION_LESS ${GNSSSDR_ARMADILLO_MIN_VERSION})
endif(ARMADILLO_FOUND)
if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO)
message(STATUS " Armadillo has not been found.")
message(STATUS " Armadillo will be downloaded and built automatically")
message(STATUS " when doing 'make'. ")
set(armadillo_BRANCH 7.900.x)
message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ")
set(armadillo_BRANCH unstable)
set(armadillo_RELEASE ${armadillo_BRANCH})
ExternalProject_Add(
if(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(
armadillo-${armadillo_RELEASE}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}
GIT_REPOSITORY https://github.com/conradsnicta/armadillo-code.git
@ -912,10 +1055,25 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO)
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS=-std=c++11
BUILD_COMMAND make
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
UPDATE_COMMAND ""
INSTALL_COMMAND ""
)
)
else(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(
armadillo-${armadillo_RELEASE}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}
GIT_REPOSITORY https://github.com/conradsnicta/armadillo-code.git
GIT_TAG ${armadillo_BRANCH}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS=-std=c++11
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}
UPDATE_COMMAND ""
INSTALL_COMMAND ""
)
endif(CMAKE_VERSION VERSION_LESS 3.2)
# Set up variables
ExternalProject_Get_Property(armadillo-${armadillo_RELEASE} binary_dir)
@ -931,7 +1089,7 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO)
if(NOT GFORTRAN)
set(GFORTRAN "")
endif(NOT GFORTRAN)
set(ARMADILLO_LIBRARIES ${BLAS} ${LAPACK} ${GFORTRAN} ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo.a)
set(ARMADILLO_LIBRARIES ${BLAS} ${LAPACK} ${GFORTRAN} ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX})
set(LOCAL_ARMADILLO true CACHE STRING "Armadillo downloaded and built automatically" FORCE)
set(ARMADILLO_VERSION_STRING ${armadillo_RELEASE})
else(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO)
@ -1026,7 +1184,7 @@ endif(NOT UHD_FOUND)
find_package(Doxygen)
if(DOXYGEN_FOUND)
message(STATUS "Doxygen found.")
message(STATUS "You can build the documentation with 'make 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")
set(HAVE_DOT ${DOXYGEN_DOT_FOUND})
file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir)
@ -1049,7 +1207,7 @@ if(DOXYGEN_FOUND)
COMMENT "Generating API documentation with Doxygen." VERBATIM
)
if(LATEX_COMPILER)
message(STATUS "'make 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
COMMAND ${CMAKE_MAKE_PROGRAM}
COMMAND ${CMAKE_COMMAND} -E copy refman.pdf ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf
@ -1059,7 +1217,7 @@ if(DOXYGEN_FOUND)
COMMENT "Generating PDF manual with Doxygen." VERBATIM
)
endif(LATEX_COMPILER)
message(STATUS "'make doc-clean' will clean the documentation.")
message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.")
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/latex
@ -1130,6 +1288,8 @@ else(ENABLE_CUDA)
message(STATUS "Enable it with 'cmake -DENABLE_CUDA=ON ../' to add support for GPU-based acceleration using CUDA." )
endif(ENABLE_CUDA)
###############################################################################
# FPGA (OPTIONAL)
###############################################################################
@ -1141,6 +1301,8 @@ else(ENABLE_FPGA)
message(STATUS "Enable it with 'cmake -DENABLE_FPGA=ON ../' to add support for GPU-based acceleration using the FPGA." )
endif(ENABLE_FPGA)
################################################################################
# Setup of optional drivers
################################################################################
@ -1210,7 +1372,7 @@ if(FLEXIBAND_DRIVER)
endif(FLEXIBAND_DRIVER)
if(ENABLE_FLEXIBAND)
message(STATUS "CTTC's Antenna Array front-end driver 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 ../'" )
else(ENABLE_FLEXIBAND)
message(STATUS "The (optional) Teleorbit Flexiband front-end driver adapter is not enabled." )
@ -1264,17 +1426,50 @@ endif(ENABLE_GPROF)
########################################################################
# Set compiler flags
########################################################################
# Enable C++11 support in GCC
# Enable C++14 support in GCC / Fallback to C++11 when using GCC < 6.1.1
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11 -Wall -Wextra") #Add warning flags: For "-Wall" see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11")
else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14")
endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wall -Wextra") #Add warning flags: For "-Wall" see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
# Enable C++14 support in Clang from 3.5 / Fallback to C++11 if older version and use lib++ if working in macOS
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11 -stdlib=libc++")
if(OS_IS_LINUX)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11")
else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14")
endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0")
endif(OS_IS_LINUX)
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(CLANG_VERSION VERSION_LESS "600")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14")
endif(CLANG_VERSION VERSION_LESS "600")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wno-deprecated-declarations")
endif(OS_IS_MACOSX)
if(CMAKE_BUILD_TYPE MATCHES "Release")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wno-unused-private-field")
endif(CMAKE_BUILD_TYPE MATCHES "Release")
if(OS_IS_MACOSX)
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -stdlib=libc++")
endif(OS_IS_MACOSX)
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(NOT (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
if(NOT (CMAKE_VERSION VERSION_LESS "3.1"))
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
endif(NOT (CMAKE_VERSION VERSION_LESS "3.1"))
endif(NOT (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
# Processor-architecture related flags
# See http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
if (NOT ARCH_COMPILER_FLAGS)

View File

@ -584,11 +584,10 @@ We use a [DBSRX2](https://www.ettus.com/product/details/DBSRX2) to do the task,
1. The default configuration file resides at [/usr/local/share/gnss-sdr/conf/default.conf](./conf/gnss-sdr.conf).
2. You need to review/modify at least the following settings:
* ```SignalSource.filename=``` (absolute or relative route to your GNSS signal captured file)
* ```GNSS-SDR.internal_fs_hz=``` (captured file sampling rate in Hz)
* ```SignalSource.sampling_frequency=``` (captured file sampling rate in Hz)
* ```SignalConditioner.sample_freq_in=``` (captured file sampling rate in Hz)
* ```SignalConditioner.sample_freq_out=``` (captured file sampling rate in Hz)
* ```TelemetryDecoder.fs_in=``` (captured file sampling rate in Hz)
* ```GNSS-SDR.internal_fs_sps=``` (captured file sampling rate in samples per second)
* ```SignalSource.sampling_frequency=``` (captured file sampling rate in samples per second)
* ```SignalConditioner.sample_freq_in=``` (captured file sampling rate in samples per second)
* ```SignalConditioner.sample_freq_out=``` (captured file sampling rate in samples per second)
3. The configuration file has in-line documentation, you can try to tune the number of channels and several receiver parameters. Store your .conf file in some working directory of your choice.
4. Run the receiver invoking the configuration by
```$ gnss-sdr --config_file=/path/to/my_receiver.conf```
@ -1138,12 +1137,10 @@ In case you are configuring a multi-system receiver, you will need to decimate t
;######### TELEMETRY DECODER GPS L1 CONFIG ############
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
TelemetryDecoder_1C.dump=false
TelemetryDecoder_1C.decimation_factor=4;
;######### TELEMETRY DECODER GALILEO E1B CONFIG ############
TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder
TelemetryDecoder_1B.dump=false
TelemetryDecoder_1B.decimation_factor=1;
~~~~~~
More documentation at the [Telemetry Decoder Blocks page](http://gnss-sdr.org/docs/sp-blocks/telemetry-decoder/).
@ -1155,25 +1152,7 @@ GNSS systems provide different kinds of observations. The most commonly used are
The common interface is [ObservablesInterface](./src/core/interfaces/observables_interface.h).
Configuration example for GPS L1 C/A signals:
~~~~~~
;######### OBSERVABLES CONFIG ############
Observables.implementation=GPS_L1_CA_Observables
Observables.dump=false
Observables.dump_filename=./observables.dat
~~~~~~
For Galileo E1B receivers:
~~~~~~
;######### OBSERVABLES CONFIG ############
Observables.implementation=Galileo_E1B_Observables
Observables.dump=false
Observables.dump_filename=./observables.dat
~~~~~~
For hybrid GPS L1 / Galileo E1B receivers:
Configuration example:
~~~~~~
;######### OBSERVABLES CONFIG ############
@ -1190,57 +1169,30 @@ Although data processing for obtaining high-accuracy PVT solutions is out of the
The common interface is [PvtInterface](./src/core/interfaces/pvt_interface.h).
Configuration example for GPS L1 C/A signals:
Configuration example:
~~~~~~
;######### PVT CONFIG ############
PVT.implementation=GPS_L1_CA_PVT
PVT.averaging_depth=10 ; Number of PVT observations in the moving average algorithm
PVT.flag_averaging=true ; Enables the PVT averaging between output intervals (arithmetic mean) [true] or [false]
PVT.output_rate_ms=100 ; Period in [ms] between two PVT outputs
PVT.display_rate_ms=500 ; Position console print (std::out) interval [ms].
PVT.dump=false ; Enables the PVT internal binary data file logging [true] or [false]
PVT.dump_filename=./PVT ; Log path and filename without extension of GeoJSON and KML files
PVT.implementation=RTKLIB_PVT
PVT.positioning_mode=Single ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic
PVT.iono_model=Broadcast ; options: OFF, Broadcast
PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen
PVT.rinex_version=2 ; options: 2 or 3
PVT.output_rate_ms=100 ; Period in [ms] between two PVT outputs
PVT.display_rate_ms=500 ; Position console print (std::out) interval [ms].
PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea ; NMEA log path and filename
PVT.flag_nmea_tty_port=true ; Enables the NMEA log to a serial TTY port
PVT.flag_nmea_tty_port=false ; Enables the NMEA log to a serial TTY port
PVT.nmea_dump_devname=/dev/pts/4 ; serial device descriptor for NMEA logging
PVT.flag_rtcm_server=false ; Enables or disables a TCP/IP server dispatching RTCM messages
PVT.flag_rtcm_tty_port=true ; Enables the RTCM log to a serial TTY port
PVT.flag_rtcm_server=true ; Enables or disables a TCP/IP server dispatching RTCM messages
PVT.flag_rtcm_tty_port=false ; Enables the RTCM log to a serial TTY port
PVT.rtcm_dump_devname=/dev/pts/1 ; serial device descriptor for RTCM logging
PVT.rtcm_tcp_port=2101
PVT.rtcm_MT1019_rate_ms=5000
PVT.rtcm_MT1045_rate_ms=5000
PVT.rtcm_MT1097_rate_ms=1000
PVT.rtcm_MT1077_rate_ms=1000
~~~~~~
For Galileo E1B receivers:
~~~~~~
;######### PVT CONFIG ############
PVT.implementation=GALILEO_E1_PVT
PVT.averaging_depth=100
PVT.flag_averaging=false
PVT.output_rate_ms=100;
PVT.display_rate_ms=500;
PVT.dump=false
PVT.dump_filename=./PVT
PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea ; NMEA log path and filename
PVT.flag_nmea_tty_port=true ; Enables the NMEA log to a serial TTY port
PVT.nmea_dump_devname=/dev/pts/4 ; serial device descriptor for NMEA logging
PVT.flag_rtcm_server=false ; Enables or disables a TCP/IP server dispatching RTCM messages
PVT.flag_rtcm_tty_port=true ; Enables the RTCM log to a serial TTY port
PVT.rtcm_dump_devname=/dev/pts/1 ; serial device descriptor for RTCM logging
~~~~~~
For hybrid GPS L1 / Galileo E1B receivers:
~~~~~~
;######### PVT CONFIG ############
PVT.implementation=Hybrid_PVT
PVT.averaging_depth=10
PVT.flag_averaging=false
PVT.output_rate_ms=100;
PVT.display_rate_ms=500;
PVT.dump=false
PVT.dump_filename=./PVT
~~~~~~
**Notes on the output formats:**
@ -1250,9 +1202,9 @@ PVT.dump_filename=./PVT
* **NMEA 0183** is a combined electrical and data specification for communication between marine electronics such as echo sounder, sonars, anemometer, gyrocompass, autopilot, GPS receivers and many other types of instruments. It has been defined by, and is controlled by, the U.S. [National Marine Electronics Association](http://www.nmea.org/). The NMEA 0183 standard uses a simple ASCII, serial communications protocol that defines how data are transmitted in a *sentence* from one *talker* to multiple *listeners* at a time. Through the use of intermediate expanders, a talker can have a unidirectional conversation with a nearly unlimited number of listeners, and using multiplexers, multiple sensors can talk to a single computer port. At the application layer, the standard also defines the contents of each sentence (message) type, so that all listeners can parse messages accurately. Those messages can be sent through the serial port (that could be for instance a Bluetooth link) and be used/displayed by a number of software applications such as [gpsd](http://www.catb.org/gpsd/ "The UNIX GPS daemon"), [JOSM](https://josm.openstreetmap.de/ "The Java OpenStreetMap Editor"), [OpenCPN](http://opencpn.org/ocpn/ "Open Chart Plotter Navigator"), and many others (and maybe running on other devices).
* **RINEX** (Receiver Independent Exchange Format) is an interchange format for raw satellite navigation system data, covering observables and the information contained in the navigation message broadcast by GNSS satellites. This allows the user to post-process the received data to produce a more accurate result (usually with other data unknown to the original receiver, such as better models of the atmospheric conditions at time of measurement). RINEX files can be used by software packages such as [GPSTk](http://www.gpstk.org), [RTKLIB](http://www.rtklib.com/) and [gLAB](http://gage14.upc.es/gLAB/). GNSS-SDR by default generates RINEX version [3.02](https://igscb.jpl.nasa.gov/igscb/data/format/rinex302.pdf). If [2.11](https://igscb.jpl.nasa.gov/igscb/data/format/rinex211.txt) is needed, it can be requested through a commandline flag when invoking the software receiver:
* **RINEX** (Receiver Independent Exchange Format) is an interchange format for raw satellite navigation system data, covering observables and the information contained in the navigation message broadcast by GNSS satellites. This allows the user to post-process the received data to produce a more accurate result (usually with other data unknown to the original receiver, such as better models of the atmospheric conditions at time of measurement). RINEX files can be used by software packages such as [GPSTk](http://www.gpstk.org), [RTKLIB](http://www.rtklib.com/) and [gLAB](http://gage14.upc.es/gLAB/). GNSS-SDR by default generates RINEX version [3.02](https://igscb.jpl.nasa.gov/igscb/data/format/rinex302.pdf). If [2.11](https://igscb.jpl.nasa.gov/igscb/data/format/rinex211.txt) is needed, it can be requested through the `rinex_version` parameter in the configuration file:
~~~~~~
$ gnss-sdr --RINEX_version=2
PVT.rinex_version=2
~~~~~~
* **RTCM SC-104** provides standards that define the data structure for differential GNSS correction information for a variety of differential correction applications. Developed by the Radio Technical Commission for Maritime Services ([RTCM](http://www.rtcm.org/overview.php#Standards "Radio Technical Commission for Maritime Services")), they have become an industry standard for communication of correction information. GNSS-SDR implements RTCM version 3.2, defined in the document *RTCM 10403.2, Differential GNSS (Global Navigation Satellite Systems) Services - Version 3* (February 1, 2013), which can be [purchased online](https://ssl29.pair.com/dmarkle/puborder.php?show=3 "RTCM Online Publication Order Form"). By default, the generated RTCM binary messages are dumped into a text file in hexadecimal format. However, GNSS-SDR is equipped with a TCP/IP server, acting as an NTRIP source that can feed an NTRIP server. NTRIP (Networked Transport of RTCM via Internet Protocol) is an open standard protocol that can be freely download from [BKG](http://igs.bkg.bund.de/root_ftp/NTRIP/documentation/NtripDocumentation.pdf "Networked Transport of RTCM via Internet Protocol (Ntrip) Version 1.0"), and it is designed for disseminating differential correction data (*e.g.* in the RTCM-104 format) or other kinds of GNSS streaming data to stationary or mobile users over the Internet. The TCP/IP server can be enabled by setting ```PVT.flag_rtcm_server=true``` in the configuration file, and will be active during the execution of the software receiver. By default, the server will operate on port 2101 (which is the recommended port for RTCM services according to the Internet Assigned Numbers Authority, [IANA](http://www.iana.org/assignments/service-names-port-numbers "Service Name and Transport Protocol Port Number Registry")), and will identify the Reference Station with ID=1234. This behaviour can be changed in the configuration file:

View File

@ -23,8 +23,8 @@ GNSS-SDR.init_altitude_m=10
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=2000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=2000000
;######### SUPL RRLP GPS assistance configuration #####
; Check http://www.mcc-mnc.com/

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=4000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=4000000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -5,8 +5,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=4000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=4000000
;######### SIGNAL_SOURCE CONFIG ############

View File

@ -5,8 +5,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=2727933.33 ; 8183800/3
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=2727933.33 ; 8183800/3
;######### SIGNAL_SOURCE CONFIG ############
@ -14,7 +14,7 @@ GNSS-SDR.internal_fs_hz=2727933.33 ; 8183800/3
;#Notes for GN3S source:
; - The front-end sampling frequency is fixed to 8.1838 MSPS (8183800 Hz).
; - The baseband signal is shifted to an IF of 38400 Hz. It should be corrected with the signal conditioner block
GNSS-SDR.internal_fs_hz=2727933.33 ; 8183800/3
GNSS-SDR.internal_fs_sps=2727933.33 ; 8183800/3
;######### SIGNAL_SOURCE CONFIG ############
SignalSource.implementation=GN3S_Signal_Source

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=4000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=4000000
;######### SIGNAL_SOURCE CONFIG ############
@ -226,7 +226,7 @@ Acquisition_1C.max_dwells=5
;Acquisition3.repeat_satellite = true
;#cboc: Only for [Galileo_E1_PCPS_Ambiguous_Acquisition]. This option allows you to choose between acquiring with CBOC signal [true] or sinboc(1,1) signal [false].
;#Use only if GNSS-SDR.internal_fs_hz is greater than or equal to 6138000
;#Use only if GNSS-SDR.internal_fs_sps is greater than or equal to 6138000
Acquisition0.cboc=false

View File

@ -7,8 +7,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=4000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=4000000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=2000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=2000000
;######### SUPL RRLP GPS assistance configuration #####
@ -177,71 +177,19 @@ Resampler.sample_freq_out=2000000
;######### CHANNELS GLOBAL CONFIG ############
;#count: Number of available GPS satellite channels.
Channels_GPS.count=6
Channels_1C.count=6
;#count: Number of available Galileo satellite channels.
Channels_Galileo.count=0
Channels_1B.count=0
;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver
Channels.in_acquisition=1
;#system: GPS, GLONASS, GALILEO, SBAS or COMPASS
;#if the option is disabled by default is assigned GPS
Channel.system=GPS
;#signal:
;# "1C" GPS L1 C/A
;# "1P" GPS L1 P
;# "1W" GPS L1 Z-tracking and similar (AS on)
;# "1Y" GPS L1 Y
;# "1M" GPS L1 M
;# "1N" GPS L1 codeless
;# "2C" GPS L2 C/A
;# "2D" GPS L2 L1(C/A)+(P2-P1) semi-codeless
;# "2S" GPS L2 L2C (M)
;# "2L" GPS L2 L2C (L)
;# "2X" GPS L2 L2C (M+L)
;# "2P" GPS L2 P
;# "2W" GPS L2 Z-tracking and similar (AS on)
;# "2Y" GPS L2 Y
;# "2M" GPS GPS L2 M
;# "2N" GPS L2 codeless
;# "5I" GPS L5 I
;# "5Q" GPS L5 Q
;# "5X" GPS L5 I+Q
;# "1C" GLONASS G1 C/A
;# "1P" GLONASS G1 P
;# "2C" GLONASS G2 C/A (Glonass M)
;# "2P" GLONASS G2 P
;# "1A" GALILEO E1 A (PRS)
;# "1B" GALILEO E1 B (I/NAV OS/CS/SoL)
;# "1C" GALILEO E1 C (no data)
;# "1X" GALILEO E1 B+C
;# "1Z" GALILEO E1 A+B+C
;# "5I" GALILEO E5a I (F/NAV OS)
;# "5Q" GALILEO E5a Q (no data)
;# "5X" GALILEO E5a I+Q
;# "7I" GALILEO E5b I
;# "7Q" GALILEO E5b Q
;# "7X" GALILEO E5b I+Q
;# "8I" GALILEO E5 I
;# "8Q" GALILEO E5 Q
;# "8X" GALILEO E5 I+Q
;# "6A" GALILEO E6 A
;# "6B" GALILEO E6 B
;# "6C" GALILEO E6 C
;# "6X" GALILEO E6 B+C
;# "6Z" GALILEO E6 A+B+C
;# "1C" SBAS L1 C/A
;# "5I" SBAS L5 I
;# "5Q" SBAS L5 Q
;# "5X" SBAS L5 I+Q
;# "2I" COMPASS E2 I
;# "2Q" COMPASS E2 Q
;# "2X" COMPASS E2 IQ
;# "7I" COMPASS E5b I
;# "7Q" COMPASS E5b Q
;# "7X" COMPASS E5b IQ
;# "6I" COMPASS E6 I
;# "6Q" COMPASS E6 Q
;# "6X" COMPASS E6 IQ
;#if the option is disabled by default is assigned "1C" GPS L1 C/A
Channel.signal=1C
@ -250,46 +198,45 @@ Channel.signal=1C
;######### CHANNEL 0 CONFIG ############
Channel0.system=GPS
Channel0.signal=1C
;Channel0.system=GPS
;Channel0.signal=1C
;#satellite: Satellite PRN ID for this channel. Disable this option to random search
Channel0.satellite=11
;Channel0.satellite=11
;######### CHANNEL 1 CONFIG ############
Channel1.system=GPS
Channel1.signal=1C
Channel1.satellite=18
;Channel1.system=GPS
;Channel1.signal=1C
;Channel1.satellite=18
;######### ACQUISITION GLOBAL CONFIG ############
;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
Acquisition_GPS.dump=false
Acquisition_1C.dump=false
;#filename: Log path and filename
Acquisition_GPS.dump_filename=./acq_dump.dat
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
Acquisition_GPS.item_type=gr_complex
Acquisition_1C.dump_filename=./acq_dump.dat
;#item_type: Type and resolution for each of the signal samples.
Acquisition_1C.item_type=gr_complex
;#if: Signal intermediate frequency in [Hz]
Acquisition_GPS.if=0
Acquisition_1C.if=0
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
Acquisition_GPS.coherent_integration_time_ms=1
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
Acquisition_GPS.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition_1C.coherent_integration_time_ms=1
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
;#threshold: Acquisition threshold. It will be ignored if pfa is defined.
Acquisition_GPS.threshold=0.01
Acquisition_1C.threshold=0.01
;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
;Acquisition_GPS.pfa=0.0001
;Acquisition_1C.pfa=0.0001
;#doppler_max: Maximum expected Doppler shift [Hz]
Acquisition_GPS.doppler_max=10000
Acquisition_1C.doppler_max=10000
;#doppler_max: Doppler step in the grid search [Hz]
Acquisition_GPS.doppler_step=500
Acquisition_1C.doppler_step=500
;#bit_transition_flag: Enable or disable a strategy to deal with bit transitions in GPS signals: process two dwells and take
maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition] (should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition])
Acquisition_GPS.bit_transition_flag=false
Acquisition_1C.bit_transition_flag=false
;#max_dwells: Maximum number of consecutive dwells to be processed. It will be ignored if bit_transition_flag=true
Acquisition_GPS.max_dwells=1
Acquisition_1C.max_dwells=1
;######### ACQUISITION CHANNELS CONFIG ######
@ -299,37 +246,37 @@ Acquisition_GPS.max_dwells=1
;######### TRACKING GLOBAL CONFIG ############
;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_PLL_C_Aid_Tracking]
Tracking_GPS.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
;#item_type: Type and resolution for each of the signal samples.
Tracking_GPS.item_type=gr_complex
Tracking_1C.item_type=gr_complex
;#sampling_frequency: Signal Intermediate Frequency in [Hz]
Tracking_GPS.if=0
Tracking_1C.if=0
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
Tracking_GPS.dump=false
Tracking_1C.dump=false
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
Tracking_GPS.dump_filename=./tracking_ch_
Tracking_1C.dump_filename=./tracking_ch_
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
Tracking_GPS.pll_bw_hz=50.0;
Tracking_1C.pll_bw_hz=30.0;
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
Tracking_GPS.dll_bw_hz=2.0;
Tracking_1C.dll_bw_hz=4.0;
;#order: PLL/DLL loop filter order [2] or [3]
Tracking_GPS.order=3;
Tracking_1C.order=3;
;#early_late_space_chips: correlator early-late space [chips]. Use [0.5]
Tracking_GPS.early_late_space_chips=0.5;
;#early_late_space_chips: correlator early-late space [chips]
Tracking_1C.early_late_space_chips=0.5;
;######### TELEMETRY DECODER GPS CONFIG ############
;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A
TelemetryDecoder_GPS.implementation=GPS_L1_CA_Telemetry_Decoder
TelemetryDecoder_GPS.dump=false
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
TelemetryDecoder_1C.dump=false
;#decimation factor
TelemetryDecoder_GPS.decimation_factor=1;
TelemetryDecoder_1C.decimation_factor=1;
;######### OBSERVABLES CONFIG ############
;#implementation:

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=4000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=4000000
;######### SIGNAL_SOURCE CONFIG ############

View File

@ -5,8 +5,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=2600000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=2600000
;######### SIGNAL_SOURCE CONFIG ############

View File

@ -5,8 +5,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=4000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=4000000
;######### SIGNAL_SOURCE CONFIG ############

View File

@ -5,8 +5,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=2000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=2000000
;######### CONTROL_THREAD CONFIG ############
ControlThread.wait_for_flowgraph=false

View File

@ -8,8 +8,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=2560000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=2560000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -8,8 +8,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=2560000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=2560000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=2000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=2000000
;######### CONTROL_THREAD CONFIG ############
ControlThread.wait_for_flowgraph=false

View File

@ -6,10 +6,10 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE
; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/
GNSS-SDR.internal_fs_hz=1200000
GNSS-SDR.internal_fs_sps=1200000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -5,10 +5,10 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE
; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/
GNSS-SDR.internal_fs_hz=1999898
GNSS-SDR.internal_fs_sps=1999898
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -5,8 +5,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=3200000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=3200000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -5,8 +5,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=2000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=2000000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -7,8 +7,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=4000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=4000000
;######### SUPL RRLP GPS assistance configuration #####
; Check http://www.mcc-mnc.com/

View File

@ -7,8 +7,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=4000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=4000000
;######### SIGNAL_SOURCE CONFIG ############

View File

@ -5,8 +5,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=4000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=4000000
;######### SIGNAL_SOURCE CONFIG ############

View File

@ -5,8 +5,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=4000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=4000000
;######### SIGNAL_SOURCE CONFIG ############
@ -193,7 +193,7 @@ Acquisition_1B.doppler_step=125
;Acquisition_1B3.repeat_satellite = true
;#cboc: Only for [Galileo_E1_PCPS_Ambiguous_Acquisition]. This option allows you to choose between acquiring with CBOC signal [true] or sinboc(1,1) signal [false].
;#Use only if GNSS-SDR.internal_fs_hz is greater than or equal to 6138000
;#Use only if GNSS-SDR.internal_fs_sps is greater than or equal to 6138000
Acquisition_1B.cboc=false

View File

@ -5,11 +5,11 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
;GNSS-SDR.internal_fs_hz=6826700
GNSS-SDR.internal_fs_hz=2560000
;GNSS-SDR.internal_fs_hz=4096000
;GNSS-SDR.internal_fs_hz=5120000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
;GNSS-SDR.internal_fs_sps=6826700
GNSS-SDR.internal_fs_sps=2560000
;GNSS-SDR.internal_fs_sps=4096000
;GNSS-SDR.internal_fs_sps=5120000
;######### SIGNAL_SOURCE CONFIG ############
@ -87,7 +87,7 @@ Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition
Acquisition_1B.pfa=0.0000008
Acquisition_1B.doppler_max=15000
Acquisition_1B.doppler_step=125
Acquisition_1B.cboc=false ; This option allows you to choose between acquiring with CBOC signal [true] or sinboc(1,1) signal [false]. Use only if GNSS-SDR.internal_fs_hz is greater than or equal to 6138000
Acquisition_1B.cboc=false ; This option allows you to choose between acquiring with CBOC signal [true] or sinboc(1,1) signal [false]. Use only if GNSS-SDR.internal_fs_sps is greater than or equal to 6138000
;######### TRACKING GLOBAL CONFIG ############
Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=32000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=32000000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=50000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=50000000
;######### SUPL RRLP GPS assistance configuration #####
; Check http://www.mcc-mnc.com/

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=20000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=20000000
;######### SIGNAL_SOURCE CONFIG ############

View File

@ -6,9 +6,9 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
;#GNSS-SDR.internal_fs_hz=2048000
GNSS-SDR.internal_fs_hz=2600000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
;GNSS-SDR.internal_fs_sps=2048000
GNSS-SDR.internal_fs_sps=2600000
;######### SIGNAL_SOURCE CONFIG ############

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=4092000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=4092000
;######### SIGNAL_SOURCE CONFIG ############
;#implementation: Use [File_Signal_Source] [Nsr_File_Signal_Source] or [UHD_Signal_Source] or [GN3S_Signal_Source] (experimental)

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=4000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=4000000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -6,11 +6,11 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
;GNSS-SDR.internal_fs_hz=6826700
GNSS-SDR.internal_fs_hz=2560000
;GNSS-SDR.internal_fs_hz=4096000
;GNSS-SDR.internal_fs_hz=5120000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
;GNSS-SDR.internal_fs_sps=6826700
GNSS-SDR.internal_fs_sps=2560000
;GNSS-SDR.internal_fs_sps=4096000
;GNSS-SDR.internal_fs_sps=5120000
;######### SIGNAL_SOURCE CONFIG ############
;#implementation: Use [File_Signal_Source] [Nsr_File_Signal_Source] or [UHD_Signal_Source] or [GN3S_Signal_Source] (experimental)

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=2500000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=2500000
;######### SUPL RRLP GPS assistance configuration #####
; Check http://www.mcc-mnc.com/

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=2500000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=2500000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=2500000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=2500000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=2500000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=2500000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=5000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=5000000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=2500000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=2500000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=2500000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=2500000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=4000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=4000000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=5000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=5000000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=5000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=5000000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -6,8 +6,8 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=5000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=5000000
;######### SUPL RRLP GPS assistance configuration #####

View File

@ -6,9 +6,11 @@
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=4000000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
GNSS-SDR.internal_fs_sps=4000000
Receiver.sources_count=2
;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing.
; it helps to not overload the CPU, but the processing time will be longer.
SignalSource.enable_throttle_control=false
@ -283,14 +285,12 @@ Resampler1.sample_freq_out=4000000
;######### CHANNELS GLOBAL CONFIG ############
;#count: Number of available GPS satellite channels.
Channels_GPS.count=2
Channels_1C.count=2
;#count: Number of available Galileo satellite channels.
Channels_Galileo.count=2
Channels_1B.count=2
;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver
Channels.in_acquisition=1
;#system: GPS, GLONASS, GALILEO, SBAS or COMPASS
;#if the option is disabled by default is assigned GPS
Channel.system=GPS, Galileo
;# CHANNEL CONNECTION
Channel0.RF_channel_ID=0
@ -305,118 +305,118 @@ Channel.signal=1B
;######### GPS ACQUISITION CONFIG ############
;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
Acquisition_GPS.dump=false
Acquisition_1C.dump=false
;#filename: Log path and filename
Acquisition_GPS.dump_filename=./acq_dump.dat
Acquisition_1C.dump_filename=./acq_dump.dat
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
Acquisition_GPS.item_type=gr_complex
Acquisition_1C.item_type=gr_complex
;#if: Signal intermediate frequency in [Hz]
Acquisition_GPS.if=0
Acquisition_1C.if=0
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
Acquisition_GPS.sampled_ms=1
Acquisition_1C.sampled_ms=1
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
Acquisition_GPS.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
;#threshold: Acquisition threshold
Acquisition_GPS.threshold=0.0075
Acquisition_1C.threshold=0.0075
;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
;Acquisition_GPS.pfa=0.01
;Acquisition_1C.pfa=0.01
;#doppler_max: Maximum expected Doppler shift [Hz]
Acquisition_GPS.doppler_max=10000
Acquisition_1C.doppler_max=10000
;#doppler_max: Doppler step in the grid search [Hz]
Acquisition_GPS.doppler_step=500
Acquisition_1C.doppler_step=500
;######### GALILEO ACQUISITION CONFIG ############
;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
Acquisition_Galileo.dump=false
Acquisition_1B.dump=false
;#filename: Log path and filename
Acquisition_Galileo.dump_filename=./acq_dump.dat
Acquisition_1B.dump_filename=./acq_dump.dat
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
Acquisition_Galileo.item_type=gr_complex
Acquisition_1B.item_type=gr_complex
;#if: Signal intermediate frequency in [Hz]
Acquisition_Galileo.if=0
Acquisition_1B.if=0
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
Acquisition_Galileo.sampled_ms=4
Acquisition_1B.sampled_ms=4
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
Acquisition_Galileo.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition
Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition
;#threshold: Acquisition threshold
;Acquisition_Galileo.threshold=0
;Acquisition_1B.threshold=0
;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
Acquisition_Galileo.pfa=0.0000008
Acquisition_1B.pfa=0.0000008
;#doppler_max: Maximum expected Doppler shift [Hz]
Acquisition_Galileo.doppler_max=15000
Acquisition_1B.doppler_max=15000
;#doppler_max: Doppler step in the grid search [Hz]
Acquisition_Galileo.doppler_step=125
Acquisition_1B.doppler_step=125
;######### TRACKING GPS CONFIG ############
;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_PLL_C_Aid_Tracking] or [GPS_L1_CA_TCP_CONNECTOR_Tracking] or [Galileo_E1_DLL_PLL_VEML_Tracking]
Tracking_GPS.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
;#item_type: Type and resolution for each of the signal samples. Use only [gr_complex] in this version.
Tracking_GPS.item_type=gr_complex
Tracking_1C.item_type=gr_complex
;#sampling_frequency: Signal Intermediate Frequency in [Hz]
Tracking_GPS.if=0
Tracking_1C.if=0
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
Tracking_GPS.dump=false
Tracking_1C.dump=false
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
Tracking_GPS.dump_filename=../data/epl_tracking_ch_
Tracking_1C.dump_filename=../data/epl_tracking_ch_
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
Tracking_GPS.pll_bw_hz=45.0;
Tracking_1C.pll_bw_hz=45.0;
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
Tracking_GPS.dll_bw_hz=4.0;
Tracking_1C.dll_bw_hz=4.0;
;#order: PLL/DLL loop filter order [2] or [3]
Tracking_GPS.order=3;
Tracking_1C.order=3;
;######### TRACKING GALILEO CONFIG ############
;#implementation: Selected tracking algorithm: [Galileo_E1_DLL_PLL_VEML_Tracking]
Tracking_Galileo.implementation=Galileo_E1_DLL_PLL_VEML_Tracking
Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking
;#item_type: Type and resolution for each of the signal samples. Use only [gr_complex] in this version.
Tracking_Galileo.item_type=gr_complex
Tracking_1B.item_type=gr_complex
;#sampling_frequency: Signal Intermediate Frequency in [Hz]
Tracking_Galileo.if=0
Tracking_1B.if=0
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
Tracking_Galileo.dump=false
Tracking_1B.dump=false
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
Tracking_Galileo.dump_filename=../data/veml_tracking_ch_
Tracking_1B.dump_filename=../data/veml_tracking_ch_
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
Tracking_Galileo.pll_bw_hz=15.0;
Tracking_1B.pll_bw_hz=15.0;
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
Tracking_Galileo.dll_bw_hz=2.0;
Tracking_1B.dll_bw_hz=2.0;
;#order: PLL/DLL loop filter order [2] or [3]
Tracking_Galileo.order=3;
Tracking_1B.order=3;
;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo
Tracking_Galileo.early_late_space_chips=0.15;
Tracking_1B.early_late_space_chips=0.15;
;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6]
Tracking_Galileo.very_early_late_space_chips=0.6;
Tracking_1B.very_early_late_space_chips=0.6;
;######### TELEMETRY DECODER GPS CONFIG ############
;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A
TelemetryDecoder_GPS.implementation=GPS_L1_CA_Telemetry_Decoder
TelemetryDecoder_GPS.dump=false
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
TelemetryDecoder_1C.dump=false
;#decimation factor
TelemetryDecoder_GPS.decimation_factor=4;
TelemetryDecoder_1C.decimation_factor=4;
;######### TELEMETRY DECODER GALILEO CONFIG ############
;#implementation: Use [Galileo_E1B_Telemetry_Decoder] for Galileo E1B
TelemetryDecoder_Galileo.implementation=Galileo_E1B_Telemetry_Decoder
TelemetryDecoder_Galileo.dump=false
TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder
TelemetryDecoder_1B.dump=false
;######### OBSERVABLES CONFIG ############

View File

@ -8,11 +8,11 @@
Receiver.sources_count=2
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
;GNSS-SDR.internal_fs_hz=6826700
GNSS-SDR.internal_fs_hz=2560000
;GNSS-SDR.internal_fs_hz=4096000
;GNSS-SDR.internal_fs_hz=5120000
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
;GNSS-SDR.internal_fs_sps=6826700
GNSS-SDR.internal_fs_sps=2560000
;GNSS-SDR.internal_fs_sps=4096000
;GNSS-SDR.internal_fs_sps=5120000
;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing.
; it helps to not overload the CPU, but the processing time will be longer.

View File

@ -21,7 +21,7 @@ set(PVT_ADAPTER_SOURCES
)
include_directories(
$(CMAKE_CURRENT_SOURCE_DIR)
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/core/system_parameters
${CMAKE_SOURCE_DIR}/src/core/interfaces
${CMAKE_SOURCE_DIR}/src/core/receiver

View File

@ -194,7 +194,8 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
int num_bands = 0;
if ((gps_1C_count > 0) || (gal_1B_count > 0)) num_bands = 1;
if (((gps_1C_count > 0) || (gal_1B_count > 0)) && (gps_2S_count > 0) ) num_bands = 2;
if (((gps_1C_count > 0) || (gal_1B_count > 0)) && (gps_2S_count > 0) && ((gal_E5a_count > 0) || (gal_E5a_count > 0))) num_bands = 3;
if (((gps_1C_count > 0) || (gal_1B_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0)) ) num_bands = 2;
if (((gps_1C_count > 0) || (gal_1B_count > 0)) && (gps_2S_count > 0) && ((gal_E5a_count > 0) || (gal_E5b_count > 0))) num_bands = 3;
int number_of_frequencies = configuration->property(role + ".num_bands", num_bands); /* (1:L1, 2:L1+L2, 3:L1+L2+L5) */
if( (number_of_frequencies < 1) || (number_of_frequencies > 3) )
{
@ -382,7 +383,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
iono_model, /* ionosphere option (IONOOPT_XXX) */
trop_model, /* troposphere option (TROPOPT_XXX) */
dynamics_model, /* dynamics model (0:none, 1:velocity, 2:accel) */
earth_tide, /* earth tide correction (0:off,1:solid,2:solid+otl+pole) */
earth_tide, /* earth tide correction (0:off,1:solid,2:solid+otl+pole) */
number_filter_iter, /* number of filter iteration */
0, /* code smoothing window size (0:none) */
0, /* interpolate reference obs (for post mission) */
@ -446,7 +447,7 @@ bool RtklibPvt::save_assistance_to_XML()
ofs.close();
LOG(INFO) << "Saved GPS L1 Ephemeris map data";
}
catch (std::exception& e)
catch (const std::exception & e)
{
LOG(WARNING) << e.what();
return false;

View File

@ -53,44 +53,41 @@ public:
virtual ~RtklibPvt();
std::string role()
inline std::string role() override
{
return role_;
}
//! Returns "RTKLIB_Pvt"
std::string implementation()
inline std::string implementation() override
{
return "RTKLIB_PVT";
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
void reset()
inline void reset() override
{
return;
}
//! All blocks must have an item_size() function implementation. Returns sizeof(gr_complex)
size_t item_size()
inline size_t item_size() override
{
return sizeof(gr_complex);
}
private:
rtklib_pvt_cc_sptr pvt_;
rtk_t rtk;
bool dump_;
std::string dump_filename_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
std::string eph_xml_filename_;
bool save_assistance_to_XML();
};

View File

@ -21,7 +21,7 @@ set(PVT_GR_BLOCKS_SOURCES
)
include_directories(
$(CMAKE_CURRENT_SOURCE_DIR)
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/core/system_parameters
${CMAKE_SOURCE_DIR}/src/core/interfaces
${CMAKE_SOURCE_DIR}/src/core/receiver

View File

@ -280,7 +280,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump
d_dump_filename.append("_raw.dat");
dump_ls_pvt_filename.append("_ls_pvt.dat");
d_ls_pvt = std::make_shared<rtklib_solver>((int)nchannels, dump_ls_pvt_filename, d_dump, rtk);
d_ls_pvt = std::make_shared<rtklib_solver>(static_cast<int>(nchannels), dump_ls_pvt_filename, d_dump, rtk);
d_ls_pvt->set_averaging_depth(1);
d_rx_time = 0.0;
@ -326,8 +326,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump
std::cout << "GNSS-SDR can not create message queues!" << std::endl;
throw new std::exception();
}
gettimeofday(&tv, NULL);
begin = tv.tv_sec * 1000000 + tv.tv_usec;
start = std::chrono::system_clock::now();
}
@ -336,7 +335,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
msgctl(sysv_msqid, IPC_RMID, NULL);
//save GPS L2CM ephemeris to XML file
std::string file_name="eph_GPS_L2CM.xml";
std::string file_name = "eph_GPS_L2CM.xml";
if (d_ls_pvt->gps_cnav_ephemeris_map.size() > 0)
{
@ -348,7 +347,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
ofs.close();
LOG(INFO) << "Saved GPS L2CM Ephemeris map data";
}
catch (std::exception& e)
catch (const std::exception & e)
{
LOG(WARNING) << e.what();
}
@ -371,7 +370,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
ofs.close();
LOG(INFO) << "Saved GPS L1 CA Ephemeris map data";
}
catch (std::exception& e)
catch (const std::exception & e)
{
LOG(WARNING) << e.what();
}
@ -394,7 +393,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
ofs.close();
LOG(INFO) << "Saved Galileo E1 Ephemeris map data";
}
catch (std::exception& e)
catch (const std::exception & e)
{
LOG(WARNING) << e.what();
}
@ -404,6 +403,17 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
LOG(WARNING) << "Failed to save Galileo E1 Ephemeris, map is empty";
}
if (d_dump_file.is_open() == true)
{
try
{
d_dump_file.close();
}
catch(const std::exception & ex)
{
LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what();
}
}
}
@ -447,16 +457,16 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
unsigned int gal_channel = 0;
gnss_observables_map.clear();
Gnss_Synchro **in = (Gnss_Synchro **) &input_items[0]; //Get the input pointer
const Gnss_Synchro **in = reinterpret_cast<const Gnss_Synchro **>(&input_items[0]); // Get the input buffer pointer
// ############ 1. READ PSEUDORANGES ####
for (unsigned int i = 0; i < d_nchannels; i++)
{
if (in[i][epoch].Flag_valid_pseudorange == true)
{
std::map<int,Gps_Ephemeris>::iterator tmp_eph_iter_gps = d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN);
std::map<int,Galileo_Ephemeris>::iterator tmp_eph_iter_gal = d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN);
std::map<int,Gps_CNAV_Ephemeris>::iterator tmp_eph_iter_cnav = d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN);
std::map<int,Gps_Ephemeris>::const_iterator tmp_eph_iter_gps = d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN);
std::map<int,Galileo_Ephemeris>::const_iterator tmp_eph_iter_gal = d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN);
std::map<int,Gps_CNAV_Ephemeris>::const_iterator tmp_eph_iter_cnav = d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN);
if(((tmp_eph_iter_gps->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1C") == 0))
|| ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("2S") == 0))
|| ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1B") == 0))
@ -559,18 +569,18 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
for (std::map<int,Gnss_Synchro>::iterator it = gnss_observables_map.begin(); it != gnss_observables_map.end(); ++it)
{
it->second.Pseudorange_m = it->second.Pseudorange_m - d_ls_pvt->d_rx_dt_s * GPS_C_m_s;
it->second.Pseudorange_m = it->second.Pseudorange_m - d_ls_pvt->get_time_offset_s() * GPS_C_m_s;
}
if(first_fix == true)
{
std::cout << "First position fix at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time)
<< " UTC is Lat = " << d_ls_pvt->d_latitude_d << " [deg], Long = " << d_ls_pvt->d_longitude_d
<< " [deg], Height= " << d_ls_pvt->d_height_m << " [m]" << std::endl;
std::cout << "First position fix at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time())
<< " UTC is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude()
<< " [deg], Height= " << d_ls_pvt->get_height() << " [m]" << std::endl;
ttff_msgbuf ttff;
ttff.mtype = 1;
gettimeofday(&tv, NULL);
long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
ttff.ttff = static_cast<double>(end - begin) / 1000000.0;
end = std::chrono::system_clock::now();
std::chrono::duration<double> elapsed_seconds = end - start;
ttff.ttff = elapsed_seconds.count();
send_sys_v_ttff_msg(ttff);
first_fix = false;
}
@ -607,20 +617,20 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
// ####################### RINEX FILES #################
std::map<int, Galileo_Ephemeris>::iterator galileo_ephemeris_iter;
std::map<int, Gps_Ephemeris>::iterator gps_ephemeris_iter;
std::map<int, Gps_CNAV_Ephemeris>::iterator gps_cnav_ephemeris_iter;
std::map<int, Gnss_Synchro>::iterator gnss_observables_iter;
std::map<int, Galileo_Ephemeris>::const_iterator galileo_ephemeris_iter;
std::map<int, Gps_Ephemeris>::const_iterator gps_ephemeris_iter;
std::map<int, Gps_CNAV_Ephemeris>::const_iterator gps_cnav_ephemeris_iter;
std::map<int, Gnss_Synchro>::const_iterator gnss_observables_iter;
if (!b_rinex_header_written) // & we have utc data in nav message!
{
galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin();
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.begin();
galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
if(type_of_rx == 1) // GPS L1 C/A only
{
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
{
rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, d_rx_time);
rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
@ -630,7 +640,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
}
if(type_of_rx == 2) // GPS L2C only
{
if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())
if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())
{
rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time);
rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model);
@ -639,7 +649,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
}
if(type_of_rx == 4) // Galileo E1B only
{
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time);
rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
@ -649,7 +659,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
if(type_of_rx == 5) // Galileo E5a only
{
std::string signal("5X");
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal);
rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
@ -659,7 +669,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
if(type_of_rx == 6) // Galileo E5b only
{
std::string signal("7X");
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal);
rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
@ -668,7 +678,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
}
if(type_of_rx == 7) // GPS L1 C/A + GPS L2C
{
if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()))
if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
{
rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time);
rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
@ -678,7 +688,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
if(type_of_rx == 9) // GPS L1 C/A + Galileo E1B
{
if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) )
if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) )
{
std::string gal_signal("1B");
rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
@ -688,7 +698,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
}
if(type_of_rx == 10) // GPS L1 C/A + Galileo E5a
{
if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) )
if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) )
{
std::string gal_signal("5X");
rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
@ -698,7 +708,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
}
if(type_of_rx == 11) // GPS L1 C/A + Galileo E5b
{
if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) )
if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) )
{
std::string gal_signal("7X");
rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
@ -708,7 +718,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
}
if(type_of_rx == 14) // Galileo E1B + Galileo E5a
{
if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) )
if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) )
{
std::string gal_signal("1B 5X");
rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
@ -718,7 +728,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
}
if(type_of_rx == 15) // Galileo E1B + Galileo E5b
{
if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) )
if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) )
{
std::string gal_signal("1B 7X");
rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
@ -756,9 +766,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map);
}
}
galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin();
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.begin();
galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
// Log observables into the RINEX file
if(flag_write_RINEX_obs_output)
@ -890,17 +900,17 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
{
if(flag_write_RTCM_1019_output == true)
{
for(std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++ )
for(std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ )
{
d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
}
}
if(flag_write_RTCM_MSM_output == true)
{
std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter;
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter;
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
{
d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
@ -910,16 +920,16 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
{
if(flag_write_RTCM_1045_output == true)
{
for(std::map<int,Galileo_Ephemeris>::iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end(); gal_ephemeris_iter++ )
for(std::map<int,Galileo_Ephemeris>::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_ephemeris_iter++ )
{
d_rtcm_printer->Print_Rtcm_MT1045(gal_ephemeris_iter->second);
}
}
if(flag_write_RTCM_MSM_output == true)
{
std::map<int,Galileo_Ephemeris>::iterator gal_ephemeris_iter;
gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin();
if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
std::map<int,Galileo_Ephemeris>::const_iterator gal_ephemeris_iter;
gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
@ -929,18 +939,18 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
{
if(flag_write_RTCM_1019_output == true)
{
for(std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++ )
for(std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ )
{
d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
}
}
if(flag_write_RTCM_MSM_output == true)
{
std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter;
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
std::map<int,Gps_CNAV_Ephemeris>::iterator gps_cnav_ephemeris_iter;
gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.begin();
if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) )
std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter;
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
std::map<int,Gps_CNAV_Ephemeris>::const_iterator gps_cnav_ephemeris_iter;
gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) )
{
d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
@ -967,7 +977,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
//gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end();
//galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end();
unsigned int i = 0;
for (gnss_observables_iter = gnss_observables_map.begin(); gnss_observables_iter != gnss_observables_map.end(); gnss_observables_iter++)
for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
{
std::string system(&gnss_observables_iter->second.System, 1);
if(gps_channel == 0)
@ -976,7 +986,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
{
// This is a channel with valid GPS signal
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
{
gps_channel = i;
}
@ -987,7 +997,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
if(system.compare("E") == 0)
{
galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
gal_channel = i;
}
@ -998,14 +1008,14 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
if(flag_write_RTCM_MSM_output == true)
{
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
}
if(flag_write_RTCM_MSM_output == true)
{
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
{
d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
@ -1018,14 +1028,14 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
{
if(type_of_rx == 1) // GPS L1 C/A
{
for(std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++ )
for(std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ )
{
d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
}
std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
{
d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
@ -1034,14 +1044,14 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
if((type_of_rx == 4) || (type_of_rx == 5) || (type_of_rx == 6) || (type_of_rx == 14) || (type_of_rx == 15)) // Galileo
{
for(std::map<int,Galileo_Ephemeris>::iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end(); gal_ephemeris_iter++ )
for(std::map<int,Galileo_Ephemeris>::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_ephemeris_iter++ )
{
d_rtcm_printer->Print_Rtcm_MT1045(gal_ephemeris_iter->second);
}
std::map<int,Galileo_Ephemeris>::iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin();
std::map<int,Galileo_Ephemeris>::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
@ -1049,15 +1059,15 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
}
if(type_of_rx == 7) // GPS L1 C/A + GPS L2C
{
for(std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++ )
for(std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ )
{
d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
}
std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
std::map<int,Gps_CNAV_Ephemeris>::iterator gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.begin();
std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
std::map<int,Gps_CNAV_Ephemeris>::const_iterator gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()))
if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
{
d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
@ -1067,7 +1077,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
{
if(d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
for(std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++ )
for(std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ )
{
d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
}
@ -1081,7 +1091,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
}
unsigned int i = 0;
for (gnss_observables_iter = gnss_observables_map.begin(); gnss_observables_iter != gnss_observables_map.end(); gnss_observables_iter++)
for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
{
std::string system(&gnss_observables_iter->second.System, 1);
if(gps_channel == 0)
@ -1126,20 +1136,20 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
}
// DEBUG MESSAGE: Display position in console output
if( (d_ls_pvt->b_valid_position == true) && (flag_display_pvt == true) )
if( (d_ls_pvt->is_valid_position() == true) && (flag_display_pvt == true) )
{
std::cout << "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time)
<< " UTC using " << d_ls_pvt->d_valid_observations << " observations is Lat = " << d_ls_pvt->d_latitude_d << " [deg], Long = " << d_ls_pvt->d_longitude_d
<< " [deg], Height= " << d_ls_pvt->d_height_m << " [m]" << std::endl;
std::cout << "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time())
<< " UTC using " << d_ls_pvt->get_num_valid_observations() << " observations is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude()
<< " [deg], Height= " << d_ls_pvt->get_height() << " [m]" << std::endl;
LOG(INFO) << "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time)
<< " UTC using "<< d_ls_pvt->d_valid_observations << " observations is Lat = " << d_ls_pvt->d_latitude_d << " [deg], Long = " << d_ls_pvt->d_longitude_d
<< " [deg], Height= " << d_ls_pvt->d_height_m << " [m]";
LOG(INFO) << "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time())
<< " UTC using "<< d_ls_pvt->get_num_valid_observations() << " observations is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude()
<< " [deg], Height= " << d_ls_pvt->get_height() << " [m]";
/* std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time)
<< " UTC using "<< d_ls_pvt->d_valid_observations<<" observations is HDOP = " << d_ls_pvt->d_HDOP << " VDOP = "
<< d_ls_pvt->d_VDOP <<" TDOP = " << d_ls_pvt->d_TDOP
<< " GDOP = " << d_ls_pvt->d_GDOP << std::endl; */
/* std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time())
<< " UTC using "<< d_ls_pvt->get_num_valid_observations()<<" observations is HDOP = " << d_ls_pvt->get_HDOP() << " VDOP = "
<< d_ls_pvt->get_VDOP() <<" TDOP = " << d_ls_pvt->get_TDOP()
<< " GDOP = " << d_ls_pvt->get_GDOP() << std::endl; */
}
// MULTIPLEXED FILE RECORDING - Record results to file
@ -1151,10 +1161,10 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
for (unsigned int i = 0; i < d_nchannels; i++)
{
tmp_double = in[i][epoch].Pseudorange_m;
d_dump_file.write((char*)&tmp_double, sizeof(double));
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
tmp_double = 0;
d_dump_file.write((char*)&tmp_double, sizeof(double));
d_dump_file.write((char*)&d_rx_time, sizeof(double));
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
d_dump_file.write(reinterpret_cast<char*>(&d_rx_time), sizeof(double));
}
}
catch (const std::ifstream::failure& e)

View File

@ -31,7 +31,7 @@
#ifndef GNSS_SDR_RTKLIB_PVT_CC_H
#define GNSS_SDR_RTKLIB_PVT_CC_H
#include <ctime>
#include <chrono>
#include <fstream>
#include <utility>
#include <string>
@ -143,8 +143,7 @@ private:
double ttff;
} ttff_msgbuf;
bool send_sys_v_ttff_msg(ttff_msgbuf ttff);
struct timeval tv;
long long int begin;
std::chrono::time_point<std::chrono::system_clock> start, end;
public:
rtklib_pvt_cc(unsigned int nchannels,

View File

@ -31,7 +31,7 @@ set(PVT_LIB_SOURCES
)
include_directories(
$(CMAKE_CURRENT_SOURCE_DIR)
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/core/system_parameters
${CMAKE_SOURCE_DIR}/src/core/interfaces
${CMAKE_SOURCE_DIR}/src/core/receiver

View File

@ -31,9 +31,9 @@
#include "geojson_printer.h"
#include <ctime>
#include <iomanip>
#include <sstream>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <glog/logging.h>
GeoJSON_Printer::GeoJSON_Printer()
@ -42,7 +42,6 @@ GeoJSON_Printer::GeoJSON_Printer()
}
GeoJSON_Printer::~GeoJSON_Printer ()
{
GeoJSON_Printer::close_file();
@ -51,41 +50,39 @@ GeoJSON_Printer::~GeoJSON_Printer ()
bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name)
{
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time();
tm timeinfo = boost::posix_time::to_tm(pt);
if (time_tag_name)
{
std::stringstream strm0;
const int year = timeinfo->tm_year - 100;
const int year = timeinfo.tm_year - 100;
strm0 << year;
const int month = timeinfo->tm_mon + 1;
const int month = timeinfo.tm_mon + 1;
if(month < 10)
{
strm0 << "0";
}
strm0 << month;
const int day = timeinfo->tm_mday;
const int day = timeinfo.tm_mday;
if(day < 10)
{
strm0 << "0";
}
strm0 << day << "_";
const int hour = timeinfo->tm_hour;
const int hour = timeinfo.tm_hour;
if(hour < 10)
{
strm0 << "0";
}
strm0 << hour;
const int min = timeinfo->tm_min;
const int min = timeinfo.tm_min;
if(min < 10)
{
strm0 << "0";
}
strm0 << min;
const int sec = timeinfo->tm_sec;
const int sec = timeinfo.tm_sec;
if(sec < 10)
{
strm0 << "0";
@ -131,7 +128,6 @@ bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name)
}
bool GeoJSON_Printer::print_position(const std::shared_ptr<Pvt_Solution>& position, bool print_average_values)
{
double latitude;
@ -142,15 +138,15 @@ bool GeoJSON_Printer::print_position(const std::shared_ptr<Pvt_Solution>& positi
if (print_average_values == false)
{
latitude = position_->d_latitude_d;
longitude = position_->d_longitude_d;
height = position_->d_height_m;
latitude = position_->get_latitude();
longitude = position_->get_longitude();
height = position_->get_height();
}
else
{
latitude = position_->d_avg_latitude_d;
longitude = position_->d_avg_longitude_d;
height = position_->d_avg_height_m;
latitude = position_->get_avg_latitude();
longitude = position_->get_avg_longitude();
height = position_->get_avg_height();
}
if (geojson_file.is_open())
@ -174,7 +170,6 @@ bool GeoJSON_Printer::print_position(const std::shared_ptr<Pvt_Solution>& positi
}
bool GeoJSON_Printer::close_file()
{
if (geojson_file.is_open())

View File

@ -46,7 +46,7 @@ hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag
d_flag_dump_enabled = flag_dump_to_file;
d_galileo_current_time = 0;
count_valid_position = 0;
d_flag_averaging = false;
this->set_averaging_flag(false);
// ############# ENABLE DATA FILE LOG #################
if (d_flag_dump_enabled == true)
{
@ -69,7 +69,17 @@ hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag
hybrid_ls_pvt::~hybrid_ls_pvt()
{
d_dump_file.close();
if (d_dump_file.is_open() == true)
{
try
{
d_dump_file.close();
}
catch(const std::exception & ex)
{
LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what();
}
}
}
@ -94,7 +104,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
double TX_time_corrected_s = 0.0;
double SV_clock_bias_s = 0.0;
d_flag_averaging = flag_averaging;
this->set_averaging_flag(flag_averaging);
// ********************************************************************************
// ****** PREPARE THE LEAST SQUARES DATA (SV POSITIONS MATRIX AND OBS VECTORS) ****
@ -138,9 +148,9 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
// 4- fill the observations vector with the corrected observables
obs.resize(valid_obs + 1, 1);
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_m_s - d_rx_dt_s * GALILEO_C_m_s;
d_visible_satellites_IDs[valid_obs] = galileo_ephemeris_iter->second.i_satellite_PRN;
d_visible_satellites_CN0_dB[valid_obs] = gnss_observables_iter->second.CN0_dB_hz;
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;
this->set_visible_satellites_ID(valid_obs, galileo_ephemeris_iter->second.i_satellite_PRN);
this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz);
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);
@ -201,9 +211,9 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
double P1_P2=(1.0-Gamma)*(gps_ephemeris_iter->second.d_TGD* GPS_C_m_s);
double Code_bias_m= P1_P2/(1.0-Gamma);
obs.resize(valid_obs + 1, 1);
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s-Code_bias_m-d_rx_dt_s * GPS_C_m_s;
d_visible_satellites_IDs[valid_obs] = gps_ephemeris_iter->second.i_satellite_PRN;
d_visible_satellites_CN0_dB[valid_obs] = gnss_observables_iter->second.CN0_dB_hz;
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;
this->set_visible_satellites_ID(valid_obs, gps_ephemeris_iter->second.i_satellite_PRN);
this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz);
// SV ECEF DEBUG OUTPUT
LOG(INFO) << "(new)ECEF GPS L1 CA satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN
@ -254,8 +264,8 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
// 4- fill the observations vector with the corrected observables
obs.resize(valid_obs + 1, 1);
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr*GPS_C_m_s + SV_clock_bias_s * GPS_C_m_s;
d_visible_satellites_IDs[valid_obs] = gps_cnav_ephemeris_iter->second.i_satellite_PRN;
d_visible_satellites_CN0_dB[valid_obs] = gnss_observables_iter->second.CN0_dB_hz;
this->set_visible_satellites_ID(valid_obs, gps_cnav_ephemeris_iter->second.i_satellite_PRN);
this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz);
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)
@ -286,7 +296,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
// ********************************************************************************
// ****** SOLVE LEAST SQUARES******************************************************
// ********************************************************************************
d_valid_observations = valid_obs;
this->set_num_valid_observations(valid_obs);
LOG(INFO) << "HYBRID PVT: valid observations=" << valid_obs;
@ -299,23 +309,23 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
try
{
// check if this is the initial position computation
if (d_rx_dt_s == 0)
if (this->get_time_offset_s() == 0)
{
// execute Bancroft's algorithm to estimate initial receiver position and time
DLOG(INFO) << " Executing Bancroft algorithm...";
rx_position_and_time = bancroftPos(satpos.t(), obs);
d_rx_pos = rx_position_and_time.rows(0, 2); // save ECEF position for the next iteration
d_rx_dt_s = rx_position_and_time(3) / GPS_C_m_s; // save time for the next iteration [meters]->[seconds]
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]
}
// Execute WLS using previous position as the initialization point
rx_position_and_time = leastSquarePos(satpos, obs, W);
d_rx_pos = rx_position_and_time.rows(0, 2); // save ECEF position for the next iteration
d_rx_dt_s += rx_position_and_time(3) / GPS_C_m_s; // accumulate the rx time error for the next iteration [meters]->[seconds]
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]
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=" << d_rx_dt_s << " clock error for this iteration=" << rx_position_and_time(3) / GPS_C_m_s << " [s]";
DLOG(INFO) << "Accumulated rx clock error=" << this->get_time_offset_s() << " clock error for this iteration=" << rx_position_and_time(3) / GPS_C_m_s << " [s]";
// Compute GST and Gregorian time
if( GST != 0.0)
@ -331,13 +341,13 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
boost::posix_time::time_duration t = boost::posix_time::seconds(utc);
// 22 August 1999 00:00 last Galileo start GST epoch (ICD sec 5.1.2)
boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
d_position_UTC_time = p_time;
this->set_position_UTC_time(p_time);
cart2geo(static_cast<double>(rx_position_and_time(0)), static_cast<double>(rx_position_and_time(1)), static_cast<double>(rx_position_and_time(2)), 4);
DLOG(INFO) << "Hybrid Position at " << boost::posix_time::to_simple_string(p_time)
<< " is Lat = " << d_latitude_d << " [deg], Long = " << d_longitude_d
<< " [deg], Height= " << d_height_m << " [m]" << " RX time offset= " << d_rx_dt_s << " [s]";
<< " is Lat = " << this->get_latitude() << " [deg], Long = " << this->get_longitude()
<< " [deg], Height= " << this->get_height() << " [m]" << " RX time offset= " << this->get_time_offset_s() << " [s]";
// ###### Compute DOPs ########
hybrid_ls_pvt::compute_DOP();
@ -351,28 +361,28 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
double tmp_double;
// PVT GPS time
tmp_double = hybrid_current_time;
d_dump_file.write((char*)&tmp_double, sizeof(double));
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
// ECEF User Position East [m]
tmp_double = rx_position_and_time(0);
d_dump_file.write((char*)&tmp_double, sizeof(double));
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
// ECEF User Position North [m]
tmp_double = rx_position_and_time(1);
d_dump_file.write((char*)&tmp_double, sizeof(double));
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
// ECEF User Position Up [m]
tmp_double = rx_position_and_time(2);
d_dump_file.write((char*)&tmp_double, sizeof(double));
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
// User clock offset [s]
tmp_double = rx_position_and_time(3);
d_dump_file.write((char*)&tmp_double, sizeof(double));
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
// GEO user position Latitude [deg]
tmp_double = d_latitude_d;
d_dump_file.write((char*)&tmp_double, sizeof(double));
tmp_double = this->get_latitude();
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
// GEO user position Longitude [deg]
tmp_double = d_longitude_d;
d_dump_file.write((char*)&tmp_double, sizeof(double));
tmp_double = this->get_longitude();
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
// GEO user position Height [m]
tmp_double = d_height_m;
d_dump_file.write((char*)&tmp_double, sizeof(double));
tmp_double = this->get_height();
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
}
catch (const std::ifstream::failure& e)
{
@ -381,18 +391,18 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
}
// MOVING AVERAGE PVT
pos_averaging(flag_averaging);
this->perform_pos_averaging();
}
catch(const std::exception & e)
{
d_rx_dt_s = 0; //reset rx time estimation
this->set_time_offset_s(0.0); //reset rx time estimation
LOG(WARNING) << "Problem with the solver, invalid solution!" << e.what();
b_valid_position = false;
this->set_valid_position(false);
}
}
else
{
b_valid_position = false;
this->set_valid_position(false);
}
return b_valid_position;
return this->is_valid_position();
}

View File

@ -49,13 +49,17 @@
class hybrid_ls_pvt : public Ls_Pvt
{
private:
int count_valid_position;
bool d_flag_dump_enabled;
std::string d_dump_filename;
std::ofstream d_dump_file;
int d_nchannels; // Number of available channels for positioning
double d_galileo_current_time;
public:
hybrid_ls_pvt(int nchannels,std::string dump_filename, bool flag_dump_to_file);
~hybrid_ls_pvt();
bool get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, double Rx_time, bool flag_averaging);
int d_nchannels; //!< Number of available channels for positioning
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
@ -70,16 +74,6 @@ public:
Gps_CNAV_Iono gps_cnav_iono;
Gps_CNAV_Utc_Model gps_cnav_utc_model;
double d_galileo_current_time;
int count_valid_position;
bool d_flag_dump_enabled;
bool d_flag_averaging;
std::string d_dump_filename;
std::ofstream d_dump_file;
};
#endif

View File

@ -30,51 +30,47 @@
*/
#include "kml_printer.h"
#include <ctime>
#include <sstream>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <glog/logging.h>
using google::LogMessage;
bool Kml_Printer::set_headers(std::string filename, bool time_tag_name)
{
boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time();
tm timeinfo = boost::posix_time::to_tm(pt);
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
if (time_tag_name)
{
std::stringstream strm0;
const int year = timeinfo->tm_year - 100;
const int year = timeinfo.tm_year - 100;
strm0 << year;
const int month = timeinfo->tm_mon + 1;
const int month = timeinfo.tm_mon + 1;
if(month < 10)
{
strm0 << "0";
}
strm0 << month;
const int day = timeinfo->tm_mday;
const int day = timeinfo.tm_mday;
if(day < 10)
{
strm0 << "0";
}
strm0 << day << "_";
const int hour = timeinfo->tm_hour;
const int hour = timeinfo.tm_hour;
if(hour < 10)
{
strm0 << "0";
}
strm0 << hour;
const int min = timeinfo->tm_min;
const int min = timeinfo.tm_min;
if(min < 10)
{
strm0 << "0";
}
strm0 << min;
const int sec = timeinfo->tm_sec;
const int sec = timeinfo.tm_sec;
if(sec < 10)
{
strm0 << "0";
@ -88,6 +84,7 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name)
kml_filename = filename + ".kml";
}
kml_file.open(kml_filename.c_str());
if (kml_file.is_open())
{
DLOG(INFO) << "KML printer writing on " << filename.c_str();
@ -98,7 +95,7 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name)
<< "<kml xmlns=\"http://www.opengis.net/kml/2.2\">" << std::endl
<< " <Document>" << std::endl
<< " <name>GNSS Track</name>" << std::endl
<< " <description>GNSS-SDR Receiver position log file created at " << asctime (timeinfo)
<< " <description>GNSS-SDR Receiver position log file created at " << pt
<< " </description>" << std::endl
<< "<Style id=\"yellowLineGreenPoly\">" << std::endl
<< " <LineStyle>" << std::endl
@ -140,15 +137,15 @@ bool Kml_Printer::print_position(const std::shared_ptr<Pvt_Solution>& position,
if (print_average_values == false)
{
latitude = position_->d_latitude_d;
longitude = position_->d_longitude_d;
height = position_->d_height_m;
latitude = position_->get_latitude();
longitude = position_->get_longitude();
height = position_->get_height();
}
else
{
latitude = position_->d_avg_latitude_d;
longitude = position_->d_avg_longitude_d;
height = position_->d_avg_height_m;
latitude = position_->get_avg_latitude();
longitude = position_->get_avg_longitude();
height = position_->get_avg_height();
}
if (kml_file.is_open())

View File

@ -188,19 +188,16 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs
//=== Initialization =======================================================
int nmbOfIterations = 10; // TODO: include in config
int nmbOfSatellites;
nmbOfSatellites = satpos.n_cols; //Armadillo
nmbOfSatellites = satpos.n_cols; // Armadillo
arma::mat w = arma::zeros(nmbOfSatellites, nmbOfSatellites);
w.diag() = w_vec; //diagonal weight matrix
arma::vec pos = {d_rx_pos(0), d_rx_pos(0), d_rx_pos(0), 0}; // time error in METERS (time x speed)
arma::vec rx_pos = this->get_rx_pos();
arma::vec pos = {rx_pos(0), rx_pos(1), rx_pos(2), 0}; // time error in METERS (time x speed)
arma::mat A;
arma::mat omc;
arma::mat az;
arma::mat el;
A = arma::zeros(nmbOfSatellites, 4);
omc = arma::zeros(nmbOfSatellites, 1);
az = arma::zeros(1, nmbOfSatellites);
el = arma::zeros(1, nmbOfSatellites);
arma::mat X = satpos;
arma::vec Rot_X;
double rho2;
@ -209,7 +206,6 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs
double dlambda;
double dphi;
double h;
arma::mat mat_tmp;
arma::vec x;
//=== Iteratively find receiver position ===================================
@ -236,11 +232,14 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs
Rot_X = Ls_Pvt::rotateSatellite(traveltime, X.col(i)); //armadillo
//--- Find DOA and range of satellites
Ls_Pvt::topocent(&d_visible_satellites_Az[i],
&d_visible_satellites_El[i],
&d_visible_satellites_Distance[i],
pos.subvec(0,2),
Rot_X - pos.subvec(0, 2));
double * azim = 0;
double * elev = 0;
double * dist = 0;
Ls_Pvt::topocent(azim, elev, dist, pos.subvec(0,2), Rot_X - pos.subvec(0, 2));
this->set_visible_satellites_Az(i, *azim);
this->set_visible_satellites_El(i, *elev);
this->set_visible_satellites_Distance(i, *dist);
if(traveltime < 0.1 && nmbOfSatellites > 3)
{
//--- Find receiver's height
@ -254,7 +253,7 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs
else
{
//--- Find delay due to troposphere (in meters)
Ls_Pvt::tropo(&trop, sin(d_visible_satellites_El[i] * GPS_PI / 180.0), h / 1000.0, 1013.0, 293.0, 50.0, 0.0, 0.0, 0.0);
Ls_Pvt::tropo(&trop, sin(this->get_visible_satellites_El(i) * 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
}
}
@ -282,7 +281,7 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs
}
//-- compute the Dilution Of Precision values
d_Q = arma::inv(arma::htrans(A) * A);
this->set_Q(arma::inv(arma::htrans(A) * A));
// check the consistency of the PVT solution
if (((fabs(pos(3)) * 1000.0) / GPS_C_m_s) > GPS_STARTOFFSET_ms * 2)

View File

@ -167,7 +167,7 @@ bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr<Pvt_Solution>& pvt_data
//GPGSV
nmea_file_descriptor << GPGSV;
}
catch(std::exception ex)
catch(const std::exception & ex)
{
DLOG(INFO) << "NMEA printer can not write on output file" << nmea_filename.c_str();;
}
@ -236,9 +236,10 @@ std::string Nmea_Printer::latitude_to_hm(double lat)
out_string.fill('0');
out_string.width(2);
out_string << deg;
out_string.width(6);
out_string.precision(4);
out_string << mins;
out_string.width(2);
out_string << static_cast<int>(mins) << ".";
out_string.width(4);
out_string << static_cast<int>((mins - static_cast<double>(static_cast<int>(mins))) * 1e4);
if (north == true)
{
@ -273,9 +274,10 @@ std::string Nmea_Printer::longitude_to_hm(double longitude)
out_string.width(3);
out_string.fill('0');
out_string << deg;
out_string.width(6);
out_string.precision(4);
out_string << mins;
out_string.width(2);
out_string << static_cast<int>(mins) << ".";
out_string.width(4);
out_string << static_cast<int>((mins - static_cast<double>(static_cast<int>(mins))) * 1e4);
if (east == true)
{
@ -338,7 +340,7 @@ std::string Nmea_Printer::get_UTC_NMEA_time(boost::posix_time::ptime d_position_
std::string Nmea_Printer::get_GPRMC()
{
// Sample -> $GPRMC,161229.487,A,3723.2475,N,12158.3416,W,0.13,309.62,120598,*10
bool valid_fix = d_PVT_data->b_valid_position;
bool valid_fix = d_PVT_data->is_valid_position();
// ToDo: Compute speed and course over ground
double speed_over_ground_knots = 0;
@ -354,7 +356,7 @@ std::string Nmea_Printer::get_GPRMC()
sentence_str << sentence_header;
//UTC Time: hhmmss.sss
sentence_str << get_UTC_NMEA_time(d_PVT_data->d_position_UTC_time);
sentence_str << get_UTC_NMEA_time(d_PVT_data->get_position_UTC_time());
//Status: A: data valid, V: data NOT valid
@ -370,16 +372,16 @@ std::string Nmea_Printer::get_GPRMC()
if (print_avg_pos == true)
{
// Latitude ddmm.mmmm,(N or S)
sentence_str << "," << latitude_to_hm(d_PVT_data->d_avg_latitude_d);
sentence_str << "," << latitude_to_hm(d_PVT_data->get_avg_latitude());
// longitude dddmm.mmmm,(E or W)
sentence_str << "," << longitude_to_hm(d_PVT_data->d_avg_longitude_d);
sentence_str << "," << longitude_to_hm(d_PVT_data->get_avg_longitude());
}
else
{
// Latitude ddmm.mmmm,(N or S)
sentence_str << "," << latitude_to_hm(d_PVT_data->d_latitude_d);
sentence_str << "," << latitude_to_hm(d_PVT_data->get_latitude());
// longitude dddmm.mmmm,(E or W)
sentence_str << "," << longitude_to_hm(d_PVT_data->d_longitude_d);
sentence_str << "," << longitude_to_hm(d_PVT_data->get_longitude());
}
//Speed over ground (knots)
@ -395,7 +397,7 @@ std::string Nmea_Printer::get_GPRMC()
sentence_str << course_over_ground_deg;
// Date ddmmyy
boost::gregorian::date sentence_date = d_PVT_data->d_position_UTC_time.date();
boost::gregorian::date sentence_date = d_PVT_data->get_position_UTC_time().date();
unsigned int year = sentence_date.year();
unsigned int day = sentence_date.day();
unsigned int month = sentence_date.month();
@ -441,11 +443,11 @@ std::string Nmea_Printer::get_GPGSA()
{
//$GPGSA,A,3,07,02,26,27,09,04,15, , , , , ,1.8,1.0,1.5*33
// GSA-GNSS DOP and Active Satellites
bool valid_fix = d_PVT_data->b_valid_position;
int n_sats_used = d_PVT_data->d_valid_observations;
double pdop = d_PVT_data->d_PDOP;
double hdop = d_PVT_data->d_HDOP;
double vdop = d_PVT_data->d_VDOP;
bool valid_fix = d_PVT_data->is_valid_position();
int n_sats_used = d_PVT_data->get_num_valid_observations();
double pdop = d_PVT_data->get_PDOP();
double hdop = d_PVT_data->get_HDOP();
double vdop = d_PVT_data->get_VDOP();
std::stringstream sentence_str;
std::string sentence_header;
@ -479,7 +481,7 @@ std::string Nmea_Printer::get_GPGSA()
{
sentence_str.width(2);
sentence_str.fill('0');
sentence_str << d_PVT_data->d_visible_satellites_IDs[i];
sentence_str << d_PVT_data->get_visible_satellites_ID(i);
}
}
@ -527,7 +529,7 @@ std::string Nmea_Printer::get_GPGSV()
{
// GSV-GNSS Satellites in View
// Notice that NMEA 2.1 only supports 12 channels
int n_sats_used = d_PVT_data->d_valid_observations;
int n_sats_used = d_PVT_data->get_num_valid_observations();
std::stringstream sentence_str;
std::stringstream frame_str;
std::string sentence_header;
@ -567,22 +569,22 @@ std::string Nmea_Printer::get_GPGSV()
frame_str << ",";
frame_str.width(2);
frame_str.fill('0');
frame_str << std::dec << d_PVT_data->d_visible_satellites_IDs[current_satellite];
frame_str << std::dec << d_PVT_data->get_visible_satellites_ID(current_satellite);
frame_str << ",";
frame_str.width(2);
frame_str.fill('0');
frame_str << std::dec << static_cast<int>(d_PVT_data->d_visible_satellites_El[current_satellite]);
frame_str << std::dec << static_cast<int>(d_PVT_data->get_visible_satellites_El(current_satellite));
frame_str << ",";
frame_str.width(3);
frame_str.fill('0');
frame_str << std::dec << static_cast<int>(d_PVT_data->d_visible_satellites_Az[current_satellite]);
frame_str << std::dec << static_cast<int>(d_PVT_data->get_visible_satellites_Az(current_satellite));
frame_str << ",";
frame_str.width(2);
frame_str.fill('0');
frame_str << std::dec << static_cast<int>(d_PVT_data->d_visible_satellites_CN0_dB[current_satellite]);
frame_str << std::dec << static_cast<int>(d_PVT_data->get_visible_satellites_CN0_dB(current_satellite));
current_satellite++;
@ -617,18 +619,18 @@ std::string Nmea_Printer::get_GPGSV()
std::string Nmea_Printer::get_GPGGA()
{
//boost::posix_time::ptime d_position_UTC_time=boost::posix_time::microsec_clock::universal_time();
bool valid_fix = d_PVT_data->b_valid_position;
int n_channels = d_PVT_data->d_valid_observations;//d_nchannels
double hdop = d_PVT_data->d_HDOP;
bool valid_fix = d_PVT_data->is_valid_position();
int n_channels = d_PVT_data->get_num_valid_observations();//d_nchannels
double hdop = d_PVT_data->get_HDOP();
double MSL_altitude;
if (d_PVT_data->d_flag_averaging == true)
if (d_PVT_data->is_averaging() == true)
{
MSL_altitude = d_PVT_data->d_avg_height_m;
MSL_altitude = d_PVT_data->get_avg_height();
}
else
{
MSL_altitude = d_PVT_data->d_height_m;
MSL_altitude = d_PVT_data->get_height();
}
std::stringstream sentence_str;
@ -639,21 +641,21 @@ std::string Nmea_Printer::get_GPGGA()
sentence_str << sentence_header;
//UTC Time: hhmmss.sss
sentence_str << get_UTC_NMEA_time(d_PVT_data->d_position_UTC_time);
sentence_str << get_UTC_NMEA_time(d_PVT_data->get_position_UTC_time());
if (d_PVT_data->d_flag_averaging == true)
if (d_PVT_data->is_averaging() == true)
{
// Latitude ddmm.mmmm,(N or S)
sentence_str << "," << latitude_to_hm(d_PVT_data->d_avg_latitude_d);
sentence_str << "," << latitude_to_hm(d_PVT_data->get_avg_latitude());
// longitude dddmm.mmmm,(E or W)
sentence_str << "," << longitude_to_hm(d_PVT_data->d_avg_longitude_d);
sentence_str << "," << longitude_to_hm(d_PVT_data->get_avg_longitude());
}
else
{
// Latitude ddmm.mmmm,(N or S)
sentence_str << "," << latitude_to_hm(d_PVT_data->d_latitude_d);
sentence_str << "," << latitude_to_hm(d_PVT_data->get_latitude());
// longitude dddmm.mmmm,(E or W)
sentence_str << "," << longitude_to_hm(d_PVT_data->d_longitude_d);
sentence_str << "," << longitude_to_hm(d_PVT_data->get_longitude());
}
// Position fix indicator

View File

@ -364,6 +364,7 @@ int Pvt_Solution::tropo(double *ddr_m, double sinel, double hsta_km, double p_mb
return 0;
}
int Pvt_Solution::topocent(double *Az, double *El, double *D, const arma::vec & x, const arma::vec & dx)
{
/* Transformation of vector dx into topocentric coordinate
@ -474,7 +475,7 @@ int Pvt_Solution::compute_DOP()
d_VDOP = sqrt(DOP_ENU(2, 2)); // VDOP
d_TDOP = sqrt(d_Q(3, 3)); // TDOP
}
catch(std::exception& ex)
catch(const std::exception & ex)
{
d_GDOP = -1; // Geometric DOP
d_PDOP = -1; // PDOP
@ -483,26 +484,28 @@ int Pvt_Solution::compute_DOP()
d_TDOP = -1; // TDOP
}
return 0;
}
int Pvt_Solution::set_averaging_depth(int depth)
void Pvt_Solution::set_averaging_depth(int depth)
{
d_averaging_depth = depth;
return 0;
}
int Pvt_Solution::pos_averaging(bool flag_averaring)
void Pvt_Solution::set_averaging_flag(bool flag)
{
d_flag_averaging = flag;
}
void Pvt_Solution::perform_pos_averaging()
{
// MOVING AVERAGE PVT
bool avg = flag_averaring;
bool avg = d_flag_averaging;
if (avg == true)
{
if (d_hist_longitude_d.size() == (unsigned int)d_averaging_depth)
if (d_hist_longitude_d.size() == static_cast<unsigned int>(d_averaging_depth))
{
// Pop oldest value
d_hist_longitude_d.pop_back();
@ -545,6 +548,313 @@ int Pvt_Solution::pos_averaging(bool flag_averaring)
{
b_valid_position = true;
}
return 0;
}
double Pvt_Solution::get_time_offset_s() const
{
return d_rx_dt_s;
}
void Pvt_Solution::set_time_offset_s(double offset)
{
d_rx_dt_s = offset;
}
double Pvt_Solution::get_latitude() const
{
return d_latitude_d;
}
double Pvt_Solution::get_longitude() const
{
return d_longitude_d;
}
double Pvt_Solution::get_height() const
{
return d_height_m;
}
double Pvt_Solution::get_avg_latitude() const
{
return d_avg_latitude_d;
}
double Pvt_Solution::get_avg_longitude() const
{
return d_avg_longitude_d;
}
double Pvt_Solution::get_avg_height() const
{
return d_avg_height_m;
}
bool Pvt_Solution::is_averaging() const
{
return d_flag_averaging;
}
bool Pvt_Solution::is_valid_position() const
{
return b_valid_position;
}
void Pvt_Solution::set_valid_position(bool is_valid)
{
b_valid_position = is_valid;
}
void Pvt_Solution::set_rx_pos(const arma::vec & pos)
{
d_rx_pos = pos;
d_latitude_d = d_rx_pos(0);
d_longitude_d = d_rx_pos(1);
d_height_m = d_rx_pos(2);
}
arma::vec Pvt_Solution::get_rx_pos() const
{
return d_rx_pos;
}
boost::posix_time::ptime Pvt_Solution::get_position_UTC_time() const
{
return d_position_UTC_time;
}
void Pvt_Solution::set_position_UTC_time(const boost::posix_time::ptime & pt)
{
d_position_UTC_time = pt;
}
int Pvt_Solution::get_num_valid_observations() const
{
return d_valid_observations;
}
void Pvt_Solution::set_num_valid_observations(int num)
{
d_valid_observations = num;
}
bool Pvt_Solution::set_visible_satellites_ID(size_t index, unsigned int prn)
{
if(index >= PVT_MAX_CHANNELS)
{
LOG(WARNING) << "Setting sat ID to channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
return false;
}
else
{
if(prn >= PVT_MAX_PRN)
{
LOG(WARNING) << "Setting to channel " << index << " a PRN of " << prn << " (the maximum is " << PVT_MAX_PRN << ")";
return false;
}
else
{
d_visible_satellites_IDs[index] = prn;
return true;
}
}
}
unsigned int Pvt_Solution::get_visible_satellites_ID(size_t index) const
{
if(index >= PVT_MAX_CHANNELS)
{
LOG(WARNING) << "Getting sat ID for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
return 0;
}
else
{
return d_visible_satellites_IDs[index];
}
}
bool Pvt_Solution::set_visible_satellites_El(size_t index, double el)
{
if(index >= PVT_MAX_CHANNELS)
{
LOG(WARNING) << "Setting sat elevation for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
return false;
}
else
{
if(el > 90.0)
{
LOG(WARNING) << "Setting a sat elevation > 90 [degrees]. Saturating to 90";
d_visible_satellites_El[index] = 90.0;
}
else
{
if(el < -90.0)
{
LOG(WARNING) << "Setting a sat elevation < -90 [degrees]. Saturating to -90";
d_visible_satellites_El[index] = -90.0;
}
else
{
d_visible_satellites_El[index] = el;
}
}
return true;
}
}
double Pvt_Solution::get_visible_satellites_El(size_t index) const
{
if(index >= PVT_MAX_CHANNELS)
{
LOG(WARNING) << "Getting sat elevation for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
return 0.0;
}
else
{
return d_visible_satellites_El[index];
}
}
bool Pvt_Solution::set_visible_satellites_Az(size_t index, double az)
{
if(index >= PVT_MAX_CHANNELS)
{
LOG(WARNING) << "Getting sat azimuth for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
return false;
}
else
{
d_visible_satellites_Az[index] = az;
return true;
}
}
double Pvt_Solution::get_visible_satellites_Az(size_t index) const
{
if(index >= PVT_MAX_CHANNELS)
{
LOG(WARNING) << "Getting sat azimuth for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
return 0.0;
}
else
{
return d_visible_satellites_Az[index];
}
}
bool Pvt_Solution::set_visible_satellites_Distance(size_t index, double dist)
{
if(index >= PVT_MAX_CHANNELS)
{
LOG(WARNING) << "Setting sat distance for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
return false;
}
else
{
d_visible_satellites_Distance[index] = dist;
return true;
}
}
double Pvt_Solution::get_visible_satellites_Distance(size_t index) const
{
if(index >= PVT_MAX_CHANNELS)
{
LOG(WARNING) << "Getting sat distance for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
return 0.0;
}
else
{
return d_visible_satellites_Distance[index];
}
}
bool Pvt_Solution::set_visible_satellites_CN0_dB(size_t index, double cn0)
{
if(index >= PVT_MAX_CHANNELS)
{
LOG(WARNING) << "Setting sat Cn0 for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
return false;
}
else
{
d_visible_satellites_CN0_dB[index] = cn0;
return true;
}
}
double Pvt_Solution::get_visible_satellites_CN0_dB(size_t index) const
{
if(index >= PVT_MAX_CHANNELS)
{
LOG(WARNING) << "Getting received CN0 for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
return 0.0;
}
else
{
return d_visible_satellites_CN0_dB[index];
}
}
void Pvt_Solution::set_Q(const arma::mat & Q)
{
d_Q = Q;
}
double Pvt_Solution::get_GDOP() const
{
return d_GDOP;
}
double Pvt_Solution::get_PDOP() const
{
return d_PDOP;
}
double Pvt_Solution::get_HDOP() const
{
return d_HDOP;
}
double Pvt_Solution::get_VDOP() const
{
return d_VDOP;
}
double Pvt_Solution::get_TDOP() const
{
return d_TDOP;
}

View File

@ -37,7 +37,8 @@
#include <armadillo>
#include <boost/date_time/posix_time/posix_time.hpp>
#define PVT_MAX_CHANNELS 24
const unsigned int PVT_MAX_CHANNELS = 90;
const unsigned int PVT_MAX_PRN = 127; // 126 is SBAS
/*!
* \brief Base class for a PVT solution
@ -45,50 +46,99 @@
*/
class Pvt_Solution
{
public:
Pvt_Solution();
private:
double d_rx_dt_s; // RX time offset [s]
double d_latitude_d; //!< RX position Latitude WGS84 [deg]
double d_longitude_d; //!< RX position Longitude WGS84 [deg]
double d_height_m; //!< RX position height WGS84 [m]
double d_latitude_d; // RX position Latitude WGS84 [deg]
double d_longitude_d; // RX position Longitude WGS84 [deg]
double d_height_m; // RX position height WGS84 [m]
arma::vec d_rx_pos;
double d_rx_dt_s; //!< RX time offset [s]
boost::posix_time::ptime d_position_UTC_time;
double d_avg_latitude_d; // Averaged latitude in degrees
double d_avg_longitude_d; // Averaged longitude in degrees
double d_avg_height_m; // Averaged height [m]
bool b_valid_position;
int d_valid_observations; //!< Number of valid pseudorange observations (valid satellites)
int d_visible_satellites_IDs[PVT_MAX_CHANNELS] = {}; //!< Array with the IDs of the valid satellites
double d_visible_satellites_El[PVT_MAX_CHANNELS] = {}; //!< Array with the LOS Elevation of the valid satellites
double d_visible_satellites_Az[PVT_MAX_CHANNELS] = {}; //!< Array with the LOS Azimuth of the valid satellites
double d_visible_satellites_Distance[PVT_MAX_CHANNELS] = {}; //!< Array with the LOS Distance of the valid satellites
double d_visible_satellites_CN0_dB[PVT_MAX_CHANNELS] = {}; //!< Array with the IDs of the valid satellites
//averaging
int d_averaging_depth; //!< Length of averaging window
std::deque<double> d_hist_latitude_d;
std::deque<double> d_hist_longitude_d;
std::deque<double> d_hist_height_m;
double d_avg_latitude_d; //!< Averaged latitude in degrees
double d_avg_longitude_d; //!< Averaged longitude in degrees
double d_avg_height_m; //!< Averaged height [m]
int pos_averaging(bool flag_averaging);
bool d_flag_averaging;
int d_averaging_depth; // Length of averaging window
arma::vec d_rx_pos;
boost::posix_time::ptime d_position_UTC_time;
int d_valid_observations;
// DOP estimations
arma::mat d_Q;
double d_GDOP;
double d_PDOP;
double d_HDOP;
double d_VDOP;
double d_TDOP;
int d_visible_satellites_IDs[PVT_MAX_CHANNELS] = {}; // Array with the IDs of the valid satellites
double d_visible_satellites_El[PVT_MAX_CHANNELS] = {}; // Array with the LOS Elevation of the valid satellites
double d_visible_satellites_Az[PVT_MAX_CHANNELS] = {}; // Array with the LOS Azimuth of the valid satellites
double d_visible_satellites_Distance[PVT_MAX_CHANNELS] = {}; // Array with the LOS Distance of the valid satellites
double d_visible_satellites_CN0_dB[PVT_MAX_CHANNELS] = {}; // Array with the IDs of the valid satellites
public:
Pvt_Solution();
double get_time_offset_s() const; //!< Get RX time offset [s]
void set_time_offset_s(double offset); //!< Set RX time offset [s]
double get_latitude() const; //!< Get RX position Latitude WGS84 [deg]
double get_longitude() const; //!< Get RX position Longitude WGS84 [deg]
double get_height() const; //!< Get RX position height WGS84 [m]
double get_avg_latitude() const; //!< Get RX position averaged Latitude WGS84 [deg]
double get_avg_longitude() const; //!< Get RX position averaged Longitude WGS84 [deg]
double get_avg_height() const; //!< Get RX position averaged height WGS84 [m]
void set_rx_pos(const arma::vec & pos); //!< Set position: Latitude [deg], longitude [deg], height [m]
arma::vec get_rx_pos() const;
bool is_valid_position() const;
void set_valid_position(bool is_valid);
boost::posix_time::ptime get_position_UTC_time() const;
void set_position_UTC_time(const boost::posix_time::ptime & pt);
int get_num_valid_observations() const; //!< Get the number of valid pseudorange observations (valid satellites)
void set_num_valid_observations(int num); //!< Set the number of valid pseudorange observations (valid satellites)
bool set_visible_satellites_ID(size_t index, unsigned int prn); //!< Set the ID of the visible satellite index channel
unsigned int get_visible_satellites_ID(size_t index) const; //!< Get the ID of the visible satellite index channel
bool set_visible_satellites_El(size_t index, double el); //!< Set the LOS Elevation, in degrees, of the visible satellite index channel
double get_visible_satellites_El(size_t index) const; //!< Get the LOS Elevation, in degrees, of the visible satellite index channel
bool set_visible_satellites_Az(size_t index, double az); //!< Set the LOS Azimuth, in degrees, of the visible satellite index channel
double get_visible_satellites_Az(size_t index) const; //!< Get the LOS Azimuth, in degrees, of the visible satellite index channel
bool set_visible_satellites_Distance(size_t index, double dist); //!< Set the LOS Distance of the visible satellite index channel
double get_visible_satellites_Distance(size_t index) const; //!< Get the LOS Distance of the visible satellite index channel
bool set_visible_satellites_CN0_dB(size_t index, double cn0); //!< Set the CN0 in dB of the visible satellite index channel
double get_visible_satellites_CN0_dB(size_t index) const; //!< Get the CN0 in dB of the visible satellite index channel
//averaging
void perform_pos_averaging();
void set_averaging_depth(int depth); //!< Set length of averaging window
bool is_averaging() const;
void set_averaging_flag(bool flag);
// DOP estimations
void set_Q(const arma::mat & Q);
int compute_DOP(); //!< Compute Dilution Of Precision parameters
bool d_flag_averaging;
int set_averaging_depth(int depth);
double get_GDOP() const;
double get_PDOP() const;
double get_HDOP() const;
double get_VDOP() const;
double get_TDOP() const;
arma::vec rotateSatellite(double traveltime, const arma::vec & X_sat);

View File

@ -1133,7 +1133,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal
out.close();
out.open(navGalfilename, std::ios::out | std::ios::trunc);
out.seekp(0);
for (int i = 0; i < (int) data.size() - 1; i++)
for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
{
out << data[i] << std::endl;
}
@ -1284,7 +1284,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut
out.close();
out.open(navfilename, std::ios::out | std::ios::trunc);
out.seekp(0);
for (int i = 0; i < (int) data.size() - 1; i++)
for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
{
out << data[i] << std::endl;
}
@ -1379,7 +1379,7 @@ void Rinex_Printer::update_nav_header(std::fstream & out, const Gps_CNAV_Utc_Mod
out.close();
out.open(navfilename, std::ios::out | std::ios::trunc);
out.seekp(0);
for (int i = 0; i < (int) data.size() - 1; i++)
for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
{
out << data[i] << std::endl;
}
@ -1510,7 +1510,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion
out.close();
out.open(navMixfilename, std::ios::out | std::ios::trunc);
out.seekp(0);
for (int i = 0; i < (int) data.size() - 1; i++)
for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
{
out << data[i] << std::endl;
}
@ -1526,8 +1526,8 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_Ephe
std::string line;
std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter;
for(gps_ephemeris_iter = eph_map.begin();
gps_ephemeris_iter != eph_map.end();
for(gps_ephemeris_iter = eph_map.cbegin();
gps_ephemeris_iter != eph_map.cend();
gps_ephemeris_iter++)
{
// -------- SV / EPOCH / SV CLK
@ -1857,8 +1857,8 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_CNAV
std::string line;
std::map<int,Gps_CNAV_Ephemeris>::const_iterator gps_ephemeris_iter;
for(gps_ephemeris_iter = eph_map.begin();
gps_ephemeris_iter != eph_map.end();
for(gps_ephemeris_iter = eph_map.cbegin();
gps_ephemeris_iter != eph_map.cend();
gps_ephemeris_iter++)
{
// -------- SV / EPOCH / SV CLK
@ -2020,8 +2020,8 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Galileo
std::string line;
std::map<int,Galileo_Ephemeris>::const_iterator galileo_ephemeris_iter;
line.clear();
for(galileo_ephemeris_iter = eph_map.begin();
galileo_ephemeris_iter != eph_map.end();
for(galileo_ephemeris_iter = eph_map.cbegin();
galileo_ephemeris_iter != eph_map.cend();
galileo_ephemeris_iter++)
{
// -------- SV / EPOCH / SV CLK
@ -3522,7 +3522,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_Utc_Model& ut
out.close();
out.open(obsfilename, std::ios::out | std::ios::trunc);
out.seekp(0);
for (int i = 0; i < (int) data.size() - 1; i++)
for (int i = 0; i < static_cast<int>( data.size()) - 1; i++)
{
out << data[i] << std::endl;
}
@ -3581,7 +3581,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_CNAV_Utc_Mode
out.close();
out.open(obsfilename, std::ios::out | std::ios::trunc);
out.seekp(0);
for (int i = 0; i < (int) data.size() - 1; i++)
for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
{
out << data[i] << std::endl;
}
@ -3641,7 +3641,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Galileo_Utc_Model
out.close();
out.open(obsfilename, std::ios::out | std::ios::trunc);
out.seekp(0);
for (int i = 0; i < (int) data.size() - 1; i++)
for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
{
out << data[i] << std::endl;
}
@ -3710,15 +3710,15 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
//Number of satellites observed in current epoch
int numSatellitesObserved = 0;
std::map<int, Gnss_Synchro>::const_iterator observables_iter;
for(observables_iter = observables.begin();
observables_iter != observables.end();
for(observables_iter = observables.cbegin();
observables_iter != observables.cend();
observables_iter++)
{
numSatellitesObserved++;
}
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(numSatellitesObserved), 3);
for(observables_iter = observables.begin();
observables_iter != observables.end();
for(observables_iter = observables.cbegin();
observables_iter != observables.cend();
observables_iter++)
{
line += satelliteSystem["GPS"];
@ -3732,8 +3732,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
out << line << std::endl;
for(observables_iter = observables.begin();
observables_iter != observables.end();
for(observables_iter = observables.cbegin();
observables_iter != observables.cend();
observables_iter++)
{
std::string lineObs;
@ -3816,8 +3816,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
//Number of satellites observed in current epoch
int numSatellitesObserved = 0;
std::map<int, Gnss_Synchro>::const_iterator observables_iter;
for(observables_iter = observables.begin();
observables_iter != observables.end();
for(observables_iter = observables.cbegin();
observables_iter != observables.cend();
observables_iter++)
{
numSatellitesObserved++;
@ -3832,8 +3832,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
Rinex_Printer::lengthCheck(line);
out << line << std::endl;
for(observables_iter = observables.begin();
observables_iter != observables.end();
for(observables_iter = observables.cbegin();
observables_iter != observables.cend();
observables_iter++)
{
std::string lineObs;
@ -3938,8 +3938,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris &
//Number of satellites observed in current epoch
int numSatellitesObserved = 0;
std::map<int, Gnss_Synchro>::const_iterator observables_iter;
for(observables_iter = observables.begin();
observables_iter != observables.end();
for(observables_iter = observables.cbegin();
observables_iter != observables.cend();
observables_iter++)
{
numSatellitesObserved++;
@ -3953,8 +3953,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris &
Rinex_Printer::lengthCheck(line);
out << line << std::endl;
for(observables_iter = observables.begin();
observables_iter != observables.end();
for(observables_iter = observables.cbegin();
observables_iter != observables.cend();
observables_iter++)
{
std::string lineObs;
@ -4063,12 +4063,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph,
std::map<int, Gnss_Synchro> observablesL1;
std::map<int, Gnss_Synchro> observablesL2;
std::map<int, Gnss_Synchro>::const_iterator observables_iter;
std::map<int, Gnss_Synchro>::const_iterator observables_iter2;
std::multimap<unsigned int, Gnss_Synchro> total_mmap;
std::multimap<unsigned int, Gnss_Synchro>::iterator mmap_iter;
for(observables_iter = observables.begin();
observables_iter != observables.end();
for(observables_iter = observables.cbegin();
observables_iter != observables.cend();
observables_iter++)
{
std::string system_(&observables_iter->second.System, 1);
@ -4104,7 +4103,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph,
std::string sys = "G";
gs.System = *sys.c_str();
std::string sig = "2S";
std::memcpy((void*)gs.Signal, sig.c_str(), 3);
std::memcpy(static_cast<void*>(gs.Signal), sig.c_str(), 3);
gs.PRN = mmap_iter->second.PRN;
total_mmap.insert(std::pair<unsigned int, Gnss_Synchro>(mmap_iter->second.PRN, gs));
}
@ -4112,8 +4111,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph,
std::set<unsigned int> available_prns;
std::set<unsigned int>::iterator it;
for(observables_iter = observablesL1.begin();
observables_iter != observablesL1.end();
for(observables_iter = observablesL1.cbegin();
observables_iter != observablesL1.cend();
observables_iter++)
{
unsigned int prn_ = observables_iter->second.PRN;
@ -4124,8 +4123,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph,
}
}
for(observables_iter = observablesL2.begin();
observables_iter != observablesL2.end();
for(observables_iter = observablesL2.cbegin();
observables_iter != observablesL2.cend();
observables_iter++)
{
unsigned int prn_ = observables_iter->second.PRN;
@ -4258,8 +4257,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
std::map<int, Gnss_Synchro> observablesE5B;
std::map<int, Gnss_Synchro>::const_iterator observables_iter;
for(observables_iter = observables.begin();
observables_iter != observables.end();
for(observables_iter = observables.cbegin();
observables_iter != observables.cend();
observables_iter++)
{
std::string system_(&observables_iter->second.System, 1);
@ -4301,8 +4300,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
}
if(found_E5a != std::string::npos)
{
for(observables_iter = observablesE5A.begin();
observables_iter != observablesE5A.end();
for(observables_iter = observablesE5A.cbegin();
observables_iter != observablesE5A.cend();
observables_iter++)
{
unsigned int prn_ = observables_iter->second.PRN;
@ -4316,7 +4315,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
std::string sys = "E";
gs.System = *sys.c_str();
std::string sig = "1B";
std::memcpy((void*)gs.Signal, sig.c_str(), 3);
std::memcpy(static_cast<void*>(gs.Signal), sig.c_str(), 3);
gs.PRN = prn_;
total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
}
@ -4326,8 +4325,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
}
if(found_E5b != std::string::npos)
{
for(observables_iter = observablesE5B.begin();
observables_iter != observablesE5B.end();
for(observables_iter = observablesE5B.cbegin();
observables_iter != observablesE5B.cend();
observables_iter++)
{
unsigned int prn_ = observables_iter->second.PRN;
@ -4336,25 +4335,25 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
{
available_prns.insert(prn_);
if(found_1B != std::string::npos)
{
Gnss_Synchro gs = Gnss_Synchro();
std::string sys = "E";
gs.System = *sys.c_str();
std::string sig = "1B";
std::memcpy((void*)gs.Signal, sig.c_str(), 3);
gs.PRN = prn_;
total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
}
{
Gnss_Synchro gs = Gnss_Synchro();
std::string sys = "E";
gs.System = *sys.c_str();
std::string sig = "1B";
std::memcpy(static_cast<void*>(gs.Signal), sig.c_str(), 3);
gs.PRN = prn_;
total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
}
if(found_E5a != std::string::npos)
{
Gnss_Synchro gs = Gnss_Synchro();
std::string sys = "E";
gs.System = *sys.c_str();
std::string sig = "5X";
std::memcpy((void*)gs.Signal, sig.c_str(), 3);
gs.PRN = prn_;
total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
}
{
Gnss_Synchro gs = Gnss_Synchro();
std::string sys = "E";
gs.System = *sys.c_str();
std::string sig = "5X";
std::memcpy(static_cast<void*>(gs.Signal), sig.c_str(), 3);
gs.PRN = prn_;
total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
}
}
else
{
@ -4362,15 +4361,15 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
if(found_E5a != std::string::npos)
{
if( (total_map.count(prn_)) == 1)
{
Gnss_Synchro gs = Gnss_Synchro();
std::string sys = "E";
gs.System = *sys.c_str();
std::string sig = "5X";
std::memcpy((void*)gs.Signal, sig.c_str(), 3);
gs.PRN = prn_;
total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
}
{
Gnss_Synchro gs = Gnss_Synchro();
std::string sys = "E";
gs.System = *sys.c_str();
std::string sig = "5X";
std::memcpy(static_cast<void*>(gs.Signal), sig.c_str(), 3);
gs.PRN = prn_;
total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
}
}
}
total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, observables_iter->second));
@ -4498,8 +4497,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
std::map<int, Gnss_Synchro> observablesE5B;
std::map<int, Gnss_Synchro>::const_iterator observables_iter;
for(observables_iter = observables.begin();
observables_iter != observables.end();
for(observables_iter = observables.cbegin();
observables_iter != observables.cend();
observables_iter++)
{
std::string system_(&observables_iter->second.System, 1);
@ -4525,8 +4524,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
std::multimap<unsigned int, Gnss_Synchro> total_gal_map;
std::set<unsigned int> available_gal_prns;
std::set<unsigned int>::iterator it;
for(observables_iter = observablesE1B.begin();
observables_iter != observablesE1B.end();
for(observables_iter = observablesE1B.cbegin();
observables_iter != observablesE1B.cend();
observables_iter++)
{
unsigned int prn_ = observables_iter->second.PRN;
@ -4538,8 +4537,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
}
}
for(observables_iter = observablesE5A.begin();
observables_iter != observablesE5A.end();
for(observables_iter = observablesE5A.cbegin();
observables_iter != observablesE5A.cend();
observables_iter++)
{
unsigned int prn_ = observables_iter->second.PRN;
@ -4551,8 +4550,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
}
}
for(observables_iter = observablesE5B.begin();
observables_iter != observablesE5B.end();
for(observables_iter = observablesE5B.cbegin();
observables_iter != observablesE5B.cend();
observables_iter++)
{
unsigned int prn_ = observables_iter->second.PRN;
@ -4578,8 +4577,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
std::string s;
std::string lineObs;
for(observables_iter = observablesG1C.begin();
observables_iter != observablesG1C.end();
for(observables_iter = observablesG1C.cbegin();
observables_iter != observablesG1C.cend();
observables_iter++)
{
lineObs.clear();

View File

@ -483,7 +483,7 @@ inline std::string & Rinex_Printer::rightJustify(std::string & s,
}
else
{
s.insert((std::string::size_type)0, length-s.length(), pad);
s.insert(static_cast<std::string::size_type>(0), length - s.length(), pad);
}
return s;
}
@ -614,13 +614,13 @@ inline std::string & Rinex_Printer::sci2for(std::string & aStr,
// (if it's negative, there's a leading '-'
if (aStr[0] == '.')
{
aStr.insert((std::string::size_type)0, 1, ' ');
aStr.insert(static_cast<std::string::size_type>(0), 1, ' ');
}
//If checkSwitch is false, add on one leading zero to the string
if (!checkSwitch)
{
aStr.insert((std::string::size_type)1, 1, '0');
aStr.insert(static_cast<std::string::size_type>(1), 1, '0');
}
return aStr;

View File

@ -32,11 +32,11 @@
*/
#include "rtcm_printer.h"
#include <ctime>
#include <iostream>
#include <iomanip>
#include <fcntl.h> // for O_RDWR
#include <termios.h> // for tcgetattr
#include <boost/date_time/posix_time/posix_time.hpp>
#include <gflags/gflags.h>
#include <glog/logging.h>
@ -45,41 +45,39 @@ using google::LogMessage;
Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_server, bool flag_rtcm_tty_port, unsigned short rtcm_tcp_port, unsigned short rtcm_station_id, std::string rtcm_dump_devname, bool time_tag_name)
{
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time();
tm timeinfo = boost::posix_time::to_tm(pt);
if (time_tag_name)
{
std::stringstream strm0;
const int year = timeinfo->tm_year - 100;
const int year = timeinfo.tm_year - 100;
strm0 << year;
const int month = timeinfo->tm_mon + 1;
const int month = timeinfo.tm_mon + 1;
if(month < 10)
{
strm0 << "0";
}
strm0 << month;
const int day = timeinfo->tm_mday;
const int day = timeinfo.tm_mday;
if(day < 10)
{
strm0 << "0";
}
strm0 << day << "_";
const int hour = timeinfo->tm_hour;
const int hour = timeinfo.tm_hour;
if(hour < 10)
{
strm0 << "0";
}
strm0 << hour;
const int min = timeinfo->tm_min;
const int min = timeinfo.tm_min;
if(min < 10)
{
strm0 << "0";
}
strm0 << min;
const int sec = timeinfo->tm_sec;
const int sec = timeinfo.tm_sec;
if(sec < 10)
{
strm0 << "0";
@ -133,11 +131,11 @@ Rtcm_Printer::~Rtcm_Printer()
{
rtcm->stop_server();
}
catch( boost::exception & e )
catch(const boost::exception & e)
{
LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e);
}
catch(std::exception const& ex)
catch(const std::exception & ex)
{
LOG(WARNING) << "STD exception: " << ex.what();
}
@ -307,9 +305,9 @@ bool Rtcm_Printer::Print_Message(const std::string & message)
{
rtcm_file_descriptor << message << std::endl;
}
catch(std::exception ex)
catch(const std::exception & ex)
{
DLOG(INFO) << "RTCM printer can not write on output file" << rtcm_filename.c_str();
DLOG(INFO) << "RTCM printer cannot write on the output file " << rtcm_filename.c_str();
return false;
}
@ -318,8 +316,8 @@ bool Rtcm_Printer::Print_Message(const std::string & message)
{
if(write(rtcm_dev_descriptor, message.c_str(), message.length()) == -1)
{
DLOG(INFO) << "RTCM printer cannot write on serial device" << rtcm_devname.c_str();
std::cout << "RTCM printer cannot write on serial device" << rtcm_devname.c_str() << std::endl;
DLOG(INFO) << "RTCM printer cannot write on serial device " << rtcm_devname.c_str();
std::cout << "RTCM printer cannot write on serial device " << rtcm_devname.c_str() << std::endl;
return false;
}
}

View File

@ -67,45 +67,55 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag
d_dump_filename = dump_filename;
d_flag_dump_enabled = flag_dump_to_file;
count_valid_position = 0;
d_flag_averaging = false;
this->set_averaging_flag(false);
rtk_ = rtk;
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 };
// ############# ENABLE DATA FILE LOG #################
if (d_flag_dump_enabled == true)
{
if (d_dump_file.is_open() == false)
{
try
{
d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit);
d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary);
LOG(INFO) << "PVT lib dump enabled Log file: " << d_dump_filename.c_str();
}
catch (const std::ifstream::failure &e)
{
LOG(WARNING) << "Exception opening PVT lib dump file " << e.what();
}
if (d_dump_file.is_open() == false)
{
try
{
d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary);
LOG(INFO) << "PVT lib dump enabled Log file: " << d_dump_filename.c_str();
}
catch (const std::ifstream::failure &e)
{
LOG(WARNING) << "Exception opening PVT lib dump file " << e.what();
}
}
}
}
}
rtklib_solver::~rtklib_solver()
{
d_dump_file.close();
if (d_dump_file.is_open() == true)
{
try
{
d_dump_file.close();
}
catch(const std::exception & ex)
{
LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what();
}
}
}
bool rtklib_solver::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, double Rx_time, bool flag_averaging)
bool rtklib_solver::get_PVT(const std::map<int,Gnss_Synchro> & gnss_observables_map, double Rx_time, bool flag_averaging)
{
std::map<int,Gnss_Synchro>::iterator gnss_observables_iter;
std::map<int,Galileo_Ephemeris>::iterator galileo_ephemeris_iter;
std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter;
std::map<int,Gps_CNAV_Ephemeris>::iterator gps_cnav_ephemeris_iter;
std::map<int,Gnss_Synchro>::const_iterator gnss_observables_iter;
std::map<int,Galileo_Ephemeris>::const_iterator galileo_ephemeris_iter;
std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter;
std::map<int,Gps_CNAV_Ephemeris>::const_iterator gps_cnav_ephemeris_iter;
d_flag_averaging = flag_averaging;
this->set_averaging_flag(flag_averaging);
// ********************************************************************************
// ****** PREPARE THE DATA (SV EPHEMERIS AND OBSERVATIONS) ************************
@ -115,246 +125,246 @@ bool rtklib_solver::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
obsd_t obs_data[MAXOBS];
eph_t eph_data[MAXOBS];
for(gnss_observables_iter = gnss_observables_map.begin();
gnss_observables_iter != gnss_observables_map.end();
for(gnss_observables_iter = gnss_observables_map.cbegin();
gnss_observables_iter != gnss_observables_map.cend();
gnss_observables_iter++)
{
switch(gnss_observables_iter->second.System)
{
case 'E':
{
std::string sig_(gnss_observables_iter->second.Signal);
// Galileo E1
if(sig_.compare("1B") == 0)
switch(gnss_observables_iter->second.System)
{
// 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key
galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (galileo_ephemeris_iter != galileo_ephemeris_map.end())
case 'E':
{
//convert ephemeris from GNSS-SDR class to RTKLIB structure
eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second);
//convert observation from GNSS-SDR class to RTKLIB structure
obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
gnss_observables_iter->second,
galileo_ephemeris_iter->second.WN_5,
0);
valid_obs++;
}
else // the ephemeris are not available for this SV
{
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
}
}
// Galileo E5
if(sig_.compare("5X") == 0)
{
// 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key
galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (galileo_ephemeris_iter != galileo_ephemeris_map.end())
{
bool found_E1_obs=false;
for (int i = 0; i < valid_obs; i++)
{
if (eph_data[i].sat == (static_cast<int>(gnss_observables_iter->second.PRN+NSATGPS+NSATGLO)))
std::string sig_(gnss_observables_iter->second.Signal);
// Galileo E1
if(sig_.compare("1B") == 0)
{
obs_data[i] = insert_obs_to_rtklib(obs_data[i],
gnss_observables_iter->second,
galileo_ephemeris_iter->second.WN_5,
2);//Band 3 (L5/E5)
found_E1_obs=true;
break;
}
}
if (!found_E1_obs)
{
//insert Galileo E5 obs as new obs and also insert its ephemeris
//convert ephemeris from GNSS-SDR class to RTKLIB structure
eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second);
//convert observation from GNSS-SDR class to RTKLIB structure
obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
gnss_observables_iter->second,
galileo_ephemeris_iter->second.WN_5,
2); //Band 3 (L5/E5)
valid_obs++;
}
}
else // the ephemeris are not available for this SV
{
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
}
// 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key
galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (galileo_ephemeris_iter != galileo_ephemeris_map.cend())
{
//convert ephemeris from GNSS-SDR class to RTKLIB structure
eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second);
//convert observation from GNSS-SDR class to RTKLIB structure
obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
gnss_observables_iter->second,
galileo_ephemeris_iter->second.WN_5,
0);
valid_obs++;
}
else // the ephemeris are not available for this SV
{
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
}
}
break;
}
case 'G':
{
// GPS L1
// 1 GPS - find the ephemeris for the current GPS SV observation. The SV PRN ID is the map key
std::string sig_(gnss_observables_iter->second.Signal);
if(sig_.compare("1C") == 0)
{
gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (gps_ephemeris_iter != gps_ephemeris_map.end())
{
//convert ephemeris from GNSS-SDR class to RTKLIB structure
eph_data[valid_obs] = eph_to_rtklib(gps_ephemeris_iter->second);
//convert observation from GNSS-SDR class to RTKLIB structure
obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
gnss_observables_iter->second,
gps_ephemeris_iter->second.i_GPS_week,
0);
valid_obs++;
}
else // the ephemeris are not available for this SV
{
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->first;
}
}
//GPS L2
if(sig_.compare("2S") == 0)
{
gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.end())
{
// 1. Find the same satellite in GPS L1 band
gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (gps_ephemeris_iter != gps_ephemeris_map.end())
{
// 2. If found, replace the existing GPS L1 ephemeris with the GPS L2 ephemeris
// (more precise!), and attach the L2 observation to the L1 observation in RTKLIB structure
for (int i = 0; i < valid_obs; i++)
}
// Galileo E5
if(sig_.compare("5X") == 0)
{
if (eph_data[i].sat == static_cast<int>(gnss_observables_iter->second.PRN))
{
eph_data[i] = eph_to_rtklib(gps_cnav_ephemeris_iter->second);
obs_data[i] = insert_obs_to_rtklib(obs_data[i],
gnss_observables_iter->second,
gps_cnav_ephemeris_iter->second.i_GPS_week,
1);//Band 2 (L2)
break;
}
// 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key
galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (galileo_ephemeris_iter != galileo_ephemeris_map.cend())
{
bool found_E1_obs=false;
for (int i = 0; i < valid_obs; i++)
{
if (eph_data[i].sat == (static_cast<int>(gnss_observables_iter->second.PRN + NSATGPS + NSATGLO)))
{
obs_data[i] = insert_obs_to_rtklib(obs_data[i],
gnss_observables_iter->second,
galileo_ephemeris_iter->second.WN_5,
2);//Band 3 (L5/E5)
found_E1_obs=true;
break;
}
}
if (!found_E1_obs)
{
//insert Galileo E5 obs as new obs and also insert its ephemeris
//convert ephemeris from GNSS-SDR class to RTKLIB structure
eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second);
//convert observation from GNSS-SDR class to RTKLIB structure
obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
gnss_observables_iter->second,
galileo_ephemeris_iter->second.WN_5,
2); //Band 3 (L5/E5)
valid_obs++;
}
}
else // the ephemeris are not available for this SV
{
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
}
}
}
else
{
// 3. If not found, insert the GPS L2 ephemeris and the observation
//convert ephemeris from GNSS-SDR class to RTKLIB structure
eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second);
//convert observation from GNSS-SDR class to RTKLIB structure
obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
gnss_observables_iter->second,
gps_cnav_ephemeris_iter->second.i_GPS_week,
1);//Band 2 (L2)
valid_obs++;
}
break;
}
else // the ephemeris are not available for this SV
case 'G':
{
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
// GPS L1
// 1 GPS - find the ephemeris for the current GPS SV observation. The SV PRN ID is the map key
std::string sig_(gnss_observables_iter->second.Signal);
if(sig_.compare("1C") == 0)
{
gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (gps_ephemeris_iter != gps_ephemeris_map.cend())
{
//convert ephemeris from GNSS-SDR class to RTKLIB structure
eph_data[valid_obs] = eph_to_rtklib(gps_ephemeris_iter->second);
//convert observation from GNSS-SDR class to RTKLIB structure
obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
gnss_observables_iter->second,
gps_ephemeris_iter->second.i_GPS_week,
0);
valid_obs++;
}
else // the ephemeris are not available for this SV
{
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->first;
}
}
//GPS L2
if(sig_.compare("2S") == 0)
{
gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.cend())
{
// 1. Find the same satellite in GPS L1 band
gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (gps_ephemeris_iter != gps_ephemeris_map.cend())
{
// 2. If found, replace the existing GPS L1 ephemeris with the GPS L2 ephemeris
// (more precise!), and attach the L2 observation to the L1 observation in RTKLIB structure
for (int i = 0; i < valid_obs; i++)
{
if (eph_data[i].sat == static_cast<int>(gnss_observables_iter->second.PRN))
{
eph_data[i] = eph_to_rtklib(gps_cnav_ephemeris_iter->second);
obs_data[i] = insert_obs_to_rtklib(obs_data[i],
gnss_observables_iter->second,
gps_cnav_ephemeris_iter->second.i_GPS_week,
1);//Band 2 (L2)
break;
}
}
}
else
{
// 3. If not found, insert the GPS L2 ephemeris and the observation
//convert ephemeris from GNSS-SDR class to RTKLIB structure
eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second);
//convert observation from GNSS-SDR class to RTKLIB structure
obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
gnss_observables_iter->second,
gps_cnav_ephemeris_iter->second.i_GPS_week,
1);//Band 2 (L2)
valid_obs++;
}
}
else // the ephemeris are not available for this SV
{
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
}
}
break;
}
default :
DLOG(INFO) << "Hybrid observables: Unknown GNSS";
break;
}
break;
}
default :
DLOG(INFO) << "Hybrid observables: Unknown GNSS";
break;
}
}
// **********************************************************************
// ****** SOLVE PVT******************************************************
// **********************************************************************
// **********************************************************************
// ****** SOLVE PVT******************************************************
// **********************************************************************
b_valid_position = false;
if (valid_obs > 0)
this->set_valid_position(false);
if (valid_obs > 0)
{
int result = 0;
nav_t nav_data;
nav_data.eph = eph_data;
nav_data.n = valid_obs;
for (int i = 0; i < MAXSAT; i++)
{
nav_data.lam[i][0] = SPEED_OF_LIGHT / FREQ1; /* L1/E1 */
nav_data.lam[i][1] = SPEED_OF_LIGHT / FREQ2; /* L2 */
nav_data.lam[i][2] = SPEED_OF_LIGHT / FREQ5; /* L5/E5 */
}
{
nav_data.lam[i][0] = SPEED_OF_LIGHT / FREQ1; /* L1/E1 */
nav_data.lam[i][1] = SPEED_OF_LIGHT / FREQ2; /* L2 */
nav_data.lam[i][2] = SPEED_OF_LIGHT / FREQ5; /* L5/E5 */
}
result = rtkpos(&rtk_, obs_data, valid_obs, &nav_data);
if(result == 0)
{
LOG(INFO) << "RTKLIB rtkpos error message: " << rtk_.errbuf;
d_rx_dt_s = 0; //reset rx time estimation
d_valid_observations = 0;
}
else
{
d_valid_observations = rtk_.sol.ns; //record the number of valid satellites used by the PVT solver
pvt_sol = rtk_.sol;
b_valid_position = true;
arma::vec rx_position_and_time(4);
rx_position_and_time(0) = pvt_sol.rr[0];
rx_position_and_time(1) = pvt_sol.rr[1];
rx_position_and_time(2) = pvt_sol.rr[2];
rx_position_and_time(3) = pvt_sol.dtr[0];
d_rx_pos = rx_position_and_time.rows(0, 2); // save ECEF position for the next iteration
d_rx_dt_s += rx_position_and_time(3) / GPS_C_m_s; // accumulate the rx time error for the next iteration [meters]->[seconds]
DLOG(INFO) << "RTKLIB Position at TOW=" << Rx_time << " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time;
boost::posix_time::ptime p_time;
gtime_t rtklib_utc_time = gpst2utc(pvt_sol.time);
p_time = boost::posix_time::from_time_t(rtklib_utc_time.time);
p_time+=boost::posix_time::microseconds(round(rtklib_utc_time.sec * 1e6));
d_position_UTC_time = p_time;
cart2geo(static_cast<double>(rx_position_and_time(0)), static_cast<double>(rx_position_and_time(1)), static_cast<double>(rx_position_and_time(2)), 4);
DLOG(INFO) << "RTKLIB Position at " << boost::posix_time::to_simple_string(p_time)
<< " is Lat = " << d_latitude_d << " [deg], Long = " << d_longitude_d
<< " [deg], Height= " << d_height_m << " [m]" << " RX time offset= " << d_rx_dt_s << " [s]";
// ######## LOG FILE #########
if(d_flag_dump_enabled == true)
{
// MULTIPLEXED FILE RECORDING - Record results to file
try
{
double tmp_double;
// PVT GPS time
tmp_double = Rx_time;
d_dump_file.write((char*)&tmp_double, sizeof(double));
// ECEF User Position East [m]
tmp_double = rx_position_and_time(0);
d_dump_file.write((char*)&tmp_double, sizeof(double));
// ECEF User Position North [m]
tmp_double = rx_position_and_time(1);
d_dump_file.write((char*)&tmp_double, sizeof(double));
// ECEF User Position Up [m]
tmp_double = rx_position_and_time(2);
d_dump_file.write((char*)&tmp_double, sizeof(double));
// User clock offset [s]
tmp_double = rx_position_and_time(3);
d_dump_file.write((char*)&tmp_double, sizeof(double));
// GEO user position Latitude [deg]
tmp_double = d_latitude_d;
d_dump_file.write((char*)&tmp_double, sizeof(double));
// GEO user position Longitude [deg]
tmp_double = d_longitude_d;
d_dump_file.write((char*)&tmp_double, sizeof(double));
// GEO user position Height [m]
tmp_double = d_height_m;
d_dump_file.write((char*)&tmp_double, sizeof(double));
}
catch (const std::ifstream::failure& e)
{
LOG(WARNING) << "Exception writing PVT LS dump file " << e.what();
}
LOG(INFO) << "RTKLIB rtkpos error message: " << rtk_.errbuf;
this->set_time_offset_s(0.0); //reset rx time estimation
this->set_num_valid_observations(0);
}
else
{
this->set_num_valid_observations(rtk_.sol.ns); //record the number of valid satellites used by the PVT solver
pvt_sol = rtk_.sol;
this->set_valid_position(true);
arma::vec rx_position_and_time(4);
rx_position_and_time(0) = pvt_sol.rr[0];
rx_position_and_time(1) = pvt_sol.rr[1];
rx_position_and_time(2) = pvt_sol.rr[2];
rx_position_and_time(3) = pvt_sol.dtr[0];
this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration
double offset_s = this->get_time_offset_s();
this->set_time_offset_s(offset_s + (rx_position_and_time(3) / GPS_C_m_s)); // accumulate the rx time error for the next iteration [meters]->[seconds]
DLOG(INFO) << "RTKLIB Position at TOW=" << Rx_time << " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time;
boost::posix_time::ptime p_time;
gtime_t rtklib_utc_time = gpst2utc(pvt_sol.time);
p_time = boost::posix_time::from_time_t(rtklib_utc_time.time);
p_time += boost::posix_time::microseconds(round(rtklib_utc_time.sec * 1e6));
this->set_position_UTC_time(p_time);
cart2geo(static_cast<double>(rx_position_and_time(0)), static_cast<double>(rx_position_and_time(1)), static_cast<double>(rx_position_and_time(2)), 4);
DLOG(INFO) << "RTKLIB Position at " << boost::posix_time::to_simple_string(p_time)
<< " is Lat = " << this->get_latitude() << " [deg], Long = " << this->get_longitude()
<< " [deg], Height= " << this->get_height() << " [m]" << " RX time offset= " << this->get_time_offset_s() << " [s]";
// ######## LOG FILE #########
if(d_flag_dump_enabled == true)
{
// MULTIPLEXED FILE RECORDING - Record results to file
try
{
double tmp_double;
// PVT GPS time
tmp_double = Rx_time;
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
// ECEF User Position East [m]
tmp_double = rx_position_and_time(0);
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
// ECEF User Position North [m]
tmp_double = rx_position_and_time(1);
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
// ECEF User Position Up [m]
tmp_double = rx_position_and_time(2);
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
// User clock offset [s]
tmp_double = rx_position_and_time(3);
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
// GEO user position Latitude [deg]
tmp_double = this->get_latitude();
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
// GEO user position Longitude [deg]
tmp_double = this->get_longitude();
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
// GEO user position Height [m]
tmp_double = this->get_height();
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
}
catch (const std::ifstream::failure& e)
{
LOG(WARNING) << "Exception writing PVT LS dump file " << e.what();
}
}
}
}
}
return b_valid_position;
}
return this->is_valid_position();
}

View File

@ -71,17 +71,21 @@
class rtklib_solver : public Pvt_Solution
{
private:
rtk_t rtk_;
std::string d_dump_filename;
std::ofstream d_dump_file;
sol_t pvt_sol;
bool d_flag_dump_enabled;
int d_nchannels; // Number of available channels for positioning
public:
rtklib_solver(int nchannels,std::string dump_filename, bool flag_dump_to_file, rtk_t & rtk);
rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, rtk_t & rtk);
~rtklib_solver();
bool get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, double Rx_time, bool flag_averaging);
int d_nchannels; //!< Number of available channels for positioning
bool get_PVT(const std::map<int,Gnss_Synchro> & gnss_observables_map, double Rx_time, bool flag_averaging);
std::map<int,Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris
std::map<int,Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris
std::map<int,Gps_CNAV_Ephemeris> gps_cnav_ephemeris_map;
std::map<int,Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris
std::map<int,Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris
std::map<int,Gps_CNAV_Ephemeris> gps_cnav_ephemeris_map; //!< Map storing new GPS_CNAV_Ephemeris
Galileo_Utc_Model galileo_utc_model;
Galileo_Iono galileo_iono;
@ -94,14 +98,6 @@ public:
Gps_CNAV_Utc_Model gps_cnav_utc_model;
int count_valid_position;
bool d_flag_dump_enabled;
sol_t pvt_sol;
rtk_t rtk_;
std::string d_dump_filename;
std::ofstream d_dump_file;
};
#endif

View File

@ -18,5 +18,7 @@
add_subdirectory(adapters)
add_subdirectory(gnuradio_blocks)
#add_subdirectory(libs)
if(ENABLE_FPGA)
add_subdirectory(libs)
endif(ENABLE_FPGA)

View File

@ -19,7 +19,6 @@
set(ACQ_ADAPTER_SOURCES
gps_l1_ca_pcps_acquisition.cc
gps_l1_ca_pcps_multithread_acquisition.cc
gps_l1_ca_pcps_assisted_acquisition.cc
gps_l1_ca_pcps_acquisition_fine_doppler.cc
gps_l1_ca_pcps_tong_acquisition.cc
@ -42,7 +41,7 @@ if(OPENCL_FOUND)
endif(OPENCL_FOUND)
include_directories(
$(CMAKE_CURRENT_SOURCE_DIR)
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/core/system_parameters
${CMAKE_SOURCE_DIR}/src/core/interfaces
${CMAKE_SOURCE_DIR}/src/core/receiver

View File

@ -53,7 +53,8 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
item_type_ = configuration_->property(role + ".item_type",
default_item_type);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
if_ = configuration_->property(role + ".if", 0);
dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
@ -61,10 +62,10 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
if (sampled_ms_ % 4 != 0)
{
sampled_ms_ = (int)(sampled_ms_/4) * 4;
sampled_ms_ = static_cast<int>(sampled_ms_ / 4) * 4;
LOG(WARNING) << "coherent_integration_time should be multiple of "
<< "Galileo code length (4 ms). coherent_integration_time = "
<< sampled_ms_ << " ms will be used.";
<< "Galileo code length (4 ms). coherent_integration_time = "
<< sampled_ms_ << " ms will be used.";
}
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
@ -73,13 +74,12 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
default_dump_filename);
//--- Find number of samples per spreading code (4 ms) -----------------
code_length_ = round(
fs_in_
/ (Galileo_E1_CODE_CHIP_RATE_HZ
/ Galileo_E1_B_CODE_LENGTH_CHIPS));
vector_length_ = code_length_ * (int)(sampled_ms_/4);
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);
int samples_per_ms = code_length_ / 4;
@ -198,7 +198,7 @@ signed int GalileoE1Pcps8msAmbiguousAcquisition::mag()
void GalileoE1Pcps8msAmbiguousAcquisition::init()
{
acquisition_cc_->init();
set_local_code();
//set_local_code();
}
@ -239,7 +239,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::reset()
float GalileoE1Pcps8msAmbiguousAcquisition::calculate_threshold(float pfa)
{
unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
{
frequency_bins++;
}
@ -251,7 +251,7 @@ float GalileoE1Pcps8msAmbiguousAcquisition::calculate_threshold(float pfa)
double val = pow(1.0 - pfa,exponent);
double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val);
float threshold = static_cast<float>(quantile(mydist,val));
return threshold;
}

View File

@ -54,7 +54,7 @@ public:
virtual ~GalileoE1Pcps8msAmbiguousAcquisition();
std::string role()
inline std::string role() override
{
return role_;
}
@ -62,66 +62,67 @@ public:
/*!
* \brief Returns "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition"
*/
std::string implementation()
inline std::string implementation() override
{
return "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition";
}
size_t item_size()
inline size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
/*!
* \brief Set acquisition channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set statistics threshold of PCPS algorithm
*/
void set_threshold(float threshold);
void set_threshold(float threshold) override;
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(unsigned int doppler_max);
void set_doppler_max(unsigned int doppler_max) override;
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(unsigned int doppler_step);
void set_doppler_step(unsigned int doppler_step) override;
/*!
* \brief Initializes acquisition algorithm.
*/
void init();
void init() override;
/*!
* \brief Sets local code for Galileo E1 PCPS acquisition algorithm.
*/
void set_local_code();
void set_local_code() override;
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag();
signed int mag() override;
/*!
* \brief Restart acquisition algorithm
*/
void reset();
void reset() override;
private:
ConfigurationInterface* configuration_;

View File

@ -52,15 +52,17 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
item_type_ = configuration_->property(role + ".item_type", default_item_type);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
if_ = configuration_->property(role + ".if", 0);
dump_ = configuration_->property(role + ".dump", false);
blocking_ = configuration_->property(role + ".blocking", true);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
if (sampled_ms_ % 4 != 0)
{
sampled_ms_ = (int)(sampled_ms_ / 4) * 4;
sampled_ms_ = static_cast<int>(sampled_ms_ / 4) * 4;
LOG(WARNING) << "coherent_integration_time should be multiple of "
<< "Galileo code length (4 ms). coherent_integration_time = "
<< sampled_ms_ << " ms will be used.";
@ -90,15 +92,19 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
item_size_ = sizeof(lv_16sc_t);
acquisition_sc_ = pcps_make_acquisition_sc(sampled_ms_, max_dwells_,
doppler_max_, if_, fs_in_, samples_per_ms, code_length_,
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, dump_filename_);
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_,
dump_filename_);
DLOG(INFO) << "acquisition(" << acquisition_sc_->unique_id() << ")";
}else{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
doppler_max_, if_, fs_in_, samples_per_ms, code_length_,
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, dump_filename_);
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
}
else
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
doppler_max_, if_, fs_in_, samples_per_ms, code_length_,
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_,
dump_filename_);
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
}
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
@ -234,7 +240,7 @@ void GalileoE1PcpsAmbiguousAcquisition::init()
acquisition_cc_->init();
}
set_local_code();
//set_local_code();
}
@ -296,7 +302,7 @@ void GalileoE1PcpsAmbiguousAcquisition::set_state(int state)
float GalileoE1PcpsAmbiguousAcquisition::calculate_threshold(float pfa)
{
unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
{
frequency_bins++;
}
@ -308,7 +314,7 @@ float GalileoE1PcpsAmbiguousAcquisition::calculate_threshold(float pfa)
double val = pow(1.0 - pfa,exponent);
double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val);
float threshold = static_cast<float>(quantile(mydist,val));
return threshold;
}

View File

@ -58,7 +58,7 @@ public:
virtual ~GalileoE1PcpsAmbiguousAcquisition();
std::string role()
inline std::string role() override
{
return role_;
}
@ -66,66 +66,67 @@ public:
/*!
* \brief Returns "Galileo_E1_PCPS_Ambiguous_Acquisition"
*/
std::string implementation()
inline std::string implementation() override
{
return "Galileo_E1_PCPS_Ambiguous_Acquisition";
}
size_t item_size()
size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
/*!
* \brief Set acquisition channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set statistics threshold of PCPS algorithm
*/
void set_threshold(float threshold);
void set_threshold(float threshold) override;
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(unsigned int doppler_max);
void set_doppler_max(unsigned int doppler_max) override;
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(unsigned int doppler_step);
void set_doppler_step(unsigned int doppler_step) override;
/*!
* \brief Initializes acquisition algorithm.
*/
void init();
void init() override;
/*!
* \brief Sets local code for Galileo E1 PCPS acquisition algorithm.
*/
void set_local_code();
void set_local_code() override;
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag();
signed int mag() override;
/*!
* \brief Restart acquisition algorithm
*/
void reset();
void reset() override;
/*!
* \brief If state = 1, it forces the block to start acquiring from the first sample
@ -154,6 +155,7 @@ private:
long fs_in_;
long if_;
bool dump_;
bool blocking_;
std::string dump_filename_;
std::complex<float> * code_;
Gnss_Synchro * gnss_synchro_;

View File

@ -52,7 +52,8 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
item_type_ = configuration_->property(role + ".item_type", default_item_type);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
if_ = configuration_->property(role + ".if", 0);
dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
@ -200,7 +201,7 @@ signed int GalileoE1PcpsCccwsrAmbiguousAcquisition::mag()
void GalileoE1PcpsCccwsrAmbiguousAcquisition::init()
{
acquisition_cc_->init();
set_local_code();
//set_local_code();
}

View File

@ -54,7 +54,7 @@ public:
virtual ~GalileoE1PcpsCccwsrAmbiguousAcquisition();
std::string role()
inline std::string role() override
{
return role_;
}
@ -62,63 +62,64 @@ public:
/*!
* \brief Returns "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition"
*/
std::string implementation()
inline std::string implementation() override
{
return "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition";
}
size_t item_size()
inline size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
/*!
* \brief Set acquisition channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set statistics threshold of CCCWSR algorithm
*/
void set_threshold(float threshold);
void set_threshold(float threshold) override;
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(unsigned int doppler_max);
void set_doppler_max(unsigned int doppler_max) override;
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(unsigned int doppler_step);
void set_doppler_step(unsigned int doppler_step) override;
/*!
* \brief Initializes acquisition algorithm.
*/
void init();
void init() override;
void set_local_code();
void set_local_code() override;
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag();
signed int mag() override;
/*!
* \brief Restart acquisition algorithm
*/
void reset();
void reset() override;
/*!
* \brief If state = 1, it forces the block to start acquiring from the first sample

View File

@ -53,7 +53,8 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
item_type_ = configuration_->property(role + ".item_type",
default_item_type);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
if_ = configuration_->property(role + ".if", 0);
dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
@ -67,14 +68,13 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
int samples_per_ms = round(code_length_ / 4.0);
/*Calculate the folding factor value based on the formula described in the paper.
This may be a bug, but acquisition also work by variying the folding factor at va-
lues different that the expressed in the paper. In adition, it is important to point
out that by making the folding factor smaller we were able to get QuickSync work with
Galileo. Future work should be directed to test this asumption statistically.*/
//folding_factor_ = (unsigned int)ceil(sqrt(log2(code_length_)));
//folding_factor_ = static_cast<unsigned int>(ceil(sqrt(log2(code_length_))));
folding_factor_ = configuration_->property(role + ".folding_factor", 2);
if (sampled_ms_ % (folding_factor_*4) != 0)
@ -85,11 +85,11 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
if(sampled_ms_ < (folding_factor_*4))
{
sampled_ms_ = (int) (folding_factor_*4);
sampled_ms_ = static_cast<int>(folding_factor_ * 4);
}
else
{
sampled_ms_ = (int)(sampled_ms_/(folding_factor_*4)) * (folding_factor_*4);
sampled_ms_ = static_cast<int>(sampled_ms_/(folding_factor_*4)) * (folding_factor_*4);
}
LOG(WARNING) << "coherent_integration_time should be multiple of "
<< "Galileo code length (4 ms). coherent_integration_time = "
@ -240,7 +240,7 @@ void
GalileoE1PcpsQuickSyncAmbiguousAcquisition::init()
{
acquisition_cc_->init();
set_local_code();
//set_local_code();
}
@ -296,7 +296,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_state(int state)
float GalileoE1PcpsQuickSyncAmbiguousAcquisition::calculate_threshold(float pfa)
{
unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
{
frequency_bins++;
}

View File

@ -54,7 +54,7 @@ public:
virtual ~GalileoE1PcpsQuickSyncAmbiguousAcquisition();
std::string role()
inline std::string role() override
{
return role_;
}
@ -62,66 +62,67 @@ public:
/*!
* \brief Returns "Galileo_E1_PCPS_Ambiguous_Acquisition"
*/
std::string implementation()
inline std::string implementation() override
{
return "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition";
}
size_t item_size()
inline size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
/*!
* \brief Set acquisition channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set statistics threshold of PCPS algorithm
*/
void set_threshold(float threshold);
void set_threshold(float threshold) override;
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(unsigned int doppler_max);
void set_doppler_max(unsigned int doppler_max) override;
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(unsigned int doppler_step);
void set_doppler_step(unsigned int doppler_step) override;
/*!
* \brief Initializes acquisition algorithm.
*/
void init();
void init() override;
/*!
* \brief Sets local code for Galileo E1 PCPS acquisition algorithm.
*/
void set_local_code();
void set_local_code() override;
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag();
signed int mag() override;
/*!
* \brief Restart acquisition algorithm
*/
void reset();
void reset() override;
/*!
* \brief If state = 1, it forces the block to start acquiring from the first sample

View File

@ -53,7 +53,8 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
item_type_ = configuration_->property(role + ".item_type",
default_item_type);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
if_ = configuration_->property(role + ".if", 0);
dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
@ -61,11 +62,10 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
if (sampled_ms_ % 4 != 0)
{
sampled_ms_ = (int)(sampled_ms_/4) * 4;
sampled_ms_ = static_cast<int>(sampled_ms_ / 4) * 4;
LOG(WARNING) << "coherent_integration_time should be multiple of "
<< "Galileo code length (4 ms). coherent_integration_time = "
<< sampled_ms_ << " ms will be used.";
<< "Galileo code length (4 ms). coherent_integration_time = "
<< sampled_ms_ << " ms will be used.";
}
tong_init_val_ = configuration->property(role + ".tong_init_val", 1);
@ -82,7 +82,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
/ (Galileo_E1_CODE_CHIP_RATE_HZ
/ Galileo_E1_B_CODE_LENGTH_CHIPS));
vector_length_ = code_length_ * (int)(sampled_ms_/4);
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);
int samples_per_ms = code_length_ / 4;
@ -204,7 +204,7 @@ signed int GalileoE1PcpsTongAmbiguousAcquisition::mag()
void GalileoE1PcpsTongAmbiguousAcquisition::init()
{
acquisition_cc_->init();
set_local_code();
//set_local_code();
}
@ -251,7 +251,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_state(int state)
float GalileoE1PcpsTongAmbiguousAcquisition::calculate_threshold(float pfa)
{
unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
{
frequency_bins++;
}
@ -263,7 +263,7 @@ float GalileoE1PcpsTongAmbiguousAcquisition::calculate_threshold(float pfa)
double val = pow(1.0-pfa,exponent);
double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val);
float threshold = static_cast<float>(quantile(mydist,val));
return threshold;
}

View File

@ -54,7 +54,7 @@ public:
virtual ~GalileoE1PcpsTongAmbiguousAcquisition();
std::string role()
inline std::string role() override
{
return role_;
}
@ -62,66 +62,67 @@ public:
/*!
* \brief Returns "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition"
*/
std::string implementation()
inline std::string implementation() override
{
return "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition";
}
size_t item_size()
inline size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
/*!
* \brief Set acquisition channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set statistics threshold of TONG algorithm
*/
void set_threshold(float threshold);
void set_threshold(float threshold) override;
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(unsigned int doppler_max);
void set_doppler_max(unsigned int doppler_max) override;
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(unsigned int doppler_step);
void set_doppler_step(unsigned int doppler_step) override;
/*!
* \brief Initializes acquisition algorithm.
*/
void init();
void init() override;
/*!
* \brief Sets local code for Galileo E1 TONG acquisition algorithm.
*/
void set_local_code();
void set_local_code() override;
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag();
signed int mag() override;
/*!
* \brief Restart acquisition algorithm
*/
void reset();
void reset() override;
/*!
* \brief If state = 1, it forces the block to start acquiring from the first sample

View File

@ -58,7 +58,8 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
item_type_ = configuration_->property(role + ".item_type", default_item_type);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000);
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
if_ = configuration_->property(role + ".if", 0);
dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
@ -206,7 +207,7 @@ signed int GalileoE5aNoncoherentIQAcquisitionCaf::mag()
void GalileoE5aNoncoherentIQAcquisitionCaf::init()
{
acquisition_cc_->init();
set_local_code();
//set_local_code();
}
@ -282,7 +283,7 @@ float GalileoE5aNoncoherentIQAcquisitionCaf::calculate_threshold(float pfa)
{
//Calculate the threshold
unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
{
frequency_bins++;
}
@ -292,7 +293,7 @@ float GalileoE5aNoncoherentIQAcquisitionCaf::calculate_threshold(float pfa)
double val = pow(1.0 - pfa, exponent);
double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val);
float threshold = static_cast<float>(quantile(mydist,val));
return threshold;
}

View File

@ -55,7 +55,7 @@ public:
virtual ~GalileoE5aNoncoherentIQAcquisitionCaf();
std::string role()
inline std::string role() override
{
return role_;
}
@ -63,67 +63,67 @@ public:
/*!
* \brief Returns "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF"
*/
std::string implementation()
inline std::string implementation() override
{
return "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF";
}
size_t item_size()
inline size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
/*!
* \brief Set acquisition channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set statistics threshold of PCPS algorithm
*/
void set_threshold(float threshold);
void set_threshold(float threshold) override;
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(unsigned int doppler_max);
void set_doppler_max(unsigned int doppler_max) override;
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(unsigned int doppler_step);
void set_doppler_step(unsigned int doppler_step) override;
/*!
* \brief Initializes acquisition algorithm.
*/
void init();
void init() override;
/*!
* \brief Sets local Galileo E5a code for PCPS acquisition algorithm.
*/
void set_local_code();
void set_local_code() override;
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag();
signed int mag() override;
/*!
* \brief Restart acquisition algorithm
*/
void reset();
void reset() override;
/*!
* \brief If set to 1, ensures that acquisition starts at the

View File

@ -55,10 +55,11 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", default_item_type);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
if_ = configuration_->property(role + ".if", 0);
dump_ = configuration_->property(role + ".dump", false);
blocking_ = configuration_->property(role + ".blocking", true);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
@ -86,15 +87,16 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
item_size_ = sizeof(lv_16sc_t);
acquisition_sc_ = pcps_make_acquisition_sc(sampled_ms_, max_dwells_,
doppler_max_, if_, fs_in_, code_length_, code_length_,
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, dump_filename_);
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_);
DLOG(INFO) << "acquisition(" << acquisition_sc_->unique_id() << ")";
}else{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
doppler_max_, if_, fs_in_, code_length_, code_length_,
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, dump_filename_);
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
}
else
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
doppler_max_, if_, fs_in_, code_length_, code_length_,
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_);
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
}
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
@ -130,7 +132,6 @@ void GpsL1CaPcpsAcquisition::set_channel(unsigned int channel)
{
acquisition_cc_->set_channel(channel_);
}
}
@ -188,9 +189,9 @@ void GpsL1CaPcpsAcquisition::set_doppler_step(unsigned int doppler_step)
{
acquisition_cc_->set_doppler_step(doppler_step_);
}
}
void GpsL1CaPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{
gnss_synchro_ = gnss_synchro;
@ -230,13 +231,12 @@ void GpsL1CaPcpsAcquisition::init()
acquisition_cc_->init();
}
set_local_code();
//set_local_code();
}
void GpsL1CaPcpsAcquisition::set_local_code()
{
std::complex<float>* code = new std::complex<float>[code_length_];
gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0);
@ -291,7 +291,7 @@ float GpsL1CaPcpsAcquisition::calculate_threshold(float pfa)
{
//Calculate the threshold
unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
{
frequency_bins++;
}
@ -301,7 +301,7 @@ float GpsL1CaPcpsAcquisition::calculate_threshold(float pfa)
double val = pow(1.0 - pfa, exponent);
double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val);
float threshold = static_cast<float>(quantile(mydist,val));
return threshold;
}

View File

@ -63,7 +63,7 @@ public:
virtual ~GpsL1CaPcpsAcquisition();
std::string role()
inline std::string role() override
{
return role_;
}
@ -71,66 +71,67 @@ public:
/*!
* \brief Returns "GPS_L1_CA_PCPS_Acquisition"
*/
std::string implementation()
inline std::string implementation() override
{
return "GPS_L1_CA_PCPS_Acquisition";
}
size_t item_size()
inline size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
/*!
* \brief Set acquisition channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set statistics threshold of PCPS algorithm
*/
void set_threshold(float threshold);
void set_threshold(float threshold) override;
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(unsigned int doppler_max);
void set_doppler_max(unsigned int doppler_max) override;
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(unsigned int doppler_step);
void set_doppler_step(unsigned int doppler_step) override;
/*!
* \brief Initializes acquisition algorithm.
*/
void init();
void init() override;
/*!
* \brief Sets local code for GPS L1/CA PCPS acquisition algorithm.
*/
void set_local_code();
void set_local_code() override;
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag();
signed int mag() override;
/*!
* \brief Restart acquisition algorithm
*/
void reset();
void reset() override;
/*!
* \brief If state = 1, it forces the block to start acquiring from the first sample
@ -159,6 +160,7 @@ private:
long fs_in_;
long if_;
bool dump_;
bool blocking_;
std::string dump_filename_;
std::complex<float> * code_;
Gnss_Synchro * gnss_synchro_;

View File

@ -51,7 +51,8 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
DLOG(INFO) << "role " << role;
item_type_ = configuration->property(role + ".item_type", default_item_type);
fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
long fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
if_ = configuration->property(role + ".if", 0);
dump_ = configuration->property(role + ".dump", false);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
@ -136,7 +137,7 @@ signed int GpsL1CaPcpsAcquisitionFineDoppler::mag()
void GpsL1CaPcpsAcquisitionFineDoppler::init()
{
acquisition_cc_->init();
set_local_code();
//set_local_code();
}

View File

@ -56,7 +56,7 @@ public:
virtual ~GpsL1CaPcpsAcquisitionFineDoppler();
std::string role()
inline std::string role() override
{
return role_;
}
@ -64,63 +64,64 @@ public:
/*!
* \brief Returns "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler"
*/
std::string implementation()
inline std::string implementation() override
{
return "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler";
}
size_t item_size()
inline size_t item_size() override
{
return item_size_;
}
void connect(boost::shared_ptr<gr::top_block> top_block);
void disconnect(boost::shared_ptr<gr::top_block> top_block);
boost::shared_ptr<gr::basic_block> get_left_block();
boost::shared_ptr<gr::basic_block> get_right_block();
void connect(boost::shared_ptr<gr::top_block> top_block) override;
void disconnect(boost::shared_ptr<gr::top_block> top_block) override;
boost::shared_ptr<gr::basic_block> get_left_block() override;
boost::shared_ptr<gr::basic_block> get_right_block() override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
/*!
* \brief Set acquisition channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set statistics threshold of PCPS algorithm
*/
void set_threshold(float threshold);
void set_threshold(float threshold) override;
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(unsigned int doppler_max);
void set_doppler_max(unsigned int doppler_max) override;
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(unsigned int doppler_step);
void set_doppler_step(unsigned int doppler_step) override;
/*!
* \brief Initializes acquisition algorithm.
*/
void init();
void init() override;
void set_local_code();
void set_local_code() override;
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag();
signed int mag() override;
/*!
* \brief Restart acquisition algorithm
*/
void reset();
void reset() override;
private:
pcps_acquisition_fine_doppler_cc_sptr acquisition_cc_;

View File

@ -32,20 +32,31 @@
*/
#include "gps_l1_ca_pcps_acquisition_fpga.h"
#include <stdexcept>
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
#include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h"
#include "configuration_interface.h"
using google::LogMessage;
GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) :
role_(role), in_streams_(in_streams), out_streams_(out_streams)
role_(role), in_streams_(in_streams), out_streams_(out_streams)
{
unsigned int code_length;
bool bit_transition_flag;
bool use_CFAR_algorithm_flag;
unsigned int sampled_ms;
long fs_in;
long ifreq;
bool dump;
std::string dump_filename;
unsigned int nsamples_total;
unsigned int select_queue_Fpga;
std::string device_name;
configuration_ = configuration;
std::string default_item_type = "cshort";
@ -55,57 +66,62 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
item_type_ = configuration_->property(role + ".item_type", default_item_type);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
if_ = configuration_->property(role + ".if", 0);
dump_ = configuration_->property(role + ".dump", false);
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
ifreq = configuration_->property(role + ".if", 0);
dump = configuration_->property(role + ".dump", false);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1);
// note : the FPGA is implemented according to bit transition flag = 0. Setting bit transition flag to 1 has no effect.
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
bit_transition_flag = configuration_->property(role + ".bit_transition_flag", false);
// note : the FPGA is implemented according to use_CFAR_algorithm = 0. Setting use_CFAR_algorithm to 1 has no effect.
use_CFAR_algorithm_flag_=configuration_->property(role + ".use_CFAR_algorithm", false);
use_CFAR_algorithm_flag = configuration_->property(role + ".use_CFAR_algorithm", false);
// note : the FPGA does not use the max_dwells variable.
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
dump_filename = configuration_->property(role + ".dump_filename", default_dump_filename);
//--- Find number of samples per spreading code -------------------------
code_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
code_length = round(
fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
// code length has the same value as d_fft_size
float nbits;
nbits = ceilf(log2f(code_length_));
nsamples_total_ = pow(2,nbits);
float nbits;
nbits = ceilf(log2f(code_length));
nsamples_total = pow(2, nbits);
//vector_length_ = code_length_ * sampled_ms_;
vector_length_ = nsamples_total_ * sampled_ms_;
vector_length_ = nsamples_total * sampled_ms;
// if( bit_transition_flag_ )
// {
// vector_length_ *= 2;
// }
if( bit_transition_flag_ )
{
vector_length_ *= 2;
}
select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga", 0);
code_ = new gr_complex[vector_length_];
std::string default_device_name = "/dev/uio0";
device_name = configuration_->property(role + ".devicename", default_device_name);
select_queue_Fpga_ = configuration_->property(role + ".select_queue_Fpga", 0);
if (item_type_.compare("cshort") == 0 )
if (item_type_.compare("cshort") == 0)
{
item_size_ = sizeof(lv_16sc_t);
gps_acquisition_fpga_sc_ = gps_pcps_make_acquisition_fpga_sc(sampled_ms_, max_dwells_,
doppler_max_, if_, fs_in_, code_length_, code_length_, vector_length_,
bit_transition_flag_, use_CFAR_algorithm_flag_, select_queue_Fpga_, dump_, dump_filename_);
DLOG(INFO) << "acquisition(" << gps_acquisition_fpga_sc_->unique_id() << ")";
gps_acquisition_fpga_sc_ = gps_pcps_make_acquisition_fpga_sc(
sampled_ms, max_dwells_, doppler_max_, ifreq, fs_in,
code_length, code_length, vector_length_, nsamples_total,
bit_transition_flag, use_CFAR_algorithm_flag,
select_queue_Fpga, device_name, dump, dump_filename);
DLOG(INFO) << "acquisition("
<< gps_acquisition_fpga_sc_->unique_id() << ")";
}
else
{
LOG(WARNING) << "item_type configured to " << item_type_ << "but FPGA implementation only accepts cshort";
throw std::invalid_argument( "Wrong input_type configuration. Should be cshort" );
}
else{
LOG(FATAL) << item_type_ << " FPGA only accepts chsort";
}
channel_ = 0;
threshold_ = 0.0;
@ -116,16 +132,13 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
GpsL1CaPcpsAcquisitionFpga::~GpsL1CaPcpsAcquisitionFpga()
{
delete[] code_;
}
void GpsL1CaPcpsAcquisitionFpga::set_channel(unsigned int channel)
{
channel_ = channel;
gps_acquisition_fpga_sc_->set_channel(channel_);
}
@ -133,7 +146,7 @@ void GpsL1CaPcpsAcquisitionFpga::set_threshold(float threshold)
{
float pfa = configuration_->property(role_ + ".pfa", 0.0);
if(pfa == 0.0)
if (pfa == 0.0)
{
threshold_ = threshold;
}
@ -143,101 +156,68 @@ void GpsL1CaPcpsAcquisitionFpga::set_threshold(float threshold)
}
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
gps_acquisition_fpga_sc_->set_threshold(threshold_);
}
void GpsL1CaPcpsAcquisitionFpga::set_doppler_max(unsigned int doppler_max)
{
doppler_max_ = doppler_max;
gps_acquisition_fpga_sc_->set_doppler_max(doppler_max_);
}
void GpsL1CaPcpsAcquisitionFpga::set_doppler_step(unsigned int doppler_step)
{
doppler_step_ = doppler_step;
gps_acquisition_fpga_sc_->set_doppler_step(doppler_step_);
}
void GpsL1CaPcpsAcquisitionFpga::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{
gnss_synchro_ = gnss_synchro;
gps_acquisition_fpga_sc_->set_gnss_synchro(gnss_synchro_);
}
signed int GpsL1CaPcpsAcquisitionFpga::mag()
{
return gps_acquisition_fpga_sc_->mag();
return gps_acquisition_fpga_sc_->mag();
}
void GpsL1CaPcpsAcquisitionFpga::init()
{
gps_acquisition_fpga_sc_->init();
gps_acquisition_fpga_sc_->init();
set_local_code();
}
void GpsL1CaPcpsAcquisitionFpga::set_local_code()
{
std::complex<float>* code = new std::complex<float>[vector_length_];
//init to zeros for the zero padding of the fft
for (uint s=0;s<vector_length_;s++)
{
code[s] = std::complex<float>(0, 0);
}
gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_ , 0);
for (unsigned int i = 0; i < sampled_ms_; i++)
{
memcpy(&(code_[i*vector_length_]), code, sizeof(gr_complex)*vector_length_);
}
gps_acquisition_fpga_sc_->set_local_code(code_);
delete[] code;
gps_acquisition_fpga_sc_->set_local_code();
}
void GpsL1CaPcpsAcquisitionFpga::reset()
{
gps_acquisition_fpga_sc_->set_active(true);
gps_acquisition_fpga_sc_->set_active(true);
}
void GpsL1CaPcpsAcquisitionFpga::set_state(int state)
{
gps_acquisition_fpga_sc_->set_state(state);
gps_acquisition_fpga_sc_->set_state(state);
}
float GpsL1CaPcpsAcquisitionFpga::calculate_threshold(float pfa)
{
//Calculate the threshold
unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_);
doppler += doppler_step_)
{
frequency_bins++;
}
@ -246,39 +226,31 @@ float GpsL1CaPcpsAcquisitionFpga::calculate_threshold(float pfa)
double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent);
double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val);
boost::math::exponential_distribution<double> mydist(lambda);
float threshold = static_cast<float>(quantile(mydist, val));
return threshold;
}
void GpsL1CaPcpsAcquisitionFpga::connect(gr::top_block_sptr top_block)
{
//nothing to connect
//nothing to connect
}
void GpsL1CaPcpsAcquisitionFpga::disconnect(gr::top_block_sptr top_block)
{
//nothing to disconnect
//nothing to disconnect
}
gr::basic_block_sptr GpsL1CaPcpsAcquisitionFpga::get_left_block()
{
return gps_acquisition_fpga_sc_;
return gps_acquisition_fpga_sc_;
}
gr::basic_block_sptr GpsL1CaPcpsAcquisitionFpga::get_right_block()
{
return gps_acquisition_fpga_sc_;
return gps_acquisition_fpga_sc_;
}

View File

@ -43,15 +43,13 @@
#include "complex_byte_to_float_x2.h"
#include <volk_gnsssdr/volk_gnsssdr.h>
class ConfigurationInterface;
/*!
* \brief This class adapts a PCPS acquisition block to an AcquisitionInterface
* for GPS L1 C/A signals
*/
class GpsL1CaPcpsAcquisitionFpga: public AcquisitionInterface
class GpsL1CaPcpsAcquisitionFpga : public AcquisitionInterface
{
public:
GpsL1CaPcpsAcquisitionFpga(ConfigurationInterface* configuration,
@ -60,7 +58,7 @@ public:
virtual ~GpsL1CaPcpsAcquisitionFpga();
std::string role()
inline std::string role() override
{
return role_;
}
@ -68,66 +66,67 @@ public:
/*!
* \brief Returns "GPS_L1_CA_PCPS_Acquisition"
*/
std::string implementation()
inline std::string implementation() override
{
return "GPS_L1_CA_PCPS_Acquisition_Fpga";
}
size_t item_size()
inline size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
/*!
* \brief Set acquisition channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set statistics threshold of PCPS algorithm
*/
void set_threshold(float threshold);
void set_threshold(float threshold) override;
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(unsigned int doppler_max);
void set_doppler_max(unsigned int doppler_max) override;
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(unsigned int doppler_step);
void set_doppler_step(unsigned int doppler_step) override;
/*!
* \brief Initializes acquisition algorithm.
*/
void init();
void init() override;
/*!
* \brief Sets local code for GPS L1/CA PCPS acquisition algorithm.
*/
void set_local_code();
void set_local_code() override;
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag();
signed int mag() override;
/*!
* \brief Restart acquisition algorithm
*/
void reset();
void reset() override;
/*!
* \brief If state = 1, it forces the block to start acquiring from the first sample
@ -137,35 +136,19 @@ public:
private:
ConfigurationInterface* configuration_;
gps_pcps_acquisition_fpga_sc_sptr gps_acquisition_fpga_sc_;
gr::blocks::stream_to_vector::sptr stream_to_vector_;
gr::blocks::float_to_complex::sptr float_to_complex_;
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
size_t item_size_;
std::string item_type_;
unsigned int vector_length_;
unsigned int code_length_;
bool bit_transition_flag_;
bool use_CFAR_algorithm_flag_;
unsigned int channel_;
float threshold_;
unsigned int doppler_max_;
unsigned int doppler_step_;
unsigned int sampled_ms_;
unsigned int max_dwells_;
long fs_in_;
long if_;
bool dump_;
std::string dump_filename_;
std::complex<float> * code_;
Gnss_Synchro * gnss_synchro_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
unsigned int nsamples_total_;
unsigned int select_queue_Fpga_;
float calculate_threshold(float pfa);
};

View File

@ -51,7 +51,8 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
DLOG(INFO) << "role " << role;
item_type_ = configuration->property(role + ".item_type", default_item_type);
fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
long fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
if_ = configuration->property(role + ".if", 0);
dump_ = configuration->property(role + ".dump", false);
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
@ -72,7 +73,6 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
acquisition_cc_ = pcps_make_assisted_acquisition_cc(max_dwells_, sampled_ms_,
doppler_max_, doppler_min_, if_, fs_in_, vector_length_,
dump_, dump_filename_);
}
else
{
@ -137,7 +137,7 @@ signed int GpsL1CaPcpsAssistedAcquisition::mag()
void GpsL1CaPcpsAssistedAcquisition::init()
{
acquisition_cc_->init();
set_local_code();
//set_local_code();
}
void GpsL1CaPcpsAssistedAcquisition::set_local_code()

View File

@ -56,7 +56,7 @@ public:
virtual ~GpsL1CaPcpsAssistedAcquisition();
std::string role()
inline std::string role() override
{
return role_;
}
@ -64,63 +64,64 @@ public:
/*!
* \brief Returns "GPS_L1_CA_PCPS_Assisted_Acquisition"
*/
std::string implementation()
inline std::string implementation() override
{
return "GPS_L1_CA_PCPS_Assisted_Acquisition";
}
size_t item_size()
inline size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
/*!
* \brief Set acquisition channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set statistics threshold of PCPS algorithm
*/
void set_threshold(float threshold);
void set_threshold(float threshold) override;
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(unsigned int doppler_max);
void set_doppler_max(unsigned int doppler_max) override;
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(unsigned int doppler_step);
void set_doppler_step(unsigned int doppler_step) override;
/*!
* \brief Initializes acquisition algorithm.
*/
void init();
void init() override;
void set_local_code();
void set_local_code() override;
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag();
signed int mag() override;
/*!
* \brief Restart acquisition algorithm
*/
void reset();
void reset() override;
private:
pcps_assisted_acquisition_cc_sptr acquisition_cc_;

View File

@ -1,286 +0,0 @@
/*!
* \file gps_l1_ca_pcps_multithread_acquisition.cc
* \brief Adapts a multithread PCPS acquisition block to an
* AcquisitionInterface for GPS L1 C/A signals
* \author Marc Molina, 2013. marc.molina.pena(at)gmail.com
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#include "gps_l1_ca_pcps_multithread_acquisition.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
#include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h"
#include "configuration_interface.h"
using google::LogMessage;
GpsL1CaPcpsMultithreadAcquisition::GpsL1CaPcpsMultithreadAcquisition(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) :
role_(role), in_streams_(in_streams), out_streams_(out_streams)
{
configuration_ = configuration;
std::string default_item_type = "gr_complex";
std::string default_dump_filename = "./data/acquisition.dat";
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type",
default_item_type);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
if_ = configuration_->property(role + ".if", 0);
dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
bit_transition_flag_ = configuration_->property("Acquisition.bit_transition_flag", false);
if (!bit_transition_flag_)
{
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
}
else
{
max_dwells_ = 2;
}
dump_filename_ = configuration_->property(role + ".dump_filename",
default_dump_filename);
//--- Find number of samples per spreading code -------------------------
code_length_ = round(fs_in_
/ (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
vector_length_ = code_length_ * sampled_ms_;
code_ = new gr_complex[vector_length_];
if (item_type_.compare("gr_complex") == 0)
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_make_multithread_acquisition_cc(sampled_ms_, max_dwells_,
doppler_max_, if_, fs_in_, code_length_, code_length_,
bit_transition_flag_, dump_, dump_filename_);
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id()
<< ")";
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id()
<< ")";
}
else
{
item_size_ = sizeof(gr_complex);
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}
channel_ = 0;
threshold_ = 0.0;
doppler_step_ = 0;
gnss_synchro_ = 0;
}
GpsL1CaPcpsMultithreadAcquisition::~GpsL1CaPcpsMultithreadAcquisition()
{
delete[] code_;
}
void GpsL1CaPcpsMultithreadAcquisition::set_channel(unsigned int channel)
{
channel_ = channel;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_channel(channel_);
}
}
void GpsL1CaPcpsMultithreadAcquisition::set_threshold(float threshold)
{
float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
if(pfa == 0.0)
{
pfa = configuration_->property(role_+".pfa", 0.0);
}
if(pfa == 0.0)
{
threshold_ = threshold;
}
else
{
threshold_ = calculate_threshold(pfa);
}
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_threshold(threshold_);
}
}
void GpsL1CaPcpsMultithreadAcquisition::set_doppler_max(unsigned int doppler_max)
{
doppler_max_ = doppler_max;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_doppler_max(doppler_max_);
}
}
void GpsL1CaPcpsMultithreadAcquisition::set_doppler_step(unsigned int doppler_step)
{
doppler_step_ = doppler_step;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_doppler_step(doppler_step_);
}
}
void GpsL1CaPcpsMultithreadAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{
gnss_synchro_ = gnss_synchro;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_gnss_synchro(gnss_synchro_);
}
}
signed int GpsL1CaPcpsMultithreadAcquisition::mag()
{
if (item_type_.compare("gr_complex") == 0)
{
return acquisition_cc_->mag();
}
else
{
return 0;
}
}
void GpsL1CaPcpsMultithreadAcquisition::init()
{
acquisition_cc_->init();
set_local_code();
}
void GpsL1CaPcpsMultithreadAcquisition::set_local_code()
{
if (item_type_.compare("gr_complex") == 0)
{
std::complex<float>* code = new std::complex<float>[code_length_];
gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0);
for (unsigned int i = 0; i < sampled_ms_; i++)
{
memcpy(&(code_[i*code_length_]), code,
sizeof(gr_complex)*code_length_);
}
acquisition_cc_->set_local_code(code_);
delete[] code;
}
}
void GpsL1CaPcpsMultithreadAcquisition::reset()
{
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_active(true);
}
}
float GpsL1CaPcpsMultithreadAcquisition::calculate_threshold(float pfa)
{
//Calculate the threshold
unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
{
frequency_bins++;
}
DLOG(INFO) << "Channel "<< channel_ << " Pfa = " << pfa;
unsigned int ncells = vector_length_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent);
double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val);
return threshold;
}
void GpsL1CaPcpsMultithreadAcquisition::connect(gr::top_block_sptr top_block)
{
if (item_type_.compare("gr_complex") == 0)
{
top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
}
}
void GpsL1CaPcpsMultithreadAcquisition::disconnect(gr::top_block_sptr top_block)
{
if (item_type_.compare("gr_complex") == 0)
{
top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0);
}
}
gr::basic_block_sptr GpsL1CaPcpsMultithreadAcquisition::get_left_block()
{
return stream_to_vector_;
}
gr::basic_block_sptr GpsL1CaPcpsMultithreadAcquisition::get_right_block()
{
return acquisition_cc_;
}

View File

@ -1,155 +0,0 @@
/*!
* \file gps_l1_ca_pcps_multithread_acquisition.h
* \brief Adapts a multithread PCPS acquisition block to an
* AcquisitionInterface for GPS L1 C/A signals
* \author Marc Molina, 2013. marc.molina.pena(at)gmail.com
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_GPS_L1_CA_PCPS_MULTITHREAD_ACQUISITION_H_
#define GNSS_SDR_GPS_L1_CA_PCPS_MULTITHREAD_ACQUISITION_H_
#include <string>
#include <gnuradio/blocks/stream_to_vector.h>
#include "gnss_synchro.h"
#include "acquisition_interface.h"
#include "pcps_multithread_acquisition_cc.h"
class ConfigurationInterface;
/*!
* \brief This class adapts a multithread PCPS acquisition block to an
* AcquisitionInterface for GPS L1 C/A signals
*/
class GpsL1CaPcpsMultithreadAcquisition: public AcquisitionInterface
{
public:
GpsL1CaPcpsMultithreadAcquisition(ConfigurationInterface* configuration,
std::string role, unsigned int in_streams,
unsigned int out_streams);
virtual ~GpsL1CaPcpsMultithreadAcquisition();
std::string role()
{
return role_;
}
/*!
* \brief Returns "GPS_L1_CA_PCPS_Multithread_Acquisition"
*/
std::string implementation()
{
return "GPS_L1_CA_PCPS_Multithread_Acquisition";
}
size_t item_size()
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
/*!
* \brief Set acquisition channel unique ID
*/
void set_channel(unsigned int channel);
/*!
* \brief Set statistics threshold of PCPS algorithm
*/
void set_threshold(float threshold);
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(unsigned int doppler_max);
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Initializes acquisition algorithm.
*/
void init();
/*!
* \brief Sets local code for GPS L1/CA PCPS acquisition algorithm.
*/
void set_local_code();
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag();
/*!
* \brief Restart acquisition algorithm
*/
void reset();
private:
ConfigurationInterface* configuration_;
pcps_multithread_acquisition_cc_sptr acquisition_cc_;
gr::blocks::stream_to_vector::sptr stream_to_vector_;
size_t item_size_;
std::string item_type_;
unsigned int vector_length_;
unsigned int code_length_;
bool bit_transition_flag_;
unsigned int channel_;
float threshold_;
unsigned int doppler_max_;
unsigned int doppler_step_;
unsigned int sampled_ms_;
unsigned int max_dwells_;
long fs_in_;
long if_;
bool dump_;
std::string dump_filename_;
std::complex<float> * code_;
Gnss_Synchro * gnss_synchro_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
float calculate_threshold(float pfa);
};
#endif /* GNSS_SDR_GPS_L1_CA_PCPS_MULTITHREAD_ACQUISITION_H_ */

View File

@ -52,7 +52,8 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition(
item_type_ = configuration_->property(role + ".item_type",
default_item_type);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
if_ = configuration_->property(role + ".if", 0);
dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
@ -194,7 +195,7 @@ signed int GpsL1CaPcpsOpenClAcquisition::mag()
void GpsL1CaPcpsOpenClAcquisition::init()
{
acquisition_cc_->init();
set_local_code();
//set_local_code();
}
@ -233,7 +234,7 @@ float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa)
//Calculate the threshold
unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
{
frequency_bins++;
}
@ -245,7 +246,7 @@ float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa)
double val = pow(1.0 - pfa, exponent);
double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val);
float threshold = static_cast<float>(quantile(mydist,val));
return threshold;
}

View File

@ -55,7 +55,7 @@ public:
virtual ~GpsL1CaPcpsOpenClAcquisition();
std::string role()
inline std::string role() override
{
return role_;
}
@ -63,66 +63,67 @@ public:
/*!
* \brief Returns "GPS_L1_CA_PCPS_OpenCl_Acquisition"
*/
std::string implementation()
inline std::string implementation() override
{
return "GPS_L1_CA_PCPS_OpenCl_Acquisition";
}
size_t item_size()
inline size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
/*!
* \brief Set acquisition channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set statistics threshold of PCPS algorithm
*/
void set_threshold(float threshold);
void set_threshold(float threshold) override;
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(unsigned int doppler_max);
void set_doppler_max(unsigned int doppler_max) override;
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(unsigned int doppler_step);
void set_doppler_step(unsigned int doppler_step) override;
/*!
* \brief Initializes acquisition algorithm.
*/
void init();
void init() override;
/*!
* \brief Sets local code for GPS L1/CA PCPS acquisition algorithm.
*/
void set_local_code();
void set_local_code() override;
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag();
signed int mag() override;
/*!
* \brief Restart acquisition algorithm
*/
void reset();
void reset() override;
private:
ConfigurationInterface* configuration_;

View File

@ -53,40 +53,39 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", default_item_type);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
if_ = configuration_->property(role + ".if", 0);
dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
//--- Find number of samples per spreading code -------------------------
code_length_ = round(fs_in_
/ (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
/*Calculate the folding factor value based on the calculations*/
unsigned int temp = (unsigned int)ceil(sqrt(log2(code_length_)));
unsigned int temp = static_cast<unsigned int>(ceil(sqrt(log2(code_length_))));
folding_factor_ = configuration_->property(role + ".folding_factor", temp);
if ( sampled_ms_ % folding_factor_ != 0)
{
LOG(WARNING) << "QuickSync Algorithm requires a coherent_integration_time"
<< " multiple of " << folding_factor_ << "ms, Value entered "
<< sampled_ms_ << " ms";
<< " multiple of " << folding_factor_ << "ms, Value entered "
<< sampled_ms_ << " ms";
if(sampled_ms_ < folding_factor_)
{
sampled_ms_ = (int) folding_factor_;
sampled_ms_ = static_cast<int>(folding_factor_);
}
else
{
sampled_ms_ = (int)(sampled_ms_/folding_factor_) * folding_factor_;
sampled_ms_ = static_cast<int>(sampled_ms_ / folding_factor_) * folding_factor_;
}
LOG(WARNING) <<" Coherent_integration_time of "
<< sampled_ms_ << " ms will be used instead.";
LOG(WARNING) << " Coherent_integration_time of "
<< sampled_ms_ << " ms will be used instead.";
}
vector_length_ = code_length_ * sampled_ms_;
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
@ -227,8 +226,7 @@ signed int GpsL1CaPcpsQuickSyncAcquisition::mag()
void GpsL1CaPcpsQuickSyncAcquisition::init()
{
acquisition_cc_->init();
set_local_code();
//set_local_code();
}
@ -263,6 +261,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::reset()
}
}
void GpsL1CaPcpsQuickSyncAcquisition::set_state(int state)
{
if (item_type_.compare("gr_complex") == 0)
@ -276,7 +275,7 @@ float GpsL1CaPcpsQuickSyncAcquisition::calculate_threshold(float pfa)
{
//Calculate the threshold
unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
{
frequency_bins++;
}
@ -298,7 +297,6 @@ void GpsL1CaPcpsQuickSyncAcquisition::connect(gr::top_block_sptr top_block)
{
top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
}
}

View File

@ -57,7 +57,7 @@ public:
virtual ~GpsL1CaPcpsQuickSyncAcquisition();
std::string role()
inline std::string role() override
{
return role_;
}
@ -65,66 +65,67 @@ public:
/*!
* \brief Returns "GPS_L1_CA_PCPS_QuickSync_Acquisition"
*/
std::string implementation()
inline std::string implementation() override
{
return "GPS_L1_CA_PCPS_QuickSync_Acquisition";
}
size_t item_size()
inline size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
/*!
* \brief Set acquisition channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set statistics threshold of PCPS algorithm
*/
void set_threshold(float threshold);
void set_threshold(float threshold) override;
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(unsigned int doppler_max);
void set_doppler_max(unsigned int doppler_max) override;
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(unsigned int doppler_step);
void set_doppler_step(unsigned int doppler_step) override;
/*!
* \brief Initializes acquisition algorithm.
*/
void init();
void init() override;
/*!
* \brief Sets local code for GPS L1/CA PCPS acquisition algorithm.
*/
void set_local_code();
void set_local_code() override;
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag();
signed int mag() override;
/*!
* \brief Restart acquisition algorithm
*/
void reset();
void reset() override;
/*!
* \brief If state = 1, it forces the block to start acquiring from the first sample

View File

@ -52,7 +52,8 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
item_type_ = configuration_->property(role + ".item_type", default_item_type);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
if_ = configuration_->property(role + ".if", 0);
dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
@ -186,7 +187,7 @@ signed int GpsL1CaPcpsTongAcquisition::mag()
void GpsL1CaPcpsTongAcquisition::init()
{
acquisition_cc_->init();
set_local_code();
//set_local_code();
}
void GpsL1CaPcpsTongAcquisition::set_local_code()
@ -232,7 +233,7 @@ float GpsL1CaPcpsTongAcquisition::calculate_threshold(float pfa)
{
//Calculate the threshold
unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
{
frequency_bins++;
}
@ -244,7 +245,7 @@ float GpsL1CaPcpsTongAcquisition::calculate_threshold(float pfa)
double val = pow(1.0 - pfa,exponent);
double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist, val);
float threshold = static_cast<float>(quantile(mydist, val));
return threshold;
}

View File

@ -54,7 +54,7 @@ public:
virtual ~GpsL1CaPcpsTongAcquisition();
std::string role()
inline std::string role() override
{
return role_;
}
@ -62,66 +62,67 @@ public:
/*!
* \brief Returns "GPS_L1_CA_PCPS_Tong_Acquisition"
*/
std::string implementation()
inline std::string implementation() override
{
return "GPS_L1_CA_PCPS_Tong_Acquisition";
}
size_t item_size()
inline size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
/*!
* \brief Set acquisition channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set statistics threshold of TONG algorithm
*/
void set_threshold(float threshold);
void set_threshold(float threshold) override;
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(unsigned int doppler_max);
void set_doppler_max(unsigned int doppler_max) override;
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(unsigned int doppler_step);
void set_doppler_step(unsigned int doppler_step) override;
/*!
* \brief Initializes acquisition algorithm.
*/
void init();
void init() override;
/*!
* \brief Sets local code for GPS L1/CA TONG acquisition algorithm.
*/
void set_local_code();
void set_local_code() override;
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag();
signed int mag() override;
/*!
* \brief Restart acquisition algorithm
*/
void reset();
void reset() override;
/*!
* \brief If state = 1, it forces the block to start acquiring from the first sample

View File

@ -55,9 +55,11 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
item_type_ = configuration_->property(role + ".item_type", default_item_type);
//float pfa = configuration_->property(role + ".pfa", 0.0);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
if_ = configuration_->property(role + ".if", 0);
dump_ = configuration_->property(role + ".dump", false);
blocking_ = configuration_->property(role + ".blocking", true);
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
@ -85,15 +87,18 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
item_size_ = sizeof(lv_16sc_t);
acquisition_sc_ = pcps_make_acquisition_sc(1, max_dwells_,
doppler_max_, if_, fs_in_, code_length_, code_length_,
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, dump_filename_);
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_);
DLOG(INFO) << "acquisition(" << acquisition_sc_->unique_id() << ")";
}else{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_make_acquisition_cc(1, max_dwells_,
doppler_max_, if_, fs_in_, code_length_, code_length_,
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, dump_filename_);
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
}
else
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_make_acquisition_cc(1, max_dwells_,
doppler_max_, if_, fs_in_, code_length_, code_length_,
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_,
dump_filename_);
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
}
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
@ -233,7 +238,7 @@ void GpsL2MPcpsAcquisition::init()
acquisition_cc_->init();
}
set_local_code();
//set_local_code();
}
@ -251,17 +256,15 @@ void GpsL2MPcpsAcquisition::set_local_code()
acquisition_cc_->set_local_code(code_);
}
// //debug
// std::ofstream d_dump_file;
// std::stringstream filename;
// std::streamsize n = 2 * sizeof(float) * (code_length_); // complex file write
// filename.str("");
// filename << "../data/local_prn_sampled.dat";
// d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
// d_dump_file.write((char*)code_, n);
// d_dump_file.close();
// }
// //debug
// std::ofstream d_dump_file;
// std::stringstream filename;
// std::streamsize n = 2 * sizeof(float) * (code_length_); // complex file write
// filename.str("");
// filename << "../data/local_prn_sampled.dat";
// d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
// d_dump_file.write(reinterpret_cast<char*>(code_), n);
// d_dump_file.close();
}
@ -305,7 +308,7 @@ float GpsL2MPcpsAcquisition::calculate_threshold(float pfa)
double val = pow(1.0 - pfa, exponent);
double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val);
float threshold = static_cast<float>(quantile(mydist,val));
return threshold;
}

View File

@ -61,7 +61,7 @@ public:
virtual ~GpsL2MPcpsAcquisition();
std::string role()
inline std::string role() override
{
return role_;
}
@ -69,66 +69,67 @@ public:
/*!
* \brief Returns "GPS_L2_M_PCPS_Acquisition"
*/
std::string implementation()
inline std::string implementation() override
{
return "GPS_L2_M_PCPS_Acquisition";
}
size_t item_size()
inline size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
/*!
* \brief Set acquisition channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set statistics threshold of PCPS algorithm
*/
void set_threshold(float threshold);
void set_threshold(float threshold) override;
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(unsigned int doppler_max);
void set_doppler_max(unsigned int doppler_max) override;
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(unsigned int doppler_step);
void set_doppler_step(unsigned int doppler_step) override;
/*!
* \brief Initializes acquisition algorithm.
*/
void init();
void init() override;
/*!
* \brief Sets local code for GPS L2/M PCPS acquisition algorithm.
*/
void set_local_code();
void set_local_code() override;
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag();
signed int mag() override;
/*!
* \brief Restart acquisition algorithm
*/
void reset();
void reset() override;
/*!
* \brief If state = 1, it forces the block to start acquiring from the first sample
@ -156,6 +157,7 @@ private:
long fs_in_;
long if_;
bool dump_;
bool blocking_;
std::string dump_filename_;
std::complex<float> * code_;
Gnss_Synchro * gnss_synchro_;

View File

@ -20,7 +20,6 @@
set(ACQ_GR_BLOCKS_SOURCES
pcps_acquisition_cc.cc
pcps_acquisition_sc.cc
pcps_multithread_acquisition_cc.cc
pcps_assisted_acquisition_cc.cc
pcps_acquisition_fine_doppler_cc.cc
pcps_tong_acquisition_cc.cc
@ -39,7 +38,7 @@ if(OPENCL_FOUND)
endif(OPENCL_FOUND)
include_directories(
$(CMAKE_CURRENT_SOURCE_DIR)
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/core/system_parameters
${CMAKE_SOURCE_DIR}/src/core/interfaces
${CMAKE_SOURCE_DIR}/src/core/receiver
@ -67,7 +66,11 @@ add_library(acq_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS})
source_group(Headers FILES ${ACQ_GR_BLOCKS_HEADERS})
#target_link_libraries(acq_gr_blocks gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES}
#target_link_libraries(acq_gr_blocks acquisition_lib gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${OPT_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES})
target_link_libraries(acq_gr_blocks gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${OPT_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES})
if(ENABLE_FPGA)
target_link_libraries(acq_gr_blocks acquisition_lib gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${OPT_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES})
else(ENABLE_FPGA)
target_link_libraries(acq_gr_blocks gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${OPT_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES})
endif(ENABLE_FPGA)
if(NOT VOLK_GNSSSDR_FOUND)
add_dependencies(acq_gr_blocks volk_gnsssdr_module)
endif(NOT VOLK_GNSSSDR_FOUND)

View File

@ -390,7 +390,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
}
case 1:
{
const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]); //Get the input samples pointer
unsigned int buff_increment;
if (ninput_items[0] + d_buffer_count <= d_fft_size)
{
@ -414,7 +414,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
case 2:
{
// Fill last part of the buffer and reset counter
const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]); //Get the input samples pointer
if (d_buffer_count < d_fft_size)
{
memcpy(&d_inbuffer[d_buffer_count], in, sizeof(gr_complex)*(d_fft_size-d_buffer_count));
@ -628,16 +628,16 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
{
if (magt_IA >= magt_IB)
{
d_dump_file.write((char*)d_magnitudeIA, n);
d_dump_file.write(reinterpret_cast<char*>(d_magnitudeIA), n);
}
else
{
d_dump_file.write((char*)d_magnitudeIB, n);
d_dump_file.write(reinterpret_cast<char*>(d_magnitudeIB), n);
}
}
else
{
d_dump_file.write((char*)d_magnitudeIA, n);
d_dump_file.write(reinterpret_cast<char*>(d_magnitudeIA), n);
}
d_dump_file.close();
}
@ -738,7 +738,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
filename.str("");
filename << "../data/test_statistics_E5a_sat_" << d_gnss_synchro->PRN << "_CAF.dat";
d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
d_dump_file.write((char*)d_CAF_vector, n);
d_dump_file.write(reinterpret_cast<char*>(d_CAF_vector), n);
d_dump_file.close();
}
volk_gnsssdr_free(accum);

View File

@ -162,7 +162,7 @@ public:
* to exchange synchronization data between acquisition and tracking blocks.
* \param p_gnss_synchro Satellite information shared by the processing blocks.
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
d_gnss_synchro = p_gnss_synchro;
}
@ -170,7 +170,7 @@ public:
/*!
* \brief Returns the maximum peak of grid search.
*/
unsigned int mag()
inline unsigned int mag() const
{
return d_mag;
}
@ -191,7 +191,7 @@ public:
* active mode
* \param active - bool that activates/deactivates the block.
*/
void set_active(bool active)
inline void set_active(bool active)
{
d_active = active;
}
@ -207,7 +207,7 @@ public:
* \brief Set acquisition channel unique ID
* \param channel - receiver channel.
*/
void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel)
{
d_channel = channel;
}
@ -217,7 +217,7 @@ public:
* \param threshold - Threshold for signal detection (check \ref Navitec2012,
* Algorithm 1, for a definition of this threshold).
*/
void set_threshold(float threshold)
inline void set_threshold(float threshold)
{
d_threshold = threshold;
}
@ -226,7 +226,7 @@ public:
* \brief Set maximum Doppler grid search
* \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
*/
void set_doppler_max(unsigned int doppler_max)
inline void set_doppler_max(unsigned int doppler_max)
{
d_doppler_max = doppler_max;
}
@ -235,12 +235,11 @@ public:
* \brief Set Doppler steps for the grid search
* \param doppler_step - Frequency bin of the search grid [Hz].
*/
void set_doppler_step(unsigned int doppler_step)
inline void set_doppler_step(unsigned int doppler_step)
{
d_doppler_step = doppler_step;
}
/*!
* \brief Parallel Code Phase Search Acquisition signal processing.
*/

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