From c19bc392e8f3602acf36288c9e9d83b517ad2b07 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 16 May 2018 20:48:59 +0200 Subject: [PATCH 1/5] Add optional Custom_UDP_Signal_Source signal source --- docs/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog b/docs/changelog index d46e1202f..74f263c33 100644 --- a/docs/changelog +++ b/docs/changelog @@ -43,7 +43,7 @@ Next release will have several improvements in different dimensions, addition of - Added the GLONASS L2 SP receiver chain. - Improvements in the Galileo E5a and GPS L2C receiver chains. - Updated list of available GNSS satellites. -- Added four more signal sources: "Fmcomms2_Signal_Source", "Plutosdr_Signal Source", "Spir_GSS6450_File_Signal_Source" and "Labsat_Signal_Source". Documented in https://gnss-sdr.org/docs/sp-blocks/signal-source/ +- Added five more signal sources: "Fmcomms2_Signal_Source" (requires gr-iio), "Plutosdr_Signal Source" (requires gr-iio), "Spir_GSS6450_File_Signal_Source", "Labsat_Signal_Source" and "Custom_UDP_Signal_Source" (requires libpcap). Documented in https://gnss-sdr.org/docs/sp-blocks/signal-source/ - Improved support for BladeRF, HackRF and RTL-SDR front-ends. - Added tools for the interaction with front-ends based on the AD9361 chipset. - Intermediate results are now saved in .mat binary format, readable from Matlab/Octave and from Python via h5py. From e2011eaa92b50848d7d86f502fc1099e86dbdf8a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 16 May 2018 20:49:58 +0200 Subject: [PATCH 2/5] Add libpcap as a new optional dependency --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 55eb8d21b..d056d3313 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ $ sudo apt-get install build-essential cmake git libboost-dev libboost-date-time libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev \ libboost-serialization-dev liblog4cpp5-dev libuhd-dev gnuradio-dev gr-osmosdr \ libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev \ - libgnutls-openssl-dev python-mako python-six libmatio-dev googletest + libgnutls-openssl-dev libpcap-dev python-mako python-six libmatio-dev googletest ~~~~~~ Please note that `googletest` was named `libgtest-dev` in distributions older than Debian 9 "stretch" and Ubuntu 17.04 "zesty". @@ -85,7 +85,7 @@ $ sudo yum install make automake gcc gcc-c++ kernel-devel cmake git boost-devel boost-date-time boost-system boost-filesystem boost-thread boost-chrono \ boost-serialization log4cpp-devel gnuradio-devel gr-osmosdr-devel \ blas-devel lapack-devel matio-devel armadillo-devel gflags-devel \ - glog-devel openssl-devel python-mako python-six + glog-devel openssl-devel libpcap-devel python-mako python-six ~~~~~~ Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux). @@ -102,7 +102,7 @@ $ sudo yum install make automake gcc gcc-c++ kernel-devel libtool \ hdf5-devel cmake git boost-devel boost-date-time boost-system \ boost-filesystem boost-thread boost-chrono boost-serialization \ log4cpp-devel gnuradio-devel gr-osmosdr-devel blas-devel lapack-devel \ - armadillo-devel openssl-devel python-mako python-six + armadillo-devel openssl-devel libpcap-devel python-mako python-six ~~~~~~ Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux). @@ -114,7 +114,7 @@ If you are using Arch Linux (with base-devel group installed): ~~~~~~ $ pacman -S cmake git boost boost-libs log4cpp libvolk gnuradio gnuradio-osmosdr \ blas lapack gflags google-glog gnutls openssl python2-mako python2-six \ - libmatio gtest + libmatio libpcap gtest ~~~~~~ Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux). From 835cf3b11e257f7a21ba7b4aa9ed0133620c59a2 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 16 May 2018 21:33:52 +0200 Subject: [PATCH 3/5] Rename CMake module for gr-iio to a more consistent name. Minor fixes --- CMakeLists.txt | 2 +- cmake/Modules/{Findiio.cmake => FindGriio.cmake} | 0 src/algorithms/PVT/libs/rtklib_solver.cc | 2 +- src/algorithms/libs/rtklib/rtklib_stream.cc | 2 +- src/algorithms/signal_source/adapters/CMakeLists.txt | 3 +-- src/algorithms/signal_source/libs/CMakeLists.txt | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) rename cmake/Modules/{Findiio.cmake => FindGriio.cmake} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 954690ffb..ccce85891 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,7 @@ option(ENABLE_ARRAY "Enable the use of CTTC's antenna array front-end as signal option(ENABLE_GN3S "Enable the use of the GN3S dongle as signal source (experimental)" OFF) option(ENABLE_PLUTOSDR "Enable the use of ADALM-PLUTO Evaluation Boards (Analog Devices Inc.), requires gr-iio" OFF) option(ENABLE_FMCOMMS2 "Enable the use of FMCOMMS4-EBZ + ZedBoard hardware, requires gr-iio" OFF) -option(ENABLE_AD9361 "Enable the use of AD9361 directo to FPGA hardware, requires gr-iio" OFF) +option(ENABLE_AD9361 "Enable the use of AD9361 directo to FPGA hardware, requires libiio" OFF) option(ENABLE_RAW_UDP "Enable the use of high-optimized custom UDP packet sample source, requires libpcap" OFF) # Performance analysis tools diff --git a/cmake/Modules/Findiio.cmake b/cmake/Modules/FindGriio.cmake similarity index 100% rename from cmake/Modules/Findiio.cmake rename to cmake/Modules/FindGriio.cmake diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index a0650d768..06332cc30 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -70,7 +70,7 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag count_valid_position = 0; this->set_averaging_flag(false); rtk_ = rtk; - for (unsigned int i = 0; i > 4; i++) dop_[i] = 0.0; + for (unsigned int i = 0; i < 4; i++) dop_[i] = 0.0; pvt_sol = {{0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, '0', '0', '0', 0, 0, 0}; // ############# ENABLE DATA FILE LOG ################# diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 3de693e65..6d307a1d1 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -1603,7 +1603,7 @@ void *ftpthread(void *arg) " --glob=off --passive-ftp " + std::string(proxyopt) + "s-t 1 -T " + std::to_string(FTP_TIMEOUT) + " -O \"" + std::string(local) + "\""; int k = s_aux.length(); - if (k < 2048) + if (k < 1024]) for (int i = 0; i < k; i++) opt[i] = s_aux[i]; // sprintf(cmd, "%s%s %s \"ftp://%s/%s\" 2> \"%s\"\n", env, FTP_CMD, opt, ftp->addr, diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index 120fff27b..78061f7f5 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -50,11 +50,10 @@ if(ENABLE_RAW_UDP) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} custom_udp_signal_source.cc) - endif(ENABLE_RAW_UDP) if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) - find_package(iio REQUIRED) + find_package(Griio REQUIRED) if(NOT IIO_FOUND) message(STATUS "gnuradio-iio not found, its installation is required.") message(STATUS "Please build and install the following projects:") diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index f37684525..8ace0c109 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -17,7 +17,7 @@ # if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) - find_package(iio REQUIRED) + find_package(Griio REQUIRED) if(NOT IIO_FOUND) message(STATUS "gnuradio-iio not found, its installation is required.") message(STATUS "Please build and install the following projects:") From 046a24e0caaa77679f844a43e51db11d0e3e3087 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 16 May 2018 21:51:20 +0200 Subject: [PATCH 4/5] Fix typo --- src/algorithms/libs/rtklib/rtklib_stream.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 6d307a1d1..4e6f0a0a1 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -1603,7 +1603,7 @@ void *ftpthread(void *arg) " --glob=off --passive-ftp " + std::string(proxyopt) + "s-t 1 -T " + std::to_string(FTP_TIMEOUT) + " -O \"" + std::string(local) + "\""; int k = s_aux.length(); - if (k < 1024]) + if (k < 1024) for (int i = 0; i < k; i++) opt[i] = s_aux[i]; // sprintf(cmd, "%s%s %s \"ftp://%s/%s\" 2> \"%s\"\n", env, FTP_CMD, opt, ftp->addr, From eeb2893f9c6a8116a7fd63cba25abf75f2ec0b98 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 16 May 2018 21:54:31 +0200 Subject: [PATCH 5/5] Fix GCC 8.1.1 warnings --- .../gr_complex_ip_packet_source.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc index 8da6d4a5d..d0b9382fc 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc @@ -319,22 +319,22 @@ void gr_complex_ip_packet_source::demux_samples(gr_vector_void_star output_items switch (d_wire_sample_type) { case 1: //interleaved byte samples - for (int i = 0; i < output_items.size(); i++) + for (long unsigned int i = 0; i < output_items.size(); i++) { real = fifo_buff[fifo_read_ptr++]; imag = fifo_buff[fifo_read_ptr++]; if (d_IQ_swap) { - ((gr_complex *)output_items[i])[n] = gr_complex(real, imag); + (static_cast(output_items[i]))[n] = gr_complex(real, imag); } else { - ((gr_complex *)output_items[i])[n] = gr_complex(imag, real); + (static_cast(output_items[i]))[n] = gr_complex(imag, real); } } break; case 2: // 4bits samples - for (int i = 0; i < output_items.size(); i++) + for (long unsigned int i = 0; i < output_items.size(); i++) { tmp_char2 = fifo_buff[fifo_read_ptr] & 0x0F; if (tmp_char2 >= 8) @@ -357,11 +357,11 @@ void gr_complex_ip_packet_source::demux_samples(gr_vector_void_star output_items } if (d_IQ_swap) { - ((gr_complex *)output_items[i])[n] = gr_complex(imag, real); + (static_cast(output_items[i]))[n] = gr_complex(imag, real); } else { - ((gr_complex *)output_items[i])[n] = gr_complex(real, imag); + (static_cast(output_items[i]))[n] = gr_complex(real, imag); } } break; @@ -381,7 +381,7 @@ int gr_complex_ip_packet_source::work(int noutput_items, boost::mutex::scoped_lock lock(d_mutex); // hold mutex for duration of this function if (fifo_items == 0) return 0; - if (output_items.size() > d_n_baseband_channels) + if (output_items.size() > static_cast(d_n_baseband_channels)) { std::cout << "Configuration error: more baseband channels connected than the available in the UDP source\n"; exit(0); @@ -430,9 +430,9 @@ int gr_complex_ip_packet_source::work(int noutput_items, //update fifo items fifo_items = fifo_items - bytes_requested; - for (int n = 0; n < output_items.size(); n++) + for (long unsigned int n = 0; n < output_items.size(); n++) { - produce(n, num_samples_readed); + produce(static_cast(n), num_samples_readed); } return this->WORK_CALLED_PRODUCE; }