mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-18 21:23:02 +00:00
Merge branch 'gnsstk' into next.
Replace GPSTK by the newer GNSSTk C++ Library, with backward compatibility. Works from GPSTK 3.0 to GNSSTk 12.1.0
This commit is contained in:
commit
5ecfcc773b
@ -53,7 +53,7 @@ IncludeBlocks: Merge
|
||||
IncludeCategories:
|
||||
- Regex: '^.*.h"'
|
||||
Priority: 1
|
||||
- Regex: '^.*(benchmark|boost|gflags|glog|gnsssdr|gnuradio|gpstk|gsl|gtest|pmt|uhd|volk)/'
|
||||
- Regex: '^.*(benchmark|boost|gflags|glog|gnsssdr|gnuradio|gnsstk|gsl|gtest|pmt|uhd|volk)/'
|
||||
Priority: 2
|
||||
- Regex: '^.*(armadillo|iio|matio|pugixml)'
|
||||
Priority: 2
|
||||
|
@ -111,7 +111,15 @@ if(ENABLE_SYSTEM_TESTING_EXTRA)
|
||||
set(ENABLE_SYSTEM_TESTING ON)
|
||||
endif()
|
||||
|
||||
option(ENABLE_OWN_GPSTK "Force to download, build and link GPSTk for system tests, even if it is already installed" OFF)
|
||||
option(ENABLE_OWN_GNSSTK "Force to download, build and link gnsstk for system tests, even if it is already installed" OFF)
|
||||
|
||||
if(NOT ENABLE_OWN_GNSSTK)
|
||||
option(ENABLE_OWN_GPSTK "Force to download, build and link gnsstk for system tests, even if it is already installed" OFF)
|
||||
if(ENABLE_OWN_GPSTK)
|
||||
message(STATUS "WARNING: Option ENABLE_OWN_GPSTK is deprecated, please use ENABLE_OWN_GNSSTK")
|
||||
set(ENABLE_OWN_GNSSTK ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(ENABLE_INSTALL_TESTS "Install QA code system-wide" OFF)
|
||||
if(ENABLE_FPGA)
|
||||
@ -330,7 +338,7 @@ else()
|
||||
set(GNSSSDR_GTEST_LOCAL_VERSION "1.12.1")
|
||||
endif()
|
||||
set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master")
|
||||
set(GNSSSDR_GPSTK_LOCAL_VERSION "8.0.0")
|
||||
set(GNSSSDR_GNSSTK_LOCAL_VERSION "12.1.0")
|
||||
set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.23")
|
||||
set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.12")
|
||||
set(GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "21.1")
|
||||
@ -654,16 +662,16 @@ endif()
|
||||
# Detect availability of std::filesystem and set C++ standard accordingly
|
||||
################################################################################
|
||||
set(FILESYSTEM_FOUND FALSE)
|
||||
if(NOT ENABLE_OWN_GPSTK)
|
||||
find_package(GPSTK)
|
||||
set_package_properties(GPSTK PROPERTIES
|
||||
if(NOT ENABLE_OWN_GNSSTK)
|
||||
find_package(GNSSTK)
|
||||
set_package_properties(GNSSTK PROPERTIES
|
||||
PURPOSE "Used in some Extra Tests."
|
||||
)
|
||||
endif()
|
||||
if(NOT (GNURADIO_VERSION VERSION_LESS 3.8) AND (LOG4CPP_READY_FOR_CXX17 OR GNURADIO_USES_SPDLOG))
|
||||
# Check if we have std::filesystem
|
||||
if(NOT (CMAKE_VERSION VERSION_LESS 3.8))
|
||||
if(NOT GPSTK_FOUND OR NOT (GPSTK_FOUND AND GPSTK_OLDER_THAN_8)) # Fix for GPSTk < 8.0.0
|
||||
if(NOT GNSSTK_FOUND OR NOT (GNSSTK_FOUND AND GNSSTK_OLDER_THAN_8)) # Fix for GNSSTk < 8.0.0
|
||||
find_package(FILESYSTEM COMPONENTS Final Experimental)
|
||||
set_package_properties(FILESYSTEM PROPERTIES
|
||||
URL "https://en.cppreference.com/w/cpp/filesystem"
|
||||
@ -3361,7 +3369,7 @@ add_feature_info(ENABLE_UNIT_TESTING_MINIMAL ENABLE_UNIT_TESTING_MINIMAL "Enable
|
||||
add_feature_info(ENABLE_UNIT_TESTING_EXTRA ENABLE_UNIT_TESTING_EXTRA "Enables building of Extra Unit Tests and downloading of external data files.")
|
||||
add_feature_info(ENABLE_SYSTEM_TESTING ENABLE_SYSTEM_TESTING "Enables building of System Tests.")
|
||||
add_feature_info(ENABLE_SYSTEM_TESTING_EXTRA ENABLE_SYSTEM_TESTING_EXTRA "Enables building of Extra System Tests and downloading of external tools.")
|
||||
add_feature_info(ENABLE_OWN_GPSTK ENABLE_OWN_GPSTK "Forces the downloading and building of GPSTk for system tests.")
|
||||
add_feature_info(ENABLE_OWN_GNSSTK ENABLE_OWN_GNSSTK "Forces the downloading and building of gnsstk for system tests.")
|
||||
add_feature_info(ENABLE_GNSS_SIM_INSTALL ENABLE_GNSS_SIM_INSTALL "Enables downloading and building of gnss-sim.")
|
||||
add_feature_info(ENABLE_INSTALL_TESTS ENABLE_INSTALL_TESTS "Install test binaries when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} install'.")
|
||||
add_feature_info(ENABLE_BENCHMARKS ENABLE_BENCHMARKS "Enables building of code snippet benchmarks.")
|
||||
|
@ -2048,10 +2048,10 @@ PVT.rtcm_MT1077_rate_ms=1000
|
||||
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](https://github.com/SGL-UT/GPSTk),
|
||||
[RTKLIB](http://www.rtklib.com/), and [gLAB](https://gage.upc.edu/gLAB/).
|
||||
GNSS-SDR by default generates RINEX version
|
||||
[3.02](ftp://igs.org/pub/data/format/rinex302.pdf). If
|
||||
be used by software packages such as
|
||||
[GNSSTK](https://github.com/SGL-UT/gnsstk), [RTKLIB](http://www.rtklib.com/),
|
||||
and [gLAB](https://gage.upc.edu/gLAB/). GNSS-SDR by default generates RINEX
|
||||
version [3.02](ftp://igs.org/pub/data/format/rinex302.pdf). If
|
||||
[2.11](ftp://igs.org/pub/data/format/rinex211.txt) is needed, it can be
|
||||
requested through the `rinex_version` parameter in the configuration file:
|
||||
|
||||
|
139
cmake/Modules/FindGNSSTK.cmake
Normal file
139
cmake/Modules/FindGNSSTK.cmake
Normal file
@ -0,0 +1,139 @@
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2022 C. Fernandez-Prades cfernandez(at)cttc.es
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
# - Find gnsstk library
|
||||
# Find the native gnsstk includes and library
|
||||
# This module defines
|
||||
# GNSSTK_INCLUDE_DIR, where to find Rinex3ObsBase.hpp, etc.
|
||||
# GNSSTK_FOUND, If false, do not try to use GNSSTK.
|
||||
# GNSSTK_LIBRARY, where to find the GNSSTK library.
|
||||
#
|
||||
# Provides the following imported target:
|
||||
# Gnsstk::gnsstk
|
||||
#
|
||||
|
||||
if(NOT COMMAND feature_summary)
|
||||
include(FeatureSummary)
|
||||
endif()
|
||||
|
||||
if(NOT GNSSTK_ROOT)
|
||||
set(GNSSTK_ROOT_USER_DEFINED /usr/local)
|
||||
else()
|
||||
set(GNSSTK_ROOT_USER_DEFINED ${GNSSTK_ROOT})
|
||||
endif()
|
||||
if(DEFINED ENV{GNSSTK_ROOT})
|
||||
set(GNSSTK_ROOT_USER_DEFINED
|
||||
${GNSSTK_ROOT_USER_DEFINED}
|
||||
$ENV{GNSSTK_ROOT}
|
||||
)
|
||||
endif()
|
||||
|
||||
unset(GNSSTK_INCLUDE_DIR CACHE)
|
||||
unset(GNSSTK_USES_GPSTK_NAMESPACE CACHE)
|
||||
find_path(GNSSTK_INCLUDE_DIR gnsstk/Rinex3ObsBase.hpp
|
||||
PATHS ${GNSSTK_ROOT_USER_DEFINED}/include
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
)
|
||||
set(GNSSTK_NAMES ${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
if(NOT GNSSTK_INCLUDE_DIR)
|
||||
find_path(GNSSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp
|
||||
PATHS ${GNSSTK_ROOT_USER_DEFINED}/include
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
)
|
||||
if(GNSSTK_INCLUDE_DIR)
|
||||
set(GNSSTK_NAMES gpstk ${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
set(GNSSTK_USES_GPSTK_NAMESPACE TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
find_library(GNSSTK_LIBRARY NAMES ${GNSSTK_NAMES}
|
||||
PATHS ${GNSSTK_ROOT_USER_DEFINED}/lib
|
||||
${GNSSTK_ROOT_USER_DEFINED}/${CMAKE_INSTALL_LIBDIR}
|
||||
/usr/local/lib
|
||||
/usr/${CMAKE_INSTALL_LIBDIR}
|
||||
/usr/local/${CMAKE_INSTALL_LIBDIR}
|
||||
/opt/local/lib
|
||||
)
|
||||
|
||||
if(GNSSTK_LIBRARY AND GNSSTK_INCLUDE_DIR)
|
||||
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
|
||||
unset(PACKAGE_VERSION)
|
||||
if(GNSSTK_USES_GPSTK_NAMESPACE)
|
||||
if(EXISTS ${GNSSTK_INCLUDE_DIR}/../share/cmake/GPSTK/GPSTKConfigVersion.cmake)
|
||||
include(${GNSSTK_INCLUDE_DIR}/../share/cmake/GPSTK/GPSTKConfigVersion.cmake)
|
||||
endif()
|
||||
else()
|
||||
if(EXISTS ${GNSSTK_INCLUDE_DIR}/../share/cmake/GNSSTK/GNSSTKConfigVersion.cmake)
|
||||
include(${GNSSTK_INCLUDE_DIR}/../share/cmake/GNSSTK/GNSSTKConfigVersion.cmake)
|
||||
endif()
|
||||
endif()
|
||||
if(PACKAGE_VERSION)
|
||||
set(GNSSTK_VERSION ${PACKAGE_VERSION})
|
||||
endif()
|
||||
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
|
||||
endif()
|
||||
|
||||
if(GNSSTK_VERSION)
|
||||
if(GNSSTK_VERSION VERSION_GREATER ${GNSSSDR_GNSSTK_LOCAL_VERSION})
|
||||
unset(GNSSTK_LIBRARY CACHE)
|
||||
unset(GNSSTK_INCLUDE_DIR CACHE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# handle the QUIET and REQUIRED arguments and set GNSSTK_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GNSSTK DEFAULT_MSG GNSSTK_LIBRARY GNSSTK_INCLUDE_DIR)
|
||||
|
||||
if(GNSSTK_FOUND AND GNSSTK_VERSION)
|
||||
set_package_properties(GNSSTK PROPERTIES
|
||||
DESCRIPTION "The GNSSTk C++ Library (found: v${GNSSTK_VERSION})"
|
||||
)
|
||||
else()
|
||||
set_package_properties(GNSSTK PROPERTIES
|
||||
DESCRIPTION "The GNSSTk C++ Library"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(GNSSTK_FOUND AND GNSSTK_USES_GPSTK_NAMESPACE AND NOT EXISTS ${GNSSTK_INCLUDE_DIR}/gpstk/SatelliteSystem.hpp)
|
||||
set(GNSSTK_OLDER_THAN_8 TRUE)
|
||||
endif()
|
||||
|
||||
set_package_properties(GNSSTK PROPERTIES
|
||||
URL "https://github.com/SGL-UT/gnsstk/"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
|
||||
if(GNSSTK_FOUND AND NOT ENABLE_OWN_GNSSTK AND NOT TARGET Gnsstk::gnsstk)
|
||||
add_library(Gnsstk::gnsstk SHARED IMPORTED)
|
||||
if(GNSSTK_USES_GPSTK_NAMESPACE)
|
||||
set_target_properties(Gnsstk::gnsstk PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
||||
IMPORTED_LOCATION "${GNSSTK_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${GNSSTK_INCLUDE_DIR};${GNSSTK_INCLUDE_DIR}/gpstk"
|
||||
INTERFACE_LINK_LIBRARIES "${GNSSTK_LIBRARY}"
|
||||
)
|
||||
else()
|
||||
set_target_properties(Gnsstk::gnsstk PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
||||
IMPORTED_LOCATION "${GNSSTK_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${GNSSTK_INCLUDE_DIR};${GNSSTK_INCLUDE_DIR}/gnsstk"
|
||||
INTERFACE_LINK_LIBRARIES "${GNSSTK_LIBRARY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(GNSSTK_LIBRARY
|
||||
GNSSTK_INCLUDE_DIR
|
||||
GNSSTK_USES_GPSTK_NAMESPACE
|
||||
GNSSTK_OLDER_THAN_8
|
||||
)
|
@ -1,99 +0,0 @@
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2011-2020 C. Fernandez-Prades cfernandez(at)cttc.es
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
# - Find gpstk library
|
||||
# Find the native gpstk includes and library
|
||||
# This module defines
|
||||
# GPSTK_INCLUDE_DIR, where to find Rinex3ObsBase.hpp, etc.
|
||||
# GPSTK_FOUND, If false, do not try to use GPSTK.
|
||||
# GPSTK_LIBRARY, where to find the GPSTK library.
|
||||
#
|
||||
# Provides the following imported target:
|
||||
# Gpstk::gpstk
|
||||
#
|
||||
|
||||
if(NOT COMMAND feature_summary)
|
||||
include(FeatureSummary)
|
||||
endif()
|
||||
|
||||
if(NOT GPSTK_ROOT)
|
||||
set(GPSTK_ROOT_USER_DEFINED /usr/local)
|
||||
else()
|
||||
set(GPSTK_ROOT_USER_DEFINED ${GPSTK_ROOT})
|
||||
endif()
|
||||
if(DEFINED ENV{GPSTK_ROOT})
|
||||
set(GPSTK_ROOT_USER_DEFINED
|
||||
${GPSTK_ROOT_USER_DEFINED}
|
||||
$ENV{GPSTK_ROOT}
|
||||
)
|
||||
endif()
|
||||
|
||||
find_path(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp
|
||||
PATHS ${GPSTK_ROOT_USER_DEFINED}/include
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
)
|
||||
|
||||
set(GPSTK_NAMES gpstk libgpstk)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES}
|
||||
PATHS ${GPSTK_ROOT_USER_DEFINED}/lib
|
||||
${GPSTK_ROOT_USER_DEFINED}/${CMAKE_INSTALL_LIBDIR}
|
||||
/usr/local/lib
|
||||
/usr/${CMAKE_INSTALL_LIBDIR}
|
||||
/usr/local/${CMAKE_INSTALL_LIBDIR}
|
||||
/opt/local/lib
|
||||
)
|
||||
|
||||
# handle the QUIET and REQUIRED arguments and set GPSTK_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR)
|
||||
|
||||
if(GPSTK_FOUND)
|
||||
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
|
||||
unset(PACKAGE_VERSION)
|
||||
if(EXISTS ${CMAKE_INSTALL_FULL_DATADIR}/cmake/GPSTK/GPSTKConfigVersion.cmake)
|
||||
include(${CMAKE_INSTALL_FULL_DATADIR}/cmake/GPSTK/GPSTKConfigVersion.cmake)
|
||||
endif()
|
||||
if(PACKAGE_VERSION)
|
||||
set(GPSTK_VERSION ${PACKAGE_VERSION})
|
||||
endif()
|
||||
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
|
||||
endif()
|
||||
|
||||
if(GPSTK_FOUND AND GPSTK_VERSION)
|
||||
set_package_properties(GPSTK PROPERTIES
|
||||
DESCRIPTION "Library and suite of applications for satellite navigation (found: v${GPSTK_VERSION})"
|
||||
)
|
||||
else()
|
||||
set_package_properties(GPSTK PROPERTIES
|
||||
DESCRIPTION "Library and suite of applications for satellite navigation"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(GPSTK_FOUND AND NOT EXISTS ${GPSTK_INCLUDE_DIR}/gpstk/SatelliteSystem.hpp)
|
||||
set(GPSTK_OLDER_THAN_8 TRUE)
|
||||
endif()
|
||||
|
||||
set_package_properties(GPSTK PROPERTIES
|
||||
URL "https://github.com/SGL-UT/GPSTk"
|
||||
)
|
||||
|
||||
if(GPSTK_FOUND AND NOT ENABLE_OWN_GPSTK AND NOT TARGET Gpstk::gpstk)
|
||||
add_library(Gpstk::gpstk SHARED IMPORTED)
|
||||
set_target_properties(Gpstk::gpstk PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
||||
IMPORTED_LOCATION "${GPSTK_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${GPSTK_INCLUDE_DIR};${GPSTK_INCLUDE_DIR}/gpstk"
|
||||
INTERFACE_LINK_LIBRARIES "${GPSTK_LIBRARY}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(GPSTK_LIBRARY GPSTK_INCLUDE_DIR)
|
@ -35,6 +35,13 @@ All notable changes to GNSS-SDR will be documented in this file.
|
||||
**not** applied to the computed PVT solution. In the Galileo E6B-only
|
||||
receiver, HAS messages are decoded and reported.
|
||||
|
||||
### Improvements in Maintainability:
|
||||
|
||||
- The now archived [GPSTk toolkit](https://github.com/SGL-UT/GPSTk), used in
|
||||
some optional tests and applications, has been replaced by the new
|
||||
[GNSSTk](https://github.com/SGL-UT/gnsstk) C++ Library. Compatibility with the
|
||||
former GPSTk toolkit is maintained.
|
||||
|
||||
### Improvements in Portability:
|
||||
|
||||
- Improved detection of the BLAS library under macOS / Macports (the `lapack`
|
||||
|
@ -514,7 +514,7 @@ Observables.dump_filename=./observables.dat
|
||||
\subsection pvt Computation of Position, Velocity and Time
|
||||
Although data processing for obtaining high-accuracy PVT solutions is out of the scope of GNSS-SDR, we provide a module that can compute a simple least square
|
||||
solution and leaves room for more sophisticated positioning methods. The integration with libraries and software tools that are able to deal with multi-constellation
|
||||
data such as <a href="https://github.com/SGL-UT/GPSTk" target="_blank">GPSTk</a> or <a href="https://gage.upc.edu/gLAB/" target="_blank">gLAB</a> appears as a viable solution for high performance, completely customizable GNSS receivers.
|
||||
data such as <a href="https://github.com/SGL-UT/gnsstk" target="_blank">GNSSTk</a> or <a href="https://gage.upc.edu/gLAB/" target="_blank">gLAB</a> appears as a viable solution for high performance, completely customizable GNSS receivers.
|
||||
|
||||
The common interface is PvtInterface. For instance, in order to use the implementation RTKLIB_PVT, add to the configuration file:
|
||||
\verbatim
|
||||
|
@ -111,7 +111,7 @@ if(NOT GOOGLETEST_FOUND)
|
||||
MAP_IMPORTED_CONFIG_O3WITHASM RelWithDebInfo
|
||||
MAP_IMPORTED_CONFIG_ASAN Debug
|
||||
IMPORTED_LOCATION_NONE ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
IMPORTED_LOCATION_DEBUG ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${DEBUG_DECORATION}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
IMPORTED_LOCATION_DEBUG ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
IMPORTED_LOCATION_RELEASE ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
IMPORTED_LOCATION_RELWITHDEBINFO ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
IMPORTED_LOCATION_MINSIZEREL ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
@ -279,7 +279,7 @@ endif()
|
||||
|
||||
|
||||
################################################################################
|
||||
# GPSTk and optional generator
|
||||
# gnsstk and optional generator
|
||||
################################################################################
|
||||
|
||||
if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
|
||||
@ -338,42 +338,42 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
|
||||
endif()
|
||||
|
||||
############################################################################
|
||||
# Local installation of GPSTk https://github.com/SGL-UT/GPSTk
|
||||
# Local installation of gnsstk https://github.com/SGL-UT/gnsstk
|
||||
############################################################################
|
||||
if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
|
||||
set_package_properties(GPSTK PROPERTIES
|
||||
PURPOSE "GPSTk v${GNSSSDR_GPSTK_LOCAL_VERSION} will be automatically downloaded and built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'."
|
||||
if(NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK)
|
||||
set_package_properties(GNSSTK PROPERTIES
|
||||
PURPOSE "GNSSTk v${GNSSSDR_GNSSTK_LOCAL_VERSION} will be automatically downloaded and built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'."
|
||||
)
|
||||
if("${TOOLCHAIN_ARG}" STREQUAL "")
|
||||
set(TOOLCHAIN_ARG "-DCMAKE_CXX_FLAGS=-Wno-deprecated")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
|
||||
endif()
|
||||
set(GPSTK_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}")
|
||||
set(GNSSTK_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}")
|
||||
if(CMAKE_GENERATOR STREQUAL Xcode)
|
||||
set(GPSTK_BUILD_COMMAND "xcodebuild" "-configuration" "${CMAKE_BUILD_TYPE}")
|
||||
set(GNSSTK_BUILD_COMMAND "xcodebuild" "-configuration" "${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
include(GNUInstallDirs)
|
||||
find_program(Patch_EXECUTABLE NAME patch PATHS ENV PATH)
|
||||
if(NOT Patch_EXECUTABLE)
|
||||
message(FATAL_ERROR "The patch command is not found. It is required to build GPSTk. Please check your OS documentation and install the patch command.")
|
||||
message(FATAL_ERROR "The patch command is not found. It is required to build GNSSTk. Please check your OS documentation and install the patch command.")
|
||||
endif()
|
||||
set(GPSTK_PATCH_COMMAND
|
||||
cd ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} &&
|
||||
${Patch_EXECUTABLE} ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/CMakeLists.txt < ${CMAKE_SOURCE_DIR}/src/tests/data/gpstk_static.patch
|
||||
set(GNSSTK_PATCH_COMMAND
|
||||
cd ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION} &&
|
||||
${Patch_EXECUTABLE} ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/CMakeLists.txt < ${CMAKE_SOURCE_DIR}/src/tests/data/gnsstk_static.patch
|
||||
)
|
||||
# Patch only once
|
||||
if(EXISTS ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/CMakeLists.txt)
|
||||
set(GPSTK_PATCH_COMMAND "")
|
||||
if(EXISTS ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/CMakeLists.txt)
|
||||
set(GNSSTK_PATCH_COMMAND "")
|
||||
endif()
|
||||
if(CMAKE_VERSION VERSION_LESS 3.2)
|
||||
ExternalProject_Add(gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
|
||||
GIT_REPOSITORY https://github.com/SGL-UT/GPSTk
|
||||
GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION}
|
||||
SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
|
||||
BINARY_DIR ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
|
||||
PATCH_COMMAND ${GPSTK_PATCH_COMMAND}
|
||||
ExternalProject_Add(gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
|
||||
GIT_REPOSITORY https://github.com/SGL-UT/gnsstk
|
||||
GIT_TAG v${GNSSSDR_GNSSTK_LOCAL_VERSION}
|
||||
SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
|
||||
BINARY_DIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
|
||||
PATCH_COMMAND ${GNSSTK_PATCH_COMMAND}
|
||||
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG}
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install
|
||||
-DBUILD_EXT=ON
|
||||
-DBUILD_PYTHON=OFF
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
@ -381,7 +381,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
|
||||
-DCMAKE_CXX_EXTENSIONS=ON
|
||||
-DCMAKE_C_STANDARD=11
|
||||
-DCMAKE_C_EXTENSIONS=ON
|
||||
BUILD_COMMAND ${GPSTK_BUILD_COMMAND}
|
||||
BUILD_COMMAND ${GNSSTK_BUILD_COMMAND}
|
||||
UPDATE_COMMAND ""
|
||||
)
|
||||
else()
|
||||
@ -389,18 +389,18 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(NUMBER_OF_PROCESSORS)
|
||||
if(NUMBER_OF_PROCESSORS GREATER 1)
|
||||
set(GPSTK_PARALLEL_BUILD "-j${NUMBER_OF_PROCESSORS}")
|
||||
set(GNSSTK_PARALLEL_BUILD "-j${NUMBER_OF_PROCESSORS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
|
||||
GIT_REPOSITORY https://github.com/SGL-UT/GPSTk
|
||||
GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION}
|
||||
SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
|
||||
BINARY_DIR ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
|
||||
PATCH_COMMAND ${GPSTK_PATCH_COMMAND}
|
||||
ExternalProject_Add(gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
|
||||
GIT_REPOSITORY https://github.com/SGL-UT/gnsstk
|
||||
GIT_TAG v${GNSSSDR_GNSSTK_LOCAL_VERSION}
|
||||
SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
|
||||
BINARY_DIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
|
||||
PATCH_COMMAND ${GNSSTK_PATCH_COMMAND}
|
||||
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG}
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install
|
||||
-DBUILD_EXT=ON
|
||||
-DBUILD_PYTHON=OFF
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
@ -408,28 +408,28 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
|
||||
-DCMAKE_CXX_EXTENSIONS=ON
|
||||
-DCMAKE_C_STANDARD=11
|
||||
-DCMAKE_C_EXTENSIONS=ON
|
||||
BUILD_COMMAND ${GPSTK_BUILD_COMMAND} ${GPSTK_PARALLEL_BUILD}
|
||||
BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
BUILD_COMMAND ${GNSSTK_BUILD_COMMAND} ${GNSSTK_PARALLEL_BUILD}
|
||||
BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
UPDATE_COMMAND ""
|
||||
)
|
||||
endif()
|
||||
set(GPSTK_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GPSTK headers")
|
||||
set(GPSTK_LIBRARY ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(GPSTK_BINDIR ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/)
|
||||
add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}")
|
||||
add_library(Gpstk::gpstk STATIC IMPORTED)
|
||||
add_dependencies(Gpstk::gpstk gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION})
|
||||
file(MAKE_DIRECTORY ${GPSTK_INCLUDE_DIRS})
|
||||
file(MAKE_DIRECTORY ${GPSTK_INCLUDE_DIRS}/gpstk)
|
||||
set_target_properties(Gpstk::gpstk PROPERTIES
|
||||
set(GNSSTK_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GNSSTK headers")
|
||||
set(GNSSTK_LIBRARY ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(GNSSTK_BINDIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/bin/)
|
||||
add_definitions(-DGNSSTK_BINDIR="${GNSSTK_BINDIR}")
|
||||
add_library(Gnsstk::gnsstk STATIC IMPORTED)
|
||||
add_dependencies(Gnsstk::gnsstk gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION})
|
||||
file(MAKE_DIRECTORY ${GNSSTK_INCLUDE_DIRS})
|
||||
file(MAKE_DIRECTORY ${GNSSTK_INCLUDE_DIRS}/gnsstk)
|
||||
set_target_properties(Gnsstk::gnsstk PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
||||
IMPORTED_LOCATION "${GPSTK_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${GPSTK_INCLUDE_DIRS};${GPSTK_INCLUDE_DIRS}/gpstk"
|
||||
INTERFACE_LINK_LIBRARIES "${GPSTK_LIBRARY}"
|
||||
IMPORTED_LOCATION "${GNSSTK_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${GNSSTK_INCLUDE_DIRS};${GNSSTK_INCLUDE_DIRS}/gnsstk"
|
||||
INTERFACE_LINK_LIBRARIES "${GNSSTK_LIBRARY}"
|
||||
)
|
||||
else()
|
||||
set(GPSTK_BINDIR ${GPSTK_INCLUDE_DIR}/../bin/)
|
||||
add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}")
|
||||
set(GNSSTK_BINDIR ${GNSSTK_INCLUDE_DIR}/../bin/)
|
||||
add_definitions(-DGNSSTK_BINDIR="${GNSSTK_BINDIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -554,10 +554,13 @@ if(ENABLE_UNIT_TESTING)
|
||||
)
|
||||
endif()
|
||||
if(ENABLE_UNIT_TESTING_EXTRA)
|
||||
target_link_libraries(run_tests PRIVATE Gpstk::gpstk)
|
||||
if(GPSTK_OLDER_THAN_8)
|
||||
target_link_libraries(run_tests PRIVATE Gnsstk::gnsstk)
|
||||
if(GNSSTK_OLDER_THAN_8)
|
||||
target_compile_definitions(run_tests PRIVATE -DOLD_GPSTK=1)
|
||||
endif()
|
||||
if(GNSSTK_USES_GPSTK_NAMESPACE)
|
||||
target_compile_definitions(run_tests PRIVATE -DGNSSTK_USES_GPSTK_NAMESPACE=1)
|
||||
endif()
|
||||
endif()
|
||||
if(ENABLE_STRIP)
|
||||
set_target_properties(run_tests PROPERTIES LINK_FLAGS "-s")
|
||||
|
39
src/tests/data/gnsstk_static.patch
Normal file
39
src/tests/data/gnsstk_static.patch
Normal file
@ -0,0 +1,39 @@
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
SPDX-FileCopyrightText: 2022 Carles Fernandez-Prades <carles.fernandez@cttc.es>
|
||||
--- CMakeLists.txt 2022-07-02 20:14:59.000000000 +0200
|
||||
+++ CMakeLists.txt 2022-07-02 20:16:55.000000000 +0200
|
||||
@@ -6,7 +6,7 @@
|
||||
# Is dependend on by $GNSSTK/build.sh
|
||||
#============================================================
|
||||
|
||||
-cmake_minimum_required( VERSION 2.8.5 )
|
||||
+cmake_minimum_required( VERSION 2.8.12 )
|
||||
|
||||
project( GNSSTK )
|
||||
set( GNSSTK_VERSION_MAJOR "12" )
|
||||
@@ -77,6 +77,16 @@
|
||||
|
||||
|
||||
include( BuildSetup.cmake )
|
||||
+set(STADYN "STATIC")
|
||||
+if(POLICY CMP0063)
|
||||
+ cmake_policy(SET CMP0063 NEW)
|
||||
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
+ set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
|
||||
+else()
|
||||
+ if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
+ add_definitions(-fvisibility=hidden)
|
||||
+ endif()
|
||||
+endif()
|
||||
|
||||
#============================================================
|
||||
# Core Library Target Files
|
||||
@@ -161,7 +171,7 @@
|
||||
add_library( gnsstk ${STADYN} ${GNSSTK_SRC_FILES} ${GNSSTK_INC_FILES} )
|
||||
|
||||
# GNSSTk library install target
|
||||
-install( TARGETS gnsstk DESTINATION "${CMAKE_INSTALL_LIBDIR}" EXPORT "${EXPORT_TARGETS_FILENAME}" )
|
||||
+install( TARGETS gnsstk DESTINATION lib EXPORT "${EXPORT_TARGETS_FILENAME}" )
|
||||
|
||||
# GNSSTk header file install target (whether it is version dependent changes based on user flag)
|
||||
install( FILES ${GNSSTK_INC_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
|
@ -1,31 +0,0 @@
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
SPDX-FileCopyrightText: 2020 Carles Fernandez-Prades <carles.fernandez@cttc.es>
|
||||
--- CMakeLists.txt 2022-04-05 23:24:04.000000000 +0200
|
||||
+++ CMakeLists.txt 2022-04-05 23:29:02.000000000 +0200
|
||||
@@ -77,7 +77,16 @@
|
||||
|
||||
|
||||
include( BuildSetup.cmake )
|
||||
-
|
||||
+set(STADYN "STATIC")
|
||||
+if(POLICY CMP0063)
|
||||
+ cmake_policy(SET CMP0063 NEW)
|
||||
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
+ set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
|
||||
+else()
|
||||
+ if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
+ add_definitions(-fvisibility=hidden)
|
||||
+ endif()
|
||||
+endif()
|
||||
#============================================================
|
||||
# Core Library Target Files
|
||||
#============================================================
|
||||
@@ -160,7 +169,7 @@
|
||||
add_library( gpstk ${STADYN} ${GPSTK_SRC_FILES} ${GPSTK_INC_FILES} )
|
||||
|
||||
# GPSTk library install target
|
||||
-install( TARGETS gpstk DESTINATION "${CMAKE_INSTALL_LIBDIR}" EXPORT "${EXPORT_TARGETS_FILENAME}" )
|
||||
+install( TARGETS gpstk DESTINATION lib EXPORT "${EXPORT_TARGETS_FILENAME}" )
|
||||
|
||||
# GPSTk header file install target (whether it is version dependent changes based on user flag)
|
||||
install( FILES ${GPSTK_INC_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
|
@ -57,11 +57,6 @@
|
||||
#include <gnuradio/blocks/null_sink.h>
|
||||
#include <gnuradio/filter/firdes.h>
|
||||
#include <gnuradio/top_block.h>
|
||||
#include <gpstk/Rinex3ObsBase.hpp>
|
||||
#include <gpstk/Rinex3ObsData.hpp>
|
||||
#include <gpstk/Rinex3ObsHeader.hpp>
|
||||
#include <gpstk/Rinex3ObsStream.hpp>
|
||||
#include <gpstk/RinexUtilities.hpp>
|
||||
#include <gtest/gtest.h>
|
||||
#include <matio.h>
|
||||
#include <pmt/pmt.h>
|
||||
@ -70,6 +65,20 @@
|
||||
#include <exception>
|
||||
#include <unistd.h>
|
||||
#include <utility>
|
||||
#if GNSSTK_USES_GPSTK_NAMESPACE
|
||||
#include <gpstk/Rinex3ObsBase.hpp>
|
||||
#include <gpstk/Rinex3ObsData.hpp>
|
||||
#include <gpstk/Rinex3ObsHeader.hpp>
|
||||
#include <gpstk/Rinex3ObsStream.hpp>
|
||||
#include <gpstk/RinexUtilities.hpp>
|
||||
namespace gnsstk = gpstk;
|
||||
#else
|
||||
#include <gnsstk/Rinex3ObsBase.hpp>
|
||||
#include <gnsstk/Rinex3ObsData.hpp>
|
||||
#include <gnsstk/Rinex3ObsHeader.hpp>
|
||||
#include <gnsstk/Rinex3ObsStream.hpp>
|
||||
#include <gnsstk/RinexUtilities.hpp>
|
||||
#endif
|
||||
|
||||
#if HAS_GENERIC_LAMBDA
|
||||
#else
|
||||
@ -1556,17 +1565,17 @@ bool HybridObservablesTest::ReadRinexObs(std::vector<arma::mat>* obs_vec, Gnss_S
|
||||
// Open and read reference RINEX observables file
|
||||
try
|
||||
{
|
||||
gpstk::Rinex3ObsStream r_ref(FLAGS_filename_rinex_obs);
|
||||
gnsstk::Rinex3ObsStream r_ref(FLAGS_filename_rinex_obs);
|
||||
r_ref.exceptions(std::ios::failbit);
|
||||
gpstk::Rinex3ObsData r_ref_data;
|
||||
gpstk::Rinex3ObsHeader r_ref_header;
|
||||
gnsstk::Rinex3ObsData r_ref_data;
|
||||
gnsstk::Rinex3ObsHeader r_ref_header;
|
||||
|
||||
gpstk::RinexDatum dataobj;
|
||||
gnsstk::RinexDatum dataobj;
|
||||
|
||||
r_ref >> r_ref_header;
|
||||
|
||||
std::vector<bool> first_row;
|
||||
gpstk::SatID prn;
|
||||
gnsstk::SatID prn;
|
||||
for (unsigned int n = 0; n < gnss_synchro_vec.size(); n++)
|
||||
{
|
||||
first_row.push_back(true);
|
||||
@ -1582,28 +1591,28 @@ bool HybridObservablesTest::ReadRinexObs(std::vector<arma::mat>* obs_vec, Gnss_S
|
||||
{
|
||||
case 'G':
|
||||
#if OLD_GPSTK
|
||||
prn = gpstk::SatID(myprn, gpstk::SatID::systemGPS);
|
||||
prn = gnsstk::SatID(myprn, gnsstk::SatID::systemGPS);
|
||||
#else
|
||||
prn = gpstk::SatID(myprn, gpstk::SatelliteSystem::GPS);
|
||||
prn = gnsstk::SatID(myprn, gnsstk::SatelliteSystem::GPS);
|
||||
#endif
|
||||
break;
|
||||
case 'E':
|
||||
#if OLD_GPSTK
|
||||
prn = gpstk::SatID(myprn, gpstk::SatID::systemGalileo);
|
||||
prn = gnsstk::SatID(myprn, gnsstk::SatID::systemGalileo);
|
||||
#else
|
||||
prn = gpstk::SatID(myprn, gpstk::SatelliteSystem::Galileo);
|
||||
prn = gnsstk::SatID(myprn, gnsstk::SatelliteSystem::Galileo);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
#if OLD_GPSTK
|
||||
prn = gpstk::SatID(myprn, gpstk::SatID::systemGPS);
|
||||
prn = gnsstk::SatID(myprn, gnsstk::SatID::systemGPS);
|
||||
#else
|
||||
prn = gpstk::SatID(myprn, gpstk::SatelliteSystem::GPS);
|
||||
prn = gnsstk::SatID(myprn, gnsstk::SatelliteSystem::GPS);
|
||||
#endif
|
||||
}
|
||||
|
||||
gpstk::CommonTime time = r_ref_data.time;
|
||||
double sow(static_cast<gpstk::GPSWeekSecond>(time).sow);
|
||||
gnsstk::CommonTime time = r_ref_data.time;
|
||||
double sow(static_cast<gnsstk::GPSWeekSecond>(time).sow);
|
||||
|
||||
auto pointer = r_ref_data.obs.find(prn);
|
||||
if (pointer == r_ref_data.obs.end())
|
||||
@ -1680,12 +1689,12 @@ bool HybridObservablesTest::ReadRinexObs(std::vector<arma::mat>* obs_vec, Gnss_S
|
||||
}
|
||||
} // end while
|
||||
} // End of 'try' block
|
||||
catch (const gpstk::FFStreamError& e)
|
||||
catch (const gnsstk::FFStreamError& e)
|
||||
{
|
||||
std::cout << e;
|
||||
return false;
|
||||
}
|
||||
catch (const gpstk::Exception& e)
|
||||
catch (const gnsstk::Exception& e)
|
||||
{
|
||||
std::cout << e;
|
||||
return false;
|
||||
|
@ -56,11 +56,6 @@
|
||||
#include <gnuradio/blocks/null_sink.h>
|
||||
#include <gnuradio/filter/firdes.h>
|
||||
#include <gnuradio/top_block.h>
|
||||
#include <gpstk/Rinex3ObsBase.hpp>
|
||||
#include <gpstk/Rinex3ObsData.hpp>
|
||||
#include <gpstk/Rinex3ObsHeader.hpp>
|
||||
#include <gpstk/Rinex3ObsStream.hpp>
|
||||
#include <gpstk/RinexUtilities.hpp>
|
||||
#include <gtest/gtest.h>
|
||||
#include <matio.h>
|
||||
#include <pmt/pmt.h>
|
||||
@ -71,6 +66,21 @@
|
||||
#include <unistd.h>
|
||||
#include <utility>
|
||||
|
||||
#if GNSSTK_USES_GPSTK_NAMESPACE
|
||||
#include <gpstk/Rinex3ObsBase.hpp>
|
||||
#include <gpstk/Rinex3ObsData.hpp>
|
||||
#include <gpstk/Rinex3ObsHeader.hpp>
|
||||
#include <gpstk/Rinex3ObsStream.hpp>
|
||||
#include <gpstk/RinexUtilities.hpp>
|
||||
namespace gnsstk = gpstk;
|
||||
#else
|
||||
#include <gnsstk/Rinex3ObsBase.hpp>
|
||||
#include <gnsstk/Rinex3ObsData.hpp>
|
||||
#include <gnsstk/Rinex3ObsHeader.hpp>
|
||||
#include <gnsstk/Rinex3ObsStream.hpp>
|
||||
#include <gnsstk/RinexUtilities.hpp>
|
||||
#endif
|
||||
|
||||
#if HAS_GENERIC_LAMBDA
|
||||
#else
|
||||
#include <boost/bind/bind.hpp>
|
||||
@ -1648,17 +1658,17 @@ bool HybridObservablesTestFpga::ReadRinexObs(std::vector<arma::mat>* obs_vec, Gn
|
||||
// Open and read reference RINEX observables file
|
||||
try
|
||||
{
|
||||
gpstk::Rinex3ObsStream r_ref(FLAGS_filename_rinex_obs);
|
||||
gnsstk::Rinex3ObsStream r_ref(FLAGS_filename_rinex_obs);
|
||||
r_ref.exceptions(std::ios::failbit);
|
||||
gpstk::Rinex3ObsData r_ref_data;
|
||||
gpstk::Rinex3ObsHeader r_ref_header;
|
||||
gnsstk::Rinex3ObsData r_ref_data;
|
||||
gnsstk::Rinex3ObsHeader r_ref_header;
|
||||
|
||||
gpstk::RinexDatum dataobj;
|
||||
gnsstk::RinexDatum dataobj;
|
||||
|
||||
r_ref >> r_ref_header;
|
||||
|
||||
std::vector<bool> first_row;
|
||||
gpstk::SatID prn;
|
||||
gnsstk::SatID prn;
|
||||
for (unsigned int n = 0; n < gnss_synchro_vec.size(); n++)
|
||||
{
|
||||
first_row.push_back(true);
|
||||
@ -1674,28 +1684,28 @@ bool HybridObservablesTestFpga::ReadRinexObs(std::vector<arma::mat>* obs_vec, Gn
|
||||
{
|
||||
case 'G':
|
||||
#if OLD_GPSTK
|
||||
prn = gpstk::SatID(myprn, gpstk::SatID::systemGPS);
|
||||
prn = gnsstk::SatID(myprn, gnsstk::SatID::systemGPS);
|
||||
#else
|
||||
prn = gpstk::SatID(myprn, gpstk::SatelliteSystem::GPS);
|
||||
prn = gnsstk::SatID(myprn, gnsstk::SatelliteSystem::GPS);
|
||||
#endif
|
||||
break;
|
||||
case 'E':
|
||||
#if OLD_GPSTK
|
||||
prn = gpstk::SatID(myprn, gpstk::SatID::systemGalileo);
|
||||
prn = gnsstk::SatID(myprn, gnsstk::SatID::systemGalileo);
|
||||
#else
|
||||
prn = gpstk::SatID(myprn, gpstk::SatelliteSystem::Galileo);
|
||||
prn = gnsstk::SatID(myprn, gnsstk::SatelliteSystem::Galileo);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
#if OLD_GPSTK
|
||||
prn = gpstk::SatID(myprn, gpstk::SatID::systemGPS);
|
||||
prn = gnsstk::SatID(myprn, gnsstk::SatID::systemGPS);
|
||||
#else
|
||||
prn = gpstk::SatID(myprn, gpstk::SatelliteSystem::GPS);
|
||||
prn = gnsstk::SatID(myprn, gnsstk::SatelliteSystem::GPS);
|
||||
#endif
|
||||
}
|
||||
|
||||
gpstk::CommonTime time = r_ref_data.time;
|
||||
double sow(static_cast<gpstk::GPSWeekSecond>(time).sow);
|
||||
gnsstk::CommonTime time = r_ref_data.time;
|
||||
double sow(static_cast<gnsstk::GPSWeekSecond>(time).sow);
|
||||
|
||||
auto pointer = r_ref_data.obs.find(prn);
|
||||
if (pointer == r_ref_data.obs.end())
|
||||
@ -1773,12 +1783,12 @@ bool HybridObservablesTestFpga::ReadRinexObs(std::vector<arma::mat>* obs_vec, Gn
|
||||
} // end while
|
||||
} // End of 'try' block
|
||||
|
||||
catch (const gpstk::FFStreamError& e)
|
||||
catch (const gnsstk::FFStreamError& e)
|
||||
{
|
||||
std::cout << e;
|
||||
return false;
|
||||
}
|
||||
catch (const gpstk::Exception& e)
|
||||
catch (const gnsstk::Exception& e)
|
||||
{
|
||||
std::cout << e;
|
||||
return false;
|
||||
|
@ -7,11 +7,18 @@
|
||||
|
||||
if("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "9.800" OR (NOT ARMADILLO_FOUND) OR ENABLE_OWN_ARMADILLO) # requires back(), introduced in Armadillo 9.800
|
||||
message(STATUS "The obsdiff utility tool will be built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'")
|
||||
find_package(GPSTK QUIET)
|
||||
if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
|
||||
if(NOT GNSSTK_FOUND)
|
||||
find_package(GNSSTK)
|
||||
endif()
|
||||
if(NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK)
|
||||
include(GNUInstallDirs)
|
||||
set(GPSTK_LIBRARY ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(GPSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include)
|
||||
if(GNSSTK_USES_GPSTK_NAMESPACE)
|
||||
set(GNSSTK_LIBRARY ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(GNSSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include)
|
||||
else()
|
||||
set(GNSSTK_LIBRARY ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(GNSSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(USE_CMAKE_TARGET_SOURCES)
|
||||
@ -48,23 +55,43 @@ if("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "9.800" OR (NOT ARMADILLO_FOUND
|
||||
if(NOT GFLAGS_FOUND)
|
||||
add_dependencies(obsdiff gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION})
|
||||
endif()
|
||||
if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
|
||||
add_dependencies(obsdiff gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION})
|
||||
if(NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK)
|
||||
add_dependencies(obsdiff gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION})
|
||||
endif()
|
||||
if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERSION})
|
||||
add_dependencies(obsdiff matio-${GNSSSDR_MATIO_LOCAL_VERSION})
|
||||
endif()
|
||||
|
||||
if(NOT TARGET Gpstk::gpstk)
|
||||
file(MAKE_DIRECTORY ${GPSTK_INCLUDE_DIR}/gpstk)
|
||||
add_library(Gpstk::gpstk STATIC IMPORTED)
|
||||
add_dependencies(Gpstk::gpstk gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION})
|
||||
set_target_properties(Gpstk::gpstk PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
||||
IMPORTED_LOCATION "${GPSTK_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${GPSTK_INCLUDE_DIR};${GPSTK_INCLUDE_DIR}/gpstk"
|
||||
INTERFACE_LINK_LIBRARIES "${GPSTK_LIBRARY}"
|
||||
)
|
||||
if(GNSSTK_USES_GPSTK_NAMESPACE)
|
||||
target_compile_definitions(obsdiff PRIVATE -DGNSSTK_USES_GPSTK_NAMESPACE=1)
|
||||
endif()
|
||||
if(GNSSTK_OLDER_THAN_8)
|
||||
target_compile_definitions(obsdiff PRIVATE -DOLD_GPSTK=1)
|
||||
endif()
|
||||
if(GNSSTK_OLDER_THAN_9)
|
||||
target_compile_definitions(obsdiff PRIVATE -DGNSSTK_OLDER_THAN_9=1)
|
||||
endif()
|
||||
if(NOT TARGET Gnsstk::gnsstk)
|
||||
if(GNSSTK_USES_GPSTK_NAMESPACE)
|
||||
file(MAKE_DIRECTORY ${GNSSTK_INCLUDE_DIR}/gpstk)
|
||||
add_library(Gnsstk::gnsstk STATIC IMPORTED)
|
||||
add_dependencies(Gnsstk::gnsstk gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION})
|
||||
set_target_properties(Gnsstk::gnsstk PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
||||
IMPORTED_LOCATION "${GNSSTK_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${GNSSTK_INCLUDE_DIR};${GNSSTK_INCLUDE_DIR}/gpstk"
|
||||
INTERFACE_LINK_LIBRARIES "${GNSSTK_LIBRARY}"
|
||||
)
|
||||
else()
|
||||
file(MAKE_DIRECTORY ${GNSSTK_INCLUDE_DIR}/gnsstk)
|
||||
add_library(Gnsstk::gnsstk STATIC IMPORTED)
|
||||
add_dependencies(Gnsstk::gnsstk gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION})
|
||||
set_target_properties(Gnsstk::gnsstk PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
||||
IMPORTED_LOCATION "${GNSSTK_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${GNSSTK_INCLUDE_DIR};${GNSSTK_INCLUDE_DIR}/gnsstk"
|
||||
INTERFACE_LINK_LIBRARIES "${GNSSTK_LIBRARY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(obsdiff
|
||||
@ -73,13 +100,9 @@ if("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "9.800" OR (NOT ARMADILLO_FOUND
|
||||
Threads::Threads
|
||||
Gflags::gflags
|
||||
Matio::matio
|
||||
Gpstk::gpstk
|
||||
Gnsstk::gnsstk
|
||||
)
|
||||
|
||||
if(GPSTK_OLDER_THAN_8)
|
||||
target_compile_definitions(obsdiff PUBLIC -DOLD_GPSTK=1)
|
||||
endif()
|
||||
|
||||
if(ENABLE_STRIP)
|
||||
set_target_properties(obsdiff PROPERTIES LINK_FLAGS "-s")
|
||||
endif()
|
||||
|
@ -23,8 +23,8 @@ Requirements:
|
||||
- [Gflags](https://github.com/gflags/gflags): A C++ library that implements
|
||||
command-line flags processing. If not found in your system, the latest version
|
||||
will be downloaded, built and linked for you at building time.
|
||||
- [GPSTK](https://github.com/SGL-UT/GPSTk): The GPS Toolkit, used for RINEX
|
||||
files reading. If not found in your system, the latest version will be
|
||||
- [GNSSTK](https://github.com/SGL-UT/gnsstk): The GNSSTk C++ Library, used for
|
||||
RINEX files reading. If not found in your system, the latest version will be
|
||||
downloaded, built and linked for you at building time.
|
||||
- [Matio](https://github.com/tbeu/matio): A MATLAB MAT File I/O Library,
|
||||
version >= 1.5.3. If it is not found, or an older version is found, CMake will
|
||||
|
@ -21,34 +21,6 @@
|
||||
#include "gnuplot_i.h"
|
||||
#include "obsdiff_flags.h"
|
||||
#include <armadillo>
|
||||
// Classes for handling observations RINEX files (data)
|
||||
#include <gpstk/Rinex3ObsData.hpp>
|
||||
#include <gpstk/Rinex3ObsHeader.hpp>
|
||||
#include <gpstk/Rinex3ObsStream.hpp>
|
||||
|
||||
// Classes for handling satellite navigation parameters RINEX
|
||||
// files (ephemerides)
|
||||
#include <gpstk/Rinex3NavData.hpp>
|
||||
#include <gpstk/Rinex3NavHeader.hpp>
|
||||
#include <gpstk/Rinex3NavStream.hpp>
|
||||
|
||||
// Classes for handling RINEX files with meteorological parameters
|
||||
#include <gpstk/RinexMetBase.hpp>
|
||||
#include <gpstk/RinexMetData.hpp>
|
||||
#include <gpstk/RinexMetHeader.hpp>
|
||||
#include <gpstk/RinexMetStream.hpp>
|
||||
|
||||
// Class for handling tropospheric model
|
||||
#include <gpstk/GGTropModel.hpp>
|
||||
|
||||
// Class for storing >broadcast-type> ephemerides
|
||||
#include <gpstk/GPSEphemerisStore.hpp>
|
||||
|
||||
// Class for handling RAIM
|
||||
#include <gpstk/PRSolution.hpp>
|
||||
|
||||
// Class defining GPS system constants
|
||||
#include <gpstk/GNSSconstants.hpp>
|
||||
#include <matio.h>
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
@ -60,6 +32,53 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#if GNSSTK_USES_GPSTK_NAMESPACE
|
||||
#include <gpstk/GGTropModel.hpp>
|
||||
#include <gpstk/GNSSconstants.hpp>
|
||||
#include <gpstk/GPSEphemerisStore.hpp>
|
||||
#include <gpstk/PRSolution.hpp>
|
||||
#include <gpstk/Rinex3NavData.hpp>
|
||||
#include <gpstk/Rinex3NavHeader.hpp>
|
||||
#include <gpstk/Rinex3NavStream.hpp>
|
||||
#include <gpstk/Rinex3ObsData.hpp>
|
||||
#include <gpstk/Rinex3ObsHeader.hpp>
|
||||
#include <gpstk/Rinex3ObsStream.hpp>
|
||||
#include <gpstk/RinexMetBase.hpp>
|
||||
#include <gpstk/RinexMetData.hpp>
|
||||
#include <gpstk/RinexMetHeader.hpp>
|
||||
#include <gpstk/RinexMetStream.hpp>
|
||||
namespace gnsstk = gpstk;
|
||||
#else
|
||||
// Classes for handling observations RINEX files (data)
|
||||
#include <gnsstk/Rinex3ObsData.hpp>
|
||||
#include <gnsstk/Rinex3ObsHeader.hpp>
|
||||
#include <gnsstk/Rinex3ObsStream.hpp>
|
||||
|
||||
// Classes for handling satellite navigation parameters RINEX
|
||||
// files (ephemerides)
|
||||
#include <gnsstk/Rinex3NavData.hpp>
|
||||
#include <gnsstk/Rinex3NavHeader.hpp>
|
||||
#include <gnsstk/Rinex3NavStream.hpp>
|
||||
|
||||
// Classes for handling RINEX files with meteorological parameters
|
||||
#include <gnsstk/RinexMetBase.hpp>
|
||||
#include <gnsstk/RinexMetData.hpp>
|
||||
#include <gnsstk/RinexMetHeader.hpp>
|
||||
#include <gnsstk/RinexMetStream.hpp>
|
||||
|
||||
// Class for handling tropospheric model
|
||||
#include <gnsstk/GGTropModel.hpp>
|
||||
|
||||
// Class for storing >broadcast-type> ephemerides
|
||||
#include <gnsstk/GPSEphemerisStore.hpp>
|
||||
|
||||
// Class for handling RAIM
|
||||
#include <gnsstk/PRSolution.hpp>
|
||||
|
||||
// Class defining GPS system constants
|
||||
#include <gnsstk/GNSSconstants.hpp>
|
||||
#endif
|
||||
|
||||
#if GFLAGS_OLD_NAMESPACE
|
||||
namespace gflags
|
||||
{
|
||||
@ -97,40 +116,40 @@ std::map<int, arma::mat> ReadRinexObs(const std::string& rinex_file, char system
|
||||
// Open and read _baseerence RINEX observables file
|
||||
try
|
||||
{
|
||||
gpstk::Rinex3ObsStream r_base(rinex_file);
|
||||
gnsstk::Rinex3ObsStream r_base(rinex_file);
|
||||
|
||||
gpstk::Rinex3ObsData r_base_data;
|
||||
gpstk::Rinex3ObsHeader r_base_header;
|
||||
gnsstk::Rinex3ObsData r_base_data;
|
||||
gnsstk::Rinex3ObsHeader r_base_header;
|
||||
|
||||
gpstk::RinexDatum dataobj;
|
||||
gnsstk::RinexDatum dataobj;
|
||||
|
||||
r_base >> r_base_header;
|
||||
|
||||
std::set<int> PRN_set;
|
||||
gpstk::SatID prn;
|
||||
gnsstk::SatID prn;
|
||||
switch (system)
|
||||
{
|
||||
case 'G':
|
||||
#if OLD_GPSTK
|
||||
prn.system = gpstk::SatID::systemGPS;
|
||||
prn.system = gnsstk::SatID::systemGPS;
|
||||
#else
|
||||
prn.system = gpstk::SatelliteSystem::GPS;
|
||||
prn.system = gnsstk::SatelliteSystem::GPS;
|
||||
#endif
|
||||
PRN_set = available_gps_prn;
|
||||
break;
|
||||
case 'E':
|
||||
#if OLD_GPSTK
|
||||
prn.system = gpstk::SatID::systemGalileo;
|
||||
prn.system = gnsstk::SatID::systemGalileo;
|
||||
#else
|
||||
prn.system = gpstk::SatelliteSystem::Galileo;
|
||||
prn.system = gnsstk::SatelliteSystem::Galileo;
|
||||
#endif
|
||||
PRN_set = available_galileo_prn;
|
||||
break;
|
||||
default:
|
||||
#if OLD_GPSTK
|
||||
prn.system = gpstk::SatID::systemGPS;
|
||||
prn.system = gnsstk::SatID::systemGPS;
|
||||
#else
|
||||
prn.system = gpstk::SatelliteSystem::GPS;
|
||||
prn.system = gnsstk::SatelliteSystem::GPS;
|
||||
#endif
|
||||
PRN_set = available_gps_prn;
|
||||
}
|
||||
@ -141,8 +160,8 @@ std::map<int, arma::mat> ReadRinexObs(const std::string& rinex_file, char system
|
||||
for (const auto& prn_it : PRN_set)
|
||||
{
|
||||
prn.id = prn_it;
|
||||
gpstk::CommonTime time = r_base_data.time;
|
||||
double sow(static_cast<gpstk::GPSWeekSecond>(time).sow);
|
||||
gnsstk::CommonTime time = r_base_data.time;
|
||||
double sow(static_cast<gnsstk::GPSWeekSecond>(time).sow);
|
||||
|
||||
auto pointer = r_base_data.obs.find(prn);
|
||||
|
||||
@ -220,12 +239,12 @@ std::map<int, arma::mat> ReadRinexObs(const std::string& rinex_file, char system
|
||||
}
|
||||
} // end while
|
||||
} // End of 'try' block
|
||||
catch (const gpstk::FFStreamError& e)
|
||||
catch (const gnsstk::FFStreamError& e)
|
||||
{
|
||||
std::cout << e;
|
||||
return obs_map;
|
||||
}
|
||||
catch (const gpstk::Exception& e)
|
||||
catch (const gnsstk::Exception& e)
|
||||
{
|
||||
std::cout << e;
|
||||
return obs_map;
|
||||
@ -906,7 +925,7 @@ void coderate_phaserate_consistence(
|
||||
arma::vec prange = measured_ch0.col(1);
|
||||
|
||||
// todo: This code is only valid for L1/E1 carrier frequency.
|
||||
arma::vec phase = measured_ch0.col(3) * (gpstk::C_MPS / gpstk::L1_FREQ_GPS);
|
||||
arma::vec phase = measured_ch0.col(3) * (gnsstk::C_MPS / gnsstk::L1_FREQ_GPS);
|
||||
|
||||
double mincodeval = 5000000.0;
|
||||
double maxcodeval = 40000000.0;
|
||||
@ -1051,7 +1070,7 @@ void code_phase_diff(
|
||||
arma::interp1(measured_ch1.col(0), measured_ch1.col(3), measurement_time, carrier_phase_ch1_obs_interp);
|
||||
|
||||
// generate Code - Phase vector
|
||||
arma::vec code_minus_phase = (measured_ch0.col(1) - code_range_ch1_obs_interp) - (measured_ch0.col(3) - carrier_phase_ch1_obs_interp) * (gpstk::C_MPS / gpstk::L1_FREQ_GPS);
|
||||
arma::vec code_minus_phase = (measured_ch0.col(1) - code_range_ch1_obs_interp) - (measured_ch0.col(3) - carrier_phase_ch1_obs_interp) * (gnsstk::C_MPS / gnsstk::L1_FREQ_GPS);
|
||||
|
||||
// remove NaN
|
||||
arma::uvec NaN_in_measured_data = arma::find_nonfinite(code_minus_phase);
|
||||
@ -1135,28 +1154,28 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
|
||||
return 0.0;
|
||||
}
|
||||
// Declaration of objects for storing ephemerides and handling RAIM
|
||||
gpstk::GPSEphemerisStore bcestore;
|
||||
gpstk::PRSolution raimSolver;
|
||||
gnsstk::GPSEphemerisStore bcestore;
|
||||
gnsstk::PRSolution raimSolver;
|
||||
|
||||
// Object for void-type tropospheric model (in case no meteorological
|
||||
// RINEX is available)
|
||||
gpstk::ZeroTropModel noTropModel;
|
||||
gnsstk::ZeroTropModel noTropModel;
|
||||
|
||||
// Object for GG-type tropospheric model (Goad and Goodman, 1974)
|
||||
// Default constructor => default values for model
|
||||
gpstk::GGTropModel ggTropModel;
|
||||
gnsstk::GGTropModel ggTropModel;
|
||||
|
||||
// Pointer to one of the two available tropospheric models. It points
|
||||
// to the void model by default
|
||||
gpstk::TropModel* tropModelPtr = &noTropModel;
|
||||
gnsstk::TropModel* tropModelPtr = &noTropModel;
|
||||
|
||||
double rx_clock_error_s = 0.0;
|
||||
try
|
||||
{
|
||||
// Read nav file and store unique list of ephemerides
|
||||
gpstk::Rinex3NavStream rnffs(rinex_nav_filename.c_str()); // Open ephemerides data file
|
||||
gpstk::Rinex3NavData rne;
|
||||
gpstk::Rinex3NavHeader hdr;
|
||||
gnsstk::Rinex3NavStream rnffs(rinex_nav_filename.c_str()); // Open ephemerides data file
|
||||
gnsstk::Rinex3NavData rne;
|
||||
gnsstk::Rinex3NavHeader hdr;
|
||||
|
||||
// Let's read the header (may be skipped)
|
||||
rnffs >> hdr;
|
||||
@ -1172,10 +1191,10 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
|
||||
|
||||
// Open and read the observation file one epoch at a time.
|
||||
// For each epoch, compute and print a position solution
|
||||
gpstk::Rinex3ObsStream roffs(rinex_obs_file.c_str()); // Open observations data file
|
||||
gnsstk::Rinex3ObsStream roffs(rinex_obs_file.c_str()); // Open observations data file
|
||||
|
||||
gpstk::Rinex3ObsHeader roh;
|
||||
gpstk::Rinex3ObsData rod;
|
||||
gnsstk::Rinex3ObsHeader roh;
|
||||
gnsstk::Rinex3ObsData rod;
|
||||
|
||||
// Let's read the header
|
||||
roffs >> roh;
|
||||
@ -1197,14 +1216,14 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
|
||||
// Apply editing criteria
|
||||
if (rod.epochFlag == 0 || rod.epochFlag == 1) // Begin usable data
|
||||
{
|
||||
std::vector<gpstk::SatID> prnVec;
|
||||
std::vector<gnsstk::SatID> prnVec;
|
||||
std::vector<double> rangeVec;
|
||||
|
||||
// Define the "it" iterator to visit the observations PRN map.
|
||||
// Rinex3ObsData::DataMap is a map from RinexSatID to
|
||||
// vector<RinexDatum>:
|
||||
// std::map<RinexSatID, vector<RinexDatum> >
|
||||
gpstk::Rinex3ObsData::DataMap::const_iterator it;
|
||||
gnsstk::Rinex3ObsData::DataMap::const_iterator it;
|
||||
|
||||
// This part gets the PRN numbers and ionosphere-corrected
|
||||
// pseudoranges for the current epoch. They are correspondly fed
|
||||
@ -1254,7 +1273,7 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
|
||||
#if OLD_GPSTK
|
||||
std::vector<gpstk::SatID::SatelliteSystem> Syss;
|
||||
#endif
|
||||
gpstk::Matrix<double> invMC;
|
||||
gnsstk::Matrix<double> invMC;
|
||||
int iret;
|
||||
// Call RAIMCompute
|
||||
#if OLD_GPSTK
|
||||
@ -1294,7 +1313,7 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
|
||||
}
|
||||
// return iret;
|
||||
}
|
||||
catch (const gpstk::Exception& e)
|
||||
catch (const gnsstk::Exception& e)
|
||||
{
|
||||
}
|
||||
|
||||
@ -1307,14 +1326,14 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
|
||||
<< std::setw(12) << raimSolver.Solution(2) << "\n";
|
||||
|
||||
std::cout << "RX CLK " << std::fixed << std::setprecision(16)
|
||||
<< raimSolver.Solution(3) / gpstk::C_MPS << " [s] \n";
|
||||
<< raimSolver.Solution(3) / gnsstk::C_MPS << " [s] \n";
|
||||
|
||||
std::cout << "NSATS, DOPs " << std::setw(2) << raimSolver.Nsvs << std::fixed
|
||||
<< std::setprecision(2) << " "
|
||||
<< std::setw(4) << raimSolver.PDOP << " " << std::setw(4) << raimSolver.GDOP
|
||||
<< " " << std::setw(8) << raimSolver.RMSResidual << "\n";
|
||||
gpstk::Position rx_pos;
|
||||
rx_pos.setECEF(gpstk::Triple(raimSolver.Solution(0), raimSolver.Solution(1), raimSolver.Solution(2)));
|
||||
gnsstk::Position rx_pos;
|
||||
rx_pos.setECEF(gnsstk::Triple(raimSolver.Solution(0), raimSolver.Solution(1), raimSolver.Solution(2)));
|
||||
|
||||
double lat_deg = rx_pos.geodeticLatitude();
|
||||
double lon_deg = rx_pos.longitude();
|
||||
@ -1325,17 +1344,17 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
|
||||
<< std::setw(12) << Alt_m << " [deg],[deg],[m]\n";
|
||||
|
||||
// set computed RX clock error and stop iterating obs epochs
|
||||
rx_clock_error_s = raimSolver.Solution(3) / gpstk::C_MPS;
|
||||
rx_clock_error_s = raimSolver.Solution(3) / gnsstk::C_MPS;
|
||||
break;
|
||||
} // End of 'if( raimSolver.isValid() )'
|
||||
} // End of 'if( rod.epochFlag == 0 || rod.epochFlag == 1 )'
|
||||
} // End of 'while( roffs >> rod )'
|
||||
}
|
||||
catch (const gpstk::FFStreamError& e)
|
||||
catch (const gnsstk::FFStreamError& e)
|
||||
{
|
||||
std::cout << "GPSTK exception: " << e << '\n';
|
||||
}
|
||||
catch (const gpstk::Exception& e)
|
||||
catch (const gnsstk::Exception& e)
|
||||
{
|
||||
std::cout << "GPSTK exception: " << e << '\n';
|
||||
}
|
||||
|
@ -4,14 +4,20 @@
|
||||
# SPDX-FileCopyrightText: 2010-2020 C. Fernandez-Prades cfernandez(at)cttc.es
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
find_package(GPSTK QUIET)
|
||||
if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
|
||||
include(GNUInstallDirs)
|
||||
set(GPSTK_LIBRARY ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(GPSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include)
|
||||
if(NOT GNSSTK_FOUND)
|
||||
find_package(GNSSTK)
|
||||
endif()
|
||||
|
||||
if(NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK)
|
||||
include(GNUInstallDirs)
|
||||
if(GNSSTK_USES_GPSTK_NAMESPACE)
|
||||
set(GNSSTK_LIBRARY ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(GNSSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include)
|
||||
else()
|
||||
set(GNSSTK_LIBRARY ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(GNSSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(Boost COMPONENTS iostreams serialization QUIET)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.5)
|
||||
@ -35,7 +41,6 @@ if(CMAKE_VERSION VERSION_LESS 3.5)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
find_program(UNCOMPRESS_EXECUTABLE uncompress
|
||||
PATHS /bin
|
||||
/usr/bin
|
||||
@ -65,7 +70,7 @@ if(Boost_FOUND)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
target_compile_options(rinex2assist
|
||||
PRIVATE
|
||||
-Wno-deprecated -Wno-unused-parameter -Wno-sign-compare
|
||||
-Wno-deprecated -Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-inconsistent-missing-override
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -73,17 +78,31 @@ if(Boost_FOUND)
|
||||
PRIVATE
|
||||
Boost::iostreams
|
||||
Boost::serialization
|
||||
${GPSTK_LIBRARY}
|
||||
${GNSSTK_LIBRARY}
|
||||
Gflags::gflags
|
||||
Threads::Threads
|
||||
core_system_parameters
|
||||
)
|
||||
|
||||
target_include_directories(rinex2assist
|
||||
PRIVATE
|
||||
${GPSTK_INCLUDE_DIR}/gpstk
|
||||
${GPSTK_INCLUDE_DIR}
|
||||
)
|
||||
if(GNSSTK_USES_GPSTK_NAMESPACE)
|
||||
target_compile_definitions(rinex2assist PUBLIC -DGNSSTK_USES_GPSTK_NAMESPACE=1)
|
||||
target_include_directories(rinex2assist
|
||||
PRIVATE
|
||||
${GNSSTK_INCLUDE_DIR}/gpstk
|
||||
${GNSSTK_INCLUDE_DIR}
|
||||
)
|
||||
else()
|
||||
target_include_directories(rinex2assist
|
||||
PRIVATE
|
||||
${GNSSTK_INCLUDE_DIR}/gnsstk
|
||||
${GNSSTK_INCLUDE_DIR}
|
||||
)
|
||||
endif()
|
||||
if(GNSSTK_VERSION)
|
||||
if(GNSSTK_VERSION VERSION_LESS "9.0.0")
|
||||
target_compile_definitions(rinex2assist PRIVATE -DGNSSTK_OLDER_THAN_9=1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT UNCOMPRESS_EXECUTABLE-NOTFOUND)
|
||||
target_compile_definitions(rinex2assist PRIVATE -DUNCOMPRESS_EXECUTABLE="${UNCOMPRESS_EXECUTABLE}")
|
||||
@ -91,8 +110,8 @@ if(Boost_FOUND)
|
||||
target_compile_definitions(rinex2assist PRIVATE -DUNCOMPRESS_EXECUTABLE="")
|
||||
endif()
|
||||
|
||||
if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
|
||||
add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION})
|
||||
if(NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK)
|
||||
add_dependencies(rinex2assist gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION})
|
||||
endif()
|
||||
|
||||
if(ENABLE_STRIP)
|
||||
|
@ -28,12 +28,23 @@
|
||||
#include <boost/iostreams/filtering_streambuf.hpp>
|
||||
#include <boost/serialization/map.hpp>
|
||||
#include <gflags/gflags.h>
|
||||
#include <gpstk/Rinex3NavData.hpp>
|
||||
#include <gpstk/Rinex3NavHeader.hpp>
|
||||
#include <gpstk/Rinex3NavStream.hpp>
|
||||
#include <cstddef> // for size_t
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#if GNSSTK_USES_GPSTK_NAMESPACE
|
||||
#include <gpstk/GALWeekSecond.hpp>
|
||||
#include <gpstk/GPSWeekSecond.hpp>
|
||||
#include <gpstk/Rinex3NavData.hpp>
|
||||
#include <gpstk/Rinex3NavHeader.hpp>
|
||||
#include <gpstk/Rinex3NavStream.hpp>
|
||||
namespace gnsstk = gpstk;
|
||||
#else
|
||||
#include <gnsstk/GALWeekSecond.hpp>
|
||||
#include <gnsstk/GPSWeekSecond.hpp>
|
||||
#include <gnsstk/Rinex3NavData.hpp>
|
||||
#include <gnsstk/Rinex3NavHeader.hpp>
|
||||
#include <gnsstk/Rinex3NavStream.hpp>
|
||||
#endif
|
||||
|
||||
#if GFLAGS_OLD_NAMESPACE
|
||||
namespace gflags
|
||||
@ -155,9 +166,9 @@ int main(int argc, char** argv)
|
||||
try
|
||||
{
|
||||
// Read nav file
|
||||
gpstk::Rinex3NavStream rnffs(input_filename.c_str()); // Open navigation data file
|
||||
gpstk::Rinex3NavData rne;
|
||||
gpstk::Rinex3NavHeader hdr;
|
||||
gnsstk::Rinex3NavStream rnffs(input_filename.c_str()); // Open navigation data file
|
||||
gnsstk::Rinex3NavData rne;
|
||||
gnsstk::Rinex3NavHeader hdr;
|
||||
|
||||
// Read header
|
||||
rnffs >> hdr;
|
||||
@ -176,8 +187,17 @@ int main(int argc, char** argv)
|
||||
gps_utc_model.valid = (hdr.valid > 2147483648) ? true : false;
|
||||
gps_utc_model.A1 = hdr.mapTimeCorr["GPUT"].A0;
|
||||
gps_utc_model.A0 = hdr.mapTimeCorr["GPUT"].A1;
|
||||
#if GNSSTK_OLDER_THAN_9
|
||||
gps_utc_model.tot = hdr.mapTimeCorr["GPUT"].refSOW;
|
||||
gps_utc_model.WN_T = hdr.mapTimeCorr["GPUT"].refWeek;
|
||||
#else
|
||||
if (hdr.mapTimeCorr["GPUT"].refTime != gnsstk::CommonTime::BEGINNING_OF_TIME)
|
||||
{
|
||||
gnsstk::GPSWeekSecond gws(hdr.mapTimeCorr["GPUT"].refTime);
|
||||
gps_utc_model.tot = gws.getSOW();
|
||||
gps_utc_model.WN_T = gws.getWeek();
|
||||
}
|
||||
#endif
|
||||
gps_utc_model.DeltaT_LS = hdr.leapSeconds;
|
||||
gps_utc_model.WN_LSF = hdr.leapWeek;
|
||||
gps_utc_model.DN = hdr.leapDay;
|
||||
@ -199,8 +219,17 @@ int main(int argc, char** argv)
|
||||
gal_utc_model.A0 = hdr.mapTimeCorr["GAUT"].A0;
|
||||
gal_utc_model.A1 = hdr.mapTimeCorr["GAUT"].A1;
|
||||
gal_utc_model.Delta_tLS = hdr.leapSeconds;
|
||||
#if GNSSTK_OLDER_THAN_9
|
||||
gal_utc_model.tot = hdr.mapTimeCorr["GAUT"].refSOW;
|
||||
gal_utc_model.WNot = hdr.mapTimeCorr["GAUT"].refWeek;
|
||||
#else
|
||||
if (hdr.mapTimeCorr["GAUT"].refTime != gnsstk::CommonTime::BEGINNING_OF_TIME)
|
||||
{
|
||||
gnsstk::GPSWeekSecond gws(hdr.mapTimeCorr["GAUT"].refTime);
|
||||
gal_utc_model.tot = gws.getSOW();
|
||||
gal_utc_model.WNot = gws.getWeek();
|
||||
}
|
||||
#endif
|
||||
gal_utc_model.WN_LSF = hdr.leapWeek;
|
||||
gal_utc_model.DN = hdr.leapDay;
|
||||
gal_utc_model.Delta_tLSF = hdr.leapDelta;
|
||||
|
Loading…
Reference in New Issue
Block a user