Skip to content

Commit

Permalink
Apply suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: tempate <[email protected]>
  • Loading branch information
Tempate committed Oct 26, 2023
1 parent a01b26c commit 93747c3
Show file tree
Hide file tree
Showing 15 changed files with 104 additions and 149 deletions.
3 changes: 3 additions & 0 deletions ddsreplayer/test/blackbox/mcap/resources/config_file.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
builtin-topics:
- name: "/dds/topic"
type: "HelloWorld"

topics:
- name: /dds/topic
qos:
reliability: true # Use QoS RELIABLE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
builtin-topics:
- name: /dds/topic
type: HelloWorld

topics:
- name: /dds/topic
qos:
reliability: true # Use QoS RELIABLE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
builtin-topics:
- name: /dds/topic
type: HelloWorld

topics:
- name: /dds/topic
qos:
reliability: true # Use QoS RELIABLE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
builtin-topics:
- name: /dds/topic
type: HelloWorld

topics:
- name: /dds/topic
qos:
reliability: true # Use QoS RELIABLE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
builtin-topics:
- name: /dds/topic
type: HelloWorld

topics:
- name: /dds/topic
qos:
reliability: true # Use QoS RELIABLE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
builtin-topics:
- name: /dds/topic
type: HelloWorld

topics:
- name: /dds/topic
qos:
reliability: true # Use QoS RELIABLE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
builtin-topics:
- name: /dds/topic
type: HelloWorld

topics:
- name: /dds/topic
qos:
reliability: true # Use QoS RELIABLE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
builtin-topics:
- name: /dds/topic
type: HelloWorld

topics:
- name: /dds/topic
qos:
reliability: true # Use QoS RELIABLE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
builtin-topics:
- name: /dds/topic
type: HelloWorld

topics:
- name: /dds/topic
qos:
reliability: true # Use QoS RELIABLE

Expand Down
2 changes: 1 addition & 1 deletion docs/rst/notes/forthcoming_version.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ Next release will include the following **DDS Recorder tool configuration featur
* Allow disabling the storage of received types (see :ref:`Record Types <recorder_usage_configuration_recordtypes>`).
* New configuration options (``timestamp-format`` and ``local-timestamp``) available for :ref:`output file <recorder_usage_configuration_outputfile>` settings.
* New configuration option (``max-tx-rate``) to configure the :ref:`Max transmission rate <replayer_usage_configuration_max_tx_rate>`).
* New configuration option (``topics``) to configure the :ref:`Topics <recorder_manual_topics>`).
* New configuration option (``topics``) to configure the :ref:`Manual Topics <recorder_manual_topics>`).
* Rename ``max-reception-rate`` to ``max-rx-rate``.
2 changes: 1 addition & 1 deletion docs/rst/recording/remote_control/remote_control.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Therefore, any user can create his own application to control the |ddsrecorder|
.. note::

Status and command topics are not blocked by default, i.e. messages on this topics will be recorded if listening on the same domain the controller is launched.
If willing to avoid this, include these topics in the :ref:`blocklist <recorder_topic_filtering_blocklist>`:
If willing to avoid this, include these topics in the :ref:`blocklist <recorder_topic_filtering>`:

.. code-block:: yaml
Expand Down
109 changes: 36 additions & 73 deletions docs/rst/recording/usage/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Built-in Topics

The discovery phase can be accelerated by listing topics under the ``builtin-topics`` tag.
The |ddsrecorder| will create the DataWriters and DataReaders for these topics in the |ddsrecorder| initialization.
The :ref:`Topic QoS <recorder_topic_qos>` for these topics can be manually configured with a :ref:`Manual Topic <recorder_manual_topics>`; if a :ref:`Topic QoS <recorder_topic_qos>` is not configured, it will take its default value.
The :ref:`Topic QoS <recorder_topic_qos>` for these topics can be manually configured with the :ref:`Manual Topic <recorder_manual_topics>` and with the :ref:`Specs Topic QoS <recorder_specs_topic_qos>`; if a :ref:`Topic QoS <recorder_topic_qos>` is not configured, it will take its default value.

The ``builtin-topics`` must specify a ``name`` and ``type`` without wildcard characters.

Expand All @@ -55,91 +55,46 @@ The ``builtin-topics`` must specify a ``name`` and ``type`` without wildcard cha
.. _recorder_topic_filtering:

Topic Filtering
^^^^^^^^^^^^^^^
---------------

The |ddsrecorder| includes a mechanism to automatically detect which topics are being used in a DDS network.
By automatically detecting these topics, a |ddsrecorder| creates internal DDS :term:`Readers<DataReader>` for each topic in order to record the data published on each discovered topic.
The |ddsrecorder| automatically detects the topics that are being used in a DDS Network.
The |ddsrecorder| then creates internal DDS :term:`Readers<DataReader>` to record the data published on each topic.

.. note::

|ddsrecorder| entities are created with the QoS of the first Publisher/Subscriber found in this Topic, unless manually set in the :ref:`built-in topics <recorder_builtin_topics>` list.

|ddsrecorder| allows filtering of DDS :term:`Topics<Topic>`, that is, it allows to define the DDS Topics' data that is going to be recorded by the application.
This way, it is possible to define a set of rules in |ddsrecorder| to filter those data samples the user does not wish to save.

It is not mandatory to define such set of rules in the configuration file.
In this case, a |ddsrecorder| will save all the data published under the topics that it automatically discovers within the DDS network to which it connects.

To define these data filtering rules based on the Topics to which they belong, the following lists are available:

* Allowed topics list (``allowlist``)
* Block topics list (``blocklist``)

These lists of topics stated above are defined by a tag in the *YAML* configuration file, which defines a *YAML* vector (``[]``).
This vector contains the list of topics for each filtering rule.
Each Topic is determined by its entries ``name`` and ``type``, with only the first one being mandatory.

.. list-table::
:header-rows: 1

* - Topic entries
- Data type
- Default value
|ddsrecorder| entities are created with the :ref:`Topic QoS <recorder_topic_qos>` of the first Subscriber found on the Topic.

* - ``name``
- ``string``
- \-
The |ddsrouter| allows filtering DDS :term:`Topics<Topic>` to allow users to configure the DDS :term:`Topics<Topic>` that must be recorded.
These data filtering rules can be configured under the ``allowlist`` and ``blocklist`` tags.
If the ``allowlist`` and ``blocklist`` are not configured, the |ddsrecorder| will recorded the data published on every topic it discovers.
If both the ``allowlist`` and ``blocklist`` are configured and a topic appears in both of them, the ``blocklist`` has priority and the topic will be blocked.

* - ``type``
- ``string``
- ``"*"``

See :term:`Topic` section for further information about the topic.
Topics are determined by the tags ``name`` (required) and ``type``, both of which accept wildcard characters.

.. note::

Placing quotation marks around values in a YAML file is generally optional.
However, values containing wildcard characters must be enclosed by single or double quotation marks.
Placing quotation marks around values in a YAML file is generally optional, but values containing wildcard characters do require single or double quotation marks.

Allow topic list
""""""""""""""""
This is the list of topics that |ddsrecorder| will record, i.e. the data published under the topics matching the expressions in the ``allowlist`` will be saved by |ddsrecorder|.

.. note::
Consider the following example:

If no ``allowlist`` is provided, data will be recorded for all topics (unless filtered out in ``blocklist``).

.. _recorder_topic_filtering_blocklist:
.. code-block:: yaml
Block topic list
""""""""""""""""
This is the list of topics that the |ddsrecorder| will block, that is, all data published under the topics matching the filters specified in the ``blocklist`` will be discarded by the |ddsrecorder| and therefore will not be recorded.
allowlist:
- name: AllowedTopic1
type: Allowed
This list takes precedence over the ``allowlist``.
If a topic matches an expression both in the ``allowlist`` and in the ``blocklist``, the ``blocklist`` takes precedence, causing the data under this topic to be discarded.
- name: AllowedTopic2
type: "*"
**Example of usage - Allowlist and blocklist collision:**
- name: HelloWorldTopic
type: HelloWorld
In the following example, the ``HelloWorldTopic`` topic is both in the ``allowlist`` and (implicitly) in the
``blocklist``, so according to the ``blocklist`` preference rule this topic is blocked.
Moreover, only the topics present in the allowlist are relayed, regardless of whether more topics are dynamically
discovered in the DDS network.
In this case the forwarded topics are ``AllowedTopic1`` with data type ``Allowed``
and ``AllowedTopic2`` regardless of its data type.
blocklist:
- name: "*"
type: HelloWorld
.. code-block:: yaml
allowlist:
- name: AllowedTopic1
type: Allowed
- name: AllowedTopic2
type: "*"
- name: HelloWorldTopic
type: HelloWorld
blocklist:
- name: "*"
type: HelloWorld
In this example, the data published in the topic ``AllowedTopic1`` with type ``Allowed`` and in the topic ``AllowedTopic2`` with any type will be recorded by the |ddsrecorder|.
The data published in the topic ``HelloWorldTopic`` with type ``HelloWorld`` will be blocked, since the ``blocklist`` is blocking all topics with any name and with type ``HelloWorld``.

.. _recorder_topic_qos:

Expand Down Expand Up @@ -190,7 +145,7 @@ For more information on topics, please read the `Fast DDS Topic <https://fast-dd

* - History Depth
- ``history-depth``
- *integer*
- *unsigned integer*
- ``5000``
- :ref:`recorder_history_depth`

Expand Down Expand Up @@ -245,8 +200,6 @@ The tag ``topics`` has a required ``name`` tag that accepts wildcard characters.
It also has two optional tags: a ``type`` tag that accepts wildcard characters, and a ``qos`` tag with the :ref:`Topic QoS <recorder_topic_qos>` that the user wants to manually configure.
If a ``qos`` is not manually configured, it will get its value by discovery.

**Example of usage**

.. code-block:: yaml
topics:
Expand All @@ -256,6 +209,10 @@ If a ``qos`` is not manually configured, it will get its value by discovery.
max-rx-rate: 15
downsampling: 2
.. note::

The :ref:`Topic QoS <recorder_topic_qos>` configured in the Manual Topics take precedence over the :ref:`Specs Topic QoS <recorder_specs_topic_qos>`.

.. _recorder_usage_configuration_domain_id:

DDS Domain
Expand Down Expand Up @@ -588,11 +545,17 @@ As explained in :ref:`Event Window <recorder_usage_configuration_event_window>`,
To accomplish this, received samples are stored in memory until the aforementioned event is triggered and, in order to limit memory consumption, outdated (received more than ``event-window`` seconds ago) samples are removed from this buffer every ``cleanup-period`` seconds.
By default, its value is equal to twice the ``event-window``.

.. _recorder_specs_topic_qos:

QoS
^^^

``specs`` supports a ``qos`` **optional** tag to configure the default values of the :ref:`Topic QoS <recorder_topic_qos>`.

.. note::

The :ref:`Topic QoS <recorder_topic_qos>` configured in ``specs`` can be overwritten by the :ref:`Manual Topics <recorder_manual_topics>`.

.. _recorder_usage_configuration_general_example:

General Example
Expand Down
Loading

0 comments on commit 93747c3

Please sign in to comment.