diff --git a/CMakeLists.txt b/CMakeLists.txt index 10d68db86..1dcd4d375 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -317,6 +317,7 @@ set(GNSSSDR_BOOST_MIN_VERSION "1.45") set(GNSSSDR_PYTHON_MIN_VERSION "2.7") set(GNSSSDR_MAKO_MIN_VERSION "0.4.2") set(GNSSSDR_ARMADILLO_MIN_VERSION "4.200.0") +set(GNSSSDR_MATIO_MIN_VERSION "1.5.3") @@ -1094,7 +1095,12 @@ endif(NOT GNUTLS_OPENSSL_LIBRARY) # Matio - https://github.com/tbeu/matio ######################################################################## find_package(MATIO) -if(NOT MATIO_FOUND) +if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERSION}) + if(MATIO_FOUND) + message(STATUS " Matio installed version (${MATIO_VERSION_STRING}) is too old (>= ${GNSSSDR_MATIO_MIN_VERSION} is required).") + endif(MATIO_FOUND) + message(STATUS " Matio will be downloaded and built automatically") + message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") find_package(ZLIB) if(ZLIB_FOUND) get_filename_component(ZLIB_BASE_DIR ${ZLIB_INCLUDE_DIRS} DIRECTORY) @@ -1112,7 +1118,7 @@ if(NOT MATIO_FOUND) message(FATAL_ERROR "libtool is required to build matio from source") endif(NOT EXISTS "/usr/bin/libtoolize") if(EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - message(STATUS "aclocal found") + message(STATUS "Automake found.") else(EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") message(" aclocal has not been found.") message(" You can try to install it by typing:") @@ -1182,7 +1188,7 @@ if(NOT MATIO_FOUND) else(ZLIB_FOUND) message(FATAL_ERROR "*** The zlib library is required to build gnss-sdr") endif(ZLIB_FOUND) -endif(NOT MATIO_FOUND) +endif(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERSION}) diff --git a/docs/manpage/gnss-sdr-manpage b/docs/manpage/gnss-sdr-manpage index f7a9c17f6..06cf36465 100644 --- a/docs/manpage/gnss-sdr-manpage +++ b/docs/manpage/gnss-sdr-manpage @@ -1,10 +1,10 @@ .\" Manpage for gnss\-sdr. .\" Contact carles.fernandez@cttc.es to correct errors or typos. -.TH gnss\-sdr 1 "05 Feb 2017" "0.0.9" "gnss\-sdr man page" +.TH gnss\-sdr 1 "24 Feb 2018" "0.0.9" "gnss\-sdr man page" .SH NAME \fBgnss\-sdr\fR \- GNSS Software Defined Receiver. .SH SYNOPSIS -\fBgnss\-sdr \-config_file=\fR\fI\fR [OPTION]... +\fBgnss\-sdr \-c=\fR\fI\fR [OPTION]... .SH DESCRIPTION \fBgnss\-sdr\fR is a Global Navigation Satellite Systems Software Defined Receiver written in C++. It implements all the signal processing chain, taking as input raw samples coming from the output of an Analog\-to\-Digital Converter, and processing them up to the computation of the Position\-Velocity\-Time solution, including the generation of code and phase measurements. \.TP @@ -12,31 +12,47 @@ .SH OPTIONS \fBgnss\-sdr\fR takes the following options: .TP -\fB\-config_file=\fR\fI\fR Set the configuration file. +\fB\-c=\fR\fI\fR or \fB\-config_file=\fR\fI\fR +Set the configuration file. .TP -\fB\-signal_source=\fR\fI\fR If defined, path to the file containing the signal samples (overrides the data file specified in the configuration file). +\fB\-s=\fR\fI\fR or \fB\-signal_source=\fR\fI\fR +If defined, path to the file containing the signal samples (overrides the data file specified in the configuration file). .TP -\fB\-log_dir=\fR\fI\fR If defined, overrides the default directory where logs are saved. +\fB\-log_dir=\fR\fI\fR +If defined, overrides the default directory where logs are saved. .TP -\fB\-doppler_max=\fR\fIdoppler\fR If defined, maximum Doppler value in the search grid, in Hz (overrides the configuration file), +\fB\-doppler_max=\fR\fI\fR +If defined, maximum Doppler value in the search grid, in Hz (overrides the configuration file). .TP -\fB\-cn0_samples=\fR\fIsamples\fR Number of correlator outputs used for CN0 estimation. +\fB\-doppler_step=\fR\fI\fR +If defined, sets the frequency step in the search grid, in Hz (overrides the configuration file). .TP -\fB\-cn0_min=\fR\fIcn0_min\fR Minimum valid CN0 (in dB-Hz). +\fB\-cn0_samples=\fR\fI\fR +Number of correlators outputs (one per integration time) used for CN0 estimation. It defaults to 20 outputs. .TP -\fB\-max_lock_fail=\fR\fImax_lock_fail\fR Number number of lock failures before dropping satellite. +\fB\-cn0_min=\fR\fI\fR +Minimum valid CN0 (in dB-Hz). It defaults to 25 dB-Hz. .TP -\fB\-carrier_lock_th=\fR\fIcarrier_lock_th\fR Carrier lock threshold (in rad). +\fB\-max_lock_fail=\fR\fI\fR +Number of lock failures before dropping satellite. It defaults to 50 failures. .TP -\fB\-dll_bw_hz=\fR\fIdll_bw_hz\fR If defined, bandwidth of the DLL low pass filter, in Hz (overrides the configuration file). +\fB\-carrier_lock_th=\fR\fI\fR +Carrier lock error threshold (in rad). It defaults to 0.85 rad (48.7 degrees). .TP -\fB\-pll_bw_hz=\fR\fIpll_bw_hz\fR If defined, bandwidth of the PLL low pass filter, in Hz (overrides the configuration file). +\fB\-dll_bw_hz=\fR\fI\fR +If defined, bandwidth of the DLL low pass filter, in Hz (overrides the configuration file). .TP -\fB\-RINEX_version=\fI\fR Specifies the RINEX version (2.11 or 3.02). Default: "3.02". +\fB\-pll_bw_hz=\fR\fI\fR +If defined, bandwidth of the PLL low pass filter, in Hz (overrides the configuration file). .TP -\fB\-version\fR Print program version and exit. +\fB\-RINEX_version=\fI\fR +If defined, specifies the RINEX version (2.11 or 3.02). Default: "3.02". Overrides the configuration file. .TP -\fB\-help\fR Print all the available commandline flags and exit. +\fB\-version\fR +Print program version and exit. +.TP +\fB\-help\fR +Print all the available commandline flags and exit. .SH SEE ALSO .BR volk_gnsssdr_profile (1) \.TP diff --git a/src/algorithms/PVT/adapters/CMakeLists.txt b/src/algorithms/PVT/adapters/CMakeLists.txt index baf58e507..71568cf88 100644 --- a/src/algorithms/PVT/adapters/CMakeLists.txt +++ b/src/algorithms/PVT/adapters/CMakeLists.txt @@ -28,6 +28,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/gnuradio_blocks ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib + ${CMAKE_SOURCE_DIR}/src/algorithms/libs ${ARMADILLO_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index c21303ab3..967109d53 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -36,7 +36,7 @@ #include #include #include "configuration_interface.h" - +#include "gnss_sdr_flags.h" using google::LogMessage; @@ -70,11 +70,30 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, // RINEX version int rinex_version = configuration->property(role + ".rinex_version", 3); - if( (rinex_version < 2) || (rinex_version > 3) ) + if ( FLAGS_RINEX_version.compare("3.01") == 0 ) { - //warn user and set the default rinex_version = 3; } + else if ( FLAGS_RINEX_version.compare("3.02") == 0 ) + { + rinex_version = 3; + } + else if ( FLAGS_RINEX_version.compare("3") == 0 ) + { + rinex_version = 3; + } + else if ( FLAGS_RINEX_version.compare("2.11") == 0 ) + { + rinex_version = 2; + } + else if ( FLAGS_RINEX_version.compare("2.10") == 0 ) + { + rinex_version = 2; + } + else if ( FLAGS_RINEX_version.compare("2") == 0 ) + { + rinex_version = 2; + } // RTCM Printer settings bool flag_rtcm_tty_port = configuration->property(role + ".flag_rtcm_tty_port", false); diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index b2dfa2a68..f1dec9219 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -43,7 +43,6 @@ #include #include #include -#include "gnss_sdr_flags.h" using google::LogMessage; @@ -143,57 +142,17 @@ Rinex_Printer::Rinex_Printer(int conf_version) observationCode["GPS_L1_CA_v2"] = "1"; observationCode["GLONASS_G1_CA_v2"] = "1"; - if ( FLAGS_RINEX_version.compare("3.01") == 0 ) - { - version = 3; - stringVersion = "3.01"; - } - else if ( FLAGS_RINEX_version.compare("3.02") == 0 ) - { - version = 3; - stringVersion = "3.02"; - } - else if ( FLAGS_RINEX_version.compare("3") == 0 ) - { - version = 3; - stringVersion = "3.02"; - } - else if ( FLAGS_RINEX_version.compare("2.11") == 0 ) - { - version = 2; - stringVersion = "2.11"; - } - else if ( FLAGS_RINEX_version.compare("2.10") == 0 ) - { - version = 2; - stringVersion = "2.10"; - } - else if ( FLAGS_RINEX_version.compare("2") == 0 ) + if(conf_version == 2) { version = 2; stringVersion = "2.11"; } else { - LOG(WARNING) << "Unknown RINEX version " << FLAGS_RINEX_version << " (must be 2.11 or 3.02). Using 3.02"; version = 3; stringVersion = "3.02"; } - if(conf_version != 0) - { - if(conf_version == 2) - { - version = 2; - stringVersion = "2.11"; - } - if(conf_version == 3) - { - version = 3; - stringVersion = "3.02"; - } - } - numberTypesObservations = 4; // Number of available types of observable in the system fake_cnav_iode = 1; } diff --git a/src/algorithms/channel/adapters/CMakeLists.txt b/src/algorithms/channel/adapters/CMakeLists.txt index e7c1c8660..b2d74748e 100644 --- a/src/algorithms/channel/adapters/CMakeLists.txt +++ b/src/algorithms/channel/adapters/CMakeLists.txt @@ -24,6 +24,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/core/interfaces ${CMAKE_SOURCE_DIR}/src/core/receiver ${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs ${GLOG_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} @@ -34,4 +35,4 @@ file(GLOB CHANNEL_ADAPTER_HEADERS "*.h") list(SORT CHANNEL_ADAPTER_HEADERS) add_library(channel_adapters ${CHANNEL_ADAPTER_SOURCES} ${CHANNEL_ADAPTER_HEADERS}) source_group(Headers FILES ${CHANNEL_ADAPTER_HEADERS}) -target_link_libraries(channel_adapters channel_fsm ${GNURADIO_RUNTIME_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(channel_adapters channel_fsm ${GNURADIO_RUNTIME_LIBRARIES} ${Boost_LIBRARIES} gnss_sdr_flags) diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index e66074b7a..59c56eeee 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -33,6 +33,7 @@ #include #include #include "configuration_interface.h" +#include "gnss_sdr_flags.h" using google::LogMessage; @@ -74,8 +75,9 @@ Channel::Channel(ConfigurationInterface *configuration, unsigned int channel, // IMPORTANT: Do not change the order between set_doppler_step and set_threshold - unsigned int doppler_step = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast(channel_) + ".doppler_step" ,0); - if(doppler_step == 0) doppler_step = configuration->property("Acquisition_" + implementation_+".doppler_step", 500); + unsigned int doppler_step = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast(channel_) + ".doppler_step", 0); + if(doppler_step == 0) doppler_step = configuration->property("Acquisition_" + implementation_ + ".doppler_step", 500); + if(FLAGS_doppler_step != 0) doppler_step = static_cast(FLAGS_doppler_step); DLOG(INFO) << "Channel "<< channel_ << " Doppler_step = " << doppler_step; acq_->set_doppler_step(doppler_step); diff --git a/src/algorithms/libs/gnss_sdr_flags.cc b/src/algorithms/libs/gnss_sdr_flags.cc index ea3d0dfbd..0aa8221b5 100644 --- a/src/algorithms/libs/gnss_sdr_flags.cc +++ b/src/algorithms/libs/gnss_sdr_flags.cc @@ -33,29 +33,31 @@ #include #include -DEFINE_string(c, "-", "Path to the configuration file (if set, overrides --config_file)"); +DEFINE_string(c, "-", "Path to the configuration file (if set, overrides --config_file)."); DEFINE_string(s, "-", - "If defined, path to the file containing the signal samples (overrides the configuration file and --signal_source)"); + "If defined, path to the file containing the signal samples (overrides the configuration file and --signal_source)."); DEFINE_string(signal_source, "-", - "If defined, path to the file containing the signal samples (overrides the configuration file)"); + "If defined, path to the file containing the signal samples (overrides the configuration file)."); -DEFINE_int32(doppler_max, 0, "If defined, maximum Doppler value in the search grid, in Hz (overrides the configuration file)"); +DEFINE_int32(doppler_max, 0, "If defined, sets the maximum Doppler value in the search grid, in Hz (overrides the configuration file)."); -DEFINE_int32(cn0_samples, 20, "Number of correlator outputs used for CN0 estimation"); +DEFINE_int32(doppler_step, 0, "If defined, sets the frequency step in the search grid, in Hz (overrides the configuration file)."); -DEFINE_int32(cn0_min, 25, "Minimum valid CN0 (in dB-Hz)"); +DEFINE_int32(cn0_samples, 20, "Number of correlator outputs used for CN0 estimation."); -DEFINE_int32(max_lock_fail, 50, "Number number of lock failures before dropping satellite"); +DEFINE_int32(cn0_min, 25, "Minimum valid CN0 (in dB-Hz)."); -DEFINE_double(carrier_lock_th, 0.85, "Carrier lock threshold (in rad)"); +DEFINE_int32(max_lock_fail, 50, "Number number of lock failures before dropping satellite."); -DEFINE_string(RINEX_version, "3.02", "Specifies the RINEX version (2.11 or 3.02)"); +DEFINE_double(carrier_lock_th, 0.85, "Carrier lock threshold (in rad)."); -DEFINE_double(dll_bw_hz, 0.0, "If defined, bandwidth of the DLL low pass filter, in Hz (overrides the configuration file)"); +DEFINE_string(RINEX_version, "-", "If defined, specifies the RINEX version (2.11 or 3.02). Overrides the configuration file."); -DEFINE_double(pll_bw_hz, 0.0, "If defined, bandwidth of the PLL low pass filter, in Hz (overrides the configuration file)"); +DEFINE_double(dll_bw_hz, 0.0, "If defined, bandwidth of the DLL low pass filter, in Hz (overrides the configuration file)."); + +DEFINE_double(pll_bw_hz, 0.0, "If defined, bandwidth of the PLL low pass filter, in Hz (overrides the configuration file)."); #if GFLAGS_GREATER_2_0 @@ -68,6 +70,14 @@ static bool ValidateDopplerMax(const char* flagname, int32_t value) return false; } +static bool ValidateDopplerStep(const char* flagname, int32_t value) +{ + if (value >= 0 && value < 10000) // value is ok + return true; + std::cout << "Invalid value for " << flagname << ": " << value << std::endl; + return false; +} + static bool ValidateCn0Samples(const char* flagname, int32_t value) { if (value > 0 && value < 10000) // value is ok @@ -118,6 +128,7 @@ static bool ValidatePllBw(const char* flagname, double value) DEFINE_validator(doppler_max, &ValidateDopplerMax); +DEFINE_validator(doppler_step, &ValidateDopplerStep); DEFINE_validator(cn0_samples, &ValidateCn0Samples); DEFINE_validator(cn0_min, &ValidateCn0Min); DEFINE_validator(max_lock_fail, &ValidateMaxLockFail); diff --git a/src/algorithms/libs/gnss_sdr_flags.h b/src/algorithms/libs/gnss_sdr_flags.h index 6d36ac087..7ccbdabe5 100644 --- a/src/algorithms/libs/gnss_sdr_flags.h +++ b/src/algorithms/libs/gnss_sdr_flags.h @@ -34,28 +34,29 @@ #include -DECLARE_string(c); // #include #include -#include +#include // for create_directories, exists +#include // for path, operator<< +#include // for filesystem #include #include "control_thread.h" #include "concurrent_queue.h"