1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-09-08 05:46:02 +00:00

fix: fixed timetag handling in PVT block & updated some comments

This commit is contained in:
Victor Castillo
2025-06-09 18:58:05 +02:00
committed by Carles Fernandez
parent 131cc2ce93
commit 13c6785ba1
11 changed files with 21 additions and 25 deletions

View File

@@ -2006,7 +2006,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
{ {
std::vector<gr::tag_t> tags_vec; std::vector<gr::tag_t> tags_vec;
// time tag from obs to pvt is always propagated in channel 0 // time tag from obs to pvt is always propagated in channel 0
this->get_tags_in_range(tags_vec, 0, this->nitems_read(0), this->nitems_read(0) + noutput_items); this->get_tags_in_range(tags_vec, 0, this->nitems_read(0), this->nitems_read(0) + noutput_items, pmt::mp("timetag"));
for (const auto& it : tags_vec) for (const auto& it : tags_vec)
{ {
try try

View File

@@ -1,6 +1,6 @@
/*! /*!
* \file sensor_data_file.cc * \file sensor_data_aggregator.cc
* \brief Provides a simple abstraction for reading contiguous binary data from a file * \brief Aggregates sensor samples from gnu radio stream tags into typed lists for easy access
* \author Victor Castillo, 2024. victorcastilloaguero(at).gmail.es * \author Victor Castillo, 2024. victorcastilloaguero(at).gmail.es
* *
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
/*! /*!
* \file sensor_data_aggregator.h * \file sensor_data_aggregator.h
* \brief GNURadio block that adds extra data to the sample stream. * \brief Aggregates sensor samples from gnu radio stream tags into typed lists for easy access
* \author Victor Castillo, 2024. victorcastilloaguero(at).gmail.es * \author Victor Castillo, 2024. victorcastilloaguero(at).gmail.es
* *
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
@@ -24,9 +24,9 @@
#include <string> #include <string>
#include <vector> #include <vector>
/** \addtogroup Signal_Source /** \addtogroup Algorithms_Library
* \{ */ * \{ */
/** \addtogroup Signal_Source_libs /** \addtogroup Algorithm_libs algorithms_libs
* \{ */ * \{ */
template <typename DataType> template <typename DataType>

View File

@@ -17,6 +17,9 @@
#include "sensor_data_file.h" #include "sensor_data_file.h"
#include <cstring> #include <cstring>
static const std::size_t IO_BUFFER_MAX_SIZE = 1024;
SensorDataFile::SensorDataFile( SensorDataFile::SensorDataFile(
const std::string& path, const std::string& path,
const std::size_t& sample_delay, const std::size_t& sample_delay,
@@ -34,7 +37,7 @@ SensorDataFile::SensorDataFile(
done_(false), done_(false),
chunks_read_(0), chunks_read_(0),
last_sample_stamp_(sample_delay), last_sample_stamp_(sample_delay),
io_buffer_size_(item_size * IO_BUFFER_CAPACITY), io_buffer_size_(item_size * IO_BUFFER_MAX_SIZE),
offset_in_io_buffer_(io_buffer_size_) // Set to end of buffer so that first look up will trigger a read. offset_in_io_buffer_(io_buffer_size_) // Set to end of buffer so that first look up will trigger a read.
{ {
file_.seekg(offset_in_file_, std::ios_base::beg); file_.seekg(offset_in_file_, std::ios_base::beg);

View File

@@ -25,16 +25,14 @@
#include <string> #include <string>
#include <vector> #include <vector>
/** \addtogroup Signal_Source /** \addtogroup Algorithms_Library
* \{ */ * \{ */
/** \addtogroup Signal_Source_libs /** \addtogroup Algorithm_libs algorithms_libs
* \{ */ * \{ */
class SensorDataFile class SensorDataFile
{ {
static constexpr std::size_t IO_BUFFER_CAPACITY = 1024;
public: public:
using sptr = std::shared_ptr<SensorDataFile>; using sptr = std::shared_ptr<SensorDataFile>;
using id_type = std::size_t; using id_type = std::size_t;
@@ -60,7 +58,6 @@ private:
void read_into_item_buffer(std::vector<uint8_t>& item_buf); void read_into_item_buffer(std::vector<uint8_t>& item_buf);
private:
std::string path_; std::string path_;
std::ifstream file_; std::ifstream file_;
std::size_t sample_delay_; std::size_t sample_delay_;

View File

@@ -25,11 +25,10 @@
#include <gnuradio/types.h> // for gr_vector_const_void_star #include <gnuradio/types.h> // for gr_vector_const_void_star
#include <cstddef> // for size_t #include <cstddef> // for size_t
#include <cstdint> #include <cstdint>
#include <string>
/** \addtogroup Signal_Source /** \addtogroup Algorithms_Library
* \{ */ * \{ */
/** \addtogroup Signal_Source_gnuradio_blocks /** \addtogroup Algorithm_libs algorithms_libs
* \{ */ * \{ */
class SensorDataSource : public gr::sync_block class SensorDataSource : public gr::sync_block

View File

@@ -1,6 +1,6 @@
/*! /*!
* \file sensor_data_source_configuration.h * \file sensor_data_source_configuration.h
* \brief GNURadio block that adds extra data to the sample stream. * \brief
* \author Victor Castillo, 2024. victorcastilloaguero(at).gmail.es * \author Victor Castillo, 2024. victorcastilloaguero(at).gmail.es
* *
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
@@ -24,9 +24,9 @@
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
/** \addtogroup Signal_Source /** \addtogroup Algorithms_Library
* \{ */ * \{ */
/** \addtogroup Signal_Source_gnuradio_blocks /** \addtogroup Algorithm_libs algorithms_libs
* \{ */ * \{ */
using namespace std::string_literals; using namespace std::string_literals;

View File

@@ -16,7 +16,6 @@
#include "sensor_data_type.h" #include "sensor_data_type.h"
#include <pmt/pmt.h> #include <pmt/pmt.h>
#include <cstdint>
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>

View File

@@ -18,13 +18,12 @@
#ifndef GNSS_SDR_SENSOR_DATA_TYPE_H #ifndef GNSS_SDR_SENSOR_DATA_TYPE_H
#define GNSS_SDR_SENSOR_DATA_TYPE_H #define GNSS_SDR_SENSOR_DATA_TYPE_H
#include <cstdint>
#include <pmt/pmt.h> #include <pmt/pmt.h>
#include <string> #include <string>
/** \addtogroup Signal_Source /** \addtogroup Algorithms_Library
* \{ */ * \{ */
/** \addtogroup Signal_Source_libs /** \addtogroup Algorithm_libs algorithms_libs
* \{ */ * \{ */
struct SensorDataType struct SensorDataType

View File

@@ -16,7 +16,6 @@
#include "sensor_identifier.h" #include "sensor_identifier.h"
#include "sensor_data_type.h" #include "sensor_data_type.h"
#include <iostream>
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>

View File

@@ -21,9 +21,9 @@
#include "sensor_data_type.h" #include "sensor_data_type.h"
#include <string> #include <string>
/** \addtogroup Signal_Source /** \addtogroup Algorithms_Library
* \{ */ * \{ */
/** \addtogroup Signal_Source_libs /** \addtogroup Algorithm_libs algorithms_libs
* \{ */ * \{ */
struct SensorIdentifier struct SensorIdentifier