1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-10-30 14:53:03 +00:00

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

This commit is contained in:
Marc Majoral
2019-04-04 19:55:56 +02:00
13 changed files with 323 additions and 291 deletions

View File

@@ -20,7 +20,7 @@
# Project setup # Project setup
################################################################################ ################################################################################
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(WARNING "In-tree build is bad practice. Try 'cd build && cmake ..'") message(FATAL_ERROR "Prevented in-tree build, it is bad practice.\nTry 'cd build && cmake ..' instead.")
endif() endif()
cmake_minimum_required(VERSION 2.8.12) cmake_minimum_required(VERSION 2.8.12)
@@ -28,6 +28,7 @@ project(gnss-sdr CXX C)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
################################################################################ ################################################################################
# Determine optional blocks/libraries to be built (default: not built) # Determine optional blocks/libraries to be built (default: not built)
# Enable them at the command line by doing 'cmake -DENABLE_XXX=ON ..' # Enable them at the command line by doing 'cmake -DENABLE_XXX=ON ..'
@@ -436,7 +437,8 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
execute_process(COMMAND execute_process(COMMAND
${CMAKE_CXX_COMPILER} -v ${CMAKE_CXX_COMPILER} -v
RESULT_VARIABLE _res ERROR_VARIABLE _err RESULT_VARIABLE _res ERROR_VARIABLE _err
ERROR_STRIP_TRAILING_WHITESPACE) ERROR_STRIP_TRAILING_WHITESPACE
)
if(${_res} STREQUAL "0") if(${_res} STREQUAL "0")
# output is in error stream # output is in error stream
string(REGEX MATCH "^Apple.*" IS_APPLE ${_err}) string(REGEX MATCH "^Apple.*" IS_APPLE ${_err})
@@ -569,10 +571,12 @@ set_package_properties(Threads PROPERTIES
################################################################################ ################################################################################
enable_testing() enable_testing()
if(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) if(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING)
if(EXISTS $ENV{GTEST_DIR}) if(NOT GTEST_DIR)
if(DEFINED ENV{GTEST_DIR})
set(GTEST_DIR $ENV{GTEST_DIR}) set(GTEST_DIR $ENV{GTEST_DIR})
message(STATUS "Googletest root folder set at ${GTEST_DIR}") message(STATUS "Googletest root folder set at ${GTEST_DIR}")
endif() endif()
endif()
endif() endif()
find_package(GOOGLETEST) find_package(GOOGLETEST)
@@ -586,9 +590,6 @@ if(NOT GOOGLETEST_FOUND)
set_package_properties(GOOGLETEST PROPERTIES set_package_properties(GOOGLETEST PROPERTIES
PURPOSE "Googletest v${GNSSSDR_GTEST_LOCAL_VERSION} will be downloaded and built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'." PURPOSE "Googletest v${GNSSSDR_GTEST_LOCAL_VERSION} will be downloaded and built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'."
) )
if(GTEST_DIR)
message(FATAL_ERROR " Googletest source code has not been found at ${GTEST_DIR}.")
endif()
endif() endif()
@@ -624,73 +625,66 @@ endif()
if(CMAKE_VERSION VERSION_LESS 3.5) if(CMAKE_VERSION VERSION_LESS 3.5)
if(NOT TARGET Boost::boost) if(NOT TARGET Boost::boost)
add_library(Boost::boost SHARED IMPORTED) # Trick for CMake 2.8.12 add_library(Boost::boost SHARED IMPORTED) # Trick for CMake 2.8.12
set_property(TARGET Boost::boost PROPERTY set_target_properties(Boost::boost PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}
set_property(TARGET Boost::boost PROPERTY IMPORTED_LOCATION ${Boost_DATE_TIME_LIBRARIES}
IMPORTED_LOCATION ${Boost_DATE_TIME_LIBRARIES}) )
endif() endif()
if(NOT TARGET Boost::date_time) if(NOT TARGET Boost::date_time)
add_library(Boost::date_time SHARED IMPORTED) add_library(Boost::date_time SHARED IMPORTED)
set_property(TARGET Boost::date_time PROPERTY set_target_properties(Boost::date_time PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}
set_property(TARGET Boost::date_time PROPERTY INTERFACE_LINK_LIBRARIES ${Boost_DATE_TIME_LIBRARIES}
INTERFACE_LINK_LIBRARIES ${Boost_DATE_TIME_LIBRARIES}) IMPORTED_LOCATION ${Boost_DATE_TIME_LIBRARIES}
set_property(TARGET Boost::date_time PROPERTY )
IMPORTED_LOCATION ${Boost_DATE_TIME_LIBRARIES})
endif() endif()
if(NOT TARGET Boost::system) if(NOT TARGET Boost::system)
add_library(Boost::system SHARED IMPORTED) add_library(Boost::system SHARED IMPORTED)
set_property(TARGET Boost::system PROPERTY set_target_properties(Boost::system PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}
set_property(TARGET Boost::system PROPERTY INTERFACE_LINK_LIBRARIES ${Boost_SYSTEM_LIBRARIES}
INTERFACE_LINK_LIBRARIES ${Boost_SYSTEM_LIBRARIES}) IMPORTED_LOCATION ${Boost_SYSTEM_LIBRARIES}
set_property(TARGET Boost::system PROPERTY )
IMPORTED_LOCATION ${Boost_SYSTEM_LIBRARIES})
endif() endif()
if(NOT TARGET Boost::filesystem) if(NOT TARGET Boost::filesystem)
add_library(Boost::filesystem SHARED IMPORTED) add_library(Boost::filesystem SHARED IMPORTED)
set_property(TARGET Boost::filesystem PROPERTY set_target_properties(Boost::filesystem PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}
set_property(TARGET Boost::filesystem PROPERTY INTERFACE_LINK_LIBRARIES ${Boost_FILESYSTEM_LIBRARIES}
INTERFACE_LINK_LIBRARIES ${Boost_FILESYSTEM_LIBRARIES}) IMPORTED_LOCATION ${Boost_FILESYSTEM_LIBRARIES}
set_property(TARGET Boost::filesystem PROPERTY )
IMPORTED_LOCATION ${Boost_FILESYSTEM_LIBRARIES})
endif() endif()
if(NOT TARGET Boost::thread) if(NOT TARGET Boost::thread)
add_library(Boost::thread SHARED IMPORTED) add_library(Boost::thread SHARED IMPORTED)
set_property(TARGET Boost::thread PROPERTY set_target_properties(Boost::thread PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}
set_property(TARGET Boost::thread PROPERTY INTERFACE_LINK_LIBRARIES ${Boost_THREAD_LIBRARIES}
INTERFACE_LINK_LIBRARIES ${Boost_THREAD_LIBRARIES}) IMPORTED_LOCATION ${Boost_THREAD_LIBRARIES}
set_property(TARGET Boost::thread PROPERTY )
IMPORTED_LOCATION ${Boost_THREAD_LIBRARIES})
endif() endif()
if(NOT TARGET Boost::serialization) if(NOT TARGET Boost::serialization)
add_library(Boost::serialization SHARED IMPORTED) add_library(Boost::serialization SHARED IMPORTED)
set_property(TARGET Boost::serialization PROPERTY set_target_properties(Boost::serialization PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}
set_property(TARGET Boost::serialization PROPERTY INTERFACE_LINK_LIBRARIES ${Boost_SERIALIZATION_LIBRARIES}
INTERFACE_LINK_LIBRARIES ${Boost_SERIALIZATION_LIBRARIES}) IMPORTED_LOCATION ${Boost_SERIALIZATION_LIBRARIES}
set_property(TARGET Boost::serialization PROPERTY )
IMPORTED_LOCATION ${Boost_SERIALIZATION_LIBRARIES})
endif() endif()
if(NOT TARGET Boost::chrono) if(NOT TARGET Boost::chrono)
add_library(Boost::chrono SHARED IMPORTED) add_library(Boost::chrono SHARED IMPORTED)
set_property(TARGET Boost::chrono PROPERTY set_target_properties(Boost::chrono PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}
set_property(TARGET Boost::chrono PROPERTY INTERFACE_LINK_LIBRARIES ${Boost_CHRONO_LIBRARIES}
INTERFACE_LINK_LIBRARIES ${Boost_CHRONO_LIBRARIES}) IMPORTED_LOCATION ${Boost_CHRONO_LIBRARIES}
set_property(TARGET Boost::chrono PROPERTY )
IMPORTED_LOCATION ${Boost_CHRONO_LIBRARIES})
endif() endif()
if(NOT TARGET Boost::atomic) if(NOT TARGET Boost::atomic)
add_library(Boost::atomic SHARED IMPORTED) add_library(Boost::atomic SHARED IMPORTED)
set_property(TARGET Boost::atomic PROPERTY set_target_properties(Boost::atomic PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}
set_property(TARGET Boost::atomic PROPERTY INTERFACE_LINK_LIBRARIES ${Boost_ATOMIC_LIBRARIES}
INTERFACE_LINK_LIBRARIES ${Boost_ATOMIC_LIBRARIES}) IMPORTED_LOCATION ${Boost_ATOMIC_LIBRARIES}
set_property(TARGET Boost::atomic PROPERTY )
IMPORTED_LOCATION ${Boost_ATOMIC_LIBRARIES})
endif() endif()
endif() endif()
@@ -994,7 +988,7 @@ if(NOT VOLKGNSSSDR_FOUND)
${STRIP_VOLK_GNSSSDR_PROFILE} ${STRIP_VOLK_GNSSSDR_PROFILE}
${USE_THIS_PYTHON} ${USE_THIS_PYTHON}
) )
if(EXISTS $ENV{OECORE_TARGET_SYSROOT}) if(DEFINED ENV{OECORE_TARGET_SYSROOT})
set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake
-DCROSSCOMPILE_MULTILIB=TRUE -DCROSSCOMPILE_MULTILIB=TRUE
@@ -1205,8 +1199,8 @@ aclocal
automake --add-missing automake --add-missing
autoreconf -vfi autoreconf -vfi
cd ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} cd ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure") ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure"
)
else() else()
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags
"#!/bin/sh "#!/bin/sh
@@ -1218,13 +1212,15 @@ aclocal
automake --add-missing automake --add-missing
autoreconf -vfi autoreconf -vfi
cd ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} cd ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure") ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure"
)
endif() endif()
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags file(COPY ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
set(GLOG_CONFIGURE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure_with_gflags) set(GLOG_CONFIGURE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure_with_gflags)
@@ -1738,7 +1734,7 @@ if(NOT PUGIXML_FOUND)
message(STATUS " PugiXML v${GNSSSDR_PUGIXML_LOCAL_VERSION} will be downloaded and built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'.") message(STATUS " PugiXML v${GNSSSDR_PUGIXML_LOCAL_VERSION} will be downloaded and built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'.")
set(PUGIXML_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}) set(PUGIXML_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
set(TOOLCHAIN_ARG "") set(TOOLCHAIN_ARG "")
if(EXISTS $ENV{OECORE_TARGET_SYSROOT}) if(DEFINED ENV{OECORE_TARGET_SYSROOT})
set(PUGIXML_COMPILER "") set(PUGIXML_COMPILER "")
set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake") set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake")
endif() endif()
@@ -1876,7 +1872,7 @@ set_package_properties(OPENCL PROPERTIES
) )
if(ENABLE_OPENCL) if(ENABLE_OPENCL)
find_package(OPENCL) find_package(OPENCL)
if($ENV{DISABLE_OPENCL}) if(DEFINED ENV{DISABLE_OPENCL})
set(DISABLE_OPENCL TRUE) set(DISABLE_OPENCL TRUE)
endif() endif()
if(DISABLE_OPENCL) if(DISABLE_OPENCL)
@@ -1903,7 +1899,7 @@ endif()
################################################################################ ################################################################################
# CUDA (OPTIONAL) # CUDA (OPTIONAL)
################################################################################ ################################################################################
if($ENV{CUDA_GPU_ACCEL}) if(DEFINED ENV{CUDA_GPU_ACCEL})
message(STATUS "CUDA_GPU_ACCEL environment variable found.") message(STATUS "CUDA_GPU_ACCEL environment variable found.")
set(ENABLE_CUDA ON) set(ENABLE_CUDA ON)
endif() endif()
@@ -1966,7 +1962,7 @@ endif()
# gr-osmosdr - OPTIONAL # gr-osmosdr - OPTIONAL
# https://github.com/osmocom/gr-osmosdr # https://github.com/osmocom/gr-osmosdr
########################################## ##########################################
if($ENV{RTLSDR_DRIVER}) if(DEFINED ENV{RTLSDR_DRIVER})
message(STATUS "RTLSDR_DRIVER environment variable found.") message(STATUS "RTLSDR_DRIVER environment variable found.")
set(ENABLE_OSMOSDR ON) set(ENABLE_OSMOSDR ON)
endif() endif()
@@ -2026,7 +2022,7 @@ set_package_properties(LIBIIO PROPERTIES
############################################## ##############################################
# TELEORBIT FLEXIBAND FRONTEND - OPTIONAL # TELEORBIT FLEXIBAND FRONTEND - OPTIONAL
############################################## ##############################################
if($ENV{FLEXIBAND_DRIVER}) if(DEFINED ENV{FLEXIBAND_DRIVER})
message(STATUS "FLEXIBAND_DRIVER environment variable found.") message(STATUS "FLEXIBAND_DRIVER environment variable found.")
set(ENABLE_FLEXIBAND ON) set(ENABLE_FLEXIBAND ON)
endif() endif()
@@ -2058,7 +2054,7 @@ endif()
###################### ######################
# GN3S - OPTIONAL # GN3S - OPTIONAL
###################### ######################
if($ENV{GN3S_DRIVER}) if(DEFINED ENV{GN3S_DRIVER})
message(STATUS "GN3S_DRIVER environment variable found.") message(STATUS "GN3S_DRIVER environment variable found.")
set(ENABLE_GN3S ON) set(ENABLE_GN3S ON)
endif() endif()
@@ -2084,7 +2080,7 @@ endif()
####################################################### #######################################################
# CTTC's digital array beamformer prototype - OPTIONAL # CTTC's digital array beamformer prototype - OPTIONAL
####################################################### #######################################################
if($ENV{RAW_ARRAY_DRIVER}) if(DEFINED ENV{RAW_ARRAY_DRIVER})
message(STATUS "RAW_ARRAY_DRIVER environment variable found.") message(STATUS "RAW_ARRAY_DRIVER environment variable found.")
set(ENABLE_ARRAY ON) set(ENABLE_ARRAY ON)
endif() endif()
@@ -2267,14 +2263,16 @@ else()
REQUIRED_PACKAGES_NOT_FOUND REQUIRED_PACKAGES_NOT_FOUND
OPTIONAL_PACKAGES_FOUND OPTIONAL_PACKAGES_FOUND
OPTIONAL_PACKAGES_NOT_FOUND OPTIONAL_PACKAGES_NOT_FOUND
ENABLED_FEATURES DISABLED_FEATURES ENABLED_FEATURES
DISABLED_FEATURES
) )
feature_summary(FILENAME ${CMAKE_CURRENT_BINARY_DIR}/features.log WHAT feature_summary(FILENAME ${CMAKE_CURRENT_BINARY_DIR}/features.log WHAT
REQUIRED_PACKAGES_FOUND REQUIRED_PACKAGES_FOUND
REQUIRED_PACKAGES_NOT_FOUND REQUIRED_PACKAGES_NOT_FOUND
OPTIONAL_PACKAGES_FOUND OPTIONAL_PACKAGES_FOUND
OPTIONAL_PACKAGES_NOT_FOUND OPTIONAL_PACKAGES_NOT_FOUND
ENABLED_FEATURES DISABLED_FEATURES ENABLED_FEATURES
DISABLED_FEATURES
) )
endif() endif()
message(STATUS "GNSS-SDR v${VERSION} is ready to be built.") message(STATUS "GNSS-SDR v${VERSION} is ready to be built.")

View File

@@ -65,22 +65,31 @@ FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configurati
usb_packet_buffer_size_ = configuration->property(role + ".usb_packet_buffer", 128); usb_packet_buffer_size_ = configuration->property(role + ".usb_packet_buffer", 128);
RF_channels_ = configuration->property(role + ".RF_channels", 1); n_channels_ = configuration->property(role + ".total_channels", 0);
if (n_channels_ == 0)
{
n_channels_ = configuration->property(role + ".RF_channels", 1);
}
sel_ch_ = configuration->property(role + ".sel_ch", 1);
if (sel_ch_ > n_channels_)
{
LOG(WARNING) << "Invalid RF channel selection";
}
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex")
{ {
item_size_ = sizeof(gr_complex); item_size_ = sizeof(gr_complex);
flexiband_source_ = gr::teleorbit::frontend::make(firmware_filename_.c_str(), gain1_, gain2_, gain3_, AGC_, usb_packet_buffer_size_, signal_file.c_str(), flag_read_file); flexiband_source_ = gr::teleorbit::frontend::make(firmware_filename_.c_str(), gain1_, gain2_, gain3_, AGC_, usb_packet_buffer_size_, signal_file.c_str(), flag_read_file);
//create I, Q -> gr_complex type conversion blocks //create I, Q -> gr_complex type conversion blocks
for (int n = 0; n < (RF_channels_ * 2); n++) for (int n = 0; n < (n_channels_ * 2); n++)
{ {
char_to_float.push_back(gr::blocks::char_to_float::make()); char_to_float.push_back(gr::blocks::char_to_float::make());
} }
for (int n = 0; n < RF_channels_; n++) for (int n = 0; n < n_channels_; n++)
{ {
float_to_complex_.push_back(gr::blocks::float_to_complex::make()); float_to_complex_.push_back(gr::blocks::float_to_complex::make());
null_sinks_.push_back(gr::blocks::null_sink::make(sizeof(gr_complex)));
} }
DLOG(INFO) << "Item size " << item_size_; DLOG(INFO) << "Item size " << item_size_;
@@ -108,15 +117,16 @@ FlexibandSignalSource::~FlexibandSignalSource() = default;
void FlexibandSignalSource::connect(gr::top_block_sptr top_block) void FlexibandSignalSource::connect(gr::top_block_sptr top_block)
{ {
for (int n = 0; n < (RF_channels_ * 2); n++) for (int n = 0; n < (n_channels_ * 2); n++)
{ {
top_block->connect(flexiband_source_, n, char_to_float.at(n), 0); top_block->connect(flexiband_source_, n, char_to_float.at(n), 0);
DLOG(INFO) << "connected flexiband_source_ to char_to_float CH" << n; DLOG(INFO) << "connected flexiband_source_ to char_to_float CH" << n;
} }
for (int n = 0; n < RF_channels_; n++) for (int n = 0; n < n_channels_; n++)
{ {
top_block->connect(char_to_float.at(n * 2), 0, float_to_complex_.at(n), 0); top_block->connect(char_to_float.at(n * 2), 0, float_to_complex_.at(n), 0);
top_block->connect(char_to_float.at(n * 2 + 1), 0, float_to_complex_.at(n), 1); top_block->connect(char_to_float.at(n * 2 + 1), 0, float_to_complex_.at(n), 1);
top_block->connect(float_to_complex_.at(n), 0, null_sinks_.at(n), 0);
DLOG(INFO) << "connected char_to_float to float_to_complex_ CH" << n; DLOG(INFO) << "connected char_to_float to float_to_complex_ CH" << n;
} }
} }
@@ -124,15 +134,16 @@ void FlexibandSignalSource::connect(gr::top_block_sptr top_block)
void FlexibandSignalSource::disconnect(gr::top_block_sptr top_block) void FlexibandSignalSource::disconnect(gr::top_block_sptr top_block)
{ {
for (int n = 0; n < (RF_channels_ * 2); n++) for (int n = 0; n < (n_channels_ * 2); n++)
{ {
top_block->disconnect(flexiband_source_, n, char_to_float.at(n), 0); top_block->disconnect(flexiband_source_, n, char_to_float.at(n), 0);
DLOG(INFO) << "disconnect flexiband_source_ to char_to_float CH" << n; DLOG(INFO) << "disconnect flexiband_source_ to char_to_float CH" << n;
} }
for (int n = 0; n < RF_channels_; n++) for (int n = 0; n < n_channels_; n++)
{ {
top_block->disconnect(char_to_float.at(n * 2), 0, float_to_complex_.at(n), 0); top_block->disconnect(char_to_float.at(n * 2), 0, float_to_complex_.at(n), 0);
top_block->disconnect(char_to_float.at(n * 2 + 1), 0, float_to_complex_.at(n), 1); top_block->disconnect(char_to_float.at(n * 2 + 1), 0, float_to_complex_.at(n), 1);
top_block->disconnect(float_to_complex_.at(n), 0, null_sinks_.at(n), 0);
DLOG(INFO) << "disconnect char_to_float to float_to_complex_ CH" << n; DLOG(INFO) << "disconnect char_to_float to float_to_complex_ CH" << n;
} }
} }
@@ -152,5 +163,14 @@ gr::basic_block_sptr FlexibandSignalSource::get_right_block()
gr::basic_block_sptr FlexibandSignalSource::get_right_block(int RF_channel) gr::basic_block_sptr FlexibandSignalSource::get_right_block(int RF_channel)
{ {
if (RF_channel == 0)
{
//in the first RF channel, return the signalsource selected channel.
//this trick enables the use of the second or the third frequency of a FlexiBand signal without a dual frequency configuration
return float_to_complex_.at(sel_ch_ - 1);
}
else
{
return float_to_complex_.at(RF_channel); return float_to_complex_.at(RF_channel);
}
} }

View File

@@ -38,6 +38,7 @@
#include <gnuradio/blocks/char_to_float.h> #include <gnuradio/blocks/char_to_float.h>
#include <gnuradio/blocks/file_sink.h> #include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/float_to_complex.h> #include <gnuradio/blocks/float_to_complex.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/hier_block2.h> #include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h> #include <gnuradio/msg_queue.h>
#include <string> #include <string>
@@ -99,12 +100,14 @@ private:
std::string signal_file; std::string signal_file;
bool flag_read_file; bool flag_read_file;
int RF_channels_; int n_channels_;
int sel_ch_;
gr::block_sptr flexiband_source_; gr::block_sptr flexiband_source_;
std::vector<boost::shared_ptr<gr::block>> char_to_float; std::vector<boost::shared_ptr<gr::block>> char_to_float;
std::vector<boost::shared_ptr<gr::block>> float_to_complex_; std::vector<boost::shared_ptr<gr::block>> float_to_complex_;
std::vector<gr::blocks::null_sink::sptr> null_sinks_;
boost::shared_ptr<gr::msg_queue> queue_; boost::shared_ptr<gr::msg_queue> queue_;
}; };

View File

@@ -134,11 +134,11 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1);
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.15); float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.15);
trk_param.early_late_space_chips = early_late_space_chips; trk_param.early_late_space_chips = early_late_space_chips;
float very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", 0.6); float very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", 0.5);
trk_param.very_early_late_space_chips = very_early_late_space_chips; trk_param.very_early_late_space_chips = very_early_late_space_chips;
float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15); float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15);
trk_param.early_late_space_narrow_chips = early_late_space_narrow_chips; trk_param.early_late_space_narrow_chips = early_late_space_narrow_chips;
float very_early_late_space_narrow_chips = configuration->property(role + ".very_early_late_space_narrow_chips", 0.6); float very_early_late_space_narrow_chips = configuration->property(role + ".very_early_late_space_narrow_chips", 0.5);
trk_param.very_early_late_space_narrow_chips = very_early_late_space_narrow_chips; trk_param.very_early_late_space_narrow_chips = very_early_late_space_narrow_chips;
bool track_pilot = configuration->property(role + ".track_pilot", false); bool track_pilot = configuration->property(role + ".track_pilot", false);
if (extend_correlation_symbols < 1) if (extend_correlation_symbols < 1)

View File

@@ -144,11 +144,11 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
int32_t extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); int32_t extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1);
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.15); float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.15);
trk_param_fpga.early_late_space_chips = early_late_space_chips; trk_param_fpga.early_late_space_chips = early_late_space_chips;
float very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", 0.6); float very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", 0.5);
trk_param_fpga.very_early_late_space_chips = very_early_late_space_chips; trk_param_fpga.very_early_late_space_chips = very_early_late_space_chips;
float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15); float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15);
trk_param_fpga.early_late_space_narrow_chips = early_late_space_narrow_chips; trk_param_fpga.early_late_space_narrow_chips = early_late_space_narrow_chips;
float very_early_late_space_narrow_chips = configuration->property(role + ".very_early_late_space_narrow_chips", 0.6); float very_early_late_space_narrow_chips = configuration->property(role + ".very_early_late_space_narrow_chips", 0.5);
trk_param_fpga.very_early_late_space_narrow_chips = very_early_late_space_narrow_chips; trk_param_fpga.very_early_late_space_narrow_chips = very_early_late_space_narrow_chips;
bool track_pilot = configuration->property(role + ".track_pilot", false); bool track_pilot = configuration->property(role + ".track_pilot", false);
if (extend_correlation_symbols < 1) if (extend_correlation_symbols < 1)

View File

@@ -75,7 +75,7 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking(
dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz); dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
} }
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.15); early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.15);
very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", 0.6); very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", 0.5);
port_ch0 = configuration->property(role + ".port_ch0", 2060); port_ch0 = configuration->property(role + ".port_ch0", 2060);
std::string default_dump_filename = "./track_ch"; std::string default_dump_filename = "./track_ch";
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);

View File

@@ -95,14 +95,14 @@ double pll_cloop_two_quadrant_atan(gr_complex prompt_s1)
*/ */
double dll_nc_e_minus_l_normalized(gr_complex early_s1, gr_complex late_s1) double dll_nc_e_minus_l_normalized(gr_complex early_s1, gr_complex late_s1)
{ {
double P_early, P_late; double P_early = std::abs(early_s1);
P_early = std::abs(early_s1); double P_late = std::abs(late_s1);
P_late = std::abs(late_s1); double E_plus_L = P_early + P_late;
if (P_early + P_late == 0.0) if (E_plus_L == 0.0)
{ {
return 0.0; return 0.0;
} }
return 0.5 * (P_early - P_late) / (P_early + P_late); return 0.5 * (P_early - P_late) / E_plus_L;
} }
@@ -117,12 +117,13 @@ double dll_nc_e_minus_l_normalized(gr_complex early_s1, gr_complex late_s1)
*/ */
double dll_nc_vemlp_normalized(gr_complex very_early_s1, gr_complex early_s1, gr_complex late_s1, gr_complex very_late_s1) double dll_nc_vemlp_normalized(gr_complex very_early_s1, gr_complex early_s1, gr_complex late_s1, gr_complex very_late_s1)
{ {
double P_early, P_late; double Early = std::sqrt(very_early_s1.real() * very_early_s1.real() + very_early_s1.imag() * very_early_s1.imag() + early_s1.real() * early_s1.real() + early_s1.imag() * early_s1.imag());
P_early = std::sqrt(std::norm(very_early_s1) + std::norm(early_s1)); double Late = std::sqrt(late_s1.real() * late_s1.real() + late_s1.imag() * late_s1.imag() + very_late_s1.real() * very_late_s1.real() + very_late_s1.imag() * very_late_s1.imag());
P_late = std::sqrt(std::norm(very_late_s1) + std::norm(late_s1));
if (P_early + P_late == 0.0) double E_plus_L = Early + Late;
if (E_plus_L == 0.0)
{ {
return 0.0; return 0.0;
} }
return (P_early - P_late) / (P_early + P_late); return (Early - Late) / E_plus_L;
} }

View File

@@ -363,6 +363,11 @@ void GNSSFlowgraph::connect()
#endif #endif
// Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID) // Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID)
std::vector<bool> signal_conditioner_connected;
for (size_t n = 0; n < sig_conditioner_.size(); n++)
{
signal_conditioner_connected.push_back(false);
}
for (unsigned int i = 0; i < channels_count_; i++) for (unsigned int i = 0; i < channels_count_; i++)
{ {
#ifndef ENABLE_FPGA #ifndef ENABLE_FPGA
@@ -500,10 +505,12 @@ void GNSSFlowgraph::connect()
top_block_->disconnect_all(); top_block_->disconnect_all();
return; return;
} }
signal_conditioner_connected.at(selected_signal_conditioner_ID) = true; //notify that this signal conditioner is connected
DLOG(INFO) << "signal conditioner " << selected_signal_conditioner_ID << " connected to channel " << i; DLOG(INFO) << "signal conditioner " << selected_signal_conditioner_ID << " connected to channel " << i;
} }
#endif #endif
// Signal Source > Signal conditioner >> Channels >> Observables // Signal Source > Signal conditioner >> Channels >> Observables
try try
{ {
@@ -519,6 +526,20 @@ void GNSSFlowgraph::connect()
} }
} }
//check for unconnected signal conditioners and connect null_sinks in order to provide configuration flexibility to multiband files or signal sources
if (configuration_->property(sig_source_.at(0)->role() + ".enable_FPGA", false) == false)
{
for (size_t n = 0; n < sig_conditioner_.size(); n++)
{
if (signal_conditioner_connected.at(n) == false)
{
null_sinks_.push_back(gr::blocks::null_sink::make(sizeof(gr_complex)));
top_block_->connect(sig_conditioner_.at(n)->get_right_block(), 0,
null_sinks_.back(), 0);
LOG(INFO) << "Null sink connected to signal conditioner " << n << " due to lack of connection to any channel" << std::endl;
}
}
}
// Put channels fixed to a given satellite at the beginning of the vector, then the rest // Put channels fixed to a given satellite at the beginning of the vector, then the rest
std::vector<unsigned int> vector_of_channels; std::vector<unsigned int> vector_of_channels;
for (unsigned int i = 0; i < channels_count_; i++) for (unsigned int i = 0; i < channels_count_; i++)

View File

@@ -40,6 +40,7 @@
#include "gnss_sdr_sample_counter.h" #include "gnss_sdr_sample_counter.h"
#include "gnss_signal.h" #include "gnss_signal.h"
#include "pvt_interface.h" #include "pvt_interface.h"
#include <gnuradio/blocks/null_sink.h> //for null_sink
#include <gnuradio/msg_queue.h> // for msg_queue, msg_queue::sptr #include <gnuradio/msg_queue.h> // for msg_queue, msg_queue::sptr
#include <gnuradio/runtime_types.h> // for basic_block_sptr, top_block_sptr #include <gnuradio/runtime_types.h> // for basic_block_sptr, top_block_sptr
#include <pmt/pmt.h> // for pmt_t #include <pmt/pmt.h> // for pmt_t
@@ -162,6 +163,7 @@ private:
std::vector<std::shared_ptr<GNSSBlockInterface>> sig_source_; std::vector<std::shared_ptr<GNSSBlockInterface>> sig_source_;
std::vector<std::shared_ptr<GNSSBlockInterface>> sig_conditioner_; std::vector<std::shared_ptr<GNSSBlockInterface>> sig_conditioner_;
std::vector<gr::blocks::null_sink::sptr> null_sinks_;
std::shared_ptr<GNSSBlockInterface> observables_; std::shared_ptr<GNSSBlockInterface> observables_;
std::shared_ptr<GNSSBlockInterface> pvt_; std::shared_ptr<GNSSBlockInterface> pvt_;

View File

@@ -58,7 +58,7 @@ const uint32_t GPS_L1_CA_CODE_PERIOD_MS = 1U; //!< GPS L1 C/A code period
const double GPS_L1_CA_CHIP_PERIOD = 9.7752e-07; //!< GPS L1 C/A chip period [seconds] const double GPS_L1_CA_CHIP_PERIOD = 9.7752e-07; //!< GPS L1 C/A chip period [seconds]
//optimum parameters //optimum parameters
const uint32_t GPS_L1_CA_OPT_ACQ_FS_HZ = 1000000; //!< Sampling frequncy that maximizes the acquisition SNR while using a non-multiple of chip rate const uint32_t GPS_L1_CA_OPT_ACQ_FS_HZ = 2000000; //!< Sampling frequncy that maximizes the acquisition SNR while using a non-multiple of chip rate
/*! /*!
* \brief Maximum Time-Of-Arrival (TOA) difference between satellites for a receiver operated on Earth surface is 20 ms * \brief Maximum Time-Of-Arrival (TOA) difference between satellites for a receiver operated on Earth surface is 20 ms

View File

@@ -64,7 +64,7 @@ const double GPS_L2_L_PERIOD = 1.5; //!< GPS L2 L code period [s
const int32_t GPS_L2C_HISTORY_DEEP = 5; const int32_t GPS_L2C_HISTORY_DEEP = 5;
//optimum parameters //optimum parameters
const uint32_t GPS_L2C_OPT_ACQ_FS_HZ = 1000000; //!< Sampling frequncy that maximizes the acquisition SNR while using a non-multiple of chip rate const uint32_t GPS_L2C_OPT_ACQ_FS_HZ = 2000000; //!< Sampling frequncy that maximizes the acquisition SNR while using a non-multiple of chip rate
const int32_t GPS_L2C_M_INIT_REG[115] = const int32_t GPS_L2C_M_INIT_REG[115] =

View File

@@ -23,25 +23,9 @@ add_subdirectory(system-tests/libs)
################################################################################ ################################################################################
# Google Test - https://github.com/google/googletest # Google Test - https://github.com/google/googletest
################################################################################ ################################################################################
if(EXISTS $ENV{GTEST_DIR})
set(GTEST_DIR_LOCAL $ENV{GTEST_DIR})
endif()
if(GTEST_DIR)
set(GTEST_DIR_LOCAL ${GTEST_DIR})
endif()
if(NOT GTEST_DIR_LOCAL)
set(GTEST_DIR_LOCAL false)
else()
set(GTEST_DIR_LOCAL true)
endif()
if(GTEST_INCLUDE_DIRS)
set(GTEST_DIR_LOCAL true)
endif()
set(GTEST_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}) set(GTEST_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
set(TOOLCHAIN_ARG "") set(TOOLCHAIN_ARG "")
if(EXISTS $ENV{OECORE_TARGET_SYSROOT}) if(DEFINED ENV{OECORE_TARGET_SYSROOT})
set(GTEST_COMPILER "") set(GTEST_COMPILER "")
set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Toolchains/oe-sdk_cross.cmake") set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Toolchains/oe-sdk_cross.cmake")
else() else()
@@ -50,8 +34,7 @@ else()
endif() endif()
endif() endif()
if(NOT ${GTEST_DIR_LOCAL}) if(NOT GOOGLETEST_FOUND)
# if GTEST_DIR is not defined, we download and build it
if(CMAKE_BUILD_TYPE MATCHES Debug) if(CMAKE_BUILD_TYPE MATCHES Debug)
set(DEBUG_POSTFIX "d") set(DEBUG_POSTFIX "d")
endif() endif()
@@ -63,8 +46,7 @@ if(NOT ${GTEST_DIR_LOCAL})
endif() endif()
if(CMAKE_VERSION VERSION_LESS 3.2) if(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add( ExternalProject_Add(gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/google/googletest GIT_REPOSITORY https://github.com/google/googletest
GIT_TAG release-${GNSSSDR_GTEST_LOCAL_VERSION} GIT_TAG release-${GNSSSDR_GTEST_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
@@ -75,8 +57,7 @@ if(NOT ${GTEST_DIR_LOCAL})
INSTALL_COMMAND "" INSTALL_COMMAND ""
) )
else() else()
ExternalProject_Add( ExternalProject_Add(gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/google/googletest GIT_REPOSITORY https://github.com/google/googletest
GIT_TAG release-${GNSSSDR_GTEST_LOCAL_VERSION} GIT_TAG release-${GNSSSDR_GTEST_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
@@ -212,7 +193,7 @@ set_package_properties(GPSTK PROPERTIES
if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
if(ENABLE_FPGA) if(ENABLE_FPGA)
set(CROSS_INSTALL_DIR "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") set(CROSS_INSTALL_DIR "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
if(EXISTS $ENV{OECORE_TARGET_SYSROOT}) if(DEFINED ENV{OECORE_TARGET_SYSROOT})
set(CROSS_INSTALL_DIR "${CROSS_INSTALL_DIR} -DBOOST_ROOT=$ENV{OECORE_TARGET_SYSROOT}/usr") set(CROSS_INSTALL_DIR "${CROSS_INSTALL_DIR} -DBOOST_ROOT=$ENV{OECORE_TARGET_SYSROOT}/usr")
endif() endif()
else() else()
@@ -224,8 +205,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n") add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n")
add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv") add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv")
else() else()
ExternalProject_Add( ExternalProject_Add(gnss-sim
gnss-sim
GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator
GIT_TAG ${GNSSSDR_GNSS_SIM_LOCAL_VERSION} GIT_TAG ${GNSSSDR_GNSS_SIM_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gnss-sim SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gnss-sim
@@ -262,8 +242,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
endif() endif()
include(GNUInstallDirs) include(GNUInstallDirs)
if(CMAKE_VERSION VERSION_LESS 3.2) if(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add( ExternalProject_Add(gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/SGL-UT/GPSTk GIT_REPOSITORY https://github.com/SGL-UT/GPSTk
GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION} GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
@@ -273,8 +252,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
PATCH_COMMAND "" PATCH_COMMAND ""
) )
else() else()
ExternalProject_Add( ExternalProject_Add(gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/SGL-UT/GPSTk GIT_REPOSITORY https://github.com/SGL-UT/GPSTk
GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION} GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
@@ -427,7 +405,8 @@ if(ENABLE_UNIT_TESTING)
else() else()
add_custom_command(TARGET run_tests POST_BUILD add_custom_command(TARGET run_tests POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:run_tests> COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:run_tests>
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:run_tests>) ${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:run_tests>
)
endif() endif()
if(ENABLE_GPERFTOOLS) if(ENABLE_GPERFTOOLS)
if(GPERFTOOLS_FOUND) if(GPERFTOOLS_FOUND)
@@ -515,7 +494,8 @@ function(add_system_test executable)
else() else()
add_custom_command(TARGET ${executable} POST_BUILD add_custom_command(TARGET ${executable} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${executable}> COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${executable}>
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:${executable}>) ${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:${executable}>
)
endif() endif()
if(ENABLE_CLANG_TIDY) if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE) if(CLANG_TIDY_EXE)
@@ -844,7 +824,14 @@ else()
if(ENABLE_FPGA) if(ENABLE_FPGA)
add_dependencies(check matio_test) add_dependencies(check matio_test)
else() else()
add_dependencies(check control_thread_test flowgraph_test gnss_block_test add_dependencies(check
gnuradio_block_test acq_test trk_test matio_test) control_thread_test
flowgraph_test
gnss_block_test
gnuradio_block_test
acq_test
trk_test
matio_test
)
endif() endif()
endif() endif()

View File

@@ -63,7 +63,13 @@ for channelNr = channelList
%% Plot all figures ======================================================= %% Plot all figures =======================================================
timeAxisInSeconds = (1:4:settings.msToProcess)/1000; if isfield(trackResults(channelNr), 'prn_start_time_s')
timeAxis=trackResults(channelNr).prn_start_time_s;
time_label='RX Time (s)';
else
timeAxis = (1:length(trackResults(channelNr).PRN));
time_label='Epoch';
end
%----- Discrete-Time Scatter Plot --------------------------------- %----- Discrete-Time Scatter Plot ---------------------------------
plot(handles(1, 1), trackResults(channelNr).data_I,... plot(handles(1, 1), trackResults(channelNr).data_I,...
@@ -77,29 +83,26 @@ for channelNr = channelList
ylabel(handles(1, 1), 'Q prompt'); ylabel(handles(1, 1), 'Q prompt');
%----- Nav bits --------------------------------------------------- %----- Nav bits ---------------------------------------------------
t = (1:length(trackResults(channelNr).data_I)); plot (handles(1, 2), timeAxis, ...
plot (handles(1, 2), t, ...
trackResults(channelNr).data_I); trackResults(channelNr).data_I);
grid (handles(1, 2)); grid (handles(1, 2));
title (handles(1, 2), 'Bits of the navigation message'); title (handles(1, 2), 'Bits of the navigation message');
xlabel(handles(1, 2), 'Time (s)'); xlabel(handles(1, 2), time_label);
axis (handles(1, 2), 'tight'); axis (handles(1, 2), 'tight');
%----- PLL discriminator unfiltered-------------------------------- %----- PLL discriminator unfiltered--------------------------------
t = (1:length(trackResults(channelNr).pllDiscr)); plot (handles(2, 1), timeAxis, ...
plot (handles(2, 1), t, ...
trackResults(channelNr).pllDiscr, 'r'); trackResults(channelNr).pllDiscr, 'r');
grid (handles(2, 1)); grid (handles(2, 1));
axis (handles(2, 1), 'tight'); axis (handles(2, 1), 'tight');
xlabel(handles(2, 1), 'Time (s)'); xlabel(handles(2, 1), time_label);
ylabel(handles(2, 1), 'Amplitude'); ylabel(handles(2, 1), 'Amplitude');
title (handles(2, 1), 'Raw PLL discriminator'); title (handles(2, 1), 'Raw PLL discriminator');
%----- Correlation ------------------------------------------------ %----- Correlation ------------------------------------------------
t = (1:length(trackResults(channelNr).I_VE)); plot(handles(2, 2), timeAxis, ...
plot(handles(2, 2), t, ...
[sqrt(trackResults(channelNr).I_VE.^2 + ... [sqrt(trackResults(channelNr).I_VE.^2 + ...
trackResults(channelNr).Q_VE.^2)', ... trackResults(channelNr).Q_VE.^2)', ...
sqrt(trackResults(channelNr).I_E.^2 + ... sqrt(trackResults(channelNr).I_E.^2 + ...
@@ -114,7 +117,7 @@ for channelNr = channelList
grid (handles(2, 2)); grid (handles(2, 2));
title (handles(2, 2), 'Correlation results'); title (handles(2, 2), 'Correlation results');
xlabel(handles(2, 2), 'Time (s)'); xlabel(handles(2, 2), time_label);
axis (handles(2, 2), 'tight'); axis (handles(2, 2), 'tight');
hLegend = legend(handles(2, 2), '$\sqrt{I_{VE}^2 + Q_{VE}^2}$', ... hLegend = legend(handles(2, 2), '$\sqrt{I_{VE}^2 + Q_{VE}^2}$', ...
@@ -127,35 +130,32 @@ for channelNr = channelList
set(hLegend, 'Interpreter', 'Latex'); set(hLegend, 'Interpreter', 'Latex');
%----- PLL discriminator filtered---------------------------------- %----- PLL discriminator filtered----------------------------------
t = (1:length(trackResults(channelNr).pllDiscrFilt)); plot (handles(3, 1), timeAxis, ...
plot (handles(3, 1), t, ...
trackResults(channelNr).pllDiscrFilt, 'b'); trackResults(channelNr).pllDiscrFilt, 'b');
grid (handles(3, 1)); grid (handles(3, 1));
axis (handles(3, 1), 'tight'); axis (handles(3, 1), 'tight');
xlabel(handles(3, 1), 'Time (s)'); xlabel(handles(3, 1), time_label);
ylabel(handles(3, 1), 'Amplitude'); ylabel(handles(3, 1), 'Amplitude');
title (handles(3, 1), 'Filtered PLL discriminator'); title (handles(3, 1), 'Filtered PLL discriminator');
%----- DLL discriminator unfiltered-------------------------------- %----- DLL discriminator unfiltered--------------------------------
t = (1:length(trackResults(channelNr).dllDiscr)); plot (handles(3, 2), timeAxis, ...
plot (handles(3, 2), t, ...
trackResults(channelNr).dllDiscr, 'r'); trackResults(channelNr).dllDiscr, 'r');
grid (handles(3, 2)); grid (handles(3, 2));
axis (handles(3, 2), 'tight'); axis (handles(3, 2), 'tight');
xlabel(handles(3, 2), 'Time (s)'); xlabel(handles(3, 2), time_label);
ylabel(handles(3, 2), 'Amplitude'); ylabel(handles(3, 2), 'Amplitude');
title (handles(3, 2), 'Raw DLL discriminator'); title (handles(3, 2), 'Raw DLL discriminator');
%----- DLL discriminator filtered---------------------------------- %----- DLL discriminator filtered----------------------------------
t = (1:length(trackResults(channelNr).dllDiscrFilt)); plot (handles(3, 3), timeAxis, ...
plot (handles(3, 3), t, ...
trackResults(channelNr).dllDiscrFilt, 'b'); trackResults(channelNr).dllDiscrFilt, 'b');
grid (handles(3, 3)); grid (handles(3, 3));
axis (handles(3, 3), 'tight'); axis (handles(3, 3), 'tight');
xlabel(handles(3, 3), 'Time (s)'); xlabel(handles(3, 3), time_label);
ylabel(handles(3, 3), 'Amplitude'); ylabel(handles(3, 3), 'Amplitude');
title (handles(3, 3), 'Filtered DLL discriminator'); title (handles(3, 3), 'Filtered DLL discriminator');