mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-10-23 11:37:40 +00:00
Merge branch 'next' into fix_observables
This commit is contained in:
@@ -39,7 +39,6 @@ set(GNSS_SPLIBS_SOURCES
|
||||
conjugate_ic.cc
|
||||
)
|
||||
|
||||
|
||||
if(OPENCL_FOUND)
|
||||
set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES}
|
||||
fft_execute.cc # Needs OpenCL
|
||||
@@ -71,7 +70,10 @@ if(OPENCL_FOUND)
|
||||
endif(OS_IS_MACOSX)
|
||||
endif(OPENCL_FOUND)
|
||||
|
||||
add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
file(GLOB GNSS_SPLIBS_HEADERS "*.h")
|
||||
list(REMOVE_ITEM GNSS_SPLIBS_HEADERS gnss_sdr_flags.h)
|
||||
list(SORT GNSS_SPLIBS_HEADERS)
|
||||
add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS})
|
||||
source_group(Headers FILES ${GNSS_SPLIBS_HEADERS})
|
||||
@@ -79,6 +81,7 @@ source_group(Headers FILES ${GNSS_SPLIBS_HEADERS})
|
||||
target_link_libraries(gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES}
|
||||
${VOLK_LIBRARIES} ${ORC_LIBRARIES}
|
||||
${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES}
|
||||
${GFlags_LIBS}
|
||||
${GNURADIO_BLOCKS_LIBRARIES}
|
||||
${GNURADIO_FFT_LIBRARIES}
|
||||
${GNURADIO_FILTER_LIBRARIES}
|
||||
@@ -89,3 +92,11 @@ target_link_libraries(gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES}
|
||||
if(NOT VOLK_GNSSSDR_FOUND)
|
||||
add_dependencies(gnss_sp_libs volk_gnsssdr_module)
|
||||
endif(NOT VOLK_GNSSSDR_FOUND)
|
||||
|
||||
if(${GFLAGS_GREATER_20})
|
||||
add_definitions(-DGFLAGS_GREATER_2_0=1)
|
||||
endif(${GFLAGS_GREATER_20})
|
||||
|
||||
add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h)
|
||||
source_group(Headers FILES gnss_sdr_flags.h)
|
||||
target_link_libraries(gnss_sdr_flags ${GFlags_LIBS})
|
130
src/algorithms/libs/gnss_sdr_flags.cc
Normal file
130
src/algorithms/libs/gnss_sdr_flags.cc
Normal file
@@ -0,0 +1,130 @@
|
||||
/*!
|
||||
* \file gnss_sdr_flags.cc
|
||||
* \brief Helper file for gnss-sdr commandline flags
|
||||
* \author Carles Fernandez-Prades, 2018. cfernandez(at)cttc.es
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#include <gnss_sdr_flags.h>
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
|
||||
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)");
|
||||
|
||||
DEFINE_string(signal_source, "-",
|
||||
"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(cn0_samples, 20, "Number of correlator outputs used for CN0 estimation");
|
||||
|
||||
DEFINE_int32(cn0_min, 25, "Minimum valid CN0 (in dB-Hz)");
|
||||
|
||||
DEFINE_int32(max_lock_fail, 50, "Number number of lock failures before dropping satellite");
|
||||
|
||||
DEFINE_double(carrier_lock_th, 0.85, "Carrier lock threshold (in rad)");
|
||||
|
||||
DEFINE_string(RINEX_version, "3.02", "Specifies the RINEX version (2.11 or 3.02)");
|
||||
|
||||
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
|
||||
|
||||
static bool ValidateDopplerMax(const char* flagname, int32_t value)
|
||||
{
|
||||
if (value >= 0 && value < 1000000) // 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
|
||||
return true;
|
||||
std::cout << "Invalid value for " << flagname << ": " << value << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool ValidateCn0Min(const char* flagname, int32_t value)
|
||||
{
|
||||
if (value > 0 && value < 100) // value is ok
|
||||
return true;
|
||||
std::cout << "Invalid value for " << flagname << ": " << value << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool ValidateMaxLockFail(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 ValidateCarrierLockTh(const char* flagname, double value)
|
||||
{
|
||||
if (value > 0.0 && value < 1.508) // value is ok
|
||||
return true;
|
||||
std::cout << "Invalid value for " << flagname << ": " << value << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool ValidateDllBw(const char* flagname, double value)
|
||||
{
|
||||
if (value >= 0.0 && value < 10000.0) // value is ok
|
||||
return true;
|
||||
std::cout << "Invalid value for " << flagname << ": " << value << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool ValidatePllBw(const char* flagname, double value)
|
||||
{
|
||||
if (value >= 0.0 && value < 10000.0) // value is ok
|
||||
return true;
|
||||
std::cout << "Invalid value for " << flagname << ": " << value << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
DEFINE_validator(doppler_max, &ValidateDopplerMax);
|
||||
DEFINE_validator(cn0_samples, &ValidateCn0Samples);
|
||||
DEFINE_validator(cn0_min, &ValidateCn0Min);
|
||||
DEFINE_validator(max_lock_fail, &ValidateMaxLockFail);
|
||||
DEFINE_validator(carrier_lock_th, &ValidateCarrierLockTh);
|
||||
DEFINE_validator(dll_bw_hz, &ValidateDllBw);
|
||||
DEFINE_validator(pll_bw_hz, &ValidatePllBw);
|
||||
|
||||
|
||||
#endif
|
||||
|
61
src/algorithms/libs/gnss_sdr_flags.h
Normal file
61
src/algorithms/libs/gnss_sdr_flags.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/*!
|
||||
* \file gnss_sdr_flags.h
|
||||
* \brief Helper file for gnss-sdr commandline flags
|
||||
* \author Carles Fernandez-Prades, 2018. cfernandez(at)cttc.es
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_FLAGS_H_
|
||||
#define GNSS_SDR_FLAGS_H_
|
||||
|
||||
|
||||
#include <gflags/gflags.h>
|
||||
|
||||
DECLARE_string(c); //<! Path to the configuration file
|
||||
DECLARE_string(config_file); //<! Path to the configuration file
|
||||
|
||||
DECLARE_string(log_dir); //<! Path to the folder in which logging will be stored
|
||||
|
||||
// Declare flags for signal sources
|
||||
DECLARE_string(s); //<! Path to the file containing the signal samples
|
||||
DECLARE_string(signal_source); //<! Path to the file containing the signal samples
|
||||
|
||||
// Declare flags for acquisition blocks
|
||||
DECLARE_int32(doppler_max); //<!If defined, maximum Doppler value in the search grid, in Hz (overrides the configuration file)
|
||||
|
||||
// Declare flags for tracking blocks
|
||||
DECLARE_int32(cn0_samples); //<! Number of correlator outputs used for CN0 estimation
|
||||
DECLARE_int32(cn0_min); //<! Minimum valid CN0 (in dB-Hz)
|
||||
DECLARE_int32(max_lock_fail); //<! Number number of lock failures before dropping satellite
|
||||
DECLARE_double(carrier_lock_th); //<! Carrier lock threshold (in rad)
|
||||
DECLARE_double(dll_bw_hz); //<! Bandwidth of the DLL low pass filter, in Hz (overrides the configuration file)
|
||||
DECLARE_double(pll_bw_hz); //<! Bandwidth of the PLL low pass filter, in Hz (overrides the configuration file)
|
||||
|
||||
// Declare flags for PVT
|
||||
DECLARE_string(RINEX_version); //<! RINEX version
|
||||
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user