1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-08-10 07:53:58 +00:00

refactor: moved sensor data source to algorithms/libs as well

This commit is contained in:
Victor Castillo 2025-06-09 00:37:30 +02:00 committed by Carles Fernandez
parent ae00dedfcb
commit 567426b415
8 changed files with 27 additions and 30 deletions

View File

@ -58,8 +58,6 @@ option(ENABLE_ZMQ "Enable GNU Radio ZeroMQ Messaging, requires gr-zeromq" ON)
option(ENABLE_ION "Enable ION GNSS-SDR Metadata Standard signal source" OFF)
option(ENABLE_SENSOR_DATA "Enable sensor data source" ON)
# Performance analysis tools
option(ENABLE_GPERFTOOLS "Enable linking to Gperftools libraries (tcmalloc and profiler)" OFF)

View File

@ -67,22 +67,22 @@ set(GNSS_SPLIBS_HEADERS
gnss_time.h
)
if (ENABLE_SENSOR_DATA)
set(GNSS_SPLIBS_HEADERS ${GNSS_SPLIBS_HEADERS}
sensor_data/sensor_data_type.h
sensor_data/sensor_identifier.h
sensor_data/sensor_data_file.h
sensor_data/sensor_data_source_configuration.h
sensor_data/sensor_data_aggregator.h
)
set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES}
sensor_data/sensor_data_type.cc
sensor_data/sensor_identifier.cc
sensor_data/sensor_data_file.cc
sensor_data/sensor_data_source_configuration.cc
sensor_data/sensor_data_aggregator.cc
)
endif ()
set(GNSS_SPLIBS_HEADERS ${GNSS_SPLIBS_HEADERS}
sensor_data/sensor_data_type.h
sensor_data/sensor_identifier.h
sensor_data/sensor_data_file.h
sensor_data/sensor_data_source_configuration.h
sensor_data/sensor_data_source.h
sensor_data/sensor_data_aggregator.h
)
set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES}
sensor_data/sensor_data_type.cc
sensor_data/sensor_identifier.cc
sensor_data/sensor_data_file.cc
sensor_data/sensor_data_source_configuration.cc
sensor_data/sensor_data_source.cc
sensor_data/sensor_data_aggregator.cc
)
if(ENABLE_OPENCL)
set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES}

View File

@ -14,7 +14,7 @@
* -----------------------------------------------------------------------------
*/
#include "sensor_data_source.h"
#include "sensor_data/sensor_data_source.h"
#include "sensor_data/sensor_data_file.h"
#include <pmt/pmt.h>
@ -35,6 +35,12 @@ SensorDataSource::SensorDataSource(
item_size_(io_signature->sizeof_stream_item(0)),
items_per_sample_(configuration.get_items_per_sample())
{
if (not configuration.validate())
{
DLOG(ERROR) << "Failed to validate sensor data configuration";
throw std::runtime_error("Failed to validate sensor data configuration");
}
// Open needed data files
for (const auto& file_pair : configuration.files())
{

View File

@ -693,9 +693,8 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)
d_Rx_clock_buffer.push_back(in[d_nchannels_in - 1][0].Tracking_sample_counter);
std::vector<gr::tag_t> tags_vec;
// sensor data tags
// Propagate sensor data tags
get_tags_in_range(tags_vec, d_nchannels_in - 1, this->nitems_read(d_nchannels_in - 1), this->nitems_read(d_nchannels_in - 1) + 1, pmt::mp("sensor_data"));
// std::cout << "OBS (" << std::to_string(tags_vec.size()) << ")" << std::endl;
while (!d_sensor_data_tags.empty())
{
d_sensor_data_tags.pop();
@ -704,6 +703,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)
{
d_sensor_data_tags.emplace(tag);
}
// time tags
tags_vec.clear();
this->get_tags_in_range(tags_vec, d_nchannels_in - 1, this->nitems_read(d_nchannels_in - 1), this->nitems_read(d_nchannels_in - 1) + 1, pmt::mp("timetag"));
@ -792,8 +792,6 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)
{
std::vector<Gnss_Synchro> epoch_data(d_nchannels_out);
int32_t n_valid = 0;
std::vector<gr::tag_t> tags{};
for (uint32_t n = 0; n < d_nchannels_out; n++)
{
Gnss_Synchro interpolated_gnss_synchro{};

View File

@ -211,7 +211,7 @@ void FileSourceBase::connect(gr::top_block_sptr top_block)
if (sensor_data_source())
{
top_block->connect(std::move(output), 0, sensor_data_source(), 0);
DLOG(INFO) << "connected output to extra data source, which now becomes the new output";
DLOG(INFO) << "connected output to sensor data source, which now becomes the new output";
output = sensor_data_source();
}

View File

@ -18,8 +18,8 @@
#ifndef GNSS_SDR_FILE_SOURCE_BASE_H
#define GNSS_SDR_FILE_SOURCE_BASE_H
#include "../../libs/sensor_data/sensor_data_source.h"
#include "concurrent_queue.h"
#include "sensor_data_source.h"
#include "signal_source_base.h"
#include <gnuradio/blocks/file_sink.h> // for dump
#include <gnuradio/blocks/file_source.h>

View File

@ -20,11 +20,6 @@ if(ENABLE_ION)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} ion_gsms.h)
endif()
if (ENABLE_SENSOR_DATA)
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} sensor_data_source.cc)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} sensor_data_source.h)
endif ()
set(SIGNAL_SOURCE_GR_BLOCKS_SOURCES
fifo_reader.cc
unpack_byte_2bit_samples.cc