diff --git a/.github/actions/install-python-packages/action.yml b/.github/actions/install-python-packages/action.yml index 9bc4281e9..7d4809b28 100644 --- a/.github/actions/install-python-packages/action.yml +++ b/.github/actions/install-python-packages/action.yml @@ -6,17 +6,17 @@ runs: - id: install-python-packages run: | sudo pip3 install -U \ - sphinx==3.0.3 \ - doc8==0.8.0 \ - sphinx_rtd_theme==0.4.3 \ - sphinxcontrib.spelling==5.0.0 \ + sphinx==4.3.1 \ + doc8==0.10.1 \ + sphinx_rtd_theme==0.5.2 \ + sphinxcontrib.spelling==7.2.1 \ sphinxcontrib-imagehelper==1.1.1 \ sphinx-tabs==3.2.0 \ colcon-common-extensions \ colcon-mixin \ vcstool \ - GitPython \ - setuptools \ + GitPython==3.1.24 \ + setuptools==58.2.0 \ gcovr==5.0 \ pyyaml \ jsonschema diff --git a/ddsrouter_yaml/src/cpp/YamlReader.cpp b/ddsrouter_yaml/src/cpp/YamlReader.cpp index ae0bbb3c7..9ee0ae9e9 100644 --- a/ddsrouter_yaml/src/cpp/YamlReader.cpp +++ b/ddsrouter_yaml/src/cpp/YamlReader.cpp @@ -897,9 +897,11 @@ YamlReader::get>( return std::make_shared( YamlReader::get(yml, version)); + case types::ParticipantKind::invalid: default: + std::string invalid_kind = YamlReader::get(yml, PARTICIPANT_KIND_TAG, version); throw eprosima::utils::ConfigurationException( - utils::Formatter() << "Unkown or non valid Participant kind:" << kind << "."); + utils::Formatter() << "Unkown or non valid Participant kind: " << invalid_kind << "."); break; } } diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index e29afca81..b6e68a124 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -53,3 +53,9 @@ compile_documentation() compile_test_documentation( "${PROJECT_SOURCE_DIR}/test" # Test directory ) + +############################################################################### +# Packaging +############################################################################### +# Install package +eprosima_packaging() diff --git a/docs/README.md b/docs/README.md index 9f199667f..c05282015 100644 --- a/docs/README.md +++ b/docs/README.md @@ -22,6 +22,7 @@ sudo apt install -y \ python3-venv \ python3-sphinxcontrib.spelling \ imagemagick +pip3 install -U -r src/ddsrouter/docs/requirements.txt ``` ### Build documentation diff --git a/docs/requirements.txt b/docs/requirements.txt index 51aead2f5..ed0266f31 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,7 @@ doc8==0.10.1 docutils==0.16.0 GitPython==3.1.24 -setuptools==59.4.0 +setuptools==58.2.0 sphinx_rtd_theme==0.5.2 sphinx-tabs==3.2.0 sphinx==4.3.1 diff --git a/docs/resources/examples/echo.yaml b/docs/resources/examples/echo.yaml index 77e75bae3..5c174adc6 100644 --- a/docs/resources/examples/echo.yaml +++ b/docs/resources/examples/echo.yaml @@ -30,10 +30,13 @@ participants: ################################## # ECHO PARTICIPANT -# This Participant will print in stdout every message received by the other Participants +# This Participant will print in stdout every message received by the other Participants, as well as discovery information - name: EchoParticipant # 6 kind: echo # 7 + discovery: true # 8 + data: true # 9 + verbose: true # 10 ################################## @@ -41,7 +44,7 @@ participants: # This configuration example configures a DDS Router to listen to every message published in domain 0 in topics # HelloWorldTopic (from Fast DDS HelloWorld) and rt/chatter from ROS2 demo_nodes, and to print the received -# messages in stdout. +# messages in stdout. Information regarding discovery events is also printed to stdout. # 0: Use YAML configuration version v3.0 @@ -59,4 +62,9 @@ participants: # 6: New Participant with name . # 7: Kind of EchoParticipant: . -# Prints in stdout every message received by the router, together with the source GUID, timestamp and Topic. + +# 8: Print a trace to stdout every time an Endpoint is discovered. + +# 9: Print a trace to stdout every time a new data message arrives to the router. + +# 10: Display verbose information regarding received messages (receiver endpoint_guid and data payload). diff --git a/docs/rst/developer_manual/installation/sources/linux.rst b/docs/rst/developer_manual/installation/sources/linux.rst index c2df2882a..b8ba2f32a 100644 --- a/docs/rst/developer_manual/installation/sources/linux.rst +++ b/docs/rst/developer_manual/installation/sources/linux.rst @@ -261,68 +261,86 @@ Local installation .. code-block:: bash - mkdir ~/DDS-Router + mkdir -p ~/DDS-Router/src + mkdir -p ~/DDS-Router/build + cd ~/DDS-Router + wget https://raw.githubusercontent.com/eProsima/DDS-Router/main/ddsrouter.repos + vcs import src < ddsrouter.repos -#. Clone the following dependencies and compile them using CMake_. +#. Compile all dependencies using CMake_. * `Foonathan memory `_ .. code-block:: bash cd ~/DDS-Router - git clone https://github.com/eProsima/foonathan_memory_vendor.git - mkdir foonathan_memory_vendor/build - cd foonathan_memory_vendor/build - cmake .. -DCMAKE_INSTALL_PREFIX=~/DDS-Router/install -DBUILD_SHARED_LIBS=ON + mkdir build/foonathan_memory_vendor + cd build/foonathan_memory_vendor + cmake ~/DDS-Router/src/foonathan_memory_vendor -DCMAKE_INSTALL_PREFIX=~/DDS-Router/install -DBUILD_SHARED_LIBS=ON cmake --build . --target install - * `Fast CDR `_ + * `Fast CDR `_ .. code-block:: bash cd ~/DDS-Router - git clone https://github.com/eProsima/Fast-CDR.git - mkdir Fast-CDR/build - cd Fast-CDR/build - cmake .. -DCMAKE_INSTALL_PREFIX=~/DDS-Router/install + mkdir build/fastcdr + cd build/fastcdr + cmake ~/DDS-Router/src/fastcdr -DCMAKE_INSTALL_PREFIX=~/DDS-Router/install cmake --build . --target install - * `Fast DDS `_ + * `Fast DDS `_ .. code-block:: bash cd ~/DDS-Router - git clone https://github.com/eProsima/Fast-DDS.git - mkdir Fast-DDS/build - cd Fast-DDS/build - cmake .. -DCMAKE_INSTALL_PREFIX=~/DDS-Router/install -DCMAKE_PREFIX_PATH=~/DDS-Router/install + mkdir build/fastdds + cd build/fastdds + cmake ~/DDS-Router/src/fastdds -DCMAKE_INSTALL_PREFIX=~/DDS-Router/install -DCMAKE_PREFIX_PATH=~/DDS-Router/install cmake --build . --target install - * `Dev Utils `_ + * `Dev Utils `_ .. code-block:: bash + # CMake Utils + cd ~/DDS-Router + mkdir build/cmake_utils + cd build/cmake_utils + cmake ~/DDS-Router/src/dev-utils/cmake_utils -DCMAKE_INSTALL_PREFIX=~/DDS-Router/install -DCMAKE_PREFIX_PATH=~/DDS-Router/install + cmake --build . --target install + + # C++ Utils cd ~/DDS-Router - git clone https://github.com/eProsima/dev-utils.git - mkdir dev-utils/build - cd dev-util/build - cmake ../cmake_utils -DCMAKE_INSTALL_PREFIX=~/DDS-Router/install -DCMAKE_PREFIX_PATH=~/DDS-Router/install - cmake ../cpp_utils -DCMAKE_INSTALL_PREFIX=~/DDS-Router/install -DCMAKE_PREFIX_PATH=~/DDS-Router/install + mkdir build/cpp_utils + cd build/cpp_utils + cmake ~/DDS-Router/src/dev-utils/cpp_utils -DCMAKE_INSTALL_PREFIX=~/DDS-Router/install -DCMAKE_PREFIX_PATH=~/DDS-Router/install cmake --build . --target install #. Once all dependencies are installed, install |ddsrouter|: .. code-block:: bash + # ddsrouter_core + cd ~/DDS-Router + mkdir build/ddsrouter_core + cd build/ddsrouter_core + cmake ~/DDS-Router/src/ddsrouter/ddsrouter_core -DCMAKE_INSTALL_PREFIX=~/DDS-Router/install -DCMAKE_PREFIX_PATH=~/DDS-Router/install + cmake --build . --target install + + # ddsrouter_yaml cd ~/DDS-Router - git clone https://github.com/eProsima/DDS-Router.git - mkdir DDS-Router/build - cd DDS-Router/build - cmake ../ddsrouter_core -DCMAKE_INSTALL_PREFIX=~/DDS-Router/install -DCMAKE_PREFIX_PATH=~/DDS-Router/install - cmake ../ddsrouter_yaml -DCMAKE_INSTALL_PREFIX=~/DDS-Router/install -DCMAKE_PREFIX_PATH=~/DDS-Router/install - cmake ../tools/ddsrouter_tool -DCMAKE_INSTALL_PREFIX=~/DDS-Router/install -DCMAKE_PREFIX_PATH=~/DDS-Router/install + mkdir build/ddsrouter_yaml + cd build/ddsrouter_yaml + cmake ~/DDS-Router/src/ddsrouter/ddsrouter_yaml -DCMAKE_INSTALL_PREFIX=~/DDS-Router/install -DCMAKE_PREFIX_PATH=~/DDS-Router/install cmake --build . --target install + # ddsrouter_tool + cd ~/DDS-Router + mkdir build/ddsrouter_tool + cd build/ddsrouter_tool + cmake ~/DDS-Router/src/ddsrouter/tools/ddsrouter_tool -DCMAKE_INSTALL_PREFIX=~/DDS-Router/install -DCMAKE_PREFIX_PATH=~/DDS-Router/install + cmake --build . --target install .. note:: diff --git a/docs/rst/developer_manual/installation/sources/windows.rst b/docs/rst/developer_manual/installation/sources/windows.rst index 4d0d98610..8c0b7f694 100644 --- a/docs/rst/developer_manual/installation/sources/windows.rst +++ b/docs/rst/developer_manual/installation/sources/windows.rst @@ -303,76 +303,91 @@ Local installation .. code-block:: bash mkdir \DDS-Router + mkdir \DDS-Router\src + mkdir \DDS-Router\build + cd \DDS-Router + wget https://raw.githubusercontent.com/eProsima/DDS-Router/main/ddsrouter.repos + vcs import src < ddsrouter.repos -#. Clone the following dependencies and compile them using CMake_. +#. Compile all dependencies using CMake_. * `Foonathan memory `_ .. code-block:: bash cd \DDS-Router - git clone https://github.com/eProsima/foonathan_memory_vendor.git - cd foonathan_memory_vendor - mkdir build - cd build - cmake .. -DCMAKE_INSTALL_PREFIX=\DDS-Router\install ^ + mkdir build\foonathan_memory_vendor + cd build\foonathan_memory_vendor + cmake \DDS-Router\src\foonathan_memory_vendor -DCMAKE_INSTALL_PREFIX=\DDS-Router\install ^ -DBUILD_SHARED_LIBS=ON cmake --build . --config Release --target install - * `Fast CDR `_ + * `Fast CDR `_ .. code-block:: bash cd \DDS-Router - git clone https://github.com/eProsima/Fast-CDR.git - cd Fast-CDR - mkdir build - cd build - cmake .. -DCMAKE_INSTALL_PREFIX=\DDS-Router\install + mkdir build\fastcdr + cd build\fastcdr + cmake \DDS-Router\src\fastcdr -DCMAKE_INSTALL_PREFIX=\DDS-Router\install cmake --build . --config Release --target install - * `Fast DDS `_ + * `Fast DDS `_ .. code-block:: bash cd \DDS-Router - git clone https://github.com/eProsima/Fast-DDS.git - cd Fast-DDS - mkdir build - cd build - cmake .. -DCMAKE_INSTALL_PREFIX=\DDS-Router\install ^ + mkdir build\fastdds + cd build\fastdds + cmake \DDS-Router\src\fastdds -DCMAKE_INSTALL_PREFIX=\DDS-Router\install ^ -DCMAKE_PREFIX_PATH=\DDS-Router\install cmake --build . --config Release --target install - * `Dev Utils `_ + * `Dev Utils `_ .. code-block:: bash - cd /DDS-Router - git clone https://github.com/eProsima/dev-utils.git - mkdir dev-utils/build - cd dev-util/build - cmake ../cmake_utils -DCMAKE_INSTALL_PREFIX=/DDS-Router/install -DCMAKE_PREFIX_PATH=/DDS-Router/install - cmake ../cpp_utils -DCMAKE_INSTALL_PREFIX=/DDS-Router/install -DCMAKE_PREFIX_PATH=/DDS-Router/install - cmake --build . --target install + # CMake Utils + cd \DDS-Router + mkdir build\cmake_utils + cd build\cmake_utils + cmake \DDS-Router\src\dev-utils\cmake_utils -DCMAKE_INSTALL_PREFIX=\DDS-Router\install ^ + -DCMAKE_PREFIX_PATH=\DDS-Router\install + cmake --build . --config Release --target install + + # C++ Utils + cd \DDS-Router + mkdir build\cpp_utils + cd build\cpp_utils + cmake \DDS-Router\src\dev-utils\cpp_utils -DCMAKE_INSTALL_PREFIX=\DDS-Router\install ^ + -DCMAKE_PREFIX_PATH=\DDS-Router\install + cmake --build . --config Release --target install #. Once all dependencies are installed, install |ddsrouter|: .. code-block:: bash + # ddsrouter_core cd \DDS-Router - git clone https://github.com/eProsima/DDS-Router.git - cd DDS-Router - mkdir build - cd build - cmake ../ddsrouter_core ^ - -DCMAKE_INSTALL_PREFIX=\DDS-Router\install ^ - -DCMAKE_PREFIX_PATH=\DDS-Router\install - cmake ../ddsrouter_yaml ^ - -DCMAKE_INSTALL_PREFIX=\DDS-Router\install ^ + mkdir build\ddsrouter_core + cd build\ddsrouter_core + cmake \DDS-Router\src\ddsrouter\ddsrouter_core ^ + -DCMAKE_INSTALL_PREFIX=\DDS-Router\install -DCMAKE_PREFIX_PATH=\DDS-Router\install + cmake --build . --config Release --target install + + # ddsrouter_yaml + cd \DDS-Router + mkdir build\ddsrouter_yaml + cd build\ddsrouter_yaml + cmake \DDS-Router\src\ddsrouter\ddsrouter_yaml -DCMAKE_INSTALL_PREFIX=\DDS-Router\install ^ -DCMAKE_PREFIX_PATH=\DDS-Router\install - cmake ../tools/ddsrouter_tool ^ - -DCMAKE_INSTALL_PREFIX=\DDS-Router\install ^ + cmake --build . --config Release --target install + + # ddsrouter_tool + cd \DDS-Router + mkdir build\ddsrouter_tool + cd build\ddsrouter_tool + cmake \DDS-Router\src\ddsrouter\tools\ddsrouter_tool -DCMAKE_INSTALL_PREFIX=\DDS-Router\install ^ -DCMAKE_PREFIX_PATH=\DDS-Router\install cmake --build . --config Release --target install diff --git a/docs/rst/examples/echo_example.rst b/docs/rst/examples/echo_example.rst index eb1de03d2..1eaebb33e 100644 --- a/docs/rst/examples/echo_example.rst +++ b/docs/rst/examples/echo_example.rst @@ -8,11 +8,12 @@ Echo Example The following YAML configuration file configures a DDS Router to create a :ref:`Simple Participant ` in :term:`Domain Id` ``0`` and an -:ref:`Echo Participant ` that will print in ``stdout`` every message get in Domain ``0``. +:ref:`Echo Participant ` that will print in ``stdout`` every message get in Domain ``0``, +as well as information regarding discovery events. .. literalinclude:: ../../resources/examples/echo.yaml :language: yaml - :lines: 5-36 + :lines: 5-39 Configuration ============= @@ -44,11 +45,12 @@ This Participant is configured with a name, a kind and the Domain Id, which is ` Echo Participant ---------------- -This Participant does not require further configuration than name and kind. +This Participant is configured to display information regarding messages received, as well as discovery events. +See :ref:`Echo Participant Configuration ` for more details. .. literalinclude:: ../../resources/examples/echo.yaml :language: yaml - :lines: 35-36 + :lines: 35-39 Execute example @@ -56,6 +58,11 @@ Execute example For a detailed explanation on how to execute the |ddsrouter|, refer to this :ref:`section `. +.. note:: + + Internal entities for a specific topic are only created once a data receiver (Reader/Subscriber) is discovered. + Hence, for these example to work, either substitute ``allowlist`` for :ref:`builtin-topics ` in the + configuration file, or launch a subscriber/listener in the same domain (``0``). Execute with Fast DDS HelloWorld Example ---------------------------------------- @@ -72,10 +79,11 @@ The expected output from the DDS Router, printed by the ``Echo Participant`` is: .. code-block:: console - Echo Participant: ParticipantId{EchoParticipant} has received from Endpoint: 01.0f.44.59.e6.de.2a.c8.01.00.00.00|0.0.1.3 in topic: Topic{HelloWorldTopic, HelloWorld} the following payload: - Echo Participant: ParticipantId{EchoParticipant} has received from Endpoint: 01.0f.44.59.e6.de.2a.c8.01.00.00.00|0.0.1.3 in topic: Topic{HelloWorldTopic, HelloWorld} the following payload: + New endpoint discovered: Endpoint{01.0f.b8.d9.81.30.3d.a7.01.00.00.00|0.0.1.3;writer;DdsTopic{HelloWorldTopic;HelloWorld;Fuzzy{Level(20) TopicQoS{TRANSIENT_LOCAL;RELIABLE;SHARED;depth(5000)}}};SpecificEndpointQoS{Partitions{};OwnershipStrength{0}};Active;ParticipantId{SimpleParticipant}}. + In Endpoint: 01.0f.b8.d9.81.30.3d.a7.01.00.00.00|0.0.1.3 from Participant: ParticipantId{SimpleParticipant} in topic: DdsTopic{HelloWorldTopic;HelloWorld;Fuzzy{Level(20) TopicQoS{VOLATILE;BEST_EFFORT;SHARED;depth(5000)}}} payload received: Payload{00 01 00 00 01 00 00 00 0b 00 00 00 48 65 6c 6c 6f 57 6f 72 6c 64 00 00} with specific qos: SpecificEndpointQoS{Partitions{};OwnershipStrength{0}}. + In Endpoint: 01.0f.b8.d9.81.30.3d.a7.01.00.00.00|0.0.1.3 from Participant: ParticipantId{SimpleParticipant} in topic: DdsTopic{HelloWorldTopic;HelloWorld;Fuzzy{Level(20) TopicQoS{VOLATILE;BEST_EFFORT;SHARED;depth(5000)}}} payload received: Payload{00 01 00 00 02 00 00 00 0b 00 00 00 48 65 6c 6c 6f 57 6f 72 6c 64 00 00} with specific qos: SpecificEndpointQoS{Partitions{};OwnershipStrength{0}}. ... - Echo Participant: ParticipantId{EchoParticipant} has received from Endpoint: 01.0f.44.59.e6.de.2a.c8.01.00.00.00|0.0.1.3 in topic: Topic{HelloWorldTopic, HelloWorld} the following payload: + In Endpoint: 01.0f.b8.d9.81.30.3d.a7.01.00.00.00|0.0.1.3 from Participant: ParticipantId{SimpleParticipant} in topic: DdsTopic{HelloWorldTopic;HelloWorld;Fuzzy{Level(20) TopicQoS{VOLATILE;BEST_EFFORT;SHARED;depth(5000)}}} payload received: Payload{00 01 00 00 0a 00 00 00 0b 00 00 00 48 65 6c 6c 6f 57 6f 72 6c 64 00 00} with specific qos: SpecificEndpointQoS{Partitions{};OwnershipStrength{0}}. Execute with ROS 2 demo nodes ----------------------------- @@ -92,6 +100,10 @@ The expected output from the DDS Router, printed by the ``Echo Participant`` is: .. code-block:: console - Echo Participant: ParticipantId{EchoParticipant} has received from Endpoint: 01.0f.44.59.33.e0.2b.cf.01.00.00.00|0.0.12.3 in topic: Topic{rt/chatter, std_msgs::msg::dds_::String_} the following payload: - Echo Participant: ParticipantId{EchoParticipant} has received from Endpoint: 01.0f.44.59.33.e0.2b.cf.01.00.00.00|0.0.12.3 in topic: Topic{rt/chatter, std_msgs::msg::dds_::String_} the following payload: + New endpoint discovered: Endpoint{01.0f.b8.d9.b6.3a.7d.95.01.00.00.00|0.0.1.3;writer;DdsTopic{ros_discovery_info;rmw_dds_common::msg::dds_::ParticipantEntitiesInfo_;Fuzzy{Level(20) TopicQoS{TRANSIENT_LOCAL;RELIABLE;SHARED;depth(5000)}}};SpecificEndpointQoS{Partitions{};OwnershipStrength{0}};Active;ParticipantId{SimpleParticipant}}. + New endpoint discovered: Endpoint{01.0f.b8.d9.b6.3a.7d.95.01.00.00.00|0.0.2.4;reader;DdsTopic{ros_discovery_info;rmw_dds_common::msg::dds_::ParticipantEntitiesInfo_;Fuzzy{Level(20) TopicQoS{TRANSIENT_LOCAL;RELIABLE;SHARED;depth(5000)}}};SpecificEndpointQoS{Partitions{};OwnershipStrength{0}};Active;ParticipantId{SimpleParticipant}}. + ... + New endpoint discovered: Endpoint{01.0f.b8.d9.b6.3a.7d.95.01.00.00.00|0.0.12.3;writer;DdsTopic{rt/chatter;std_msgs::msg::dds_::String_;Fuzzy{Level(20) TopicQoS{VOLATILE;RELIABLE;SHARED;depth(5000)}}};SpecificEndpointQoS{Partitions{};OwnershipStrength{0}};Active;ParticipantId{SimpleParticipant}}. + In Endpoint: 01.0f.b8.d9.b6.3a.7d.95.01.00.00.00|0.0.12.3 from Participant: ParticipantId{SimpleParticipant} in topic: DdsTopic{rt/chatter;std_msgs::msg::dds_::String_;Fuzzy{Level(0) TopicQoS{VOLATILE;BEST_EFFORT;SHARED;depth(1000)}}} payload received: Payload{00 01 00 00 0f 00 00 00 48 65 6c 6c 6f 20 57 6f 72 6c 64 3a 20 31 00 00} with specific qos: SpecificEndpointQoS{Partitions{};OwnershipStrength{0}}. + In Endpoint: 01.0f.b8.d9.b6.3a.7d.95.01.00.00.00|0.0.12.3 from Participant: ParticipantId{SimpleParticipant} in topic: DdsTopic{rt/chatter;std_msgs::msg::dds_::String_;Fuzzy{Level(0) TopicQoS{VOLATILE;BEST_EFFORT;SHARED;depth(1000)}}} payload received: Payload{00 01 00 00 0f 00 00 00 48 65 6c 6c 6f 20 57 6f 72 6c 64 3a 20 32 00 00} with specific qos: SpecificEndpointQoS{Partitions{};OwnershipStrength{0}}. ... diff --git a/docs/rst/user_manual/participants/echo.rst b/docs/rst/user_manual/participants/echo.rst index 2aa166b03..727260a8a 100644 --- a/docs/rst/user_manual/participants/echo.rst +++ b/docs/rst/user_manual/participants/echo.rst @@ -6,23 +6,30 @@ Echo Participant ################ -This :term:`Participant` prints in ``stdout`` every data that is received by the |ddsrouter|. -The resulted logs contain the echo :term:`Participant Name`, the source :term:`Endpoint` :term:`Guid` that has -originally generated the message, the :term:`Topic` where this message has been received, -and the :term:`Payload` (in hexadecimal format) received. -Notice that this Payload is the same that a standard DDS :term:`DataReader` will receive if it is connected to one -of the Participants of the |ddsrouter|. +This :term:`Participant` prints in ``stdout`` all discovery information and/or user data that is received by the |ddsrouter|. + +In the case of discovery traces, messages such as the following will be displayed: + +.. code-block:: bash + + New endpoint discovered: Endpoint{;;}. + +For data reception messages, the traces show the following information: .. code-block:: bash - Echo Participant: has received from Endpoint: in topic: the following payload: + Received data in Participant: in topic: . -This is an example of a message received by a |ddsrouter| in a Participant connected to a ROS2 ``talker`` -and written by an **Echo Participant**: +These logs contain the :term:`Participant Name` of the participant that has originally received the message, and the +:term:`Topic` where this message has been received. +Additionally, extra information such as the data :term:`Payload` (in hexadecimal format) and source :term:`Endpoint` :term:`Guid` is displayed in verbose mode: .. code-block:: bash - Echo Participant: ParticipantId{echo} has received from Endpoint: 01.0f.b8.a8.2e.69.b1.47.01.00.00.00|0.0.12.3 in topic: Topic{rt/chatter, std_msgs::msg::dds_::String_} the following payload: + In Endpoint: from Participant: in topic: payload received: with specific qos: . + +Notice that this Payload is the same that a standard DDS :term:`DataReader` will receive if it is connected to one +of the Participants of the |ddsrouter|. .. note:: @@ -32,9 +39,9 @@ and written by an **Echo Participant**: Use case ======== -Use this Participant in order to see in ``stdout`` the data that is being relayed by the router. -All the data received by any of the Participants of the router will be printed with timestamp, topic and source guid -along with the payload. +Use this Participant in order to see in ``stdout`` the data that is being relayed by the router, as well as information regarding discovery events. +All the data received by any of the Participants of the router will be printed (if ``data`` is ``true``) with its topic and source guid, +along with the payload (in ``verbose`` mode). Kind aliases @@ -42,10 +49,16 @@ Kind aliases * ``echo`` +.. _user_manual_participants_echo_configuration: + Configuration ============= -Echo Participant does not allow any configuration. +Echo Participant accepts three different **optional** parameters: + +- ``discovery``: Whether to echo information regarding discovery events. Defaults to **true**. +- ``data``: Whether to echo information regarding user data reception. Defaults to **false**. +- ``verbose``: Display detailed information about the user data received (if ``data`` set to ``true``). Defaults to **false**. Configuration Example ===================== @@ -54,3 +67,6 @@ Configuration Example - name: echo_participant # Participant Name = echo_participant kind: echo + data: true # Print a trace with every arrival of user data + verbose: true # Show detailed information on user data reception + discovery: false # Do not print traces regarding discovery events diff --git a/docs/rst/user_manual/participants/participant.rst b/docs/rst/user_manual/participants/participant.rst index 8bcbd207e..18d18f719 100644 --- a/docs/rst/user_manual/participants/participant.rst +++ b/docs/rst/user_manual/participants/participant.rst @@ -49,8 +49,7 @@ Each participant configuration is specified as a different item of ``participant configurations has a unique Participant Name that should not be repeated in a |ddsrouter| execution. Each Participant Kind is associated with one or several names or aliases that represent it. -In order to use a Participant of a specific kind, use ``kind`` tag in the yaml configuration file, or set the -Participant Name as the alias of the kind. +In order to use a Participant of a specific kind, use ``kind`` tag in the yaml configuration file. If the kind is not any of the valid aliases, the Participant will not be created and the execution will fail. @@ -90,8 +89,10 @@ Below is the list with all the available Participant Kinds. * - :ref:`user_manual_participants_echo` - ``echo`` - - - - Print in `stdout` every data received. + - ``discovery`` |br| + ``data`` |br| + ``verbose`` + - Print in `stdout` all user and/or discovery data received. * - :ref:`user_manual_participants_simple` - ``simple`` |br| diff --git a/resources/configurations/examples/echo.yaml b/resources/configurations/examples/echo.yaml index 77e75bae3..5c174adc6 100644 --- a/resources/configurations/examples/echo.yaml +++ b/resources/configurations/examples/echo.yaml @@ -30,10 +30,13 @@ participants: ################################## # ECHO PARTICIPANT -# This Participant will print in stdout every message received by the other Participants +# This Participant will print in stdout every message received by the other Participants, as well as discovery information - name: EchoParticipant # 6 kind: echo # 7 + discovery: true # 8 + data: true # 9 + verbose: true # 10 ################################## @@ -41,7 +44,7 @@ participants: # This configuration example configures a DDS Router to listen to every message published in domain 0 in topics # HelloWorldTopic (from Fast DDS HelloWorld) and rt/chatter from ROS2 demo_nodes, and to print the received -# messages in stdout. +# messages in stdout. Information regarding discovery events is also printed to stdout. # 0: Use YAML configuration version v3.0 @@ -59,4 +62,9 @@ participants: # 6: New Participant with name . # 7: Kind of EchoParticipant: . -# Prints in stdout every message received by the router, together with the source GUID, timestamp and Topic. + +# 8: Print a trace to stdout every time an Endpoint is discovered. + +# 9: Print a trace to stdout every time a new data message arrives to the router. + +# 10: Display verbose information regarding received messages (receiver endpoint_guid and data payload). diff --git a/tools/ddsrouter_yaml_validator/ddsrouter_yaml_validator/ddsrouter_config_schema.json b/tools/ddsrouter_yaml_validator/ddsrouter_yaml_validator/ddsrouter_config_schema.json index 2097f9b4a..46e01806b 100644 --- a/tools/ddsrouter_yaml_validator/ddsrouter_yaml_validator/ddsrouter_config_schema.json +++ b/tools/ddsrouter_yaml_validator/ddsrouter_yaml_validator/ddsrouter_config_schema.json @@ -151,6 +151,15 @@ }, "tls":{ "$ref":"#/definitions/TLS" + }, + "discovery":{ + "type":"boolean" + }, + "data":{ + "type":"boolean" + }, + "verbose":{ + "type":"boolean" } }, "required":[ @@ -165,7 +174,6 @@ "type":"string", "enum":[ "void", - "echo", "dummy" ] } @@ -201,6 +209,67 @@ "repeater":{ "not":{ + } + }, + "discovery":{ + "not":{ + + } + }, + "data":{ + "not":{ + + } + }, + "verbose":{ + "not":{ + + } + } + } + } + }, + { + "if":{ + "properties":{ + "kind":{ + "type":"string", + "enum":[ + "echo" + ] + } + } + }, + "then":{ + "properties":{ + "domain":{ + "not":{ + + } + }, + "discovery-server-guid":{ + "not":{ + + } + }, + "listening-addresses":{ + "not":{ + + } + }, + "connection-addresses":{ + "not":{ + + } + }, + "tls":{ + "not":{ + + } + }, + "repeater":{ + "not":{ + } } } @@ -227,6 +296,16 @@ } }, + "listening-addresses":{ + "not":{ + + } + }, + "connection-addresses":{ + "not":{ + + } + }, "tls":{ "not":{ @@ -235,6 +314,21 @@ "repeater":{ "not":{ + } + }, + "discovery":{ + "not":{ + + } + }, + "data":{ + "not":{ + + } + }, + "verbose":{ + "not":{ + } } } @@ -265,6 +359,21 @@ "domain":{ "not":{ + } + }, + "discovery":{ + "not":{ + + } + }, + "data":{ + "not":{ + + } + }, + "verbose":{ + "not":{ + } } } @@ -310,6 +419,21 @@ "discovery-server-guid":{ "not":{ + } + }, + "discovery":{ + "not":{ + + } + }, + "data":{ + "not":{ + + } + }, + "verbose":{ + "not":{ + } } }