Skip to content

Commit fff316b

Browse files
Document Zenoh (#5231) (#5342)
Signed-off-by: Alejandro Hernandez Cordero <[email protected]> (cherry picked from commit 05a4bc3) Co-authored-by: Alejandro Hernández Cordero <[email protected]>
1 parent 10ac0aa commit fff316b

File tree

9 files changed

+148
-17
lines changed

9 files changed

+148
-17
lines changed

source/Installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Options for installing ROS 2 {DISTRO_TITLE_FULL}:
1616
Installation/Alternatives
1717
Installation/Maintaining-a-Source-Checkout
1818
Installation/Testing
19-
Installation/DDS-Implementations
19+
Installation/RMW-Implementations
2020

2121
Binary packages
2222
---------------
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.. redirect-from::
2+
3+
Installation/DDS-Implementations
4+
5+
RMW implementations
6+
===================
7+
8+
By default, ROS 2 uses DDS as its `middleware <https://design.ros2.org/articles/ros_on_dds.html>`__.
9+
It is compatible with multiple DDS or RTPS (the DDS wire protocol) vendors.
10+
There is currently support for eProsima's Fast DDS, RTI's Connext DDS, Eclipse Cyclone DDS, and GurumNetworks GurumDDS.
11+
12+
It also supports non DDS RMW implementations such us Zenoh.
13+
14+
See `REP-2000 <https://ros.org/reps/rep-2000.html>`__ for supported RMW vendors by distribution.
15+
16+
The default RMW vendor is eProsima's Fast DDS.
17+
18+
Review all the possible options:
19+
20+
.. toctree::
21+
:hidden:
22+
:glob:
23+
24+
RMW-Implementations/*
25+
26+
* :doc:`DDS implementations <RMW-Implementations/DDS-Implementations>` explains how to use DDS.
27+
* :doc:`Non DDS implementations <RMW-Implementations/Non-DDS-Implementations>` explains how to use non DDS implementations.

source/Installation/DDS-Implementations.rst renamed to source/Installation/RMW-Implementations/DDS-Implementations.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
DDS implementations
22
===================
33

4-
By default, ROS 2 uses DDS as its `middleware <https://design.ros2.org/articles/ros_on_dds.html>`__.
5-
It is compatible with multiple DDS or RTPS (the DDS wire protocol) vendors.
6-
There is currently support for eProsima's Fast DDS, RTI's Connext DDS, Eclipse Cyclone DDS, and GurumNetworks GurumDDS.
7-
See `REP-2000 <https://ros.org/reps/rep-2000.html>`__ for supported DDS vendors by distribution.
8-
9-
The default DDS vendor is eProsima's Fast DDS.
4+
These are the available DDS implementaions:
105

116
* :doc:`Working with Eclipse Cyclone DDS <DDS-Implementations/Working-with-Eclipse-CycloneDDS>` explains how to utilize Cyclone DDS.
127
* :doc:`Working with eProsima Fast DDS <DDS-Implementations/Working-with-eProsima-Fast-DDS>` explains how to utilize Fast DDS.
@@ -22,4 +17,4 @@ The default DDS vendor is eProsima's Fast DDS.
2217
If you would like to use one of the other vendors you will need to install their software separately before building.
2318
The ROS 2 build will automatically build support for vendors that have been installed and sourced correctly.
2419

25-
Once you've installed a new DDS vendor, you can change the vendor used at runtime: :doc:`Working with Multiple RMW Implementations <../How-To-Guides/Working-with-multiple-RMW-implementations>`.
20+
Once you've installed a new RMW vendor, you can change the vendor used at runtime: :doc:`Working with Multiple RMW Implementations <../../How-To-Guides/Working-with-multiple-RMW-implementations>`.

source/Installation/DDS-Implementations/Working-with-Eclipse-CycloneDDS.rst renamed to source/Installation/RMW-Implementations/DDS-Implementations/Working-with-Eclipse-CycloneDDS.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See also: https://projects.eclipse.org/projects/iot.cyclonedds
1313
Prerequisites
1414
-------------
1515

16-
Have :doc:`rosdep installed <../../Tutorials/Intermediate/Rosdep>`.
16+
Have :doc:`rosdep installed <../../../Tutorials/Intermediate/Rosdep>`.
1717

1818
Install packages
1919
----------------
@@ -59,7 +59,7 @@ Switch from other rmw to rmw_cyclonedds by specifying the environment variable.
5959
6060
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
6161
62-
See also: :doc:`Working with multiple RMW implementations <../../How-To-Guides/Working-with-multiple-RMW-implementations>`
62+
See also: :doc:`Working with multiple RMW implementations <../../../How-To-Guides/Working-with-multiple-RMW-implementations>`
6363

6464
Run the talker and listener
6565
---------------------------

source/Installation/DDS-Implementations/Working-with-GurumNetworks-GurumDDS.rst renamed to source/Installation/RMW-Implementations/DDS-Implementations/Working-with-GurumNetworks-GurumDDS.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ For more information about GurumDDS, visit the `GurumNetworks website <https://g
1010

1111
Prerequisites
1212
-------------
13-
This guide assumes you have completed the ROS 2 environment setup process, either by :doc:`Installing ROS 2 via Deb Packages <../Ubuntu-Install-Debs>` or :doc:`Building ROS 2 from source on Ubuntu <../Alternatives/Ubuntu-Development-Setup>`.
13+
This guide assumes you have completed the ROS 2 environment setup process, either by :doc:`Installing ROS 2 via Deb Packages <../../Ubuntu-Install-Debs>` or :doc:`Building ROS 2 from source on Ubuntu <../../Alternatives/Ubuntu-Development-Setup>`.
1414

1515
Version Requirements (`see the README for details <https://github.com/ros2/rmw_gurumdds>`_):
1616

@@ -57,7 +57,7 @@ Option 2: Build from source code
5757
cd ..
5858
rosdep install --from src -i --rosdistro {DISTRO}
5959
60-
3. Build the worksapce using Colcon:
60+
3. Build the workspace using Colcon:
6161

6262
.. code-block:: bash
6363
@@ -72,8 +72,7 @@ Switch from other RMW implementations to rmw_gurumdds by setting the environment
7272
7373
export RMW_IMPLEMENTATION=rmw_gurumdds_cpp
7474
75-
For more information on working with multiple RMW implementations, see :doc:`Working with multiple RMW implementations <../../How-To-Guides/Working-with-multiple-RMW-implementations>`.
76-
75+
For more information on working with multiple RMW implementations, see :doc:`Working with multiple RMW implementations <../../../How-To-Guides/Working-with-multiple-RMW-implementations>`.
7776

7877
Testing the installation
7978
------------------------

source/Installation/DDS-Implementations/Working-with-RTI-Connext-DDS.rst renamed to source/Installation/RMW-Implementations/DDS-Implementations/Working-with-RTI-Connext-DDS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Set the environment variable ``RMW_IMPLEMENTATION`` to tell ROS 2 which RMW to u
106106
107107
export RMW_IMPLEMENTATION=rmw_connextdds
108108
109-
See also: :doc:`Working with multiple RMW implementations <../../How-To-Guides/Working-with-multiple-RMW-implementations>`
109+
See also: :doc:`Working with multiple RMW implementations <../../../How-To-Guides/Working-with-multiple-RMW-implementations>`
110110

111111
Run the talker and listener
112112
---------------------------

source/Installation/DDS-Implementations/Working-with-eProsima-Fast-DDS.rst renamed to source/Installation/RMW-Implementations/DDS-Implementations/Working-with-eProsima-Fast-DDS.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ See also: https://www.eprosima.com/index.php/products-all/eprosima-fast-dds
88
Prerequisites
99
-------------
1010

11-
Have :doc:`rosdep installed <../../Tutorials/Intermediate/Rosdep>`.
11+
Have :doc:`rosdep installed <../../../Tutorials/Intermediate/Rosdep>`.
1212

1313
Install packages
1414
----------------
@@ -54,7 +54,7 @@ The eProsima Fast DDS RMW can be selected by specifying the environment variable
5454
5555
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
5656
57-
See also: :doc:`Working with multiple RMW implementations <../../How-To-Guides/Working-with-multiple-RMW-implementations>`
57+
See also: :doc:`Working with multiple RMW implementations <../../../How-To-Guides/Working-with-multiple-RMW-implementations>`
5858

5959
Run the talker and listener
6060
---------------------------
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Non-DDS-Implementations
2+
=======================
3+
4+
* :doc:`Working with Zenoh <Non-DDS-Implementations/Working-with-Zenoh>` explains how to utilize Zenoh.
5+
6+
.. toctree::
7+
:hidden:
8+
:glob:
9+
10+
Non-DDS-Implementations/*
11+
12+
If you would like to use one of the other vendors you will need to install their software separately before building.
13+
The ROS 2 build will automatically build support for vendors that have been installed and sourced correctly.
14+
15+
Once you've installed a new RMW vendor, you can change the vendor used at runtime: :doc:`Working with Multiple RMW Implementations <../../How-To-Guides/Working-with-multiple-RMW-implementations>`.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
Zenoh
2+
=====
3+
4+
Zenoh is an open source communication protocol and middleware designed to facilitate efficient data distribution across heterogeneous systems.
5+
It provides location-transparent abstractions for high performance pub/sub and distributed queries.
6+
See also: https://zenoh.io/docs/getting-started/first-app/
7+
8+
Prerequisites
9+
-------------
10+
11+
Have :doc:`rosdep installed <../../../Tutorials/Intermediate/Rosdep>`.
12+
13+
Installation packages
14+
---------------------
15+
16+
The rmw implementation Zenoh can be installed via binaries, recommended for stable development.
17+
18+
Binary packages for supported ROS 2 distributions (see distro branches) are available on respective Tier-1 platforms for the distributions.
19+
First ensure that your system is set up to install ROS 2 binaries by following the instructions here.
20+
21+
Then install rmw_zenoh binaries using the command
22+
23+
.. code-block:: bash
24+
25+
sudo apt install ros-{DISTRO}-rmw-zenoh-cpp
26+
27+
Build from source code
28+
----------------------
29+
30+
Built from source, recommended if latest features are needed.
31+
32+
By default, we vendor and compile ``zenoh-cpp`` with a subset of zenoh features.
33+
The ``ZENOHC_CARGO_FLAGS`` CMake argument may be overwritten with other features included if required.
34+
See `zenoh_cpp_vendor/CMakeLists.txt <https://github.com/ros2/rmw_zenoh/blob/{DISTRO}/zenoh_cpp_vendor/CMakeLists.txt>`__ for more details.
35+
36+
1. Clone the repository
37+
38+
.. code-block:: bash
39+
40+
mkdir ~/ws_rmw_zenoh/src -p && cd ~/ws_rmw_zenoh/src
41+
git clone https://github.com/ros2/rmw_zenoh.git -b {DISTRO}
42+
43+
1. Install dependencies:
44+
45+
.. code-block:: bash
46+
47+
cd ~/ws_rmw_zenoh
48+
rosdep install --from-paths src --ignore-src --rosdistro {DISTRO} -y
49+
50+
3. Build the workspace using Colcon:
51+
52+
.. code-block:: bash
53+
54+
source /opt/ros/{DISTRO}/setup.bash
55+
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
56+
57+
58+
Switch to rmw_zenoh_cpp
59+
------------------------
60+
61+
Switch from other rmw to rmw_zenoh_cpp by specifying the environment variable.
62+
63+
.. code-block:: bash
64+
65+
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
66+
67+
Run the talker and listener
68+
---------------------------
69+
70+
Now run ``talker`` and ``listener`` to test Zenoh.
71+
72+
Start the Zenoh router
73+
74+
.. code-block:: bash
75+
76+
# terminal 1
77+
ros2 run rmw_zenoh_cpp talker rmw_zenohd
78+
79+
.. note:: Without the Zenoh router, nodes will not be able to discover each other since multicast discovery is disabled by default in the node's session config.
80+
Instead, nodes will receive discovery information about other peers via the Zenoh router's gossip functionality.
81+
82+
.. code-block:: bash
83+
84+
# terminal 2
85+
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
86+
ros2 run demo_nodes_cpp talker
87+
88+
.. code-block:: bash
89+
90+
# terminal 3
91+
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
92+
ros2 run demo_nodes_cpp listener
93+
94+
.. note:: Remember to source your ROS 2 setup script before running these commands.
95+

0 commit comments

Comments
 (0)