From ae61ca47bafb7d05a4cfadea8e0d279db5191096 Mon Sep 17 00:00:00 2001 From: tempate Date: Wed, 11 Oct 2023 12:37:20 +0200 Subject: [PATCH] Minor fixes Signed-off-by: tempate --- ddspipe_core/include/ddspipe_core/core/DdsPipe.hpp | 14 +++++++------- .../reader/auxiliar/BaseReader.hpp | 12 ++++++------ .../writer/auxiliar/BaseWriter.hpp | 6 +++--- .../src/cpp/reader/rtps/CommonReader.cpp | 3 --- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/ddspipe_core/include/ddspipe_core/core/DdsPipe.hpp b/ddspipe_core/include/ddspipe_core/core/DdsPipe.hpp index 0b4cb1c2..91a4f22d 100644 --- a/ddspipe_core/include/ddspipe_core/core/DdsPipe.hpp +++ b/ddspipe_core/include/ddspipe_core/core/DdsPipe.hpp @@ -333,6 +333,13 @@ class DdsPipe */ void deactivate_all_topics_nts_() noexcept; + ////////////////////////// + // CONFIGURATION VARIABLES + ////////////////////////// + + //! Configuration of the DDS Pipe + DdsPipeConfiguration configuration_; + ///////////////////////// // SHARED DATA STORAGE ///////////////////////// @@ -403,13 +410,6 @@ class DdsPipe * @brief Internal mutex for concurrent calls */ mutable std::mutex mutex_; - - ////////////////////////// - // CONFIGURATION VARIABLES - ////////////////////////// - - //! Configuration of the DDS Pipe - DdsPipeConfiguration configuration_; }; } /* namespace core */ diff --git a/ddspipe_participants/include/ddspipe_participants/reader/auxiliar/BaseReader.hpp b/ddspipe_participants/include/ddspipe_participants/reader/auxiliar/BaseReader.hpp index 2c333569..be9d437c 100644 --- a/ddspipe_participants/include/ddspipe_participants/reader/auxiliar/BaseReader.hpp +++ b/ddspipe_participants/include/ddspipe_participants/reader/auxiliar/BaseReader.hpp @@ -215,6 +215,12 @@ class BaseReader : public core::IReader //! Participant parent ID const core::types::ParticipantId participant_id_; + // Max reception rate + float max_rx_rate_; + + //! Downsampling value + unsigned int downsampling_; + //! Lambda to call the callback whenever a new data arrives std::function on_data_available_lambda_; @@ -227,12 +233,6 @@ class BaseReader : public core::IReader //! Mutex that guards every access to the Reader mutable std::recursive_mutex mutex_; - // Max reception rate - float max_rx_rate_; - - //! Downsampling value - unsigned int downsampling_; - //! Counter used to keep only 1 sample of every N received, with N being the topic's downsampling factor. unsigned int downsampling_idx_ = 0; diff --git a/ddspipe_participants/include/ddspipe_participants/writer/auxiliar/BaseWriter.hpp b/ddspipe_participants/include/ddspipe_participants/writer/auxiliar/BaseWriter.hpp index 1a260437..bfef291a 100644 --- a/ddspipe_participants/include/ddspipe_participants/writer/auxiliar/BaseWriter.hpp +++ b/ddspipe_participants/include/ddspipe_participants/writer/auxiliar/BaseWriter.hpp @@ -145,15 +145,15 @@ class BaseWriter : public core::IWriter //! Participant parent ID const core::types::ParticipantId participant_id_; + // Max transmission rate + float max_tx_rate_; + //! Whether the Writer is currently enabled std::atomic enabled_; //! Mutex that guards every access to the Writer mutable std::recursive_mutex mutex_; - // Max transmission rate - float max_tx_rate_; - //! Timestamp of the last sent message. utils::Timestamp last_sent_ts_ = utils::the_beginning_of_time(); diff --git a/ddspipe_participants/src/cpp/reader/rtps/CommonReader.cpp b/ddspipe_participants/src/cpp/reader/rtps/CommonReader.cpp index c1d22444..626d1043 100644 --- a/ddspipe_participants/src/cpp/reader/rtps/CommonReader.cpp +++ b/ddspipe_participants/src/cpp/reader/rtps/CommonReader.cpp @@ -255,9 +255,6 @@ void CommonReader::enable_nts_() noexcept bool CommonReader::should_accept_change_( const fastrtps::rtps::CacheChange_t* change) noexcept { - // Get reception timestamp - auto now = utils::now(); - // Reject samples sent by a Writer from the same Participant this Reader belongs to if (come_from_this_participant_(change)) {