diff --git a/ddspipe_core/include/ddspipe_core/communication/dds/DdsBridge.hpp b/ddspipe_core/include/ddspipe_core/communication/dds/DdsBridge.hpp index 734cf650..e1af73ec 100644 --- a/ddspipe_core/include/ddspipe_core/communication/dds/DdsBridge.hpp +++ b/ddspipe_core/include/ddspipe_core/communication/dds/DdsBridge.hpp @@ -20,8 +20,8 @@ #include #include #include -#include #include +#include namespace eprosima { namespace ddspipe { diff --git a/ddspipe_core/include/ddspipe_core/types/dds/TopicQoS.hpp b/ddspipe_core/include/ddspipe_core/types/dds/TopicQoS.hpp index c4ba9322..8f6634da 100644 --- a/ddspipe_core/include/ddspipe_core/types/dds/TopicQoS.hpp +++ b/ddspipe_core/include/ddspipe_core/types/dds/TopicQoS.hpp @@ -39,12 +39,23 @@ using HistoryDepthType = unsigned int; using OwnershipQosPolicyKind = eprosima::fastdds::dds::OwnershipQosPolicyKind; /** - * Collection of QoS related with a Topic. + * The collection of QoS related to a Topic. + * + * The Topic QoS are: + * - Durability + * - Reliability + * - Ownership + * - Partitions + * - Keyed + * - History Depth + * - Max Transmission Rate + * - Max Reception Rate + * - Downsampling * * @warning partitions are considered a Topic QoS. A Topic can then only either have partitions or not have them, but it * cannot support empty partitions. * - * @todo add keys to Topic QoS + * @todo create a child of TopicQoS called DdsTopicQoS that contains the QoS specific to DDS. */ struct TopicQoS diff --git a/ddspipe_participants/include/ddspipe_participants/reader/dds/CommonReader.hpp b/ddspipe_participants/include/ddspipe_participants/reader/dds/CommonReader.hpp index 797924ca..32af8a84 100644 --- a/ddspipe_participants/include/ddspipe_participants/reader/dds/CommonReader.hpp +++ b/ddspipe_participants/include/ddspipe_participants/reader/dds/CommonReader.hpp @@ -137,7 +137,7 @@ class CommonReader : public BaseReader, public fastdds::dds::DataReaderListener reckon_reader_qos_() const; //! Whether a change received should be processed - virtual bool should_accept_change_( + virtual bool should_accept_sample_( const fastdds::dds::SampleInfo& info) noexcept; virtual void fill_received_data_( diff --git a/ddspipe_participants/src/cpp/reader/dds/CommonReader.cpp b/ddspipe_participants/src/cpp/reader/dds/CommonReader.cpp index 78d35848..70c281a1 100644 --- a/ddspipe_participants/src/cpp/reader/dds/CommonReader.cpp +++ b/ddspipe_participants/src/cpp/reader/dds/CommonReader.cpp @@ -144,8 +144,8 @@ utils::ReturnCode CommonReader::take_nts_( return ret; } - // Check if the change is acceptable - if (should_accept_change_(info)) + // Check if the sample is acceptable + if (should_accept_sample_(info)) { break; } @@ -221,7 +221,7 @@ fastdds::dds::DataReaderQos CommonReader::reckon_reader_qos_() const return qos; } -bool CommonReader::should_accept_change_( +bool CommonReader::should_accept_sample_( const fastdds::dds::SampleInfo& info) noexcept { // Reject samples sent by a Writer from the same Participant this Reader belongs to @@ -232,7 +232,7 @@ bool CommonReader::should_accept_change_( return false; } - return should_accept_sample_(); + return BaseReader::should_accept_sample_(); } void CommonReader::fill_received_data_( diff --git a/ddspipe_yaml/include/ddspipe_yaml/YamlReader.hpp b/ddspipe_yaml/include/ddspipe_yaml/YamlReader.hpp index d32787af..3a7b94f7 100644 --- a/ddspipe_yaml/include/ddspipe_yaml/YamlReader.hpp +++ b/ddspipe_yaml/include/ddspipe_yaml/YamlReader.hpp @@ -56,7 +56,7 @@ enum YamlReaderVersion V_1_0, /** - * @brief Version 2.0 + * @brief Version 2.0 * * @version 0.3.0 * @@ -68,7 +68,7 @@ enum YamlReaderVersion V_2_0, /** - * @brief Version 3.0 + * @brief Version 3.0 * * @version 0.4.0 * @@ -78,7 +78,7 @@ enum YamlReaderVersion V_3_0, /** - * @brief Latest version. + * @brief Version 3.1. * * @version 0.5.0 * @@ -87,6 +87,21 @@ enum YamlReaderVersion */ V_3_1, + /** + * @brief Latest version. + * + * @version 0.6.0 + * + * - Forwarding Routes. + * - Remove Unused Entities. + * - Manual Topics. + * - Max Transmission Rate. + * - Max Reception Rate. + * - Downsampling. + * - Rename the `max-depth` under the `specs` tag to `history-depth`. + */ + V_4_0, + /** * @brief Main version. * diff --git a/ddspipe_yaml/include/ddspipe_yaml/yaml_configuration_tags.hpp b/ddspipe_yaml/include/ddspipe_yaml/yaml_configuration_tags.hpp index b54402da..29702841 100644 --- a/ddspipe_yaml/include/ddspipe_yaml/yaml_configuration_tags.hpp +++ b/ddspipe_yaml/include/ddspipe_yaml/yaml_configuration_tags.hpp @@ -27,6 +27,7 @@ constexpr const char* VERSION_TAG_V_1_0("v1.0"); //! Version v1.0 constexpr const char* VERSION_TAG_V_2_0("v2.0"); //! Version v2.0 constexpr const char* VERSION_TAG_V_3_0("v3.0"); //! Version v3.0 constexpr const char* VERSION_TAG_V_3_1("v3.1"); //! Version v3.1 +constexpr const char* VERSION_TAG_V_4_0("v4.0"); //! Version v4.0 // Topics related tags constexpr const char* ALLOWLIST_TAG("allowlist"); //! List of allowed topics @@ -136,10 +137,10 @@ constexpr const char* TOPIC_ROUTES_TAG("topic-routes"); // Topic specific forwar // Advanced configuration constexpr const char* SPECS_TAG("specs"); //! Specs options for DDS Router configuration +constexpr const char* SPECS_QOS_TAG("qos"); //! Global Topic QoS constexpr const char* NUMBER_THREADS_TAG("threads"); //! Number of threads to configure the thread pool constexpr const char* WAIT_ALL_ACKED_TIMEOUT_TAG("wait-all-acked-timeout"); //! Wait for a maximum of *wait-all-acked-timeout* ms until all msgs sent by reliable writers are acknowledged by their matched readers constexpr const char* REMOVE_UNUSED_ENTITIES_TAG("remove-unused-entities"); //! Dynamically create and delete entities and tracks. -constexpr const char* SPECS_QOS_TAG("qos"); //! Global Topic QoS // XML configuration tags constexpr const char* XML_TAG("xml"); //! Tag to read xml configuration diff --git a/ddspipe_yaml/src/cpp/YamlReader_types.cpp b/ddspipe_yaml/src/cpp/YamlReader_types.cpp index 10a9bd2a..3ac08602 100644 --- a/ddspipe_yaml/src/cpp/YamlReader_types.cpp +++ b/ddspipe_yaml/src/cpp/YamlReader_types.cpp @@ -96,6 +96,7 @@ YamlReaderVersion YamlReader::get( {VERSION_TAG_V_2_0, YamlReaderVersion::V_2_0}, {VERSION_TAG_V_3_0, YamlReaderVersion::V_3_0}, {VERSION_TAG_V_3_1, YamlReaderVersion::V_3_1}, + {VERSION_TAG_V_4_0, YamlReaderVersion::V_4_0}, }); } @@ -411,13 +412,13 @@ void YamlReader::fill( // Max Transmission Rate optional if (is_tag_present(yml, QOS_MAX_TX_RATE_TAG)) { - object.max_tx_rate.set_value(get(yml, QOS_MAX_TX_RATE_TAG, version)); + object.max_tx_rate.set_value(get_nonnegative_float(yml, QOS_MAX_TX_RATE_TAG)); } // Max Reception Rate optional if (is_tag_present(yml, QOS_MAX_RX_RATE_TAG)) { - object.max_rx_rate.set_value(get(yml, QOS_MAX_RX_RATE_TAG, version)); + object.max_rx_rate.set_value(get_nonnegative_float(yml, QOS_MAX_RX_RATE_TAG)); } // Downsampling optional