1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 04:30:33 +00:00

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

This commit is contained in:
Carles Fernandez 2019-07-20 13:23:01 +02:00
commit 6264a3cbd6
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
213 changed files with 2385 additions and 2480 deletions

View File

@ -401,7 +401,7 @@ set(GNSSSDR_ARMADILLO_LOCAL_VERSION "9.600.x")
set(GNSSSDR_GTEST_LOCAL_VERSION "1.8.1")
set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master")
set(GNSSSDR_GPSTK_LOCAL_VERSION "2.10.6")
set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.16")
set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.17")
set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.9")
set(GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "3.9.0")

View File

@ -341,7 +341,7 @@ Cloning the GNSS-SDR repository as in the line above will create a folder named
|-----utils <- some utilities (e.g. Matlab scripts).
~~~~~~
By default, you will be in the 'master' branch of the Git repository, which corresponds to the lastest stable release. If you want to try the latest developments, you can use the 'next' branch by going to the newly created gnss-sdr folder doing:
By default, you will be in the 'master' branch of the Git repository, which corresponds to the latest stable release. If you want to try the latest developments, you can use the 'next' branch by going to the newly created gnss-sdr folder doing:
~~~~~~
$ git checkout next

View File

@ -48,7 +48,7 @@ list(APPEND AVAIL_BUILDTYPES
# known build types in AVAIL_BUILDTYPES. If the build type is found,
# the function exits immediately. If nothing is found by the end of
# checking all available build types, we exit with an error and list
# the avialable build types.
# the available build types.
########################################################################
function(GNSSSDR_CHECK_BUILD_TYPE settype)
string(TOUPPER ${settype} _settype)

View File

@ -21,6 +21,7 @@
### Improvements in Flexibility:
- Rewritten Control Thread and GNSS Flowgraph for increased control of channels' status and smarter assignation of satellites in multi-band configurations.
- New Tracking parameters allow the configuration of PLL and DLL filters order.
- Added parameter to enable FLL during pull-in time.
- Configurable pull-in time in the Tracking loops.
@ -28,7 +29,7 @@
### Improvements in Interoperability:
- Added the BeiDou B1I receiver chain.
- Added the BeiDou B1I and B3I receiver chains.
- Fix bug in GLONASS dual frequency receiver.
- Added a custom UDP/IP output for PVT data streaming.
- Improved Monitor block with UDP/IP output for internal receiver's data streaming.
@ -43,6 +44,7 @@
- Applied clang-tidy checks and fixes related to readability: readability-container-size-empty, readability-identifier-naming, readability-inconsistent-declaration-parameter-name, readability-named-parameter, readability-non-const-parameter, readability-string-compare.
- Improved includes selection following suggestions by include-what-you-use (see https://include-what-you-use.org/), allowing faster compiles, fewer recompiles and making refactoring easier.
- Deprecated boost::asio::io_service replaced by boost::asio::io_context if Boost > 1.65
- The internal communication mechanism based on gr::msg_queue has been replaced by asynchronous message passing.
### Improvements in Portability:

View File

@ -126,9 +126,12 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels,
{
// Send feedback message to observables block with the receiver clock offset
this->message_port_register_out(pmt::mp("pvt_to_observables"));
// Send PVT status to gnss_flowgraph
this->message_port_register_out(pmt::mp("status"));
d_output_rate_ms = conf_.output_rate_ms;
d_display_rate_ms = conf_.display_rate_ms;
d_report_rate_ms = 1000; //report every second PVT to gnss_synchro
d_dump = conf_.dump;
d_dump_mat = conf_.dump_mat and d_dump;
d_dump_filename = conf_.dump_filename;
@ -3729,10 +3732,19 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
}
// PVT MONITOR
if (d_pvt_solver->is_valid_position() and flag_monitor_pvt_enabled)
if (d_pvt_solver->is_valid_position())
{
Monitor_Pvt monitor_pvt = d_pvt_solver->get_monitor_pvt();
udp_sink_ptr->write_monitor_pvt(monitor_pvt);
std::shared_ptr<Monitor_Pvt> monitor_pvt = std::make_shared<Monitor_Pvt>(d_pvt_solver->get_monitor_pvt());
//publish new position to the gnss_flowgraph channel status monitor
if (current_RX_time_ms % d_report_rate_ms == 0)
{
this->message_port_pub(pmt::mp("status"), pmt::make_any(monitor_pvt));
}
if (flag_monitor_pvt_enabled)
{
udp_sink_ptr->write_monitor_pvt(monitor_pvt);
}
}
}
}

View File

@ -169,6 +169,7 @@ private:
int32_t d_output_rate_ms;
int32_t d_display_rate_ms;
int32_t d_report_rate_ms;
std::shared_ptr<Rinex_Printer> rp;
std::shared_ptr<Kml_Printer> d_kml_dump;

View File

@ -51,14 +51,14 @@ Monitor_Pvt_Udp_Sink::Monitor_Pvt_Udp_Sink(const std::vector<std::string>& addre
}
bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(const Monitor_Pvt& monitor_pvt)
bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(const std::shared_ptr<Monitor_Pvt>& monitor_pvt)
{
std::string outbound_data;
if (use_protobuf == false)
{
std::ostringstream archive_stream;
boost::archive::binary_oarchive oa{archive_stream};
oa << monitor_pvt;
oa << *monitor_pvt.get();
outbound_data = archive_stream.str();
}
else

View File

@ -45,8 +45,8 @@ using b_io_context = boost::asio::io_service;
class Monitor_Pvt_Udp_Sink
{
public:
Monitor_Pvt_Udp_Sink(const std::vector<std::string>& addresses, const uint16_t &port, bool protobuf_enabled);
bool write_monitor_pvt(const Monitor_Pvt &monitor_pvt);
Monitor_Pvt_Udp_Sink(const std::vector<std::string>& addresses, const uint16_t& port, bool protobuf_enabled);
bool write_monitor_pvt(const std::shared_ptr<Monitor_Pvt>& monitor_pvt);
private:
b_io_context io_context;

View File

@ -6217,7 +6217,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph
if (version == 2)
{
// --------- WAVELENGHT FACTOR
// --------- WAVELENGTH FACTOR
// put here real data!
line.clear();
line += Rinex_Printer::rightJustify("1", 6);

View File

@ -43,6 +43,7 @@
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <glog/logging.h>
#include <pmt/pmt.h>
#include <bitset>
#include <cstddef> // for size_t
#include <cstdint>

View File

@ -384,7 +384,7 @@ int Rtcm_Printer::init_serial(const std::string& serial_device)
* Opens the serial device and sets the default baud rate for a RTCM transmission (9600,8,N,1)
*/
int32_t fd = 0;
struct termios options;
struct termios options{};
int64_t BAUD;
int64_t DATABITS;
int64_t STOPBITS;

View File

@ -34,7 +34,7 @@
#include "monitor_pvt.h"
#include "monitor_pvt.pb.h" // file created by Protocol Buffers at compile time
#include <memory>
/*!
* \brief This class implements serialization and deserialization of
@ -80,40 +80,40 @@ public:
return *this;
}
inline std::string createProtobuffer(const Monitor_Pvt& monitor) //!< Serialization into a string
inline std::string createProtobuffer(std::shared_ptr<Monitor_Pvt> monitor) //!< Serialization into a string
{
monitor_.Clear();
std::string data;
monitor_.set_tow_at_current_symbol_ms(monitor.TOW_at_current_symbol_ms);
monitor_.set_week(monitor.week);
monitor_.set_rx_time(monitor.RX_time);
monitor_.set_user_clk_offset(monitor.user_clk_offset);
monitor_.set_pos_x(monitor.pos_x);
monitor_.set_pos_y(monitor.pos_y);
monitor_.set_pos_z(monitor.pos_z);
monitor_.set_vel_x(monitor.vel_x);
monitor_.set_vel_y(monitor.vel_y);
monitor_.set_vel_z(monitor.vel_z);
monitor_.set_cov_xx(monitor.cov_xx);
monitor_.set_cov_yy(monitor.cov_yy);
monitor_.set_cov_zz(monitor.cov_zz);
monitor_.set_cov_xy(monitor.cov_xy);
monitor_.set_cov_yz(monitor.cov_yz);
monitor_.set_cov_zx(monitor.cov_zx);
monitor_.set_latitude(monitor.latitude);
monitor_.set_longitude(monitor.longitude);
monitor_.set_height(monitor.height);
monitor_.set_valid_sats(monitor.valid_sats);
monitor_.set_solution_status(monitor.solution_status);
monitor_.set_solution_type(monitor.solution_type);
monitor_.set_ar_ratio_factor(monitor.AR_ratio_factor);
monitor_.set_ar_ratio_threshold(monitor.AR_ratio_threshold);
monitor_.set_gdop(monitor.gdop);
monitor_.set_pdop(monitor.pdop);
monitor_.set_hdop(monitor.hdop);
monitor_.set_vdop(monitor.vdop);
monitor_.set_tow_at_current_symbol_ms(monitor->TOW_at_current_symbol_ms);
monitor_.set_week(monitor->week);
monitor_.set_rx_time(monitor->RX_time);
monitor_.set_user_clk_offset(monitor->user_clk_offset);
monitor_.set_pos_x(monitor->pos_x);
monitor_.set_pos_y(monitor->pos_y);
monitor_.set_pos_z(monitor->pos_z);
monitor_.set_vel_x(monitor->vel_x);
monitor_.set_vel_y(monitor->vel_y);
monitor_.set_vel_z(monitor->vel_z);
monitor_.set_cov_xx(monitor->cov_xx);
monitor_.set_cov_yy(monitor->cov_yy);
monitor_.set_cov_zz(monitor->cov_zz);
monitor_.set_cov_xy(monitor->cov_xy);
monitor_.set_cov_yz(monitor->cov_yz);
monitor_.set_cov_zx(monitor->cov_zx);
monitor_.set_latitude(monitor->latitude);
monitor_.set_longitude(monitor->longitude);
monitor_.set_height(monitor->height);
monitor_.set_valid_sats(monitor->valid_sats);
monitor_.set_solution_status(monitor->solution_status);
monitor_.set_solution_type(monitor->solution_type);
monitor_.set_ar_ratio_factor(monitor->AR_ratio_factor);
monitor_.set_ar_ratio_threshold(monitor->AR_ratio_threshold);
monitor_.set_gdop(monitor->gdop);
monitor_.set_pdop(monitor->pdop);
monitor_.set_hdop(monitor->hdop);
monitor_.set_vdop(monitor->vdop);
monitor_.SerializeToString(&data);
return data;

View File

@ -40,9 +40,9 @@
#include <gnuradio/io_signature.h>
#include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <array>
#include <exception>
#include <sstream>
#include <utility>
galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(
@ -310,9 +310,8 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::init()
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex *>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
float phase_step_rad = GALILEO_TWO_PI * doppler / static_cast<float>(d_fs_in);
float _phase[1];
_phase[0] = 0;
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size);
std::array<float, 1> _phase{};
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase.data(), d_fft_size);
}
/* CAF Filtering to resolve doppler ambiguity. Phase and quadrature must be processed

View File

@ -34,9 +34,9 @@
#include <gnuradio/io_signature.h>
#include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <array>
#include <exception>
#include <sstream>
#include <utility>
galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc(
@ -192,9 +192,8 @@ void galileo_pcps_8ms_acquisition_cc::init()
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex *>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index;
float phase_step_rad = static_cast<float>(GALILEO_TWO_PI) * doppler / static_cast<float>(d_fs_in);
float _phase[1];
_phase[0] = 0;
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size);
std::array<float, 1> _phase{};
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase.data(), d_fft_size);
}
}
@ -358,7 +357,7 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items,
std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write
filename.str("");
filename << "../data/test_statistics_" << d_gnss_synchro->System
<< "_" << d_gnss_synchro->Signal << "_sat_"
<< "_" << d_gnss_synchro->Signal[0] << d_gnss_synchro->Signal[1] << "_sat_"
<< d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat";
d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
d_dump_file.write(reinterpret_cast<char *>(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin?

View File

@ -284,9 +284,8 @@ void pcps_acquisition::update_local_carrier(gsl::span<gr_complex> carrier_vector
{
phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(acq_parameters.fs_in);
}
float _phase[1];
_phase[0] = 0.0;
volk_gnsssdr_s32f_sincos_32fc(carrier_vector.data(), -phase_step_rad, _phase, carrier_vector.length());
std::array<float, 1> _phase{};
volk_gnsssdr_s32f_sincos_32fc(carrier_vector.data(), -phase_step_rad, _phase.data(), carrier_vector.length());
}

View File

@ -158,11 +158,11 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con
unsigned int pcps_acquisition_fine_doppler_cc::nextPowerOf2(unsigned int n)
{
n--;
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
n |= n >> 1U;
n |= n >> 2U;
n |= n >> 4U;
n |= n >> 8U;
n |= n >> 16U;
n++;
return n;
}

View File

@ -38,6 +38,7 @@
#include <gnuradio/io_signature.h>
#include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <array>
#include <exception>
#include <sstream>
#include <utility>
@ -233,9 +234,8 @@ void pcps_assisted_acquisition_cc::redefine_grid()
// doppler search steps
// compute the carrier doppler wipe-off signal and store it
phase_step_rad = static_cast<float>(GPS_TWO_PI) * doppler_hz / static_cast<float>(d_fs_in);
float _phase[1];
_phase[0] = 0;
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index].data(), -phase_step_rad, _phase, d_fft_size);
std::array<float, 1> _phase{};
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index].data(), -phase_step_rad, _phase.data(), d_fft_size);
}
}

View File

@ -206,9 +206,8 @@ void pcps_cccwsr_acquisition_cc::init()
int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index;
float phase_step_rad = GPS_TWO_PI * doppler / static_cast<float>(d_fs_in);
float _phase[1];
_phase[0] = 0;
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size);
std::array<float, 1> _phase{};
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase.data(), d_fft_size);
}
}

View File

@ -57,11 +57,11 @@
#include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <algorithm>
#include <array>
#include <exception>
#include <fstream>
#include <iostream>
#include <sstream>
#include <utility>
pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc(
@ -324,9 +324,8 @@ void pcps_opencl_acquisition_cc::init()
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
float phase_step_rad = static_cast<float>(GPS_TWO_PI) * doppler / static_cast<float>(d_fs_in);
float _phase[1];
_phase[0] = 0;
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size);
std::array<float, 1> _phase{};
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase.data(), d_fft_size);
if (d_opencl == 0)
{

View File

@ -38,7 +38,6 @@
#include <cmath>
#include <exception>
#include <sstream>
#include <utility>
pcps_quicksync_acquisition_cc_sptr pcps_quicksync_make_acquisition_cc(
@ -235,9 +234,8 @@ void pcps_quicksync_acquisition_cc::init()
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index;
float phase_step_rad = GPS_TWO_PI * doppler / static_cast<float>(d_fs_in);
float _phase[1];
_phase[0] = 0;
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_samples_per_code * d_folding_factor);
std::array<float, 1> _phase{};
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase.data(), d_samples_per_code * d_folding_factor);
}
// DLOG(INFO) << "end init";
}

View File

@ -54,9 +54,9 @@
#include <gnuradio/io_signature.h>
#include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <array>
#include <exception>
#include <sstream>
#include <utility>
pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc(
@ -211,9 +211,8 @@ void pcps_tong_acquisition_cc::init()
int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index;
float phase_step_rad = GPS_TWO_PI * doppler / static_cast<float>(d_fs_in);
float _phase[1];
_phase[0] = 0;
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size);
std::array<float, 1> _phase{};
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase.data(), d_fft_size);
d_grid_data[doppler_index] = static_cast<float *>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment()));

View File

@ -31,6 +31,7 @@ target_link_libraries(channel_adapters
Gnuradio::runtime
channel_libs
core_system_parameters
core_receiver
PRIVATE
Gflags::gflags
Glog::glog

View File

@ -42,7 +42,7 @@
Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::shared_ptr<AcquisitionInterface> acq,
std::shared_ptr<TrackingInterface> trk, std::shared_ptr<TelemetryDecoderInterface> nav,
std::string role, std::string implementation, gr::msg_queue::sptr queue)
std::string role, std::string implementation, std::shared_ptr<Concurrent_Queue<pmt::pmt_t> > queue)
{
acq_ = std::move(acq);
trk_ = std::move(trk);

View File

@ -38,10 +38,11 @@
#include "channel_fsm.h"
#include "channel_interface.h"
#include "channel_msg_receiver_cc.h"
#include "concurrent_queue.h"
#include "gnss_signal.h"
#include "gnss_synchro.h"
#include <gnuradio/block.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstddef>
#include <cstdint>
#include <memory>
@ -66,7 +67,7 @@ public:
//! Constructor
Channel(ConfigurationInterface* configuration, uint32_t channel, std::shared_ptr<AcquisitionInterface> acq,
std::shared_ptr<TrackingInterface> trk, std::shared_ptr<TelemetryDecoderInterface> nav,
std::string role, std::string implementation, gr::msg_queue::sptr queue);
std::string role, std::string implementation, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~Channel(); //!< Virtual destructor
@ -100,12 +101,12 @@ private:
std::string implementation_;
bool flag_enable_fpga;
uint32_t channel_;
Gnss_Synchro gnss_synchro_;
Gnss_Synchro gnss_synchro_{};
Gnss_Signal gnss_signal_;
bool connected_;
bool repeat_;
std::shared_ptr<ChannelFsm> channel_fsm_;
gr::msg_queue::sptr queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
std::mutex mx;
};

View File

@ -35,14 +35,14 @@ add_library(channel_libs ${CHANNEL_FSM_SOURCES} ${CHANNEL_FSM_HEADERS})
target_link_libraries(channel_libs
PUBLIC
core_libs
core_system_parameters
Gnuradio::runtime
Gnuradio::pmt
core_system_parameters
PRIVATE
Boost::boost
Gflags::gflags
Glog::glog
core_receiver
)
if(ENABLE_CLANG_TIDY)

View File

@ -31,7 +31,7 @@
*/
#include "channel_fsm.h"
#include "control_message_factory.h"
#include "channel_event.h"
#include <glog/logging.h>
#include <utility>
@ -179,7 +179,7 @@ void ChannelFsm::set_telemetry(std::shared_ptr<TelemetryDecoderInterface> teleme
}
void ChannelFsm::set_queue(gr::msg_queue::sptr queue)
void ChannelFsm::set_queue(std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
{
std::lock_guard<std::mutex> lk(mx);
queue_ = std::move(queue);
@ -215,29 +215,17 @@ void ChannelFsm::start_acquisition()
void ChannelFsm::start_tracking()
{
trk_->start_tracking();
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (queue_ != gr::msg_queue::make())
{
queue_->handle(cmf->GetQueueMessage(channel_, 1));
}
queue_->push(pmt::make_any(channel_event_make(channel_, 1)));
}
void ChannelFsm::request_satellite()
{
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (queue_ != gr::msg_queue::make())
{
queue_->handle(cmf->GetQueueMessage(channel_, 0));
}
queue_->push(pmt::make_any(channel_event_make(channel_, 0)));
}
void ChannelFsm::notify_stop_tracking()
{
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (queue_ != gr::msg_queue::make())
{
queue_->handle(cmf->GetQueueMessage(channel_, 2));
}
queue_->push(pmt::make_any(channel_event_make(channel_, 2)));
}

View File

@ -34,9 +34,10 @@
#define GNSS_SDR_CHANNEL_FSM_H
#include "acquisition_interface.h"
#include "concurrent_queue.h"
#include "telemetry_decoder_interface.h"
#include "tracking_interface.h"
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <memory>
#include <mutex>
@ -54,7 +55,7 @@ public:
void set_acquisition(std::shared_ptr<AcquisitionInterface> acquisition);
void set_tracking(std::shared_ptr<TrackingInterface> tracking);
void set_telemetry(std::shared_ptr<TelemetryDecoderInterface> telemetry);
void set_queue(gr::msg_queue::sptr queue);
void set_queue(std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
void set_channel(uint32_t channel);
void start_acquisition();
// FSM EVENTS
@ -76,7 +77,7 @@ private:
std::shared_ptr<AcquisitionInterface> acq_;
std::shared_ptr<TrackingInterface> trk_;
std::shared_ptr<TelemetryDecoderInterface> nav_;
gr::msg_queue::sptr queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
uint32_t channel_;
uint32_t d_state;
std::mutex mx;

View File

@ -109,6 +109,12 @@ Pass_Through::Pass_Through(ConfigurationInterface* configuration, const std::str
}
kludge_copy_ = gr::blocks::copy::make(item_size_);
unsigned long int max_source_buffer_samples = configuration->property("GNSS-SDR.max_source_buffer_samples", 0);
if (max_source_buffer_samples > 0)
{
kludge_copy_->set_max_output_buffer(max_source_buffer_samples);
LOG(INFO) << "Set signal conditioner max output buffer to " << max_source_buffer_samples;
}
DLOG(INFO) << "kludge_copy(" << kludge_copy_->unique_id() << ")";
if (in_streams_ > 1)
{

View File

@ -577,7 +577,7 @@ typedef struct
typedef struct
{ /* SBAS message type */
int week, tow; /* receiption time */
int week, tow; /* reception time */
int prn; /* SBAS satellite PRN number */
unsigned char msg[29]; /* SBAS message (226bit) padded by 0 */
} sbsmsg_t;
@ -912,7 +912,7 @@ typedef struct
unsigned char buff[1200]; /* message buffer */
unsigned int word; /* word buffer for rtcm 2 */
unsigned int nmsg2[100]; /* message count of RTCM 2 (1-99:1-99,0:other) */
unsigned int nmsg3[400]; /* message count of RTCM 3 (1-299:1001-1299,300-399:2000-2099,0:ohter) */
unsigned int nmsg3[400]; /* message count of RTCM 3 (1-299:1001-1299,300-399:2000-2099,0:other) */
char opt[256]; /* RTCM dependent options */
} rtcm_t;

View File

@ -75,7 +75,7 @@ const double ERREPH_GLO = 5.0; /* error of glonass ephemeris (m) */
const double TSTEP = 60.0; /* integration step glonass ephemeris (s) */
const double RTOL_KEPLER = 1e-13; /* relative tolerance for Kepler equation */
const double DEFURASSR = 0.15; /* default accurary of ssr corr (m) */
const double DEFURASSR = 0.15; /* default accuracy of ssr corr (m) */
const double MAXECORSSR = 10.0; /* max orbit correction of ssr (m) */
const double MAXCCORSSR = 1e-6 * SPEED_OF_LIGHT; /* max clock correction of ssr (m) */
const double MAXAGESSR = 90.0; /* max age of ssr orbit and clock (s) */
@ -473,7 +473,7 @@ void seph2pos(gtime_t time, const seph_t *seph, double *rs, double *dts,
}
/* select ephememeris --------------------------------------------------------*/
/* select ephemeris --------------------------------------------------------*/
eph_t *seleph(gtime_t time, int sat, int iode, const nav_t *nav)
{
double t, tmax, tmin;
@ -532,7 +532,7 @@ eph_t *seleph(gtime_t time, int sat, int iode, const nav_t *nav)
}
/* select glonass ephememeris ------------------------------------------------*/
/* select glonass ephemeris ------------------------------------------------*/
geph_t *selgeph(gtime_t time, int sat, int iode, const nav_t *nav)
{
double t, tmax = MAXDTOE_GLO, tmin = tmax + 1.0;
@ -574,7 +574,7 @@ geph_t *selgeph(gtime_t time, int sat, int iode, const nav_t *nav)
}
/* select sbas ephememeris ---------------------------------------------------*/
/* select sbas ephemeris ---------------------------------------------------*/
seph_t *selseph(gtime_t time, int sat, const nav_t *nav)
{
double t, tmax = MAXDTOE_SBS, tmin = tmax + 1.0;

View File

@ -52,7 +52,7 @@
* [1] S.Schear, W.Gurtner and J.Feltens, IONEX: The IONosphere Map EXchange
* Format Version 1, February 25, 1998
* [2] S.Schaer, R.Markus, B.Gerhard and A.S.Timon, Daily Global Ionosphere
* Maps based on GPS Carrier Phase Data Routinely producted by CODE
* Maps based on GPS Carrier Phase Data Routinely produced by CODE
* Analysis Center, Proceeding of the IGS Analysis Center Workshop, 1996
*
*----------------------------------------------------------------------------*/

View File

@ -52,7 +52,7 @@
* [1] S.Schear, W.Gurtner and J.Feltens, IONEX: The IONosphere Map EXchange
* Format Version 1, February 25, 1998
* [2] S.Schaer, R.Markus, B.Gerhard and A.S.Timon, Daily Global Ionosphere
* Maps based on GPS Carrier Phase Data Routinely producted by CODE
* Maps based on GPS Carrier Phase Data Routinely produced by CODE
* Analysis Center, Proceeding of the IGS Analysis Center Workshop, 1996
*
*----------------------------------------------------------------------------*/

View File

@ -296,7 +296,7 @@ int search(int n, int m, const double *L, const double *D,
* double *F O fixed solutions (n x m)
* double *s O sum of squared residulas of fixed solutions (1 x m)
* return : status (0:ok,other:error)
* notes : matrix stored by column-major order (fortran convension)
* notes : matrix stored by column-major order (fortran convention)
*-----------------------------------------------------------------------------*/
int lambda(int n, int m, const double *a, const double *Q, double *F,
double *s)

View File

@ -331,7 +331,7 @@ int is_depend(int sat1, int sat2, int *flgs, int *max_flg)
}
else
{
return 0; /* linear depenent */
return 0; /* linear dependent */
}
return 1;
}

View File

@ -546,7 +546,7 @@ int readdcbf(const char *file, nav_t *nav, const sta_t *sta)
* read differential code bias (dcb) parameters
* args : char *file I dcb parameters file (wild-card * expanded)
* nav_t *nav IO navigation data
* sta_t *sta I station info data to inport receiver dcb
* sta_t *sta I station info data to import receiver dcb
* (NULL: no use)
* return : status (1:ok,0:error)
* notes : currently only p1-c1 bias of code *.dcb file

View File

@ -223,11 +223,12 @@ const unsigned int TBL_CR_C24_Q[] = {
0x42FA2F, 0xC4B6D4, 0xC82F22, 0x4E63D9, 0xD11CCE, 0x575035, 0x5BC9C3, 0xDD8538};
extern "C" {
void dgemm_(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
extern void dgetrf_(int *, int *, double *, int *, int *, int *);
extern void dgetri_(int *, double *, int *, int *, double *, int *, int *);
extern void dgetrs_(char *, int *, int *, double *, int *, int *, double *, int *, int *);
extern "C"
{
void dgemm_(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
extern void dgetrf_(int *, int *, double *, int *, int *, int *);
extern void dgetri_(int *, double *, int *, int *, double *, int *, int *);
extern void dgetrs_(char *, int *, int *, double *, int *, int *, double *, int *, int *);
}
@ -3619,7 +3620,7 @@ void freeobs(obs_t *obs)
/* free navigation data ---------------------------------------------------------
* free memory for navigation data
* args : nav_t *nav IO navigation data
* int opt I option (or of followings)
* int opt I option (one of the following)
* (0x01: gps/qzs ephmeris, 0x02: glonass ephemeris,
* 0x04: sbas ephemeris, 0x08: precise ephemeris,
* 0x10: precise clock 0x20: almanac,

View File

@ -922,7 +922,7 @@ void searchigp(gtime_t time __attribute__((unused)), const double *pos, const sb
* double *var O variance of ionospheric delay (m^2)
* return : status (1:ok, 0:no correction)
* notes : before calling the function, sbas ionosphere correction parameters
* in navigation data (nav->sbsion) must be set by callig
* in navigation data (nav->sbsion) must be set by calling
* sbsupdatecorr()
*-----------------------------------------------------------------------------*/
int sbsioncorr(gtime_t time, const nav_t *nav, const double *pos,
@ -1206,7 +1206,7 @@ int sbsfastcorr(gtime_t time, int sat, const sbssat_t *sbssat,
* double *var O sat position and clock variance (m^2)
* return : status (1:ok,0:no correction)
* notes : before calling the function, sbas satellite correction parameters
* in navigation data (nav->sbssat) must be set by callig
* in navigation data (nav->sbssat) must be set by calling
* sbsupdatecorr().
* satellite clock correction include long-term correction and fast
* correction.

View File

@ -2132,7 +2132,7 @@ int outsols(unsigned char *buff, const sol_t *sol, const double *rb,
/* output solution extended ----------------------------------------------------
* output solution exteneded information
* output solution extended information
* args : unsigned char *buff IO output buffer
* sol_t *sol I solution
* ssat_t *ssat I satellite status
@ -2232,7 +2232,7 @@ void outsol(FILE *fp, const sol_t *sol, const double *rb,
/* output solution extended ----------------------------------------------------
* output solution exteneded information to file
* output solution extended information to file
* args : FILE *fp I output file pointer
* sol_t *sol I solution
* ssat_t *ssat I satellite status

View File

@ -257,7 +257,7 @@ void tide_pole(gtime_t tut, const double *pos, const double *erpv,
* displacements by earth tides
* args : gtime_t tutc I time in utc
* double *rr I site position (ecef) (m)
* int opt I options (or of the followings)
* int opt I options (one of the following)
* 1: solid earth tide
* 2: ocean tide loading
* 4: pole tide

View File

@ -84,6 +84,9 @@ hybrid_observables_gs::hybrid_observables_gs(uint32_t nchannels_in,
this->message_port_register_in(pmt::mp("pvt_to_observables"));
this->set_msg_handler(pmt::mp("pvt_to_observables"), boost::bind(&hybrid_observables_gs::msg_handler_pvt_to_observables, this, _1));
// Send Channel status to gnss_flowgraph
this->message_port_register_out(pmt::mp("status"));
d_dump = dump;
d_dump_mat = dump_mat and d_dump;
d_dump_filename = std::move(dump_filename);
@ -140,7 +143,7 @@ hybrid_observables_gs::hybrid_observables_gs(uint32_t nchannels_in,
T_rx_remnant_to_20ms = 0;
T_rx_step_ms = 20; //read from config at the adapter GNSS-SDR.observable_interval_ms!!
T_rx_TOW_set = false;
T_status_report_timer_ms = 0;
// rework
d_Rx_clock_buffer.set_capacity(10); // 10*20 ms = 200 ms of data in buffer
d_Rx_clock_buffer.clear(); // Clear all the elements in the buffer
@ -618,6 +621,20 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)
{
out[n][0] = epoch_data.at(n);
}
//report channel status every second
T_status_report_timer_ms += T_rx_step_ms;
if (T_status_report_timer_ms >= 1000)
{
for (uint32_t n = 0; n < d_nchannels_out; n++)
{
std::shared_ptr<Gnss_Synchro> gnss_synchro_sptr = std::make_shared<Gnss_Synchro>(epoch_data.at(n));
//publish valid gnss_synchro to the gnss_flowgraph channel status monitor
this->message_port_pub(pmt::mp("status"), pmt::make_any(gnss_synchro_sptr));
}
T_status_report_timer_ms = 0;
}
if (d_dump)
{
// MULTIPLEXED FILE RECORDING - Record results to file

View File

@ -90,6 +90,7 @@ private:
uint32_t T_rx_TOW_ms;
uint32_t T_rx_remnant_to_20ms;
uint32_t T_rx_step_ms;
uint32_t T_status_report_timer_ms;
uint32_t d_nchannels_in;
uint32_t d_nchannels_out;
double T_rx_offset_ms;

View File

@ -34,6 +34,7 @@ target_link_libraries(signal_generator_adapters
Gflags::gflags
Glog::glog
algorithms_libs
core_receiver
)
target_include_directories(signal_generator_adapters

View File

@ -44,7 +44,7 @@
SignalGenerator::SignalGenerator(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t> > queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
{
std::string default_item_type = "gr_complex";
std::string default_dump_file = "./data/gen_source.dat";

View File

@ -33,12 +33,13 @@
#ifndef GNSS_SDR_SIGNAL_GENERATOR_H_
#define GNSS_SDR_SIGNAL_GENERATOR_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include "signal_generator_c.h"
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/vector_to_stream.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <string>
#include <vector>
@ -53,7 +54,7 @@ class SignalGenerator : public GNSSBlockInterface
public:
SignalGenerator(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t> > queue);
virtual ~SignalGenerator();
@ -91,6 +92,6 @@ private:
boost::shared_ptr<gr::block> gen_source_;
gr::blocks::vector_to_stream::sptr vector_to_stream_;
gr::blocks::file_sink::sptr file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t> > queue_;
};
#endif /*GNSS_SDR_SIGNAL_GENERATOR_H_*/

View File

@ -28,7 +28,6 @@ add_library(signal_generator_gr_blocks
target_link_libraries(signal_generator_gr_blocks
PUBLIC
Boost::boost
Gnuradio::runtime
core_system_parameters
PRIVATE

View File

@ -97,7 +97,7 @@ void signal_generator_c::init()
{
work_counter_ = 0;
complex_phase_ = static_cast<gr_complex *>(volk_gnsssdr_malloc(vector_length_ * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
complex_phase_.reserve(vector_length_);
// True if Galileo satellites are present
bool galileo_signal = std::find(system_.begin(), system_.end(), "E") != system_.end();
@ -152,13 +152,13 @@ void signal_generator_c::init()
void signal_generator_c::generate_codes()
{
sampled_code_data_.reset(new gr_complex *[num_sats_]);
sampled_code_pilot_.reset(new gr_complex *[num_sats_]);
//sampled_code_data_.reset(new gr_complex *[num_sats_]);
//sampled_code_pilot_.reset(new gr_complex *[num_sats_]);
sampled_code_data_ = std::vector<std::vector<gr_complex>>(num_sats_, std::vector<gr_complex>(vector_length_));
sampled_code_pilot_ = std::vector<std::vector<gr_complex>>(num_sats_, std::vector<gr_complex>(vector_length_));
for (unsigned int sat = 0; sat < num_sats_; sat++)
{
sampled_code_data_[sat] = static_cast<gr_complex *>(std::malloc(vector_length_ * sizeof(gr_complex)));
std::array<gr_complex, 64000> code{}; //[samples_per_code_[sat]];
if (system_[sat] == "G")
@ -211,7 +211,7 @@ void signal_generator_c::generate_codes()
{
std::array<char, 3> signal = {{'5', 'X', '\0'}};
galileo_e5_a_code_gen_complex_sampled(gsl::span<gr_complex>(sampled_code_data_[sat], vector_length_), signal, PRN_[sat], fs_in_,
galileo_e5_a_code_gen_complex_sampled(sampled_code_data_[sat], signal, PRN_[sat], fs_in_,
static_cast<int>(GALILEO_E5A_CODE_LENGTH_CHIPS) - delay_chips_[sat]);
//noise
if (noise_flag_)
@ -248,11 +248,10 @@ void signal_generator_c::generate_codes()
}
// Generate E1C signal (25 code-periods, with secondary code)
sampled_code_pilot_[sat] = static_cast<gr_complex *>(std::malloc(vector_length_ * sizeof(gr_complex)));
std::array<char, 3> signal_1C = {{'1', 'C', '\0'}};
galileo_e1_code_gen_complex_sampled(gsl::span<gr_complex>(sampled_code_pilot_[sat], vector_length_), signal_1C, cboc, PRN_[sat], fs_in_,
galileo_e1_code_gen_complex_sampled(gsl::span<gr_complex>(sampled_code_pilot_[sat].data(), vector_length_), signal_1C, cboc, PRN_[sat], fs_in_,
static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat], true);
// Obtain the desired CN0 assuming that Pn = 1.
@ -269,20 +268,6 @@ void signal_generator_c::generate_codes()
}
signal_generator_c::~signal_generator_c()
{
/* for (unsigned int sat = 0; sat < num_sats_; sat++)
{
std::free(sampled_code_data_[sat]);
if (system_[sat] == "E" && signal_[sat].at(0) != '5')
{
std::free(sampled_code_pilot_[sat]);
}
} */
volk_gnsssdr_free(complex_phase_);
}
int signal_generator_c::general_work(int noutput_items __attribute__((unused)),
gr_vector_int &ninput_items __attribute__((unused)),
gr_vector_const_void_star &input_items __attribute__((unused)),
@ -306,9 +291,9 @@ int signal_generator_c::general_work(int noutput_items __attribute__((unused)),
for (unsigned int sat = 0; sat < num_sats_; sat++)
{
float phase_step_rad = -static_cast<float>(GPS_TWO_PI) * doppler_Hz_[sat] / static_cast<float>(fs_in_);
float _phase[1];
std::array<float, 1> _phase{};
_phase[0] = -start_phase_rad_[sat];
volk_gnsssdr_s32f_sincos_32fc(complex_phase_, -phase_step_rad, _phase, vector_length_);
volk_gnsssdr_s32f_sincos_32fc(complex_phase_.data(), -phase_step_rad, _phase.data(), vector_length_);
start_phase_rad_[sat] += vector_length_ * phase_step_rad;
out_idx = 0;
@ -346,7 +331,7 @@ int signal_generator_c::general_work(int noutput_items __attribute__((unused)),
phase_step_rad = -static_cast<float>(GPS_TWO_PI) * (freq + (DFRQ1_GLO * GLONASS_PRN.at(PRN_[sat])) + doppler_Hz_[sat]) / static_cast<float>(fs_in_);
// std::cout << "sat " << PRN_[sat] << " SG - Freq = " << (freq + (DFRQ1_GLO * GLONASS_PRN.at(PRN_[sat]))) << " Doppler = " << doppler_Hz_[sat] << std::endl;
_phase[0] = -start_phase_rad_[sat];
volk_gnsssdr_s32f_sincos_32fc(complex_phase_, -phase_step_rad, _phase, vector_length_);
volk_gnsssdr_s32f_sincos_32fc(complex_phase_.data(), -phase_step_rad, _phase.data(), vector_length_);
unsigned int delay_samples = (delay_chips_[sat] % static_cast<int>(GLONASS_L1_CA_CODE_LENGTH_CHIPS)) * samples_per_code_[sat] / GLONASS_L1_CA_CODE_LENGTH_CHIPS;

View File

@ -32,7 +32,6 @@
#define GNSS_SDR_SIGNAL_GENERATOR_C_H
#include "gnss_signal.h"
#include <boost/scoped_array.hpp>
#include <gnuradio/block.h>
#include <random>
#include <string>
@ -83,7 +82,7 @@ signal_generator_c_sptr signal_make_generator_c(
class signal_generator_c : public gr::block
{
public:
~signal_generator_c(); // public destructor
~signal_generator_c() = default; // public destructor
// Where all the action really happens
int general_work(int noutput_items,
@ -146,9 +145,9 @@ private:
std::vector<signed int> current_data_bit_int_;
std::vector<signed int> data_modulation_;
std::vector<signed int> pilot_modulation_;
boost::scoped_array<gr_complex *> sampled_code_data_;
boost::scoped_array<gr_complex *> sampled_code_pilot_;
gr_complex *complex_phase_;
std::vector<std::vector<gr_complex>> sampled_code_data_;
std::vector<std::vector<gr_complex>> sampled_code_pilot_;
std::vector<gr_complex> complex_phase_;
unsigned int work_counter_;
std::random_device r;
std::default_random_engine e1;

View File

@ -48,7 +48,7 @@
Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
{
std::string default_item_type = "gr_complex";
std::string default_dump_file = "./data/signal_source.dat";

View File

@ -32,10 +32,11 @@
#ifndef GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H_
#define GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "fpga_switch.h"
#include "gnss_block_interface.h"
#include <boost/shared_ptr.hpp>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <string>
@ -46,7 +47,7 @@ class Ad9361FpgaSignalSource : public GNSSBlockInterface
public:
Ad9361FpgaSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
~Ad9361FpgaSignalSource();
@ -112,7 +113,7 @@ private:
bool dump_;
std::string dump_filename_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
std::shared_ptr<Fpga_Switch> switch_fpga;
};

View File

@ -40,7 +40,7 @@
CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
{
// DUMP PARAMETERS
std::string empty = "";

View File

@ -32,12 +32,13 @@
#ifndef GNSS_SDR_CUSTOM_UDP_SIGNAL_SOURCE_H
#define GNSS_SDR_CUSTOM_UDP_SIGNAL_SOURCE_H
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include "gr_complex_ip_packet_source.h"
#include <boost/shared_ptr.hpp>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <stdexcept>
#include <string>
#include <vector>
@ -54,7 +55,7 @@ class CustomUDPSignalSource : public GNSSBlockInterface
public:
CustomUDPSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~CustomUDPSignalSource();
@ -98,7 +99,7 @@ private:
std::vector<boost::shared_ptr<gr::block>> null_sinks_;
Gr_Complex_Ip_Packet_Source::sptr udp_gnss_rx_source_;
std::vector<boost::shared_ptr<gr::block>> file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_CUSTOM_UDP_SIGNAL_SOURCE_H */

View File

@ -44,7 +44,7 @@
FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
{
std::string default_filename = "./example_capture.dat";
std::string default_item_type = "short";

View File

@ -35,13 +35,15 @@
#ifndef GNSS_SDR_FILE_SIGNAL_SOURCE_H_
#define GNSS_SDR_FILE_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/throttle.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <memory>
#include <string>
class ConfigurationInterface;
@ -55,7 +57,7 @@ class FileSignalSource : public GNSSBlockInterface
public:
FileSignalSource(ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~FileSignalSource();
@ -122,7 +124,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr sink_;
gr::blocks::throttle::sptr throttle_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
size_t item_size_;
// Throttle control
bool enable_throttle_control_;

View File

@ -34,7 +34,6 @@
#include "configuration_interface.h"
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/msg_queue.h>
#include <teleorbit/frontend.h>
#include <utility>
@ -43,10 +42,10 @@ FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configurati
const std::string& role,
unsigned int in_stream,
unsigned int out_stream,
gr::msg_queue::sptr queue) : role_(role),
in_stream_(in_stream),
out_stream_(out_stream),
queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role),
in_stream_(in_stream),
out_stream_(out_stream),
queue_(std::move(queue))
{
std::string default_item_type = "byte";
item_type_ = configuration->property(role + ".item_type", default_item_type);

View File

@ -34,13 +34,14 @@
#ifndef GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H_
#define GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <gnuradio/blocks/char_to_float.h>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/float_to_complex.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <string>
#include <vector>
@ -56,7 +57,7 @@ class FlexibandSignalSource : public GNSSBlockInterface
public:
FlexibandSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, gr::msg_queue::sptr queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~FlexibandSignalSource();
@ -109,7 +110,7 @@ private:
std::vector<boost::shared_ptr<gr::block>> float_to_complex_;
std::vector<gr::blocks::null_sink::sptr> null_sinks_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif // GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H_

View File

@ -43,7 +43,7 @@
Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
{
std::string default_item_type = "gr_complex";
std::string default_dump_file = "./data/signal_source.dat";

View File

@ -41,7 +41,8 @@
#else
#include <iio/fmcomms2_source.h>
#endif
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <pmt/pmt.h>
#include <string>
class ConfigurationInterface;
@ -51,7 +52,7 @@ class Fmcomms2SignalSource : public GNSSBlockInterface
public:
Fmcomms2SignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~Fmcomms2SignalSource();
@ -122,7 +123,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_FMCOMMS2_SIGNAL_SOURCE_H_*/

View File

@ -42,7 +42,7 @@
// Constructor
GenSignalSource::GenSignalSource(GNSSBlockInterface *signal_generator, GNSSBlockInterface *filter,
std::string role, boost::shared_ptr<gr::msg_queue> queue) : signal_generator_(signal_generator),
std::string role, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : signal_generator_(signal_generator),
filter_(filter),
role_(std::move(role)),
queue_(std::move(queue))

View File

@ -34,8 +34,9 @@
#define GNSS_SDR_GEN_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <string>
/*!
@ -47,7 +48,7 @@ class GenSignalSource : public GNSSBlockInterface
public:
//! Constructor
GenSignalSource(GNSSBlockInterface *signal_generator, GNSSBlockInterface *filter,
std::string role, boost::shared_ptr<gr::msg_queue> queue);
std::string role, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
//! Virtual destructor
virtual ~GenSignalSource();
@ -58,20 +59,17 @@ public:
gr::basic_block_sptr get_right_block() override;
inline std::string role() override { return role_; }
//! Returns "Signal Source"
inline std::string implementation() override { return "Signal Source"; }
inline size_t item_size() override { return 0; }
inline GNSSBlockInterface *signal_generator() const { return signal_generator_; }
private:
GNSSBlockInterface *signal_generator_;
GNSSBlockInterface *filter_;
std::string role_;
std::string implementation_;
bool connected_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_GEN_SIGNAL_SOURCE_H*/

View File

@ -32,12 +32,11 @@
#include "configuration_interface.h"
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/msg_queue.h>
#include <gn3s/gn3s_source_cc.h>
Gn3sSignalSource::Gn3sSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue)
std::string role, unsigned int in_stream, unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue)
{
std::string default_item_type = "short";
std::string default_dump_file = "./data/gn3s_source.dat";

View File

@ -32,10 +32,11 @@
#ifndef GNSS_SDR_GN3S_SIGNAL_SOURCE_H_
#define GNSS_SDR_GN3S_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <string>
@ -49,7 +50,7 @@ class Gn3sSignalSource : public GNSSBlockInterface
public:
Gn3sSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream,
unsigned int out_stream, gr::msg_queue::sptr queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~Gn3sSignalSource();
@ -87,7 +88,7 @@ private:
std::string dump_filename_;
gr::block_sptr gn3s_source_;
gr::blocks::file_sink::sptr file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_GN3S_SIGNAL_SOURCE_H_*/

View File

@ -37,7 +37,7 @@
LabsatSignalSource::LabsatSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
const std::string& role, unsigned int in_stream, unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
{
std::string default_item_type = "gr_complex";
std::string default_dump_file = "./labsat_output.dat";

View File

@ -32,10 +32,11 @@
#ifndef GNSS_SDR_LABSAT_SIGNAL_SOURCE_H_
#define GNSS_SDR_LABSAT_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <string>
class ConfigurationInterface;
@ -48,7 +49,7 @@ class LabsatSignalSource : public GNSSBlockInterface
public:
LabsatSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, gr::msg_queue::sptr queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~LabsatSignalSource();
@ -86,7 +87,7 @@ private:
std::string dump_filename_;
gr::block_sptr labsat23_source_;
gr::blocks::file_sink::sptr file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_LABSAT_SIGNAL_SOURCE_H_*/

View File

@ -43,7 +43,7 @@
MultichannelFileSignalSource::MultichannelFileSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
{
std::string default_filename = "./example_capture.dat";
std::string default_item_type = "short";

View File

@ -35,12 +35,13 @@
#ifndef GNSS_SDR_MULTICHANNEL_FILE_SIGNAL_SOURCE_H_
#define GNSS_SDR_MULTICHANNEL_FILE_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/throttle.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <string>
#include <vector>
@ -56,7 +57,7 @@ class MultichannelFileSignalSource : public GNSSBlockInterface
public:
MultichannelFileSignalSource(ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~MultichannelFileSignalSource();
@ -122,7 +123,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr sink_;
std::vector<gr::blocks::throttle::sptr> throttle_vec_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
size_t item_size_;
// Throttle control
bool enable_throttle_control_;

View File

@ -44,7 +44,7 @@
NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
{
std::string default_filename = "../data/my_capture.dat";
std::string default_item_type = "byte";

View File

@ -35,13 +35,14 @@
#ifndef GNSS_SDR_NSR_FILE_SIGNAL_SOURCE_H_
#define GNSS_SDR_NSR_FILE_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include "unpack_byte_2bit_samples.h"
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/throttle.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <string>
class ConfigurationInterface;
@ -55,7 +56,7 @@ class NsrFileSignalSource : public GNSSBlockInterface
public:
NsrFileSignalSource(ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~NsrFileSignalSource();
inline std::string role() override
@ -122,7 +123,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr sink_;
gr::blocks::throttle::sptr throttle_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
size_t item_size_;
// Throttle control
bool enable_throttle_control_;

View File

@ -42,7 +42,7 @@
OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
{
// DUMP PARAMETERS
std::string empty = "";

View File

@ -33,10 +33,11 @@
#ifndef GNSS_SDR_OSMOSDR_SIGNAL_SOURCE_H_
#define GNSS_SDR_OSMOSDR_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <boost/shared_ptr.hpp>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <osmosdr/source.h>
#include <stdexcept>
@ -54,7 +55,7 @@ class OsmosdrSignalSource : public GNSSBlockInterface
public:
OsmosdrSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~OsmosdrSignalSource();
@ -110,7 +111,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_OSMOSDR_SIGNAL_SOURCE_H_*/

View File

@ -39,7 +39,7 @@
PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
{
std::string default_item_type = "gr_complex";
std::string default_dump_file = "./data/signal_source.dat";

View File

@ -40,7 +40,8 @@
#else
#include <iio/pluto_source.h>
#endif
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <pmt/pmt.h>
#include <string>
@ -53,7 +54,7 @@ class PlutosdrSignalSource : public GNSSBlockInterface
public:
PlutosdrSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~PlutosdrSignalSource();
@ -109,7 +110,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_PLUTOSDR_SIGNAL_SOURCE_H_*/

View File

@ -29,15 +29,16 @@
*/
#include "raw_array_signal_source.h"
#include "concurrent_queue.h"
#include "configuration_interface.h"
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <dbfcttc/raw_array.h>
RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue)
std::string role, unsigned int in_stream, unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue)
{
std::string default_item_type = "gr_complex";
std::string default_dump_file = "./data/raw_array_source.dat";

View File

@ -32,10 +32,11 @@
#ifndef GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H_
#define GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <string>
class ConfigurationInterface;
@ -48,7 +49,7 @@ class RawArraySignalSource : public GNSSBlockInterface
public:
RawArraySignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream,
unsigned int out_stream, gr::msg_queue::sptr queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~RawArraySignalSource();
@ -87,7 +88,7 @@ private:
std::string eth_device_;
gr::block_sptr raw_array_source_;
gr::blocks::file_sink::sptr file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H_*/

View File

@ -45,7 +45,7 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_stream,
unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue) : role_(role),
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role),
in_stream_(in_stream),
out_stream_(out_stream),
queue_(std::move(queue))

View File

@ -32,13 +32,14 @@
#ifndef GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
#define GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include "rtl_tcp_signal_source_c.h"
#include <boost/shared_ptr.hpp>
#include <gnuradio/blocks/deinterleave.h>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/float_to_complex.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <stdexcept>
#include <string>
@ -57,7 +58,7 @@ public:
const std::string& role,
unsigned int in_stream,
unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~RtlTcpSignalSource();
@ -113,7 +114,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H */

View File

@ -43,7 +43,7 @@
SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
{
std::string default_filename = "../data/my_capture.dat";
std::string default_item_type = "int";

View File

@ -32,13 +32,14 @@
#ifndef GNSS_SDR_SPIR_FILE_SIGNAL_SOURCE_H_
#define GNSS_SDR_SPIR_FILE_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include "unpack_intspir_1bit_samples.h"
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/throttle.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <string>
@ -53,7 +54,7 @@ class SpirFileSignalSource : public GNSSBlockInterface
public:
SpirFileSignalSource(ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~SpirFileSignalSource();
inline std::string role() override
@ -120,7 +121,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr sink_;
gr::blocks::throttle::sptr throttle_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
size_t item_size_;
// Throttle control
bool enable_throttle_control_;

View File

@ -40,7 +40,7 @@
SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* configuration,
const std::string& role, uint32_t in_streams, uint32_t out_streams, gr::msg_queue::sptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
const std::string& role, uint32_t in_streams, uint32_t out_streams, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
{
std::string default_filename = "../data/my_capture.dat";
std::string default_dump_filename = "../data/my_capture_dump.dat";
@ -148,7 +148,7 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface*
for (uint32_t i = 0; i < (n_channels_); i++)
{
valve_vec_.push_back(gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue_));
valve_vec_.emplace_back(gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue_));
if (dump_)
{
std::string tmp_str = dump_filename_ + "_ch" + std::to_string(i);

View File

@ -32,6 +32,7 @@
#ifndef GNSS_SDR_SPIR_GSS6450_FILE_SIGNAL_SOURCE_H_
#define GNSS_SDR_SPIR_GSS6450_FILE_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include "gnss_sdr_valve.h"
#include "unpack_spir_gss6450_samples.h"
@ -42,7 +43,7 @@
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/blocks/throttle.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <string>
#include <vector>
@ -58,7 +59,7 @@ class SpirGSS6450FileSignalSource : public GNSSBlockInterface
{
public:
SpirGSS6450FileSignalSource(ConfigurationInterface* configuration, const std::string& role,
uint32_t in_streams, uint32_t out_streams, gr::msg_queue::sptr queue);
uint32_t in_streams, uint32_t out_streams, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~SpirGSS6450FileSignalSource();
inline std::string role() override
@ -131,7 +132,7 @@ private:
std::vector<boost::shared_ptr<gr::block>> valve_vec_;
std::vector<gr::blocks::file_sink::sptr> sink_vec_;
std::vector<gr::blocks::throttle::sptr> throttle_vec_;
gr::msg_queue::sptr queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
size_t item_size_;
};

View File

@ -45,7 +45,7 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con
const std::string& role,
unsigned int in_streams,
unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : role_(role),
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams),
queue_(std::move(queue))

View File

@ -34,6 +34,7 @@
#ifndef GNSS_SDR_TWO_BIT_CPX_FILE_SIGNAL_SOURCE_H_
#define GNSS_SDR_TWO_BIT_CPX_FILE_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include "unpack_byte_2bit_cpx_samples.h"
#include <gnuradio/blocks/file_sink.h>
@ -41,7 +42,7 @@
#include <gnuradio/blocks/interleaved_short_to_complex.h>
#include <gnuradio/blocks/throttle.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <string>
@ -59,7 +60,7 @@ public:
const std::string& role,
unsigned int in_streams,
unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~TwoBitCpxFileSignalSource();
inline std::string role() override
@ -127,7 +128,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr sink_;
gr::blocks::throttle::sptr throttle_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
size_t item_size_;
// Throttle control
bool enable_throttle_control_;

View File

@ -47,7 +47,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
const std::string& role,
unsigned int in_streams,
unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : role_(role),
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams),
queue_(std::move(queue))

View File

@ -35,6 +35,7 @@
#ifndef GNSS_SDR_TWO_BIT_PACKED_FILE_SIGNAL_SOURCE_H_
#define GNSS_SDR_TWO_BIT_PACKED_FILE_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include "unpack_2bit_samples.h"
#include <gnuradio/blocks/file_sink.h>
@ -42,7 +43,7 @@
#include <gnuradio/blocks/interleaved_char_to_complex.h>
#include <gnuradio/blocks/throttle.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <string>
@ -58,7 +59,7 @@ class TwoBitPackedFileSignalSource : public GNSSBlockInterface
public:
TwoBitPackedFileSignalSource(ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~TwoBitPackedFileSignalSource();
inline std::string role() override
@ -146,7 +147,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr sink_;
gr::blocks::throttle::sptr throttle_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
size_t item_size_;
bool big_endian_items_;
bool big_endian_bytes_;

View File

@ -42,7 +42,7 @@
UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
{
// DUMP PARAMETERS
std::string empty = "";
@ -216,7 +216,7 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
if (samples_.at(i) != 0ULL)
{
LOG(INFO) << "RF_channel " << i << " Send STOP signal after " << samples_.at(i) << " samples";
valve_.push_back(gnss_sdr_make_valve(item_size_, samples_.at(i), queue_));
valve_.emplace_back(gnss_sdr_make_valve(item_size_, samples_.at(i), queue_));
DLOG(INFO) << "valve(" << valve_.at(i)->unique_id() << ")";
}

View File

@ -31,12 +31,13 @@
#ifndef GNSS_SDR_UHD_SIGNAL_SOURCE_H_
#define GNSS_SDR_UHD_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <boost/shared_ptr.hpp>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <gnuradio/uhd/usrp_source.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <string>
#include <vector>
@ -52,7 +53,7 @@ class UhdSignalSource : public GNSSBlockInterface
public:
UhdSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~UhdSignalSource();
@ -107,7 +108,7 @@ private:
std::vector<boost::shared_ptr<gr::block>> valve_;
std::vector<gr::blocks::file_sink::sptr> file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_UHD_SIGNAL_SOURCE_H_*/

View File

@ -85,7 +85,7 @@ private:
int fifo_items;
int d_sock_raw;
int d_udp_port;
struct sockaddr_in si_me;
struct sockaddr_in si_me{};
std::string d_src_device;
std::string d_origin_address;
int d_udp_payload_size;

View File

@ -30,7 +30,8 @@
#include "labsat23_source.h"
#include "control_message_factory.h"
#include "command_event.h"
#include <boost/any.hpp>
#include <gnuradio/io_signature.h>
#include <array>
#include <exception>
@ -39,7 +40,7 @@
#include <utility>
labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename, int channel_selector, gr::msg_queue::sptr queue)
labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename, int channel_selector, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
{
return labsat23_source_sptr(new labsat23_source(signal_file_basename, channel_selector, std::move(queue)));
}
@ -47,10 +48,10 @@ labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename,
labsat23_source::labsat23_source(const char *signal_file_basename,
int channel_selector,
gr::msg_queue::sptr queue) : gr::block("labsat23_source",
gr::io_signature::make(0, 0, 0),
gr::io_signature::make(1, 1, sizeof(gr_complex))),
d_queue(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : gr::block("labsat23_source",
gr::io_signature::make(0, 0, 0),
gr::io_signature::make(1, 1, sizeof(gr_complex))),
d_queue(std::move(queue))
{
if (channel_selector < 1 or channel_selector > 2)
{
@ -467,9 +468,8 @@ int labsat23_source::general_work(int noutput_items,
{
std::cout << "End of file reached, LabSat source stop" << std::endl;
}
auto *cmf = new ControlMessageFactory();
d_queue->handle(cmf->GetQueueMessage(200, 0));
delete cmf;
d_queue->push(pmt::make_any(command_event_make(200, 0)));
return -1;
}
}
@ -528,9 +528,7 @@ int labsat23_source::general_work(int noutput_items,
{
std::cout << "End of file reached, LabSat source stop" << std::endl;
}
auto *cmf = new ControlMessageFactory();
d_queue->handle(cmf->GetQueueMessage(200, 0));
delete cmf;
d_queue->push(pmt::make_any(command_event_make(200, 0)));
return -1;
}
}

View File

@ -31,8 +31,9 @@
#ifndef GNSS_SDR_LABSAT23_SOURCE_H
#define GNSS_SDR_LABSAT23_SOURCE_H
#include "concurrent_queue.h"
#include <gnuradio/block.h>
#include <gnuradio/msg_queue.h> // for msg_queue, msg_queue::sptr
#include <pmt/pmt.h>
#include <cstdint>
#include <fstream>
#include <string>
@ -45,7 +46,7 @@ using labsat23_source_sptr = boost::shared_ptr<labsat23_source>;
labsat23_source_sptr labsat23_make_source_sptr(
const char *signal_file_basename,
int channel_selector,
gr::msg_queue::sptr queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
/*!
* \brief This class implements conversion between Labsat2 and 3 format byte packet samples to gr_complex
@ -64,11 +65,11 @@ private:
friend labsat23_source_sptr labsat23_make_source_sptr(
const char *signal_file_basename,
int channel_selector,
gr::msg_queue::sptr queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
labsat23_source(const char *signal_file_basename,
int channel_selector,
gr::msg_queue::sptr queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
std::string generate_filename();
void decode_samples_one_channel(int16_t input_short, gr_complex *out, int type);
@ -82,7 +83,7 @@ private:
std::ifstream *binary_input_file;
uint8_t d_ref_clock;
uint8_t d_bits_per_sample;
gr::msg_queue::sptr d_queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> d_queue;
};
#endif

View File

@ -110,7 +110,7 @@ private:
size_t unread_;
// lookup for scaling data
boost::array<float, 0xff> lookup_;
boost::array<float, 0xff> lookup_{};
// async read callback
void handle_read(const boost::system::error_code &ec,

View File

@ -71,10 +71,10 @@ target_link_libraries(signal_source_libs
PUBLIC
Boost::boost
Gnuradio::runtime
core_receiver
PRIVATE
Gflags::gflags
Glog::glog
core_receiver
)
if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)

View File

@ -32,17 +32,17 @@
*/
#include "gnss_sdr_valve.h"
#include "control_message_factory.h" // for ControlMessageFactory
#include <glog/logging.h> // for LOG
#include <gnuradio/io_signature.h> // for io_signature
#include <algorithm> // for min
#include <cstring> // for memcpy
#include <unistd.h> // for usleep
#include "command_event.h"
#include <glog/logging.h> // for LOG
#include <gnuradio/io_signature.h> // for io_signature
#include <algorithm> // for min
#include <cstring> // for memcpy
#include <unistd.h> // for usleep
#include <utility>
Gnss_Sdr_Valve::Gnss_Sdr_Valve(size_t sizeof_stream_item,
uint64_t nitems,
gr::msg_queue::sptr queue,
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue,
bool stop_flowgraph) : gr::sync_block("valve",
gr::io_signature::make(1, 20, sizeof_stream_item),
gr::io_signature::make(1, 20, sizeof_stream_item)),
@ -55,14 +55,14 @@ Gnss_Sdr_Valve::Gnss_Sdr_Valve(size_t sizeof_stream_item,
}
boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, gr::msg_queue::sptr queue, bool stop_flowgraph)
boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue, bool stop_flowgraph)
{
boost::shared_ptr<Gnss_Sdr_Valve> valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), stop_flowgraph));
return valve_;
}
boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, gr::msg_queue::sptr queue)
boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
{
boost::shared_ptr<Gnss_Sdr_Valve> valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), true));
return valve_;
@ -83,10 +83,8 @@ int Gnss_Sdr_Valve::work(int noutput_items,
{
if (d_ncopied_items >= d_nitems)
{
auto *cmf = new ControlMessageFactory();
d_queue->handle(cmf->GetQueueMessage(200, 0));
LOG(INFO) << "Stopping receiver, " << d_ncopied_items << " samples processed";
delete cmf;
d_queue->push(pmt::make_any(command_event_make(200, 0)));
if (d_stop_flowgraph)
{
return -1; // Done!

View File

@ -34,11 +34,12 @@
#ifndef GNSS_SDR_GNSS_SDR_VALVE_H_
#define GNSS_SDR_GNSS_SDR_VALVE_H_
#include "concurrent_queue.h"
#include <boost/shared_ptr.hpp>
#include <gnuradio/msg_queue.h> // for msg_queue, msg_queue::sptr
#include <gnuradio/sync_block.h> // for sync_block
#include <gnuradio/types.h> // for gr_vector_const_void_star
#include <cstddef> // for size_t
#include <pmt/pmt.h>
#include <cstddef> // for size_t
#include <cstdint>
class Gnss_Sdr_Valve;
@ -46,12 +47,12 @@ class Gnss_Sdr_Valve;
boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(
size_t sizeof_stream_item,
uint64_t nitems,
gr::msg_queue::sptr queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(
size_t sizeof_stream_item,
uint64_t nitems,
gr::msg_queue::sptr queue,
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue,
bool stop_flowgraph);
/*!
@ -71,21 +72,21 @@ private:
friend boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(
size_t sizeof_stream_item,
uint64_t nitems,
gr::msg_queue::sptr queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
friend boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(
size_t sizeof_stream_item,
uint64_t nitems,
gr::msg_queue::sptr queue,
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue,
bool stop_flowgraph);
Gnss_Sdr_Valve(size_t sizeof_stream_item,
uint64_t nitems,
gr::msg_queue::sptr queue, bool stop_flowgraph);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue, bool stop_flowgraph);
uint64_t d_nitems;
uint64_t d_ncopied_items;
gr::msg_queue::sptr d_queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> d_queue;
bool d_stop_flowgraph;
bool d_open_valve;
};

View File

@ -56,7 +56,6 @@ target_link_libraries(telemetry_decoder_gr_blocks
telemetry_decoder_libs
core_system_parameters
Gnuradio::runtime
Volkgnsssdr::volkgnsssdr
Boost::boost
PRIVATE
Gflags::gflags

View File

@ -42,12 +42,10 @@
#include <gnuradio/io_signature.h>
#include <pmt/pmt.h> // for make_any
#include <pmt/pmt_sugar.h> // for mp
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <array>
#include <cstdlib> // for abs
#include <exception> // for exception
#include <iostream> // for cout
#include <memory> // for shared_ptr, make_shared
#include <cstdlib> // for abs
#include <exception> // for exception
#include <iostream> // for cout
#include <memory> // for shared_ptr, make_shared
#define CRC_ERROR_LIMIT 8
@ -64,7 +62,7 @@ beidou_b1i_telemetry_decoder_gs::beidou_b1i_telemetry_decoder_gs(
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)))
{
//prevent telemetry symbols accumulation in output buffers
// prevent telemetry symbols accumulation in output buffers
this->set_max_noutput_items(1);
// Ephemeris data port out
this->message_port_register_out(pmt::mp("telemetry"));
@ -78,7 +76,6 @@ beidou_b1i_telemetry_decoder_gs::beidou_b1i_telemetry_decoder_gs(
d_symbol_duration_ms = BEIDOU_B1I_TELEMETRY_SYMBOLS_PER_BIT * BEIDOU_B1I_CODE_PERIOD_MS;
d_symbols_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS;
d_samples_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS;
d_preamble_samples = static_cast<int32_t *>(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment()));
d_preamble_period_samples = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS;
// Setting samples of preamble code
@ -94,7 +91,6 @@ beidou_b1i_telemetry_decoder_gs::beidou_b1i_telemetry_decoder_gs(
}
}
d_subframe_symbols = static_cast<float *>(volk_gnsssdr_malloc(BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS * sizeof(float), volk_gnsssdr_get_alignment()));
d_required_symbols = BEIDOU_DNAV_SUBFRAME_SYMBOLS + d_samples_per_preamble;
d_symbol_history.set_capacity(d_required_symbols);
@ -118,9 +114,6 @@ beidou_b1i_telemetry_decoder_gs::beidou_b1i_telemetry_decoder_gs(
beidou_b1i_telemetry_decoder_gs::~beidou_b1i_telemetry_decoder_gs()
{
volk_gnsssdr_free(d_preamble_samples);
volk_gnsssdr_free(d_subframe_symbols);
if (d_dump_file.is_open() == true)
{
try
@ -299,13 +292,8 @@ void beidou_b1i_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satell
// Update tel dec parameters for D2 NAV Messages
if (sat_prn > 0 and sat_prn < 6)
{
// Clear values from previous declaration
volk_gnsssdr_free(d_preamble_samples);
volk_gnsssdr_free(d_subframe_symbols);
d_symbols_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS;
d_samples_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS;
d_preamble_samples = static_cast<int32_t *>(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment()));
d_preamble_period_samples = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS;
// Setting samples of preamble code
@ -322,20 +310,15 @@ void beidou_b1i_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satell
}
d_symbol_duration_ms = BEIDOU_B1I_GEO_TELEMETRY_SYMBOLS_PER_BIT * BEIDOU_B1I_CODE_PERIOD_MS;
d_subframe_symbols = static_cast<float *>(volk_gnsssdr_malloc(BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS * sizeof(float), volk_gnsssdr_get_alignment()));
d_required_symbols = BEIDOU_DNAV_SUBFRAME_SYMBOLS + d_samples_per_preamble;
d_symbol_history.set_capacity(d_required_symbols);
}
else
{
// Clear values from previous declaration
volk_gnsssdr_free(d_preamble_samples);
volk_gnsssdr_free(d_subframe_symbols);
//back to normal satellites
d_symbol_duration_ms = BEIDOU_B1I_TELEMETRY_SYMBOLS_PER_BIT * BEIDOU_B1I_CODE_PERIOD_MS;
d_symbols_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS;
d_samples_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS;
d_preamble_samples = static_cast<int32_t *>(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment()));
d_preamble_period_samples = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS;
// Setting samples of preamble code
@ -351,7 +334,6 @@ void beidou_b1i_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satell
}
}
d_subframe_symbols = static_cast<float *>(volk_gnsssdr_malloc(BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS * sizeof(float), volk_gnsssdr_get_alignment()));
d_required_symbols = BEIDOU_DNAV_SUBFRAME_SYMBOLS + d_samples_per_preamble;
d_symbol_history.set_capacity(d_required_symbols);
}
@ -403,7 +385,7 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_
auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]); // Get the output buffer pointer
const auto **in = reinterpret_cast<const Gnss_Synchro **>(&input_items[0]); // Get the input buffer pointer
Gnss_Synchro current_symbol; // structure to save the synchronization information and send the output object to the next block
Gnss_Synchro current_symbol{}; // structure to save the synchronization information and send the output object to the next block
// 1. Copy the current tracking output
current_symbol = in[0][0];
d_symbol_history.push_back(current_symbol.Prompt_I); // add new symbol to the symbol queue
@ -470,7 +452,7 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_
}
// call the decoder
decode_subframe(d_subframe_symbols);
decode_subframe(d_subframe_symbols.data());
if (d_nav.flag_crc_test == true)
{
@ -527,7 +509,7 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_
}
// call the decoder
decode_subframe(d_subframe_symbols);
decode_subframe(d_subframe_symbols.data());
if (d_nav.flag_crc_test == true)
{

View File

@ -40,6 +40,7 @@
#include <boost/shared_ptr.hpp> // for boost::shared_ptr
#include <gnuradio/block.h> // for block
#include <gnuradio/types.h> // for gr_vector_const_void_star
#include <array>
#include <cstdint>
#include <fstream>
#include <string>
@ -49,7 +50,9 @@ class beidou_b1i_telemetry_decoder_gs;
using beidou_b1i_telemetry_decoder_gs_sptr = boost::shared_ptr<beidou_b1i_telemetry_decoder_gs>;
beidou_b1i_telemetry_decoder_gs_sptr beidou_b1i_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump);
beidou_b1i_telemetry_decoder_gs_sptr beidou_b1i_make_telemetry_decoder_gs(
const Gnss_Satellite &satellite,
bool dump);
/*!
@ -71,21 +74,22 @@ public:
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
private:
friend beidou_b1i_telemetry_decoder_gs_sptr
beidou_b1i_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump);
friend beidou_b1i_telemetry_decoder_gs_sptr beidou_b1i_make_telemetry_decoder_gs(
const Gnss_Satellite &satellite,
bool dump);
beidou_b1i_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump);
void decode_subframe(float *symbols);
void decode_word(int32_t word_counter, const float *enc_word_symbols, int32_t *dec_word_symbols);
void decode_bch15_11_01(const int32_t *bits, int32_t *decbits);
// Preamble decoding
int32_t *d_preamble_samples;
std::array<int32_t, BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS> d_preamble_samples{};
int32_t d_symbols_per_preamble;
int32_t d_samples_per_preamble;
int32_t d_preamble_period_samples;
float *d_subframe_symbols;
std::array<float, BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS> d_subframe_symbols{};
uint32_t d_required_symbols;
// Storage for incoming data
@ -100,7 +104,7 @@ private:
int32_t d_CRC_error_counter; // Number of failed CRC operations
bool flag_SOW_set; // Indicates when time of week is set
//!< Navigation Message variable
// Navigation Message variable
Beidou_Dnav_Navigation_Message d_nav;
// Values to populate gnss synchronization structure

View File

@ -41,12 +41,10 @@
#include <gnuradio/io_signature.h>
#include <pmt/pmt.h> // for make_any
#include <pmt/pmt_sugar.h> // for mp
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <array>
#include <cstdlib> // for abs
#include <exception> // for exception
#include <iostream> // for cout
#include <memory> // for shared_ptr, make_shared
#include <cstdlib> // for abs
#include <exception> // for exception
#include <iostream> // for cout
#include <memory> // for shared_ptr, make_shared
#define CRC_ERROR_LIMIT 8
@ -64,7 +62,7 @@ beidou_b3i_telemetry_decoder_gs::beidou_b3i_telemetry_decoder_gs(
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)))
{
//prevent telemetry symbols accumulation in output buffers
// prevent telemetry symbols accumulation in output buffers
this->set_max_noutput_items(1);
// Ephemeris data port out
this->message_port_register_out(pmt::mp("telemetry"));
@ -78,7 +76,6 @@ beidou_b3i_telemetry_decoder_gs::beidou_b3i_telemetry_decoder_gs(
d_symbol_duration_ms = BEIDOU_B3I_TELEMETRY_SYMBOLS_PER_BIT * BEIDOU_B3I_CODE_PERIOD_MS;
d_symbols_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS;
d_samples_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS;
d_preamble_samples = static_cast<int32_t *>(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment()));
d_preamble_period_samples = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS;
// Setting samples of preamble code
@ -94,7 +91,6 @@ beidou_b3i_telemetry_decoder_gs::beidou_b3i_telemetry_decoder_gs(
}
}
d_subframe_symbols = static_cast<float *>(volk_gnsssdr_malloc(BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS * sizeof(float), volk_gnsssdr_get_alignment()));
d_required_symbols = BEIDOU_DNAV_SUBFRAME_SYMBOLS + d_samples_per_preamble;
d_symbol_history.set_capacity(d_required_symbols);
@ -118,9 +114,6 @@ beidou_b3i_telemetry_decoder_gs::beidou_b3i_telemetry_decoder_gs(
beidou_b3i_telemetry_decoder_gs::~beidou_b3i_telemetry_decoder_gs()
{
volk_gnsssdr_free(d_preamble_samples);
volk_gnsssdr_free(d_subframe_symbols);
if (d_dump_file.is_open() == true)
{
try
@ -317,15 +310,8 @@ void beidou_b3i_telemetry_decoder_gs::set_satellite(
// Update tel dec parameters for D2 NAV Messages
if (sat_prn > 0 and sat_prn < 6)
{
// Clear values from previous declaration
volk_gnsssdr_free(d_preamble_samples);
volk_gnsssdr_free(d_subframe_symbols);
d_symbols_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS;
d_samples_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS;
d_preamble_samples = static_cast<int32_t *>(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t),
volk_gnsssdr_get_alignment()));
d_preamble_period_samples = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS;
// Setting samples of preamble code
@ -341,22 +327,15 @@ void beidou_b3i_telemetry_decoder_gs::set_satellite(
}
}
d_symbol_duration_ms = BEIDOU_B3I_GEO_TELEMETRY_SYMBOLS_PER_BIT * BEIDOU_B3I_CODE_PERIOD_MS;
d_subframe_symbols = static_cast<float *>(volk_gnsssdr_malloc(
BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS * sizeof(float),
volk_gnsssdr_get_alignment()));
d_required_symbols = BEIDOU_DNAV_SUBFRAME_SYMBOLS + d_samples_per_preamble;
d_symbol_history.set_capacity(d_required_symbols);
}
else
{
// Clear values from previous declaration
volk_gnsssdr_free(d_preamble_samples);
volk_gnsssdr_free(d_subframe_symbols);
//back to normal satellites
// back to normal satellites
d_symbol_duration_ms = BEIDOU_B3I_TELEMETRY_SYMBOLS_PER_BIT * BEIDOU_B3I_CODE_PERIOD_MS;
d_symbols_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS;
d_samples_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS;
d_preamble_samples = static_cast<int32_t *>(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment()));
d_preamble_period_samples = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS;
// Setting samples of preamble code
@ -372,7 +351,6 @@ void beidou_b3i_telemetry_decoder_gs::set_satellite(
}
}
d_subframe_symbols = static_cast<float *>(volk_gnsssdr_malloc(BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS * sizeof(float), volk_gnsssdr_get_alignment()));
d_required_symbols = BEIDOU_DNAV_SUBFRAME_SYMBOLS + d_samples_per_preamble;
d_symbol_history.set_capacity(d_required_symbols);
}
@ -430,7 +408,7 @@ int beidou_b3i_telemetry_decoder_gs::general_work(
auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]); // Get the output buffer pointer
const auto **in = reinterpret_cast<const Gnss_Synchro **>(&input_items[0]); // Get the input buffer pointer
Gnss_Synchro current_symbol; // structure to save the synchronization
Gnss_Synchro current_symbol{}; // structure to save the synchronization
// information and send the output object to the
// next block
// 1. Copy the current tracking output
@ -498,7 +476,7 @@ int beidou_b3i_telemetry_decoder_gs::general_work(
}
// call the decoder
decode_subframe(d_subframe_symbols);
decode_subframe(d_subframe_symbols.data());
if (d_nav.flag_crc_test == true)
{
@ -558,7 +536,7 @@ int beidou_b3i_telemetry_decoder_gs::general_work(
}
// call the decoder
decode_subframe(d_subframe_symbols);
decode_subframe(d_subframe_symbols.data());
if (d_nav.flag_crc_test == true)
{

View File

@ -40,19 +40,19 @@
#include <cstdint>
#include <fstream>
#include <string>
#include <array>
class beidou_b3i_telemetry_decoder_gs;
using beidou_b3i_telemetry_decoder_gs_sptr =
boost::shared_ptr<beidou_b3i_telemetry_decoder_gs>;
beidou_b3i_telemetry_decoder_gs_sptr
beidou_b3i_make_telemetry_decoder_gs(const Gnss_Satellite &satellite,
beidou_b3i_telemetry_decoder_gs_sptr beidou_b3i_make_telemetry_decoder_gs(
const Gnss_Satellite &satellite,
bool dump);
/*!
* \brief This class implements a block that decodes the BeiDou DNAV data.
*
*/
class beidou_b3i_telemetry_decoder_gs : public gr::block
{
@ -70,9 +70,10 @@ public:
gr_vector_void_star &output_items);
private:
friend beidou_b3i_telemetry_decoder_gs_sptr
beidou_b3i_make_telemetry_decoder_gs(const Gnss_Satellite &satellite,
friend beidou_b3i_telemetry_decoder_gs_sptr beidou_b3i_make_telemetry_decoder_gs(
const Gnss_Satellite &satellite,
bool dump);
beidou_b3i_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump);
void decode_subframe(float *symbols);
@ -81,11 +82,11 @@ private:
void decode_bch15_11_01(const int32_t *bits, int32_t *decbits);
// Preamble decoding
int32_t *d_preamble_samples;
std::array<int32_t, BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS> d_preamble_samples{};
int32_t d_symbols_per_preamble;
int32_t d_samples_per_preamble;
int32_t d_preamble_period_samples;
float *d_subframe_symbols;
std::array<float, BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS> d_subframe_symbols{};
uint32_t d_required_symbols;
// Storage for incoming data

View File

@ -43,12 +43,11 @@
#include <gnuradio/io_signature.h>
#include <pmt/pmt.h> // for make_any
#include <pmt/pmt_sugar.h> // for mp
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath> // for fmod
#include <cstdlib> // for abs
#include <exception> // for exception
#include <iostream> // for cout
#include <memory> // for shared_ptr, make_shared
#include <cmath> // for fmod
#include <cstdlib> // for abs
#include <exception> // for exception
#include <iostream> // for cout
#include <memory> // for shared_ptr, make_shared
#define CRC_ERROR_LIMIT 6
@ -66,7 +65,7 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
bool dump) : gr::block("galileo_telemetry_decoder_gs", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)))
{
//prevent telemetry symbols accumulation in output buffers
// prevent telemetry symbols accumulation in output buffers
this->set_max_noutput_items(1);
// Ephemeris data port out
this->message_port_register_out(pmt::mp("telemetry"));
@ -75,7 +74,6 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
d_last_valid_preamble = 0;
d_sent_tlm_failed_msg = false;
// initialize internal vars
d_dump = dump;
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
@ -93,7 +91,7 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
d_preamble_period_symbols = GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS;
d_required_symbols = static_cast<uint32_t>(GALILEO_INAV_PAGE_SYMBOLS) + d_samples_per_preamble;
// preamble bits to sampled symbols
d_preamble_samples = static_cast<int32_t *>(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment()));
d_preamble_samples.reserve(d_samples_per_preamble);
d_frame_length_symbols = GALILEO_INAV_PAGE_PART_SYMBOLS - GALILEO_INAV_PREAMBLE_LENGTH_BITS;
CodeLength = GALILEO_INAV_PAGE_PART_SYMBOLS - GALILEO_INAV_PREAMBLE_LENGTH_BITS;
DataLength = (CodeLength / nn) - mm;
@ -110,7 +108,7 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
d_preamble_period_symbols = GALILEO_FNAV_SYMBOLS_PER_PAGE;
d_required_symbols = static_cast<uint32_t>(GALILEO_FNAV_SYMBOLS_PER_PAGE) + d_samples_per_preamble;
// preamble bits to sampled symbols
d_preamble_samples = static_cast<int32_t *>(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment()));
d_preamble_samples.reserve(d_samples_per_preamble);
d_frame_length_symbols = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS;
CodeLength = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS;
DataLength = (CodeLength / nn) - mm;
@ -121,7 +119,6 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
d_bits_per_preamble = 0;
d_samples_per_preamble = 0;
d_preamble_period_symbols = 0;
d_preamble_samples = nullptr;
d_PRN_code_period_ms = 0U;
d_required_symbols = 0U;
d_frame_length_symbols = 0U;
@ -131,7 +128,7 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
std::cout << "Galileo unified telemetry decoder error: Unknown frame type " << std::endl;
}
d_page_part_symbols = static_cast<double *>(volk_gnsssdr_malloc(d_frame_length_symbols * sizeof(double), volk_gnsssdr_get_alignment()));
d_page_part_symbols.reserve(d_frame_length_symbols);
for (int32_t i = 0; i < d_bits_per_preamble; i++)
{
switch (d_frame_type)
@ -184,24 +181,18 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
int32_t max_states = 1U << static_cast<uint32_t>(mm); // 2^mm
g_encoder[0] = 121; // Polynomial G1
g_encoder[1] = 91; // Polynomial G2
out0 = static_cast<int32_t *>(volk_gnsssdr_malloc(max_states * sizeof(int32_t), volk_gnsssdr_get_alignment()));
out1 = static_cast<int32_t *>(volk_gnsssdr_malloc(max_states * sizeof(int32_t), volk_gnsssdr_get_alignment()));
state0 = static_cast<int32_t *>(volk_gnsssdr_malloc(max_states * sizeof(int32_t), volk_gnsssdr_get_alignment()));
state1 = static_cast<int32_t *>(volk_gnsssdr_malloc(max_states * sizeof(int32_t), volk_gnsssdr_get_alignment()));
out0.reserve(max_states);
out1.reserve(max_states);
state0.reserve(max_states);
state1.reserve(max_states);
// create appropriate transition matrices
nsc_transit(out0, state0, 0, g_encoder, KK, nn);
nsc_transit(out1, state1, 1, g_encoder, KK, nn);
nsc_transit(out0.data(), state0.data(), 0, g_encoder.data(), KK, nn);
nsc_transit(out1.data(), state1.data(), 1, g_encoder.data(), KK, nn);
}
galileo_telemetry_decoder_gs::~galileo_telemetry_decoder_gs()
{
volk_gnsssdr_free(d_preamble_samples);
volk_gnsssdr_free(d_page_part_symbols);
volk_gnsssdr_free(out0);
volk_gnsssdr_free(out1);
volk_gnsssdr_free(state0);
volk_gnsssdr_free(state1);
if (d_dump_file.is_open() == true)
{
try
@ -218,7 +209,7 @@ galileo_telemetry_decoder_gs::~galileo_telemetry_decoder_gs()
void galileo_telemetry_decoder_gs::viterbi_decoder(double *page_part_symbols, int32_t *page_part_bits)
{
Viterbi(page_part_bits, out0, state0, out1, state1,
Viterbi(page_part_bits, out0.data(), state0.data(), out1.data(), state1.data(),
page_part_symbols, KK, nn, DataLength);
}
@ -238,8 +229,8 @@ void galileo_telemetry_decoder_gs::deinterleaver(int32_t rows, int32_t cols, con
void galileo_telemetry_decoder_gs::decode_INAV_word(double *page_part_symbols, int32_t frame_length)
{
// 1. De-interleave
auto *page_part_symbols_deint = static_cast<double *>(volk_gnsssdr_malloc(frame_length * sizeof(double), volk_gnsssdr_get_alignment()));
deinterleaver(GALILEO_INAV_INTERLEAVER_ROWS, GALILEO_INAV_INTERLEAVER_COLS, page_part_symbols, page_part_symbols_deint);
std::vector<double> page_part_symbols_deint(frame_length);
deinterleaver(GALILEO_INAV_INTERLEAVER_ROWS, GALILEO_INAV_INTERLEAVER_COLS, page_part_symbols, page_part_symbols_deint.data());
// 2. Viterbi decoder
// 2.1 Take into account the NOT gate in G2 polynomial (Galileo ICD Figure 13, FEC encoder)
@ -252,9 +243,8 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(double *page_part_symbols, i
}
}
auto *page_part_bits = static_cast<int32_t *>(volk_gnsssdr_malloc((frame_length / 2) * sizeof(int32_t), volk_gnsssdr_get_alignment()));
viterbi_decoder(page_part_symbols_deint, page_part_bits);
volk_gnsssdr_free(page_part_symbols_deint);
std::vector<int32_t> page_part_bits(frame_length / 2);
viterbi_decoder(page_part_symbols_deint.data(), page_part_bits.data());
// 3. Call the Galileo page decoder
std::string page_String;
@ -290,7 +280,6 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(double *page_part_symbols, i
d_inav_nav.split_page(page_String, flag_even_word_arrived);
flag_even_word_arrived = 1;
}
volk_gnsssdr_free(page_part_bits);
// 4. Push the new navigation data to the queues
if (d_inav_nav.have_new_ephemeris() == true)
@ -332,8 +321,8 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(double *page_part_symbols, i
void galileo_telemetry_decoder_gs::decode_FNAV_word(double *page_symbols, int32_t frame_length)
{
// 1. De-interleave
auto *page_symbols_deint = static_cast<double *>(volk_gnsssdr_malloc(frame_length * sizeof(double), volk_gnsssdr_get_alignment()));
deinterleaver(GALILEO_FNAV_INTERLEAVER_ROWS, GALILEO_FNAV_INTERLEAVER_COLS, page_symbols, page_symbols_deint);
std::vector<double> page_symbols_deint(frame_length);
deinterleaver(GALILEO_FNAV_INTERLEAVER_ROWS, GALILEO_FNAV_INTERLEAVER_COLS, page_symbols, page_symbols_deint.data());
// 2. Viterbi decoder
// 2.1 Take into account the NOT gate in G2 polynomial (Galileo ICD Figure 13, FEC encoder)
@ -345,9 +334,8 @@ void galileo_telemetry_decoder_gs::decode_FNAV_word(double *page_symbols, int32_
page_symbols_deint[i] = -page_symbols_deint[i];
}
}
auto *page_bits = static_cast<int32_t *>(volk_gnsssdr_malloc((frame_length / 2) * sizeof(int32_t), volk_gnsssdr_get_alignment()));
viterbi_decoder(page_symbols_deint, page_bits);
volk_gnsssdr_free(page_symbols_deint);
std::vector<int32_t> page_bits(frame_length / 2);
viterbi_decoder(page_symbols_deint.data(), page_bits.data());
// 3. Call the Galileo page decoder
std::string page_String;
@ -362,7 +350,6 @@ void galileo_telemetry_decoder_gs::decode_FNAV_word(double *page_symbols, int32_
page_String.push_back('0');
}
}
volk_gnsssdr_free(page_bits);
// DECODE COMPLETE WORD (even + odd) and TEST CRC
d_fnav_nav.split_page(page_String);
@ -462,7 +449,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
d_symbol_history.push_back(current_symbol.Prompt_I);
break;
}
case 2: //FNAV
case 2: // FNAV
{
d_symbol_history.push_back(current_symbol.Prompt_Q);
break;
@ -494,7 +481,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
{
case 0: // no preamble information
{
//correlate with preamble
// correlate with preamble
int32_t corr_value = 0;
if (d_symbol_history.size() > d_required_symbols)
{
@ -522,7 +509,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
}
case 1: // possible preamble lock
{
//correlate with preamble
// correlate with preamble
int32_t corr_value = 0;
int32_t preamble_diff = 0;
if (d_symbol_history.size() > d_required_symbols)
@ -594,7 +581,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
d_page_part_symbols[i] = -d_symbol_history.at(i + d_samples_per_preamble); // because last symbol of the preamble is just received now!
}
}
decode_INAV_word(d_page_part_symbols, d_frame_length_symbols);
decode_INAV_word(d_page_part_symbols.data(), d_frame_length_symbols);
break;
case 2: // FNAV
// NEW Galileo page part is received
@ -619,7 +606,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
}
}
}
decode_FNAV_word(d_page_part_symbols, d_frame_length_symbols);
decode_FNAV_word(d_page_part_symbols.data(), d_frame_length_symbols);
break;
default:
return -1;

View File

@ -40,15 +40,20 @@
#include <boost/shared_ptr.hpp> // for boost::shared_ptr
#include <gnuradio/block.h> // for block
#include <gnuradio/types.h> // for gr_vector_const_void_star
#include <array>
#include <cstdint>
#include <fstream>
#include <string>
#include <vector>
class galileo_telemetry_decoder_gs;
using galileo_telemetry_decoder_gs_sptr = boost::shared_ptr<galileo_telemetry_decoder_gs>;
galileo_telemetry_decoder_gs_sptr galileo_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, int frame_type, bool dump);
galileo_telemetry_decoder_gs_sptr galileo_make_telemetry_decoder_gs(
const Gnss_Satellite &satellite,
int frame_type,
bool dump);
/*!
* \brief This class implements a block that decodes the INAV and FNAV data defined in Galileo ICD
@ -69,8 +74,11 @@ public:
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
private:
friend galileo_telemetry_decoder_gs_sptr
galileo_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, int frame_type, bool dump);
friend galileo_telemetry_decoder_gs_sptr galileo_make_telemetry_decoder_gs(
const Gnss_Satellite &satellite,
int frame_type,
bool dump);
galileo_telemetry_decoder_gs(const Gnss_Satellite &satellite, int frame_type, bool dump);
void viterbi_decoder(double *page_part_symbols, int32_t *page_part_bits);
@ -84,11 +92,11 @@ private:
int32_t d_bits_per_preamble;
int32_t d_samples_per_preamble;
int32_t d_preamble_period_symbols;
int32_t *d_preamble_samples;
std::vector<int32_t> d_preamble_samples;
uint32_t d_PRN_code_period_ms;
uint32_t d_required_symbols;
uint32_t d_frame_length_symbols;
double *d_page_part_symbols;
std::vector<double> d_page_part_symbols;
boost::circular_buffer<float> d_symbol_history;
@ -118,14 +126,17 @@ private:
uint32_t d_TOW_at_current_symbol_ms;
bool flag_TOW_set;
double delta_t; //GPS-GALILEO time offset
double delta_t; // GPS-GALILEO time offset
std::string d_dump_filename;
std::ofstream d_dump_file;
// vars for Viterbi decoder
int32_t *out0, *out1, *state0, *state1;
int32_t g_encoder[2]{};
std::vector<int32_t> out0;
std::vector<int32_t> out1;
std::vector<int32_t> state0;
std::vector<int32_t> state1;
std::array<int32_t, 2> g_encoder{};
const int32_t nn = 2; // Coding rate 1/n
const int32_t KK = 7; // Constraint Length
int32_t mm = KK - 1;

View File

@ -38,13 +38,11 @@
#include <gnuradio/io_signature.h>
#include <pmt/pmt.h> // for make_any
#include <pmt/pmt_sugar.h> // for mp
#include <array>
#include <cmath> // for floor, round
#include <cstdlib> // for abs, malloc
#include <cstring> // for memcpy
#include <exception> // for exception
#include <iostream> // for cout
#include <memory> // for shared_ptr, make_shared
#include <cmath> // for floor, round
#include <cstdlib> // for abs
#include <exception> // for exception
#include <iostream> // for cout
#include <memory> // for shared_ptr, make_shared
#define CRC_ERROR_LIMIT 6
@ -61,7 +59,7 @@ glonass_l1_ca_telemetry_decoder_gs::glonass_l1_ca_telemetry_decoder_gs(
bool dump) : gr::block("glonass_l1_ca_telemetry_decoder_gs", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)))
{
//prevent telemetry symbols accumulation in output buffers
// prevent telemetry symbols accumulation in output buffers
this->set_max_noutput_items(1);
// Ephemeris data port out
this->message_port_register_out(pmt::mp("telemetry"));
@ -71,19 +69,8 @@ glonass_l1_ca_telemetry_decoder_gs::glonass_l1_ca_telemetry_decoder_gs(
d_dump = dump;
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
LOG(INFO) << "Initializing GLONASS L1 CA TELEMETRY DECODING";
// Define the number of sampes per symbol. Notice that GLONASS has 2 rates,
// one for the navigation data and the other for the preamble information
d_samples_per_symbol = (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS) / GLONASS_L1_CA_SYMBOL_RATE_BPS;
// Set the preamble information
std::array<uint16_t, GLONASS_GNAV_PREAMBLE_LENGTH_BITS> preambles_bits{GLONASS_GNAV_PREAMBLE};
// Since preamble rate is different than navigation data rate we use a constant
d_symbols_per_preamble = GLONASS_GNAV_PREAMBLE_LENGTH_SYMBOLS;
memcpy(static_cast<uint16_t *>(this->d_preambles_bits), preambles_bits.data(), GLONASS_GNAV_PREAMBLE_LENGTH_BITS * sizeof(uint16_t));
// preamble bits to sampled symbols
d_preambles_symbols = static_cast<int32_t *>(malloc(sizeof(int32_t) * d_symbols_per_preamble));
int32_t n = 0;
for (uint16_t d_preambles_bit : d_preambles_bits)
{
@ -120,7 +107,6 @@ glonass_l1_ca_telemetry_decoder_gs::glonass_l1_ca_telemetry_decoder_gs(
glonass_l1_ca_telemetry_decoder_gs::~glonass_l1_ca_telemetry_decoder_gs()
{
delete d_preambles_symbols;
if (d_dump_file.is_open() == true)
{
try

Some files were not shown because too many files have changed in this diff Show More