1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-18 11:09:56 +00:00

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

This commit is contained in:
Carles Fernandez 2020-10-23 19:50:42 +02:00
commit 292d084478
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
67 changed files with 876 additions and 214 deletions

View File

@ -51,6 +51,7 @@ David Pubill david.pubill@cttc.cat Contributor
Fran Fabra fabra@ice.csic.es Contributor
Gabriel Araujo gabriel.araujo.5000@gmail.com Contributor
Gerald LaMountain gerald@gece.neu.edu Contributor
Josh Schindehette jschindehette@geontech.com Contributor
Leonardo Tonetto tonetto.dev@gmail.com Contributor
Mara Branzanti mara.branzanti@gmail.com Contributor
Marc Molina marc.molina.pena@gmail.com Contributor

View File

@ -326,7 +326,7 @@ set(GNSSSDR_ARMADILLO_LOCAL_VERSION "9.900.x")
set(GNSSSDR_GTEST_LOCAL_VERSION "1.10.0")
set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master")
set(GNSSSDR_GPSTK_LOCAL_VERSION "3.0.0")
set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.17")
set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.18")
set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.10")
set(GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "3.13.0")
set(GNSSSDR_BENCHMARK_LOCAL_VERSION "1.5.1")
@ -2097,7 +2097,7 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS
ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION}
PREFIX ${CMAKE_BINARY_DIR}/matio
GIT_REPOSITORY https://github.com/tbeu/matio
GIT_TAG 596cb3ce71038958812bd6cf9b141f12ce155ac6 # Workaround until Matio 1.5.18 v${GNSSSDR_MATIO_LOCAL_VERSION}
GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}
UPDATE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh
CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix=<INSTALL_DIR>
@ -2678,16 +2678,14 @@ if(DEFINED ENV{CUDA_GPU_ACCEL})
endif()
if(ENABLE_CUDA)
set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_EXTENSIONS ON)
if(CMAKE_VERSION VERSION_GREATER 3.11)
include(CheckLanguage)
check_language(CUDA)
if(CMAKE_CUDA_COMPILER)
enable_language(CUDA)
set(CUDA_FOUND TRUE)
if(NOT DEFINED CMAKE_CUDA_STANDARD)
set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
endif()
else()
set(ENABLE_CUDA OFF)
endif()
@ -2695,11 +2693,19 @@ if(ENABLE_CUDA)
find_package(CUDA REQUIRED)
set_package_properties(CUDA PROPERTIES
URL "https://developer.nvidia.com/cuda-downloads"
DESCRIPTION "Library for parallel programming in Nvidia GPUs"
PURPOSE "Used in some processing block implementations."
TYPE REQUIRED
)
if(NOT CUDA_FOUND)
if(CUDA_FOUND)
set_package_properties(CUDA PROPERTIES
DESCRIPTION "Library for parallel programming in Nvidia GPUs (found: v${CUDA_VERSION_STRING})"
)
set(CMAKE_CUDA_COMPILER_ID "NVIDIA") # only for reporting purposes
set(CMAKE_CUDA_COMPILER_VERSION ${CUDA_VERSION_STRING}) # only for reporting purposes
else()
set_package_properties(CUDA PROPERTIES
DESCRIPTION "Library for parallel programming in Nvidia GPUs"
)
set(ENABLE_CUDA OFF)
endif()
endif()
@ -2709,7 +2715,6 @@ if(ENABLE_CUDA)
message(STATUS " You can disable it with 'cmake -DENABLE_CUDA=OFF ..'")
else()
message(STATUS "NVIDIA CUDA GPU Acceleration will be not enabled.")
message(STATUS " Enable it with 'cmake -DENABLE_CUDA=ON ..' to add support for GPU-based acceleration using CUDA.")
endif()
@ -2997,7 +3002,9 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
add_compile_options(-Wno-missing-field-initializers)
endif()
if(CMAKE_CROSSCOMPILING OR NOT ENABLE_PACKAGING)
add_compile_options(-Wno-psabi)
if(NOT ENABLE_CUDA)
add_compile_options(-Wno-psabi)
endif()
endif()
if(IS_ARM)
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "7.1.0") AND (CMAKE_VERSION VERSION_GREATER "3.1"))
@ -3031,7 +3038,9 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
add_compile_options(-mtune=native)
endif()
else()
add_compile_options(-march=native)
if(NOT ENABLE_CUDA)
add_compile_options(-march=native)
endif()
endif()
endif()
endif()
@ -3157,6 +3166,9 @@ endif()
message(STATUS "CMake version: ${CMAKE_VERSION}")
message(STATUS "The CXX compiler identification is ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}. Standard: C++${CMAKE_CXX_STANDARD}.")
message(STATUS "The C compiler identification is ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}. Standard: C${CMAKE_C_STANDARD}.")
if(CUDA_FOUND)
message(STATUS "The CUDA compiler identification is ${CMAKE_CUDA_COMPILER_ID} ${CMAKE_CUDA_COMPILER_VERSION}. Standard: C++${CMAKE_CUDA_STANDARD}.")
endif()
message(STATUS "")
file(REMOVE ${CMAKE_BINARY_DIR}/features.log)
file(WRITE ${CMAKE_BINARY_DIR}/features.log "**********************************\n")

View File

@ -49,7 +49,7 @@ endmacro()
# or finds the interpreter via the built-in cmake module.
########################################################################
if(CMAKE_VERSION VERSION_LESS 3.12)
if(CMAKE_VERSION VERSION_LESS 3.12 OR CMAKE_CROSSCOMPILING)
if(PYTHON_EXECUTABLE)
message(STATUS "User set python executable ${PYTHON_EXECUTABLE}")
string(FIND "${PYTHON_EXECUTABLE}" "python3" IS_PYTHON3)

View File

@ -0,0 +1,89 @@
; This is a GNSS-SDR configuration file
; The configuration API is described at https://gnss-sdr.org/docs/sp-blocks/
; SPDX-License-Identifier: GPL-3.0-or-later
; SPDX-FileCopyrightText: (C) 2010-2020 (see AUTHORS file for a list of contributors)
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
GNSS-SDR.internal_fs_sps=2000000
;######### SIGNAL_SOURCE CONFIG ############
SignalSource.implementation=File_Signal_Source
SignalSource.filename=/tmp/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat
SignalSource.item_type=ishort
SignalSource.sampling_frequency=4000000
SignalSource.freq=1575420000
SignalSource.samples=0
SignalSource.enable_throttle_control=true
;######### SIGNAL_CONDITIONER CONFIG ############
SignalConditioner.implementation=Signal_Conditioner
;######### DATA_TYPE_ADAPTER CONFIG ############
DataTypeAdapter.implementation=Ishort_To_Complex
;######### INPUT_FILTER CONFIG ############
InputFilter.implementation=Pass_Through
InputFilter.item_type=gr_complex
;######### RESAMPLER CONFIG ############
Resampler.implementation=Direct_Resampler
Resampler.sample_freq_in=4000000
Resampler.sample_freq_out=2000000
Resampler.item_type=gr_complex
;######### CHANNELS GLOBAL CONFIG ############
Channels_1C.count=3
Channels.in_acquisition=1
Channel.signal=1C
Channel0.satellite=1
Channel1.satellite=11
Channel2.satellite=17
;######### ACQUISITION GLOBAL CONFIG ############
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition_1C.item_type=gr_complex
Acquisition_1C.threshold=0.008
Acquisition_1C.doppler_max=10000
Acquisition_1C.doppler_step=250
;######### TRACKING GLOBAL CONFIG ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=gr_complex
Tracking_1C.pll_bw_hz=40.0;
Tracking_1C.dll_bw_hz=4.0;
;######### TELEMETRY DECODER GPS CONFIG ############
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
;######### OBSERVABLES CONFIG ############
Observables.implementation=Hybrid_Observables
;######### PVT CONFIG ############
PVT.implementation=RTKLIB_PVT
PVT.averaging_depth=100
PVT.flag_averaging=true
PVT.output_rate_ms=10
PVT.display_rate_ms=500
PVT.enable_monitor=true
PVT.monitor_client_addresses=127.0.0.1
PVT.monitor_udp_port=1234
;######### MONITOR CONFIG ############
Monitor.enable_monitor=true
Monitor.decimation_factor=1
Monitor.client_addresses=127.0.0.1
Monitor.udp_port=1233
;######### ACQUISITION MONITOR CONFIG ############
AcquisitionMonitor.enable_monitor=true
AcquisitionMonitor.decimation_factor=1
AcquisitionMonitor.client_addresses=127.0.0.1
AcquisitionMonitor.udp_port=1231
;######### TRACKING MONITOR CONFIG ############
TrackingMonitor.enable_monitor=true
TrackingMonitor.decimation_factor=1
TrackingMonitor.client_addresses=127.0.0.1
TrackingMonitor.udp_port=1232

View File

@ -0,0 +1,82 @@
; This is a GNSS-SDR configuration file
; The configuration API is described at https://gnss-sdr.org/docs/sp-blocks/
; SPDX-License-Identifier: GPL-3.0-or-later
; SPDX-FileCopyrightText: (C) 2010-2020 (see AUTHORS file for a list of contributors)
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [Sps]
GNSS-SDR.internal_fs_sps=4000000
;######### SIGNAL_SOURCE CONFIG ############
SignalSource.implementation=Custom_UDP_Signal_Source
SignalSource.item_type=gr_complex
SignalSource.origin_address=127.0.0.1
SignalSource.capture_device=lo
SignalSource.port=1230
;SignalSource.payload_bytes=1472 # Not used! Size is retrieved from UDP Packet
SignalSource.sample_type=cfloat
SignalSource.IQ_swap=true
SignalSource.RF_channels=1
SignalSource.channels_in_udp=1
SignalSource.dump=false
SignalSource.dump_filename=./signal_source.dat
;######### SIGNAL_CONDITIONER CONFIG ############
SignalConditioner.implementation=Pass_Through
;######### CHANNELS GLOBAL CONFIG ############
Channels_1C.count=3
Channels.in_acquisition=1
Channel.signal=1C
Channel0.satellite=1
Channel1.satellite=11
Channel2.satellite=17
;######### ACQUISITION GLOBAL CONFIG ############
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition_1C.item_type=gr_complex
Acquisition_1C.threshold=0.008
Acquisition_1C.doppler_max=10000
Acquisition_1C.doppler_step=250
;######### TRACKING GLOBAL CONFIG ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=gr_complex
Tracking_1C.pll_bw_hz=40.0;
Tracking_1C.dll_bw_hz=4.0;
;######### TELEMETRY DECODER GPS CONFIG ############
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
;######### OBSERVABLES CONFIG ############
Observables.implementation=Hybrid_Observables
;######### PVT CONFIG ############
PVT.implementation=RTKLIB_PVT
PVT.averaging_depth=100
PVT.flag_averaging=true
PVT.output_rate_ms=10
PVT.display_rate_ms=500
PVT.enable_monitor=true
PVT.monitor_client_addresses=127.0.0.1
PVT.monitor_udp_port=1234
;######### MONITOR CONFIG ############
Monitor.enable_monitor=true
Monitor.decimation_factor=1
Monitor.client_addresses=127.0.0.1
Monitor.udp_port=1233
;######### ACQUISITION MONITOR CONFIG ############
AcquisitionMonitor.enable_monitor=true
AcquisitionMonitor.decimation_factor=1
AcquisitionMonitor.client_addresses=127.0.0.1
AcquisitionMonitor.udp_port=1231
;######### TRACKING MONITOR CONFIG ############
TrackingMonitor.enable_monitor=true
TrackingMonitor.decimation_factor=1
TrackingMonitor.client_addresses=127.0.0.1
TrackingMonitor.udp_port=1232

View File

@ -41,6 +41,8 @@ SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades <carles.fernandez@cttc
extra dependency is needed. This change is transparent to the user, since
everything is managed by the CMake scripts.
- Fix building with `-DENABLE_CUDA=ON` for blocks implemented with CUDA.
### Improvements in Usability:
- Fixed a bug when enabling pseudorange carrier smoothing in other bands than
@ -51,7 +53,14 @@ SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades <carles.fernandez@cttc
v0.0.13. This change recovers the old behavior.
- Fixed the termination of the receiver with `q` + `[Enter]` keys when using the
`Osmosdr_Signal_Source` implementation of the `SignalSource` block.
- The `Labsat_Signal_Source` implementation of the `SignalSource` block now can
be throttled with the new parameters `SignalSource.enable_throttle_control`
and `SignalSource.throttle_frequency_sps`, thus allowing the emulation of
real-time operation.
- Improved General Block diagram, both in content and in image resolution.
- The `Custom_UDP_Signal_Source` implementation now accepts
`SignalSource.sample_type=cfloat`, in addition to the existing 4 and 8-bit
length sample types.
&nbsp;
@ -147,6 +156,7 @@ SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades <carles.fernandez@cttc
processed (e.g., `GNSS-SDR.Galileo_banned_prns=14,18` since Galileo E14 and
E18 satellites are not usable for PVT). Satellites on those lists will never
be assigned to a processing channel.
- Added acquisition and tracking monitors, with configuration examples.
- Added a Matlab script to quantize the input signal with a given number of bits
per sample.
- Fixed the building option `-DENABLE_LOG=OFF`, which strips internal logging

View File

@ -85,12 +85,14 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
code_ = std::vector<std::complex<float>>(vector_length_);
bool enable_monitor_output = configuration->property("AcquisitionMonitor.enable_monitor", false);
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = galileo_pcps_8ms_make_acquisition_cc(sampled_ms_, max_dwells_,
doppler_max_, fs_in_, samples_per_ms, code_length_,
dump_, dump_filename_);
dump_, dump_filename_, enable_monitor_output);
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
DLOG(INFO) << "stream_to_vector("
<< stream_to_vector_->unique_id() << ")";

View File

@ -78,12 +78,14 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
code_data_ = std::vector<std::complex<float>>(vector_length_);
code_pilot_ = std::vector<std::complex<float>>(vector_length_);
bool enable_monitor_output = configuration_->property("AcquisitionMonitor.enable_monitor", false);
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_cccwsr_make_acquisition_cc(sampled_ms_, max_dwells_,
doppler_max_, fs_in_, samples_per_ms, code_length_,
dump_, dump_filename_);
dump_, dump_filename_, enable_monitor_output);
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
DLOG(INFO) << "stream_to_vector("
<< stream_to_vector_->unique_id() << ")";

View File

@ -111,6 +111,8 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
dump_filename_ = configuration_->property(role + ".dump_filename",
default_dump_filename);
bool enable_monitor_output = configuration_->property("AcquisitionMonitor.enable_monitor", false);
code_ = std::vector<std::complex<float>>(code_length_);
LOG(INFO) << "Vector Length: " << vector_length_
<< ", Samples per ms: " << samples_per_ms
@ -123,7 +125,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
acquisition_cc_ = pcps_quicksync_make_acquisition_cc(folding_factor_,
sampled_ms_, max_dwells_, doppler_max_, fs_in_,
samples_per_ms, code_length_, bit_transition_flag_,
dump_, dump_filename_);
dump_, dump_filename_, enable_monitor_output);
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_,
vector_length_);
DLOG(INFO) << "stream_to_vector_quicksync("

View File

@ -77,6 +77,8 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
dump_filename_ = configuration_->property(role + ".dump_filename",
default_dump_filename);
bool enable_monitor_output = configuration_->property("AcquisitionMonitor.enable_monitor", false);
// -- Find number of samples per spreading code (4 ms) -----------------
code_length_ = static_cast<unsigned int>(round(
@ -93,7 +95,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_,
fs_in_, samples_per_ms, code_length_, tong_init_val_,
tong_max_val_, tong_max_dwells_, dump_, dump_filename_);
tong_max_val_, tong_max_dwells_, dump_, dump_filename_, enable_monitor_output);
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
DLOG(INFO) << "stream_to_vector("

View File

@ -94,6 +94,8 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
codeQ_ = std::vector<std::complex<float>>(vector_length_);
both_signal_components = false;
bool enable_monitor_output = configuration->property("AcquisitionMonitor.enable_monitor", false);
std::string sig_ = configuration_->property("Channel.signal", std::string("5X"));
if (sig_.at(0) == '5' && sig_.at(1) == 'X')
{
@ -104,7 +106,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
item_size_ = sizeof(gr_complex);
acquisition_cc_ = galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(sampled_ms_, max_dwells_,
doppler_max_, fs_in_, code_length_, code_length_, bit_transition_flag_,
dump_, dump_filename_, both_signal_components, CAF_window_hz_, Zero_padding);
dump_, dump_filename_, both_signal_components, CAF_window_hz_, Zero_padding, enable_monitor_output);
}
else
{

View File

@ -55,6 +55,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1);
max_dwells_ = configuration->property(role + ".max_dwells", 1);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
bool enable_monitor_output = configuration->property("AcquisitionMonitor.enable_monitor", false);
// --- Find number of samples per spreading code -------------------------
vector_length_ = static_cast<unsigned int>(round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
@ -66,7 +67,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_make_assisted_acquisition_cc(max_dwells_, sampled_ms_,
doppler_max_, doppler_min_, fs_in_, vector_length_,
dump_, dump_filename_);
dump_, dump_filename_, enable_monitor_output);
}
else
{

View File

@ -100,6 +100,8 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
bool enable_monitor_output = configuration_->property("AcquisitionMonitor.enable_monitor", false);
int samples_per_ms = round(code_length_);
code_ = std::vector<std::complex<float>>(code_length_);
/* Object relevant information for debugging */
@ -116,7 +118,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
acquisition_cc_ = pcps_quicksync_make_acquisition_cc(folding_factor_,
sampled_ms_, max_dwells_, doppler_max_, fs_in_,
samples_per_ms, code_length_, bit_transition_flag_,
dump_, dump_filename_);
dump_, dump_filename_, enable_monitor_output);
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_,
code_length_ * folding_factor_);

View File

@ -67,6 +67,8 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
bool enable_monitor_output = configuration_->property("AcquisitionMonitor.enable_monitor", false);
// -- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
@ -79,7 +81,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, fs_in_,
code_length_, code_length_, tong_init_val_, tong_max_val_, tong_max_dwells_,
dump_, dump_filename_);
dump_, dump_filename_, enable_monitor_output);
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);

View File

@ -46,11 +46,12 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make
const std::string &dump_filename,
bool both_signal_components_,
int CAF_window_hz_,
int Zero_padding_)
int Zero_padding_,
bool enable_monitor_output)
{
return galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr(
new galileo_e5a_noncoherentIQ_acquisition_caf_cc(sampled_ms, max_dwells, doppler_max, fs_in, samples_per_ms,
samples_per_code, bit_transition_flag, dump, dump_filename, both_signal_components_, CAF_window_hz_, Zero_padding_));
samples_per_code, bit_transition_flag, dump, dump_filename, both_signal_components_, CAF_window_hz_, Zero_padding_, enable_monitor_output));
}
@ -66,9 +67,10 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit
const std::string &dump_filename,
bool both_signal_components_,
int CAF_window_hz_,
int Zero_padding_) : gr::block("galileo_e5a_noncoherentIQ_acquisition_caf_cc",
gr::io_signature::make(1, 1, sizeof(gr_complex)),
gr::io_signature::make(0, 0, sizeof(gr_complex)))
int Zero_padding_,
bool enable_monitor_output) : gr::block("galileo_e5a_noncoherentIQ_acquisition_caf_cc",
gr::io_signature::make(1, 1, sizeof(gr_complex)),
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
{
this->message_port_register_out(pmt::mp("events"));
d_sample_counter = 0ULL; // SAMPLE COUNTER
@ -96,6 +98,7 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit
d_buffer_count = 0;
d_both_signal_components = both_signal_components_;
d_CAF_window_hz = CAF_window_hz_;
d_enable_monitor_output = enable_monitor_output;
d_inbuffer.reserve(d_fft_size);
d_fft_code_I_A.reserve(d_fft_size);
@ -285,7 +288,7 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::set_state(int state)
int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items __attribute__((unused)),
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items __attribute__((unused)))
gr_vector_void_star &output_items)
{
/*
* By J.Arribas, L.Esteve, M.Molina and M.Sales
@ -300,6 +303,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
*/
int acquisition_message = -1; // 0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
int return_value = 0; // 0=Produces no Gnss_Synchro objects
/* States: 0 Stop Channel
* 1 Load the buffer until it reaches fft_size
* 2 Acquisition algorithm
@ -726,6 +730,17 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
d_sample_counter += static_cast<uint64_t>(ninput_items[0]); // sample counter
consume_each(ninput_items[0]);
// Copy and push current Gnss_Synchro to monitor queue
if (d_enable_monitor_output)
{
auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
Gnss_Synchro current_synchro_data = Gnss_Synchro();
current_synchro_data = *d_gnss_synchro;
*out[0] = current_synchro_data;
return_value = 1; // Number of Gnss_Synchro objects produced
}
break;
}
case 4:
@ -752,5 +767,5 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
}
}
return 0;
return return_value;
}

View File

@ -60,7 +60,8 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make
const std::string& dump_filename,
bool both_signal_components_,
int CAF_window_hz_,
int Zero_padding_);
int Zero_padding_,
bool enable_monitor_output);
/*!
* \brief This class implements a Parallel Code Phase Search Acquisition.
@ -186,7 +187,8 @@ private:
const std::string& dump_filename,
bool both_signal_components_,
int CAF_window_hz_,
int Zero_padding_);
int Zero_padding_,
bool enable_monitor_output);
galileo_e5a_noncoherentIQ_acquisition_caf_cc(
unsigned int sampled_ms,
@ -198,7 +200,8 @@ private:
const std::string& dump_filename,
bool both_signal_components_,
int CAF_window_hz_,
int Zero_padding_);
int Zero_padding_,
bool enable_monitor_output);
void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift,
int doppler_offset);
@ -260,6 +263,7 @@ private:
bool d_active;
bool d_dump;
bool d_both_signal_components;
bool d_enable_monitor_output;
};
#endif // GNSS_SDR_GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_CC_H

View File

@ -37,11 +37,13 @@ galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc(
int64_t fs_in,
int32_t samples_per_ms,
int32_t samples_per_code,
bool dump, const std::string &dump_filename)
bool dump,
const std::string &dump_filename,
bool enable_monitor_output)
{
return galileo_pcps_8ms_acquisition_cc_sptr(
new galileo_pcps_8ms_acquisition_cc(sampled_ms, max_dwells, doppler_max, fs_in, samples_per_ms,
samples_per_code, dump, dump_filename));
samples_per_code, dump, dump_filename, enable_monitor_output));
}
@ -53,9 +55,10 @@ galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc(
int32_t samples_per_ms,
int32_t samples_per_code,
bool dump,
const std::string &dump_filename) : gr::block("galileo_pcps_8ms_acquisition_cc",
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
gr::io_signature::make(0, 0, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)))
const std::string &dump_filename,
bool enable_monitor_output) : gr::block("galileo_pcps_8ms_acquisition_cc",
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
{
this->message_port_register_out(pmt::mp("events"));
d_sample_counter = 0ULL; // SAMPLE COUNTER
@ -87,6 +90,8 @@ galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc(
d_dump = dump;
d_dump_filename = dump_filename;
d_enable_monitor_output = enable_monitor_output;
d_doppler_resolution = 0;
d_threshold = 0;
d_doppler_step = 0;
@ -199,7 +204,7 @@ void galileo_pcps_8ms_acquisition_cc::set_state(int32_t state)
int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items,
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items __attribute__((unused)))
gr_vector_void_star &output_items)
{
int32_t acquisition_message = -1; // 0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
@ -380,6 +385,16 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items,
acquisition_message = 1;
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
// Copy and push current Gnss_Synchro to monitor queue
if (d_enable_monitor_output)
{
auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
Gnss_Synchro current_synchro_data = Gnss_Synchro();
current_synchro_data = *d_gnss_synchro;
*out[0] = current_synchro_data;
noutput_items = 1; // Number of Gnss_Synchro objects produced
}
break;
}

View File

@ -52,7 +52,8 @@ galileo_pcps_8ms_make_acquisition_cc(uint32_t sampled_ms,
int32_t samples_per_ms,
int32_t samples_per_code,
bool dump,
const std::string& dump_filename);
const std::string& dump_filename,
bool enable_monitor_output);
/*!
* \brief This class implements a Parallel Code Phase Search Acquisition for
@ -174,7 +175,8 @@ private:
int32_t samples_per_ms,
int32_t samples_per_code,
bool dump,
const std::string& dump_filename);
const std::string& dump_filename,
bool enable_monitor_output);
galileo_pcps_8ms_acquisition_cc(
uint32_t sampled_ms,
@ -184,7 +186,8 @@ private:
int32_t samples_per_ms,
int32_t samples_per_code,
bool dump,
const std::string& dump_filename);
const std::string& dump_filename,
bool enable_monitor_output);
void calculate_magnitudes(
gr_complex* fft_begin,
@ -230,6 +233,7 @@ private:
bool d_active;
bool d_dump;
bool d_enable_monitor_output;
};
#endif // GNSS_SDR_PCPS_8MS_ACQUISITION_CC_H

View File

@ -71,7 +71,7 @@ pcps_acquisition_sptr pcps_make_acquisition(const Acq_Conf& conf_)
pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acquisition",
gr::io_signature::make(1, 1, conf_.it_size),
gr::io_signature::make(0, 0, conf_.it_size))
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
{
this->message_port_register_out(pmt::mp("events"));
@ -385,6 +385,14 @@ void pcps_acquisition::send_positive_acquisition()
{
this->message_port_pub(pmt::mp("events"), pmt::from_long(1));
}
// Copy and push current Gnss_Synchro to monitor queue
if (d_acq_parameters.enable_monitor_output)
{
Gnss_Synchro current_synchro_data = Gnss_Synchro();
current_synchro_data = *d_gnss_synchro;
d_monitor_queue.push(current_synchro_data);
}
}
@ -903,7 +911,7 @@ void pcps_acquisition::calculate_threshold()
int pcps_acquisition::general_work(int noutput_items __attribute__((unused)),
gr_vector_int& ninput_items,
gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items __attribute__((unused)))
gr_vector_void_star& output_items)
{
/*
* By J.Arribas, L.Esteve and M.Molina
@ -1010,5 +1018,22 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)),
break;
}
}
// Send outputs to the monitor
if (d_acq_parameters.enable_monitor_output)
{
auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
if (!d_monitor_queue.empty())
{
int num_gnss_synchro_objects = d_monitor_queue.size();
for (int i = 0; i < num_gnss_synchro_objects; ++i) {
Gnss_Synchro current_synchro_data = d_monitor_queue.front();
d_monitor_queue.pop();
*out[i] = current_synchro_data;
}
return num_gnss_synchro_objects;
}
}
return 0;
}

View File

@ -59,6 +59,7 @@
#include <complex>
#include <cstdint>
#include <memory>
#include <queue>
#include <string>
#include <utility>
@ -284,6 +285,8 @@ private:
bool d_step_two;
bool d_use_CFAR_algorithm_flag;
bool d_dump;
std::queue<Gnss_Synchro> d_monitor_queue;
};
#endif // GNSS_SDR_PCPS_ACQUISITION_H

View File

@ -63,7 +63,7 @@ pcps_acquisition_fine_doppler_cc_sptr pcps_make_acquisition_fine_doppler_cc(cons
pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Conf &conf_)
: gr::block("pcps_acquisition_fine_doppler_cc",
gr::io_signature::make(1, 1, sizeof(gr_complex)),
gr::io_signature::make(0, 0, sizeof(gr_complex)))
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
{
this->message_port_register_out(pmt::mp("events"));
acq_parameters = conf_;
@ -482,7 +482,7 @@ void pcps_acquisition_fine_doppler_cc::set_state(int state)
int pcps_acquisition_fine_doppler_cc::general_work(int noutput_items,
gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items __attribute__((unused)))
gr_vector_void_star &output_items)
{
/*!
* TODO: High sensitivity acquisition algorithm:
@ -498,6 +498,7 @@ int pcps_acquisition_fine_doppler_cc::general_work(int noutput_items,
* S5. Negative_Acq: Send message and stop acq -> S0
*/
int return_value = 0; // Number of Gnss_Syncro objects produced
int samples_remaining;
switch (d_state)
{
@ -585,6 +586,15 @@ int pcps_acquisition_fine_doppler_cc::general_work(int noutput_items,
d_sample_counter += static_cast<uint64_t>(noutput_items); // sample counter
consume_each(noutput_items);
}
// Copy and push current Gnss_Synchro to monitor queue
if (acq_parameters.enable_monitor_output)
{
auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
Gnss_Synchro current_synchro_data = Gnss_Synchro();
current_synchro_data = *d_gnss_synchro;
*out[0] = current_synchro_data;
return_value = 1; // Number of Gnss_Synchro objects produced
}
break;
case 5: // Negative_Acq
DLOG(INFO) << "negative acquisition";
@ -619,7 +629,7 @@ int pcps_acquisition_fine_doppler_cc::general_work(int noutput_items,
}
break;
}
return 0;
return return_value;
}
void pcps_acquisition_fine_doppler_cc::dump_results(int effective_fft_size)

View File

@ -180,7 +180,7 @@ void pcps_acquisition_fpga::acquisition_core(uint32_t num_doppler_bins, uint32_t
&d_doppler_index,
&total_block_exp);
const auto doppler = static_cast<int32_t>(doppler_min) + doppler_step * (d_doppler_index - 1);
const int32_t doppler = static_cast<int32_t>(doppler_min) + doppler_step * (d_doppler_index - 1);
if (total_block_exp > d_total_block_exp)
{
@ -268,7 +268,7 @@ void pcps_acquisition_fpga::set_active(bool active)
while (num_second_acq < d_max_num_acqs)
{
acquisition_core(d_num_doppler_bins_step2, d_doppler_step2, d_doppler_center_step_two - static_cast<float>(floor(d_num_doppler_bins_step2 / 2.0)) * d_doppler_step2 + d_doppler_center);
acquisition_core(d_num_doppler_bins_step2, d_doppler_step2, d_doppler_center_step_two - static_cast<float>(floor(d_num_doppler_bins_step2 / 2.0)) * d_doppler_step2);
if (d_test_statistics > d_threshold)
{
d_active = false;

View File

@ -40,20 +40,20 @@ extern Concurrent_Map<Gps_Acq_Assist> global_gps_acq_assist_map;
pcps_assisted_acquisition_cc_sptr pcps_make_assisted_acquisition_cc(
int32_t max_dwells, uint32_t sampled_ms, int32_t doppler_max, int32_t doppler_min,
int64_t fs_in, int32_t samples_per_ms, bool dump,
const std::string &dump_filename)
const std::string &dump_filename, bool enable_monitor_output)
{
return pcps_assisted_acquisition_cc_sptr(
new pcps_assisted_acquisition_cc(max_dwells, sampled_ms, doppler_max, doppler_min,
fs_in, samples_per_ms, dump, dump_filename));
fs_in, samples_per_ms, dump, dump_filename, enable_monitor_output));
}
pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc(
int32_t max_dwells, uint32_t sampled_ms, int32_t doppler_max, int32_t doppler_min,
int64_t fs_in, int32_t samples_per_ms, bool dump,
const std::string &dump_filename) : gr::block("pcps_assisted_acquisition_cc",
gr::io_signature::make(1, 1, sizeof(gr_complex)),
gr::io_signature::make(0, 0, sizeof(gr_complex)))
int64_t fs_in, int32_t samples_per_ms, bool dump, const std::string &dump_filename,
bool enable_monitor_output) : gr::block("pcps_assisted_acquisition_cc",
gr::io_signature::make(1, 1, sizeof(gr_complex)),
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
{
this->message_port_register_out(pmt::mp("events"));
d_sample_counter = 0ULL; // SAMPLE COUNTER
@ -81,6 +81,8 @@ pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc(
// For dumping samples into a file
d_dump = dump;
d_dump_filename = dump_filename;
d_enable_monitor_output = enable_monitor_output;
d_doppler_resolution = 0;
d_threshold = 0;
@ -334,7 +336,7 @@ int32_t pcps_assisted_acquisition_cc::compute_and_accumulate_grid(gr_vector_cons
int pcps_assisted_acquisition_cc::general_work(int noutput_items,
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items __attribute__((unused)))
gr_vector_void_star &output_items)
{
/*!
* TODO: High sensitivity acquisition algorithm:
@ -428,6 +430,15 @@ int pcps_assisted_acquisition_cc::general_work(int noutput_items,
d_sample_counter += static_cast<uint64_t>(ninput_items[0]); // sample counter
consume_each(ninput_items[0]);
d_state = 0;
// Copy and push current Gnss_Synchro to monitor queue
if (d_enable_monitor_output)
{
auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
Gnss_Synchro current_synchro_data = Gnss_Synchro();
current_synchro_data = *d_gnss_synchro;
*out[0] = current_synchro_data;
noutput_items = 1; // Number of Gnss_Synchro objects produced
}
break;
case 6: // Negative_Acq
DLOG(INFO) << "negative acquisition";

View File

@ -67,7 +67,9 @@ pcps_assisted_acquisition_cc_sptr pcps_make_assisted_acquisition_cc(
int32_t doppler_min,
int64_t fs_in,
int32_t samples_per_ms,
bool dump, const std::string& dump_filename);
bool dump,
const std::string& dump_filename,
bool enable_monitor_output);
/*!
* \brief This class implements a Parallel Code Phase Search Acquisition.
@ -183,12 +185,12 @@ private:
pcps_make_assisted_acquisition_cc(int32_t max_dwells, uint32_t sampled_ms,
int32_t doppler_max, int32_t doppler_min, int64_t fs_in,
int32_t samples_per_ms, bool dump,
const std::string& dump_filename);
const std::string& dump_filename, bool enable_monitor_output);
pcps_assisted_acquisition_cc(int32_t max_dwells, uint32_t sampled_ms,
int32_t doppler_max, int32_t doppler_min, int64_t fs_in,
int32_t samples_per_ms, bool dump,
const std::string& dump_filename);
const std::string& dump_filename, bool enable_monitor_output);
void calculate_magnitudes(gr_complex* fft_begin, int32_t doppler_shift,
int32_t doppler_offset);
@ -242,6 +244,7 @@ private:
bool d_active;
bool d_disable_assist;
bool d_dump;
bool d_enable_monitor_output;
};
#endif // GNSS_SDR_PCPS_ASSISTED_ACQUISITION_CC_H

View File

@ -42,11 +42,13 @@ pcps_cccwsr_acquisition_cc_sptr pcps_cccwsr_make_acquisition_cc(
int64_t fs_in,
int32_t samples_per_ms,
int32_t samples_per_code,
bool dump, const std::string &dump_filename)
bool dump,
const std::string &dump_filename,
bool enable_monitor_output)
{
return pcps_cccwsr_acquisition_cc_sptr(
new pcps_cccwsr_acquisition_cc(sampled_ms, max_dwells, doppler_max, fs_in,
samples_per_ms, samples_per_code, dump, dump_filename));
samples_per_ms, samples_per_code, dump, dump_filename, enable_monitor_output));
}
@ -58,9 +60,10 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc(
int32_t samples_per_ms,
int32_t samples_per_code,
bool dump,
const std::string &dump_filename) : gr::block("pcps_cccwsr_acquisition_cc",
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
gr::io_signature::make(0, 0, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)))
const std::string &dump_filename,
bool enable_monitor_output) : gr::block("pcps_cccwsr_acquisition_cc",
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
{
this->message_port_register_out(pmt::mp("events"));
d_sample_counter = 0ULL; // SAMPLE COUNTER
@ -96,6 +99,8 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc(
d_dump = dump;
d_dump_filename = dump_filename;
d_enable_monitor_output = enable_monitor_output;
d_doppler_resolution = 0;
d_threshold = 0;
d_doppler_step = 0;
@ -208,7 +213,7 @@ void pcps_cccwsr_acquisition_cc::set_state(int32_t state)
int pcps_cccwsr_acquisition_cc::general_work(int noutput_items,
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items __attribute__((unused)))
gr_vector_void_star &output_items)
{
int32_t acquisition_message = -1; // 0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
@ -400,6 +405,16 @@ int pcps_cccwsr_acquisition_cc::general_work(int noutput_items,
acquisition_message = 1;
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
// Copy and push current Gnss_Synchro to monitor queue
if (d_enable_monitor_output)
{
auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
Gnss_Synchro current_synchro_data = Gnss_Synchro();
current_synchro_data = *d_gnss_synchro;
*out[0] = current_synchro_data;
noutput_items = 1; // Number of Gnss_Synchro objects produced
}
break;
}

View File

@ -58,7 +58,8 @@ pcps_cccwsr_acquisition_cc_sptr pcps_cccwsr_make_acquisition_cc(
int32_t samples_per_ms,
int32_t samples_per_code,
bool dump,
const std::string& dump_filename);
const std::string& dump_filename,
bool enable_monitor_output);
/*!
* \brief This class implements a Parallel Code Phase Search Acquisition with
@ -176,12 +177,12 @@ private:
pcps_cccwsr_make_acquisition_cc(uint32_t sampled_ms, uint32_t max_dwells,
uint32_t doppler_max, int64_t fs_in,
int32_t samples_per_ms, int32_t samples_per_code,
bool dump, const std::string& dump_filename);
bool dump, const std::string& dump_filename, bool enable_monitor_output);
pcps_cccwsr_acquisition_cc(uint32_t sampled_ms, uint32_t max_dwells,
uint32_t doppler_max, int64_t fs_in,
int32_t samples_per_ms, int32_t samples_per_code,
bool dump, const std::string& dump_filename);
bool dump, const std::string& dump_filename, bool enable_monitor_output);
void calculate_magnitudes(gr_complex* fft_begin, int32_t doppler_shift,
int32_t doppler_offset);
@ -231,6 +232,7 @@ private:
bool d_active;
bool d_dump;
bool d_enable_monitor_output;
};
#endif // GNSS_SDR_PCPS_CCCWSR_ACQUISITION_CC_H

View File

@ -61,11 +61,12 @@ pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc(
int samples_per_ms, int samples_per_code,
bool bit_transition_flag,
bool dump,
const std::string &dump_filename)
const std::string &dump_filename,
bool enable_monitor_output)
{
return pcps_opencl_acquisition_cc_sptr(
new pcps_opencl_acquisition_cc(sampled_ms, max_dwells, doppler_max, fs_in, samples_per_ms,
samples_per_code, bit_transition_flag, dump, dump_filename));
samples_per_code, bit_transition_flag, dump, dump_filename, enable_monitor_output));
}
@ -78,9 +79,10 @@ pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc(
int samples_per_code,
bool bit_transition_flag,
bool dump,
const std::string &dump_filename) : gr::block("pcps_opencl_acquisition_cc",
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
gr::io_signature::make(0, 0, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)))
const std::string &dump_filename,
bool enable_monitor_output) : gr::block("pcps_opencl_acquisition_cc",
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
{
this->message_port_register_out(pmt::mp("events"));
d_sample_counter = 0ULL; // SAMPLE COUNTER
@ -122,6 +124,8 @@ pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc(
// For dumping samples into a file
d_dump = dump;
d_dump_filename = dump_filename;
d_enable_monitor_output = enable_monitor_output;
}
@ -658,7 +662,7 @@ void pcps_opencl_acquisition_cc::set_state(int state)
int pcps_opencl_acquisition_cc::general_work(int noutput_items,
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items __attribute__((unused)))
gr_vector_void_star &output_items)
{
int acquisition_message = -1; // 0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
switch (d_state)
@ -761,6 +765,16 @@ int pcps_opencl_acquisition_cc::general_work(int noutput_items,
acquisition_message = 1;
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
// Copy and push current Gnss_Synchro to monitor queue
if (d_enable_monitor_output)
{
auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
Gnss_Synchro current_synchro_data = Gnss_Synchro();
current_synchro_data = *d_gnss_synchro;
*out[0] = current_synchro_data;
noutput_items = 1; // Number of Gnss_Synchro objects produced
}
break;
}

View File

@ -75,7 +75,8 @@ pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc(
int samples_per_code,
bool bit_transition_flag,
bool dump,
const std::string& dump_filename);
const std::string& dump_filename,
bool enable_monitor_output);
/*!
* \brief This class implements a Parallel Code Phase Search Acquisition.
@ -210,14 +211,16 @@ private:
int samples_per_ms, int samples_per_code,
bool bit_transition_flag,
bool dump,
const std::string& dump_filename);
const std::string& dump_filename,
bool enable_monitor_output);
pcps_opencl_acquisition_cc(uint32_t sampled_ms, uint32_t max_dwells,
uint32_t doppler_max, int64_t fs_in,
int samples_per_ms, int samples_per_code,
bool bit_transition_flag,
bool dump,
const std::string& dump_filename);
const std::string& dump_filename,
bool enable_monitor_output);
void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift,
int doppler_offset);
@ -290,6 +293,7 @@ private:
bool d_active;
bool d_core_working;
bool d_dump;
bool d_enable_monitor_output;
};
#endif

View File

@ -40,7 +40,8 @@ pcps_quicksync_acquisition_cc_sptr pcps_quicksync_make_acquisition_cc(
int32_t samples_per_code,
bool bit_transition_flag,
bool dump,
const std::string& dump_filename)
const std::string& dump_filename,
bool enable_monitor_output)
{
return pcps_quicksync_acquisition_cc_sptr(
new pcps_quicksync_acquisition_cc(
@ -49,7 +50,8 @@ pcps_quicksync_acquisition_cc_sptr pcps_quicksync_make_acquisition_cc(
fs_in, samples_per_ms,
samples_per_code,
bit_transition_flag,
dump, dump_filename));
dump, dump_filename,
enable_monitor_output));
}
@ -60,9 +62,10 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc(
int32_t samples_per_ms, int32_t samples_per_code,
bool bit_transition_flag,
bool dump,
const std::string& dump_filename) : gr::block("pcps_quicksync_acquisition_cc",
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
gr::io_signature::make(0, 0, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)))
const std::string& dump_filename,
bool enable_monitor_output) : gr::block("pcps_quicksync_acquisition_cc",
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
{
this->message_port_register_out(pmt::mp("events"));
d_sample_counter = 0ULL; // SAMPLE COUNTER
@ -104,6 +107,8 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc(
d_dump = dump;
d_dump_filename = dump_filename;
d_enable_monitor_output = enable_monitor_output;
d_code_folded = std::vector<gr_complex>(d_fft_size, lv_cmake(0.0F, 0.0F));
d_signal_folded.reserve(d_fft_size);
d_noise_floor_power = 0;
@ -228,7 +233,7 @@ void pcps_quicksync_acquisition_cc::set_state(int32_t state)
int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
gr_vector_int& ninput_items, gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items __attribute__((unused)))
gr_vector_void_star& output_items)
{
/*
* By J.Arribas, L.Esteve and M.Molina
@ -507,6 +512,17 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
acquisition_message = 1;
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
// DLOG(INFO) << "END CASE 2";
// Copy and push current Gnss_Synchro to monitor queue
if (d_enable_monitor_output)
{
auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
Gnss_Synchro current_synchro_data = Gnss_Synchro();
current_synchro_data = *d_gnss_synchro;
*out[0] = current_synchro_data;
noutput_items = 1; // Number of Gnss_Synchro objects produced
}
break;
}

View File

@ -76,7 +76,8 @@ pcps_quicksync_acquisition_cc_sptr pcps_quicksync_make_acquisition_cc(
int32_t samples_per_code,
bool bit_transition_flag,
bool dump,
const std::string& dump_filename);
const std::string& dump_filename,
bool enable_monitor_output);
/*!
* \brief This class implements a Parallel Code Phase Search Acquisition with
@ -199,7 +200,8 @@ private:
int32_t samples_per_ms, int32_t samples_per_code,
bool bit_transition_flag,
bool dump,
const std::string& dump_filename);
const std::string& dump_filename,
bool enable_monitor_output);
pcps_quicksync_acquisition_cc(uint32_t folding_factor,
uint32_t sampled_ms, uint32_t max_dwells,
@ -207,7 +209,8 @@ private:
int32_t samples_per_ms, int32_t samples_per_code,
bool bit_transition_flag,
bool dump,
const std::string& dump_filename);
const std::string& dump_filename,
bool enable_monitor_output);
void calculate_magnitudes(gr_complex* fft_begin, int32_t doppler_shift,
int32_t doppler_offset);
@ -261,6 +264,7 @@ private:
bool d_bit_transition_flag;
bool d_active;
bool d_dump;
bool d_enable_monitor_output;
};
#endif // GNSS_SDR_PCPS_QUICKSYNC_ACQUISITION_CC_H

View File

@ -58,11 +58,13 @@ pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc(
uint32_t tong_init_val,
uint32_t tong_max_val,
uint32_t tong_max_dwells,
bool dump, const std::string &dump_filename)
bool dump,
const std::string &dump_filename,
bool enable_monitor_output)
{
return pcps_tong_acquisition_cc_sptr(
new pcps_tong_acquisition_cc(sampled_ms, doppler_max, fs_in, samples_per_ms, samples_per_code,
tong_init_val, tong_max_val, tong_max_dwells, dump, dump_filename));
tong_init_val, tong_max_val, tong_max_dwells, dump, dump_filename, enable_monitor_output));
}
@ -76,9 +78,10 @@ pcps_tong_acquisition_cc::pcps_tong_acquisition_cc(
uint32_t tong_max_val,
uint32_t tong_max_dwells,
bool dump,
const std::string &dump_filename) : gr::block("pcps_tong_acquisition_cc",
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
gr::io_signature::make(0, 0, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)))
const std::string &dump_filename,
bool enable_monitor_output) : gr::block("pcps_tong_acquisition_cc",
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
{
this->message_port_register_out(pmt::mp("events"));
d_sample_counter = 0ULL; // SAMPLE COUNTER
@ -112,6 +115,8 @@ pcps_tong_acquisition_cc::pcps_tong_acquisition_cc(
d_dump = dump;
d_dump_filename = dump_filename;
d_enable_monitor_output = enable_monitor_output;
d_doppler_resolution = 0;
d_threshold = 0;
d_doppler_step = 0;
@ -224,7 +229,7 @@ void pcps_tong_acquisition_cc::set_state(int32_t state)
int pcps_tong_acquisition_cc::general_work(int noutput_items,
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items __attribute__((unused)))
gr_vector_void_star &output_items)
{
int32_t acquisition_message = -1; // 0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
@ -401,6 +406,16 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items,
acquisition_message = 1;
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
// Copy and push current Gnss_Synchro to monitor queue
if (d_enable_monitor_output)
{
auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
Gnss_Synchro current_synchro_data = Gnss_Synchro();
current_synchro_data = *d_gnss_synchro;
*out[0] = current_synchro_data;
noutput_items = 1; // Number of Gnss_Synchro objects produced
}
break;
}

View File

@ -73,7 +73,8 @@ pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc(
uint32_t tong_max_val,
uint32_t tong_max_dwells,
bool dump,
const std::string& dump_filename);
const std::string& dump_filename,
bool enable_monitor_output);
/*!
* \brief This class implements a Parallel Code Phase Search Acquisition with
@ -191,13 +192,13 @@ private:
int64_t fs_in, int32_t samples_per_ms,
int32_t samples_per_code, uint32_t tong_init_val,
uint32_t tong_max_val, uint32_t tong_max_dwells,
bool dump, const std::string& dump_filename);
bool dump, const std::string& dump_filename, bool enable_monitor_output);
pcps_tong_acquisition_cc(uint32_t sampled_ms, uint32_t doppler_max,
int64_t fs_in, int32_t samples_per_ms,
int32_t samples_per_code, uint32_t tong_init_val,
uint32_t tong_max_val, uint32_t tong_max_dwells,
bool dump, const std::string& dump_filename);
bool dump, const std::string& dump_filename, bool enable_monitor_output);
void calculate_magnitudes(gr_complex* fft_begin, int32_t doppler_shift,
int32_t doppler_offset);
@ -246,6 +247,7 @@ private:
bool d_active;
bool d_dump;
bool d_enable_monitor_output;
};
#endif // GNSS_SDR_PCPS_TONG_ACQUISITION_CC_H

View File

@ -56,6 +56,7 @@ Acq_Conf::Acq_Conf()
resampler_ratio = 1.0;
resampled_fs = 0LL;
resampler_latency_samples = 0U;
enable_monitor_output = false;
}
@ -121,6 +122,8 @@ void Acq_Conf::SetFromConfiguration(const ConfigurationInterface *configuration,
use_CFAR_algorithm_flag = false;
}
enable_monitor_output = configuration->property("AcquisitionMonitor.enable_monitor", false);
SetDerivedParams();
}

View File

@ -67,6 +67,7 @@ public:
bool blocking_on_standby; // enable it only for unit testing to avoid sample consume on idle status
bool make_2_steps;
bool use_automatic_resampler;
bool enable_monitor_output;
private:
void SetDerivedParams();

View File

@ -174,6 +174,10 @@ gr::basic_block_sptr Channel::get_left_block_trk()
return trk_->get_left_block();
}
gr::basic_block_sptr Channel::get_right_block_trk()
{
return trk_->get_right_block();
}
gr::basic_block_sptr Channel::get_left_block_acq()
{
@ -184,6 +188,10 @@ gr::basic_block_sptr Channel::get_left_block_acq()
return acq_->get_left_block();
}
gr::basic_block_sptr Channel::get_right_block_acq()
{
return acq_->get_right_block();
}
gr::basic_block_sptr Channel::get_right_block()
{

View File

@ -68,9 +68,11 @@ public:
void connect(gr::top_block_sptr top_block) override; //!< Connects the tracking block to the top_block and to the telemetry
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_left_block_trk() override; //!< Gets the GNU Radio tracking block input pointer
gr::basic_block_sptr get_left_block_acq() override; //!< Gets the GNU Radio acquisition block input pointer
gr::basic_block_sptr get_right_block() override; //!< Gets the GNU Radio channel block output pointer
gr::basic_block_sptr get_left_block_trk() override; //!< Gets the GNU Radio tracking block input pointer
gr::basic_block_sptr get_right_block_trk() override; //!< Gets the GNU Radio tracking block output pointer
gr::basic_block_sptr get_left_block_acq() override; //!< Gets the GNU Radio acquisition block input pointer
gr::basic_block_sptr get_right_block_acq() override; //!< Gets the GNU Radio acquisition block output pointer
gr::basic_block_sptr get_right_block() override; //!< Gets the GNU Radio channel block output pointer
inline std::string role() override { return role_; }
inline std::string implementation() override { return std::string("Channel"); } //!< Returns "Channel"

View File

@ -55,7 +55,7 @@ endmacro()
set(VOLK_PYTHON_MIN_VERSION "2.7")
set(VOLK_PYTHON3_MIN_VERSION "3.4")
if(CMAKE_VERSION VERSION_LESS 3.12)
if(CMAKE_VERSION VERSION_LESS 3.12 OR CMAKE_CROSSCOMPILING)
if(PYTHON_EXECUTABLE)
message(STATUS "User set python executable ${PYTHON_EXECUTABLE}")
find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED)

View File

@ -5,11 +5,11 @@
* gr_complex input and gr_complex output
* \author Luis Esteve, 2011. luis(at)epsilon-formacion.com
*
* This block takes in a signal stream and performs direct
* resampling.
* The theory behind this block can be found in Chapter 7.5 of
* the following book.
*
* This block takes in a signal stream and performs direct resampling.
* The theory behind this block can be found in Chapter 7.5 of the following
* book:
* R. Lyons, Undestanding Digital Signal Processing, 3rd ed., Pearson Education,
* 2010.
*
* -----------------------------------------------------------------------------
*

View File

@ -148,8 +148,6 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con
{
freq_band = "L1L2";
}
thread_file_to_dma = std::thread([&] { run_DMA_process(freq_band, filename_rx1, filename_rx2); });
}
if (switch_position == 2) // Real-time via AD9361
{
@ -368,6 +366,11 @@ Ad9361FpgaSignalSource::~Ad9361FpgaSignalSource()
}
}
void Ad9361FpgaSignalSource::start()
{
thread_file_to_dma = std::thread([&] { run_DMA_process(freq_band, filename_rx1, filename_rx2); });
}
void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const std::string &Filename1, const std::string &Filename2)
{
@ -589,6 +592,11 @@ void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const
lock.unlock();
}
if (close(tx_fd) < 0)
{
std::cerr << "Error closing loop device " << '\n';
}
try
{
infile1.close();
@ -604,7 +612,7 @@ void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const
}
void Ad9361FpgaSignalSource::run_dynamic_bit_selection_process(void)
void Ad9361FpgaSignalSource::run_dynamic_bit_selection_process()
{
bool dynamic_bit_selection_active = true;

View File

@ -43,6 +43,8 @@ public:
~Ad9361FpgaSignalSource();
void start();
inline std::string role() override
{
return role_;
@ -74,7 +76,7 @@ private:
const std::string &Filename1,
const std::string &Filename2);
void run_dynamic_bit_selection_process(void);
void run_dynamic_bit_selection_process();
std::thread thread_file_to_dma;
std::thread thread_dynamic_bit_selection;
@ -95,6 +97,9 @@ private:
std::string filename_rx2;
std::string freq_band;
std::mutex dma_mutex;
std::mutex dynamic_bit_selection_mutex;
double rf_gain_rx1_;
double rf_gain_rx2_;
uint64_t freq_; // frequency of local oscillator
@ -125,9 +130,6 @@ private:
bool enable_DMA_;
bool enable_dynamic_bit_selection_;
bool rf_shutdown_;
std::mutex dma_mutex;
std::mutex dynamic_bit_selection_mutex;
};
#endif // GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H

View File

@ -34,6 +34,11 @@ LabsatSignalSource::LabsatSignalSource(const ConfigurationInterface* configurati
dump_ = configuration->property(role + ".dump", false);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
enable_throttle_control_ = configuration->property(role + ".enable_throttle_control", false);
const int64_t sampling_frequency_deprecated = configuration->property(role + ".sampling_frequency", static_cast<int64_t>(16368000));
const int64_t throttle_frequency_sps = configuration->property(role + ".throttle_frequency_sps", static_cast<int64_t>(sampling_frequency_deprecated));
const int channel_selector = configuration->property(role + ".selected_channel", 1);
const std::string default_filename("./example_capture.LS3");
@ -54,12 +59,15 @@ LabsatSignalSource::LabsatSignalSource(const ConfigurationInterface* configurati
if (dump_)
{
DLOG(INFO) << "Dumping output into file " << dump_filename_;
DLOG(INFO) << "file_sink(" << file_sink_->unique_id() << ")";
file_sink_ = gr::blocks::file_sink::make(item_size_, dump_filename_.c_str());
}
if (dump_)
if (enable_throttle_control_)
{
DLOG(INFO) << "file_sink(" << file_sink_->unique_id() << ")";
throttle_ = gr::blocks::throttle::make(item_size_, throttle_frequency_sps);
}
if (in_stream_ > 0)
{
LOG(ERROR) << "A signal source does not have an input stream";
@ -73,23 +81,50 @@ LabsatSignalSource::LabsatSignalSource(const ConfigurationInterface* configurati
void LabsatSignalSource::connect(gr::top_block_sptr top_block)
{
if (dump_)
if (enable_throttle_control_ == true)
{
top_block->connect(labsat23_source_, 0, file_sink_, 0);
DLOG(INFO) << "connected labsat23_source_ to file sink";
top_block->connect(labsat23_source_, 0, throttle_, 0);
DLOG(INFO) << "connected labsat23_source_ to throttle";
if (dump_)
{
top_block->connect(labsat23_source_, 0, file_sink_, 0);
DLOG(INFO) << "connected labsat23_source_to sink";
}
}
else
{
DLOG(INFO) << "nothing to connect internally";
if (dump_)
{
top_block->connect(labsat23_source_, 0, file_sink_, 0);
DLOG(INFO) << "connected labsat23_source_ to sink";
}
else
{
DLOG(INFO) << "nothing to connect internally";
}
}
}
void LabsatSignalSource::disconnect(gr::top_block_sptr top_block)
{
if (dump_)
if (enable_throttle_control_ == true)
{
top_block->disconnect(labsat23_source_, 0, file_sink_, 0);
top_block->disconnect(labsat23_source_, 0, throttle_, 0);
DLOG(INFO) << "disconnected labsat23_source_ to throttle";
if (dump_)
{
top_block->disconnect(labsat23_source_, 0, file_sink_, 0);
DLOG(INFO) << "disconnected labsat23_source_ to sink";
}
}
else
{
if (dump_)
{
top_block->disconnect(labsat23_source_, 0, file_sink_, 0);
DLOG(INFO) << "disconnected labsat23_source_ to sink";
}
}
}
@ -103,5 +138,9 @@ gr::basic_block_sptr LabsatSignalSource::get_left_block()
gr::basic_block_sptr LabsatSignalSource::get_right_block()
{
if (enable_throttle_control_ == true)
{
return throttle_;
}
return labsat23_source_;
}

View File

@ -24,6 +24,7 @@
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/throttle.h>
#include <gnuradio/hier_block2.h>
#include <pmt/pmt.h>
#include <memory>
@ -69,13 +70,19 @@ public:
private:
gr::block_sptr labsat23_source_;
gr::blocks::file_sink::sptr file_sink_;
gr::blocks::throttle::sptr throttle_;
std::string role_;
std::string item_type_;
std::string filename_;
std::string dump_filename_;
size_t item_size_;
unsigned int in_stream_;
unsigned int out_stream_;
size_t item_size_;
bool enable_throttle_control_;
bool dump_;
};

View File

@ -118,6 +118,11 @@ Gr_Complex_Ip_Packet_Source::Gr_Complex_Ip_Packet_Source(std::string src_device,
d_wire_sample_type = 2;
d_bytes_per_sample = d_n_baseband_channels;
}
else if (wire_sample_type == "cfloat")
{
d_wire_sample_type = 3;
d_bytes_per_sample = d_n_baseband_channels * 8;
}
else
{
std::cout << "Unknown wire sample type\n";
@ -319,9 +324,6 @@ void Gr_Complex_Ip_Packet_Source::my_pcap_loop_thread(pcap_t *pcap_handle)
void Gr_Complex_Ip_Packet_Source::demux_samples(const gr_vector_void_star &output_items, int num_samples_readed)
{
int8_t real;
int8_t imag;
uint8_t tmp_char2;
for (int n = 0; n < num_samples_readed; n++)
{
switch (d_wire_sample_type)
@ -329,6 +331,8 @@ void Gr_Complex_Ip_Packet_Source::demux_samples(const gr_vector_void_star &outpu
case 1: // interleaved byte samples
for (auto &output_item : output_items)
{
int8_t real;
int8_t imag;
real = fifo_buff[fifo_read_ptr++];
imag = fifo_buff[fifo_read_ptr++];
if (d_IQ_swap)
@ -344,6 +348,9 @@ void Gr_Complex_Ip_Packet_Source::demux_samples(const gr_vector_void_star &outpu
case 2: // 4-bit samples
for (auto &output_item : output_items)
{
int8_t real;
int8_t imag;
uint8_t tmp_char2;
tmp_char2 = fifo_buff[fifo_read_ptr] & 0x0F;
if (tmp_char2 >= 8)
{
@ -373,6 +380,25 @@ void Gr_Complex_Ip_Packet_Source::demux_samples(const gr_vector_void_star &outpu
}
}
break;
case 3: // interleaved float samples
for (auto &output_item : output_items)
{
float real;
float imag;
memcpy(&real, &fifo_buff[fifo_read_ptr], sizeof(real));
fifo_read_ptr += 4; // Four bytes in float
memcpy(&imag, &fifo_buff[fifo_read_ptr], sizeof(imag));
fifo_read_ptr += 4; // Four bytes in float
if (d_IQ_swap)
{
static_cast<gr_complex *>(output_item)[n] = gr_complex(real, imag);
}
else
{
static_cast<gr_complex *>(output_item)[n] = gr_complex(imag, real);
}
}
break;
default:
std::cout << "Unknown wire sample type\n";
exit(0);
@ -407,6 +433,7 @@ int Gr_Complex_Ip_Packet_Source::work(int noutput_items,
{
case 1: // complex byte samples
case 2: // complex 4 bits samples
case 3: // complex float samples
bytes_requested = noutput_items * d_bytes_per_sample;
if (bytes_requested < fifo_items)
{

View File

@ -62,8 +62,8 @@ private:
static const uint32_t shift_out_bit_max = Num_bits_ADC - Num_bits_FPGA; // maximum possible value for the bit selection
// received signal power thresholds for the bit selection
// the received signal power is estimated as the averaged squared absolute value of the received signal samples
static const uint32_t Power_Threshold_High = 15000;
static const uint32_t Power_Threshold_Low = 6000;
static const uint32_t Power_Threshold_High = 9000;
static const uint32_t Power_Threshold_Low = 3000;
void close_devices(void);

View File

@ -107,14 +107,22 @@ target_include_directories(tracking_adapters
${CMAKE_SOURCE_DIR}/src/core/interfaces
)
if(ENABLE_CUDA AND NOT CMAKE_VERSION VERSION_GREATER 3.11)
target_link_libraries(tracking_adapters
PUBLIC
${CUDA_LIBRARIES}
)
target_include_directories(tracking_adapters
PUBLIC
${CUDA_INCLUDE_DIRS}
if(ENABLE_CUDA)
if(CMAKE_VERSION VERSION_GREATER 3.11)
target_include_directories(tracking_adapters
PUBLIC ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
)
else()
target_link_libraries(tracking_adapters
PUBLIC ${CUDA_LIBRARIES}
)
target_include_directories(tracking_adapters
PUBLIC ${CUDA_INCLUDE_DIRS}
)
endif()
set_target_properties(tracking_adapters PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
POSITION_INDEPENDENT_CODE ON
)
endif()

View File

@ -103,14 +103,22 @@ if(GNURADIO_USES_STD_POINTERS)
)
endif()
if(ENABLE_CUDA AND NOT CMAKE_VERSION VERSION_GREATER 3.11)
target_link_libraries(tracking_gr_blocks
PUBLIC
${CUDA_LIBRARIES}
)
target_include_directories(tracking_gr_blocks
PUBLIC
${CUDA_INCLUDE_DIRS}
if(ENABLE_CUDA)
if(CMAKE_VERSION VERSION_GREATER 3.11)
target_include_directories(tracking_gr_blocks
PUBLIC ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
)
else()
target_link_libraries(tracking_gr_blocks
PUBLIC cuda_correlator_lib
)
target_include_directories(tracking_gr_blocks
PUBLIC ${CUDA_INCLUDE_DIRS}
)
endif()
set_target_properties(tracking_gr_blocks PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
POSITION_INDEPENDENT_CODE ON
)
endif()

View File

@ -1664,6 +1664,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
Gnss_Synchro current_synchro_data = Gnss_Synchro();
current_synchro_data.Flag_valid_symbol_output = false;
bool loss_of_lock = false;
if (d_pull_in_transitory == true)
{
@ -1745,6 +1746,8 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
{
clear_tracking_vars();
d_state = 0; // loss-of-lock detected
loss_of_lock = true; // Set the flag so that the negative indication can be generated
current_synchro_data = *d_acquisition_gnss_synchro; // Fill in the Gnss_Synchro object with basic info
}
else
{
@ -1904,6 +1907,8 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
{
clear_tracking_vars();
d_state = 0; // loss-of-lock detected
loss_of_lock = true; // Set the flag so that the negative indication can be generated
current_synchro_data = *d_acquisition_gnss_synchro; // Fill in the Gnss_Synchro object with basic info
}
else
{
@ -1951,10 +1956,11 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
}
consume_each(d_current_prn_length_samples);
d_sample_counter += static_cast<uint64_t>(d_current_prn_length_samples);
if (current_synchro_data.Flag_valid_symbol_output)
if (current_synchro_data.Flag_valid_symbol_output || loss_of_lock)
{
current_synchro_data.fs = static_cast<int64_t>(d_trk_parameters.fs_in);
current_synchro_data.Tracking_sample_counter = d_sample_counter;
current_synchro_data.Flag_valid_symbol_output = !loss_of_lock;
*out[0] = current_synchro_data;
return 1;
}

View File

@ -283,6 +283,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
// process vars
float carr_error_filt_hz = 0.0;
float code_error_filt_chips = 0.0;
bool loss_of_lock = false;
Tcp_Packet_Data tcp_data;
// GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
@ -420,6 +421,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
d_carrier_lock_fail_counter = 0;
d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine
loss_of_lock = true;
}
}
@ -433,7 +435,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
current_synchro_data.Carrier_phase_rads = static_cast<double>(d_acc_carrier_phase_rad);
current_synchro_data.Carrier_Doppler_hz = static_cast<double>(d_carrier_doppler_hz);
current_synchro_data.CN0_dB_hz = static_cast<double>(d_CN0_SNV_dB_Hz);
current_synchro_data.Flag_valid_symbol_output = true;
current_synchro_data.Flag_valid_symbol_output = !loss_of_lock;
current_synchro_data.correlation_length_ms = 4;
}
else
@ -524,7 +526,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
consume_each(d_current_prn_length_samples); // this is needed in gr::block derivates
d_sample_counter += d_current_prn_length_samples; // count for the processed samples
if (d_enable_tracking)
if (d_enable_tracking || loss_of_lock)
{
return 1;
}

View File

@ -572,6 +572,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
double code_error_filt_secs_Ti = 0.0;
double CURRENT_INTEGRATION_TIME_S = 0.0;
double CORRECTED_INTEGRATION_TIME_S = 0.0;
bool loss_of_lock = false;
if (d_enable_tracking == true)
{
@ -780,6 +781,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock
d_carrier_lock_fail_counter = 0;
d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine
loss_of_lock = true;
}
check_carrier_phase_coherent_initialization();
}
@ -791,7 +793,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
current_synchro_data.Carrier_phase_rads = TWO_PI * d_acc_carrier_phase_cycles;
current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;
current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz;
current_synchro_data.Flag_valid_symbol_output = true;
current_synchro_data.Flag_valid_symbol_output = !loss_of_lock;
if (d_preamble_synchronized == true)
{
current_synchro_data.correlation_length_ms = d_extend_correlation_ms;

View File

@ -575,6 +575,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
double code_error_filt_secs_Ti = 0.0;
double CURRENT_INTEGRATION_TIME_S = 0.0;
double CORRECTED_INTEGRATION_TIME_S = 0.0;
bool loss_of_lock = false;
if (d_enable_tracking == true)
{
@ -781,6 +782,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock
d_carrier_lock_fail_counter = 0;
d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine
loss_of_lock = true;
}
check_carrier_phase_coherent_initialization();
}
@ -793,7 +795,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
current_synchro_data.Carrier_phase_rads = TWO_PI * d_acc_carrier_phase_cycles;
current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;
current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz;
current_synchro_data.Flag_valid_symbol_output = true;
current_synchro_data.Flag_valid_symbol_output = !loss_of_lock;
if (d_preamble_synchronized == true)
{
current_synchro_data.correlation_length_ms = d_extend_correlation_ms;

View File

@ -507,6 +507,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
double carr_error_filt_hz = 0.0;
double code_error_chips = 0.0;
double code_error_filt_chips = 0.0;
bool loss_of_lock = false;
// Block input data and block output stream pointers
const auto *in = reinterpret_cast<const gr_complex *>(input_items[0]); // PRN start block alignment
@ -628,6 +629,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock
d_carrier_lock_fail_counter = 0;
d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine
loss_of_lock = true;
}
check_carrier_phase_coherent_initialization();
}
@ -639,7 +641,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad;
current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;
current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz;
current_synchro_data.Flag_valid_symbol_output = true;
current_synchro_data.Flag_valid_symbol_output = !loss_of_lock;
current_synchro_data.correlation_length_ms = 1;
}
else

View File

@ -571,6 +571,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
double code_error_filt_secs_Ti = 0.0;
double CURRENT_INTEGRATION_TIME_S = 0.0;
double CORRECTED_INTEGRATION_TIME_S = 0.0;
bool loss_of_lock = false;
if (d_enable_tracking == true)
{
@ -779,6 +780,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock
d_carrier_lock_fail_counter = 0;
d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine
loss_of_lock = true;
}
check_carrier_phase_coherent_initialization();
}
@ -790,7 +792,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
current_synchro_data.Carrier_phase_rads = TWO_PI * d_acc_carrier_phase_cycles;
current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;
current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz;
current_synchro_data.Flag_valid_symbol_output = true;
current_synchro_data.Flag_valid_symbol_output = !loss_of_lock;
if (d_preamble_synchronized == true)
{
current_synchro_data.correlation_length_ms = d_extend_correlation_ms;

View File

@ -573,6 +573,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
double code_error_filt_secs_Ti = 0.0;
double CURRENT_INTEGRATION_TIME_S = 0.0;
double CORRECTED_INTEGRATION_TIME_S = 0.0;
bool loss_of_lock = false;
if (d_enable_tracking == true)
{
@ -779,6 +780,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock
d_carrier_lock_fail_counter = 0;
d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine
loss_of_lock = true;
}
check_carrier_phase_coherent_initialization();
}
@ -791,7 +793,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
current_synchro_data.Carrier_phase_rads = TWO_PI * d_acc_carrier_phase_cycles;
current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;
current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz;
current_synchro_data.Flag_valid_symbol_output = true;
current_synchro_data.Flag_valid_symbol_output = !loss_of_lock;
if (d_preamble_synchronized == true)
{
current_synchro_data.correlation_length_ms = d_extend_correlation_ms;

View File

@ -509,6 +509,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
double carr_error_filt_hz = 0.0;
double code_error_chips = 0.0;
double code_error_filt_chips = 0.0;
bool loss_of_lock = false;
// Block input data and block output stream pointers
const auto *in = reinterpret_cast<const gr_complex *>(input_items[0]); // PRN start block alignment
@ -630,6 +631,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock
d_carrier_lock_fail_counter = 0;
d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine
loss_of_lock = true;
}
check_carrier_phase_coherent_initialization();
}
@ -641,7 +643,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad;
current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;
current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz;
current_synchro_data.Flag_valid_symbol_output = true;
current_synchro_data.Flag_valid_symbol_output = !loss_of_lock;
current_synchro_data.correlation_length_ms = 1;
}
else

View File

@ -177,7 +177,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::start_tracking()
d_code_phase_step_chips = static_cast<double>(d_code_freq_chips) / static_cast<double>(d_fs_in);
const double T_chip_mod_seconds = 1 / d_code_freq_chips;
const double T_prn_mod_seconds = T_chip_mod_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS;
T_prn_mod_samples T_prn_mod_samples = T_prn_mod_seconds * static_cast<double>(d_fs_in);
const double T_prn_mod_samples = T_prn_mod_seconds * static_cast<double>(d_fs_in);
d_correlation_length_samples = round(T_prn_mod_samples);
@ -328,6 +328,8 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work(int noutput_items __attribut
double CORRECTED_INTEGRATION_TIME_S = 0.001;
double dll_code_error_secs_Ti = 0.0;
double carr_phase_error_secs_Ti = 0.0;
bool loss_of_lock = false;
if (d_enable_tracking == true)
{
// Fill the acquisition data
@ -446,6 +448,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work(int noutput_items __attribut
this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock
d_carrier_lock_fail_counter = 0;
d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine
loss_of_lock = true;
}
check_carrier_phase_coherent_initialization();
}
@ -458,7 +461,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work(int noutput_items __attribut
current_synchro_data.Carrier_phase_rads = TWO_PI * d_acc_carrier_phase_cycles;
current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;
current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz;
current_synchro_data.Flag_valid_symbol_output = true;
current_synchro_data.Flag_valid_symbol_output = !loss_of_lock;
current_synchro_data.correlation_length_ms = 1;
}
else
@ -545,7 +548,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work(int noutput_items __attribut
consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates
d_sample_counter += d_correlation_length_samples; // count for the processed samples
if (d_enable_tracking)
if (d_enable_tracking || loss_of_lock)
{
return 1;
}

View File

@ -48,7 +48,7 @@ typedef std::shared_ptr<Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc>
#else
typedef boost::shared_ptr<Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc>
gps_l1_ca_dll_pll_tracking_gpu_cc_sptr;
#end
#endif
gps_l1_ca_dll_pll_tracking_gpu_cc_sptr
gps_l1_ca_dll_pll_make_tracking_gpu_cc(

View File

@ -621,6 +621,7 @@ int Gps_L1_Ca_Kf_Tracking_cc::general_work(int noutput_items __attribute__((unus
d_carr_phase_error_rad = 0.0;
code_error_chips = 0.0;
code_error_filt_chips = 0.0;
bool loss_of_lock = false;
// Block input data and block output stream pointers
const auto *in = reinterpret_cast<const gr_complex *>(input_items[0]);
@ -800,6 +801,7 @@ int Gps_L1_Ca_Kf_Tracking_cc::general_work(int noutput_items __attribute__((unus
this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock
d_carrier_lock_fail_counter = 0;
d_enable_tracking = false;
loss_of_lock = true;
}
}
// ########### Output the tracking data to navigation and PVT ##########
@ -810,7 +812,7 @@ int Gps_L1_Ca_Kf_Tracking_cc::general_work(int noutput_items __attribute__((unus
current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad;
current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;
current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz;
current_synchro_data.Flag_valid_symbol_output = true;
current_synchro_data.Flag_valid_symbol_output = !loss_of_lock;
current_synchro_data.correlation_length_ms = 1;
kf_iter++;

View File

@ -312,6 +312,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib
float carr_error = 0.0;
float code_error = 0.0;
float code_nco = 0.0;
bool loss_of_lock = false;
Tcp_Packet_Data tcp_data;
// GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
@ -452,6 +453,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib
this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock
d_carrier_lock_fail_counter = 0;
d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine
loss_of_lock = true;
}
}
@ -466,7 +468,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib
current_synchro_data.Carrier_phase_rads = static_cast<double>(d_acc_carrier_phase_rad);
current_synchro_data.Carrier_Doppler_hz = static_cast<double>(d_carrier_doppler_hz);
current_synchro_data.CN0_dB_hz = static_cast<double>(d_CN0_SNV_dB_Hz);
current_synchro_data.Flag_valid_symbol_output = true;
current_synchro_data.Flag_valid_symbol_output = !loss_of_lock;
current_synchro_data.correlation_length_ms = 1;
}
else
@ -561,7 +563,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib
d_sample_counter_seconds = d_sample_counter_seconds + (static_cast<double>(d_current_prn_length_samples) / static_cast<double>(d_fs_in));
d_sample_counter += d_current_prn_length_samples; // count for the processed samples
if (d_enable_tracking)
if (d_enable_tracking || loss_of_lock)
{
return 1;
}

View File

@ -42,20 +42,14 @@ set(TRACKING_LIB_HEADERS
exponential_smoother.h
)
set(OPT_TRACKING_LIBRARIES "")
set(OPT_TRACKING_INCLUDES "")
if(ENABLE_CUDA)
list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_30,code=sm_30; -O3; -use_fast_math -default-stream per-thread")
if(CMAKE_VERSION VERSION_GREATER 3.11)
set(TRACKING_LIB_SOURCES ${TRACKING_LIB_SOURCES} cuda_multicorrelator.cu)
set(TRACKING_LIB_HEADERS ${TRACKING_LIB_HEADERS} cuda_multicorrelator.h)
else()
list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_30,code=sm_30; -std=c++11;-O3; -use_fast_math -default-stream per-thread")
set(CUDA_PROPAGATE_HOST_FLAGS OFF)
cuda_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(LIB_TYPE STATIC) #set the lib type
cuda_add_library(CUDA_CORRELATOR_LIB ${LIB_TYPE} cuda_multicorrelator.h cuda_multicorrelator.cu)
set(OPT_TRACKING_LIBRARIES ${OPT_TRACKING_LIBRARIES} CUDA_CORRELATOR_LIB)
set(OPT_TRACKING_INCLUDES ${OPT_TRACKING_INCLUDES} ${CUDA_INCLUDE_DIRS})
cuda_add_library(cuda_correlator_lib STATIC cuda_multicorrelator.h cuda_multicorrelator.cu)
endif()
endif()
@ -94,20 +88,28 @@ target_link_libraries(tracking_libs
Volkgnsssdr::volkgnsssdr
core_system_parameters
algorithms_libs
${OPT_TRACKING_LIBRARIES}
PRIVATE
gnss_sdr_flags
Glog::glog
)
if(NOT CMAKE_VERSION VERSION_GREATER 3.11)
target_link_libraries(tracking_libs
PUBLIC
${OPT_TRACKING_LIBRARIES}
)
target_include_directories(tracking_libs
PUBLIC
${OPT_TRACKING_INCLUDES}
if(ENABLE_CUDA)
if(CMAKE_VERSION VERSION_GREATER 3.11)
target_include_directories(tracking_libs
PUBLIC ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
)
else()
target_link_libraries(tracking_libs
PUBLIC ${CUDA_LIBRARIES}
)
target_include_directories(tracking_libs
PUBLIC ${CUDA_INCLUDE_DIRS}
)
endif()
set_target_properties(tracking_libs PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
POSITION_INDEPENDENT_CODE ON
CUDA_RESOLVE_DEVICE_SYMBOLS ON
)
endif()

View File

@ -41,7 +41,9 @@ class ChannelInterface : public GNSSBlockInterface
{
public:
virtual gr::basic_block_sptr get_left_block_trk() = 0;
virtual gr::basic_block_sptr get_right_block_trk() = 0;
virtual gr::basic_block_sptr get_left_block_acq() = 0;
virtual gr::basic_block_sptr get_right_block_acq() = 0;
virtual gr::basic_block_sptr get_left_block() = 0;
virtual gr::basic_block_sptr get_right_block() = 0;
virtual Gnss_Signal get_signal() const = 0;

View File

@ -68,6 +68,11 @@ public:
}; // avoid unused param warning
return nullptr; // added to support raw array access (non pure virtual to allow left unimplemented)= 0;
}
/*!
* \brief Start the flow of samples if needed.
*/
virtual void start(){};
};
#endif // GNSS_SDR_GNSS_BLOCK_INTERFACE_H

View File

@ -46,7 +46,7 @@ gnss_synchro_monitor::gnss_synchro_monitor(int n_channels,
int decimation_factor,
int udp_port,
const std::vector<std::string>& udp_addresses,
bool enable_protobuf) : gr::sync_block("gnss_synchro_monitor",
bool enable_protobuf) : gr::block("gnss_synchro_monitor",
gr::io_signature::make(n_channels, n_channels, sizeof(Gnss_Synchro)),
gr::io_signature::make(0, 0, 0))
{
@ -54,28 +54,46 @@ gnss_synchro_monitor::gnss_synchro_monitor(int n_channels,
d_nchannels = n_channels;
udp_sink_ptr = std::make_unique<Gnss_Synchro_Udp_Sink>(udp_addresses, udp_port, enable_protobuf);
count = 0;
}
int gnss_synchro_monitor::work(int noutput_items, gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items __attribute__((unused)))
void gnss_synchro_monitor::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required)
{
const auto** in = reinterpret_cast<const Gnss_Synchro**>(&input_items[0]); // Get the input buffer pointer
for (int epoch = 0; epoch < noutput_items; epoch++)
for (int32_t channel_index = 0; channel_index < d_nchannels; channel_index++)
{
count++;
if (count >= d_decimation_factor)
{
for (int i = 0; i < d_nchannels; i++)
{
std::vector<Gnss_Synchro> stocks;
stocks.push_back(in[i][epoch]);
udp_sink_ptr->write_gnss_synchro(stocks);
}
count = 0;
}
// Set the required number of inputs to 0 so that a lone input on any channel can be pushed to UDP
ninput_items_required[channel_index] = 0;
}
return noutput_items;
}
int gnss_synchro_monitor::general_work(int noutput_items __attribute__((unused)), gr_vector_int& ninput_items,
gr_vector_const_void_star& input_items, gr_vector_void_star& output_items __attribute__((unused)))
{
// Get the input buffer pointer
const auto** in = reinterpret_cast<const Gnss_Synchro**>(&input_items[0]);
// Loop through each input stream channel
for (int channel_index = 0; channel_index < d_nchannels; channel_index++)
{
// Loop through each item in each input stream channel
int count = 0;
for (int item_index = 0; item_index < ninput_items[channel_index]; item_index++)
{
// Use the count variable to limit how many items are sent per channel
count++;
if (count >= d_decimation_factor)
{
// Convert to a vector and write to the UDP sink
std::vector<Gnss_Synchro> stocks;
stocks.push_back(in[channel_index][item_index]);
udp_sink_ptr->write_gnss_synchro(stocks);
// Reset count variable
count = 0;
}
}
// Consume the number of items for the input stream channel
consume(channel_index, ninput_items[channel_index]);
}
// Not producing any outputs
return 0;
}

View File

@ -24,8 +24,8 @@
#define GNSS_SDR_GNSS_SYNCHRO_MONITOR_H
#include "gnss_synchro_udp_sink.h"
#include <gnuradio/block.h>
#include <gnuradio/runtime_types.h> // for gr_vector_void_star
#include <gnuradio/sync_block.h>
#include <memory>
#include <string>
#include <vector>
@ -54,13 +54,13 @@ gnss_synchro_monitor_sptr gnss_synchro_make_monitor(int n_channels,
* a data stream with the receiver internal parameters (Gnss_Synchro objects)
* to local or remote clients over UDP.
*/
class gnss_synchro_monitor : public gr::sync_block
class gnss_synchro_monitor : public gr::block
{
public:
~gnss_synchro_monitor() = default; //!< Default destructor
int work(int noutput_items, gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items);
void forecast(int noutput_items, gr_vector_int& ninput_items_required);
int general_work(int noutput_items, gr_vector_int& ninput_items,
gr_vector_const_void_star& input_items, gr_vector_void_star& output_items);
private:
friend gnss_synchro_monitor_sptr gnss_synchro_make_monitor(int n_channels,
@ -78,7 +78,6 @@ private:
int d_nchannels;
int d_decimation_factor;
std::unique_ptr<Gnss_Synchro_Udp_Sink> udp_sink_ptr;
int count;
};
#endif

View File

@ -120,9 +120,22 @@ else()
endif()
if(ENABLE_CUDA)
if(NOT CMAKE_VERSION VERSION_GREATER 3.11)
target_include_directories(core_receiver PUBLIC ${CUDA_INCLUDE_DIRS})
if(CMAKE_VERSION VERSION_GREATER 3.11)
target_include_directories(core_receiver
PUBLIC ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
)
else()
target_link_libraries(core_receiver
PUBLIC ${CUDA_LIBRARIES}
)
target_include_directories(core_receiver
PUBLIC ${CUDA_INCLUDE_DIRS}
)
endif()
set_target_properties(core_receiver PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
POSITION_INDEPENDENT_CODE ON
)
target_compile_definitions(core_receiver PRIVATE -DCUDA_GPU_ACCEL=1)
endif()

View File

@ -110,6 +110,14 @@ void GNSSFlowgraph::start()
return;
}
#ifdef ENABLE_FPGA
// start the DMA if the receiver is in post-processing mode
if (configuration_->property(sig_source_.at(0)->role() + ".switch_position", 0) == 0)
{
sig_source_.at(0)->start();
}
#endif
running_ = true;
}
@ -707,6 +715,44 @@ void GNSSFlowgraph::connect()
return;
}
}
// GNSS SYNCHRO ACQUISITION MONITOR
if (enable_acquisition_monitor_)
{
try
{
for (int i = 0; i < channels_count_; i++)
{
top_block_->connect(channels_.at(i)->get_right_block_acq(), 0, GnssSynchroAcquisitionMonitor_, i);
}
}
catch (const std::exception& e)
{
LOG(WARNING) << "Can't connect acquisition intermediate outputs to Monitor block";
LOG(ERROR) << e.what();
top_block_->disconnect_all();
return;
}
}
// GNSS SYNCHRO TRACKING MONITOR
if (enable_tracking_monitor_)
{
try
{
for (int i = 0; i < channels_count_; i++)
{
top_block_->connect(channels_.at(i)->get_right_block_trk(), 0, GnssSynchroTrackingMonitor_, i);
}
}
catch (const std::exception& e)
{
LOG(WARNING) << "Can't connect tracking outputs to Monitor block";
LOG(ERROR) << e.what();
top_block_->disconnect_all();
return;
}
}
#ifndef ENABLE_FPGA
// Activate acquisition in enabled channels
for (int i = 0; i < channels_count_; i++)
@ -949,6 +995,14 @@ void GNSSFlowgraph::disconnect()
{
top_block_->disconnect(observables_->get_right_block(), i, GnssSynchroMonitor_, i);
}
if (enable_acquisition_monitor_)
{
top_block_->disconnect(channels_.at(i)->get_right_block_acq(), 0, GnssSynchroAcquisitionMonitor_, i);
}
if (enable_tracking_monitor_)
{
top_block_->disconnect(channels_.at(i)->get_right_block_trk(), 0, GnssSynchroTrackingMonitor_, i);
}
top_block_->msg_disconnect(channels_.at(i)->get_right_block(), pmt::mp("telemetry"), pvt_->get_left_block(), pmt::mp("telemetry"));
}
top_block_->msg_disconnect(pvt_->get_left_block(), pmt::mp("pvt_to_observables"), observables_->get_right_block(), pmt::mp("pvt_to_observables"));
@ -1587,23 +1641,71 @@ void GNSSFlowgraph::init()
* Instantiate the receiver monitor block, if required
*/
enable_monitor_ = configuration_->property("Monitor.enable_monitor", false);
bool enable_protobuf = configuration_->property("Monitor.enable_protobuf", true);
if (configuration_->property("PVT.enable_protobuf", false) == true)
{
enable_protobuf = true;
}
std::string address_string = configuration_->property("Monitor.client_addresses", std::string("127.0.0.1"));
std::vector<std::string> udp_addr_vec = split_string(address_string, '_');
std::sort(udp_addr_vec.begin(), udp_addr_vec.end());
udp_addr_vec.erase(std::unique(udp_addr_vec.begin(), udp_addr_vec.end()), udp_addr_vec.end());
if (enable_monitor_)
{
// Retrieve monitor properties
bool enable_protobuf = configuration_->property("Monitor.enable_protobuf", true);
if (configuration_->property("PVT.enable_protobuf", false) == true)
{
enable_protobuf = true;
}
std::string address_string = configuration_->property("Monitor.client_addresses", std::string("127.0.0.1"));
std::vector<std::string> udp_addr_vec = split_string(address_string, '_');
std::sort(udp_addr_vec.begin(), udp_addr_vec.end());
udp_addr_vec.erase(std::unique(udp_addr_vec.begin(), udp_addr_vec.end()), udp_addr_vec.end());
// Instantiate monitor object
GnssSynchroMonitor_ = gnss_synchro_make_monitor(channels_count_,
configuration_->property("Monitor.decimation_factor", 1),
configuration_->property("Monitor.udp_port", 1234),
udp_addr_vec, enable_protobuf);
}
/*
* Instantiate the receiver acquisition monitor block, if required
*/
enable_acquisition_monitor_ = configuration_->property("AcquisitionMonitor.enable_monitor", false);
if (enable_acquisition_monitor_)
{
// Retrieve monitor properties
bool enable_protobuf = configuration_->property("AcquisitionMonitor.enable_protobuf", true);
if (configuration_->property("PVT.enable_protobuf", false) == true)
{
enable_protobuf = true;
}
std::string address_string = configuration_->property("AcquisitionMonitor.client_addresses", std::string("127.0.0.1"));
std::vector<std::string> udp_addr_vec = split_string(address_string, '_');
std::sort(udp_addr_vec.begin(), udp_addr_vec.end());
udp_addr_vec.erase(std::unique(udp_addr_vec.begin(), udp_addr_vec.end()), udp_addr_vec.end());
GnssSynchroAcquisitionMonitor_ = gnss_synchro_make_monitor(channels_count_,
configuration_->property("AcquisitionMonitor.decimation_factor", 1),
configuration_->property("AcquisitionMonitor.udp_port", 1235),
udp_addr_vec, enable_protobuf);
}
/*
* Instantiate the receiver tracking monitor block, if required
*/
enable_tracking_monitor_ = configuration_->property("TrackingMonitor.enable_monitor", false);
if (enable_tracking_monitor_)
{
// Retrieve monitor properties
bool enable_protobuf = configuration_->property("TrackingMonitor.enable_protobuf", true);
if (configuration_->property("PVT.enable_protobuf", false) == true)
{
enable_protobuf = true;
}
std::string address_string = configuration_->property("TrackingMonitor.client_addresses", std::string("127.0.0.1"));
std::vector<std::string> udp_addr_vec = split_string(address_string, '_');
std::sort(udp_addr_vec.begin(), udp_addr_vec.end());
udp_addr_vec.erase(std::unique(udp_addr_vec.begin(), udp_addr_vec.end()), udp_addr_vec.end());
GnssSynchroTrackingMonitor_ = gnss_synchro_make_monitor(channels_count_,
configuration_->property("TrackingMonitor.decimation_factor", 1),
configuration_->property("TrackingMonitor.udp_port", 1236),
udp_addr_vec, enable_protobuf);
}
}

View File

@ -191,6 +191,8 @@ private:
std::vector<gr::blocks::null_sink::sptr> null_sinks_;
gr::basic_block_sptr GnssSynchroMonitor_;
gr::basic_block_sptr GnssSynchroAcquisitionMonitor_;
gr::basic_block_sptr GnssSynchroTrackingMonitor_;
channel_status_msg_receiver_sptr channels_status_; // class that receives and stores the current status of the receiver channels
gnss_sdr_sample_counter_sptr ch_out_sample_counter_;
#if ENABLE_FPGA
@ -240,6 +242,8 @@ private:
bool running_;
bool multiband_;
bool enable_monitor_;
bool enable_acquisition_monitor_;
bool enable_tracking_monitor_;
};
#endif // GNSS_SDR_GNSS_FLOWGRAPH_H

View File

@ -39,16 +39,22 @@ target_link_libraries(gnss-sdr
target_compile_definitions(gnss-sdr PRIVATE -DGNSS_SDR_VERSION="${VERSION}")
if(ENABLE_CUDA)
if(NOT CMAKE_VERSION VERSION_GREATER 3.11)
if(CMAKE_VERSION VERSION_GREATER 3.11)
target_include_directories(gnss-sdr
PUBLIC ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
)
else()
target_link_libraries(gnss-sdr
PRIVATE
${CUDA_LIBRARIES}
PUBLIC ${CUDA_LIBRARIES}
)
target_include_directories(gnss-sdr
PRIVATE
${CUDA_INCLUDE_DIRS}
PUBLIC ${CUDA_INCLUDE_DIRS}
)
endif()
set_target_properties(gnss-sdr PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
POSITION_INDEPENDENT_CODE ON
)
target_compile_definitions(gnss-sdr PRIVATE -DCUDA_GPU_ACCEL=1)
endif()