Skip to content

Document Zenoh (backport #5231) #5342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/Installation.rst
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ Options for installing ROS 2 {DISTRO_TITLE_FULL}:
Installation/Alternatives
Installation/Maintaining-a-Source-Checkout
Installation/Testing
Installation/DDS-Implementations
Installation/RMW-Implementations

Binary packages
---------------
27 changes: 27 additions & 0 deletions source/Installation/RMW-Implementations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. redirect-from::

Installation/DDS-Implementations

RMW implementations
===================

By default, ROS 2 uses DDS as its `middleware <https://design.ros2.org/articles/ros_on_dds.html>`__.
It is compatible with multiple DDS or RTPS (the DDS wire protocol) vendors.
There is currently support for eProsima's Fast DDS, RTI's Connext DDS, Eclipse Cyclone DDS, and GurumNetworks GurumDDS.

It also supports non DDS RMW implementations such us Zenoh.

See `REP-2000 <https://ros.org/reps/rep-2000.html>`__ for supported RMW vendors by distribution.

The default RMW vendor is eProsima's Fast DDS.

Review all the possible options:

.. toctree::
:hidden:
:glob:

RMW-Implementations/*

* :doc:`DDS implementations <RMW-Implementations/DDS-Implementations>` explains how to use DDS.
* :doc:`Non DDS implementations <RMW-Implementations/Non-DDS-Implementations>` explains how to use non DDS implementations.
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
DDS implementations
===================

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

The default DDS vendor is eProsima's Fast DDS.
These are the available DDS implementaions:

* :doc:`Working with Eclipse Cyclone DDS <DDS-Implementations/Working-with-Eclipse-CycloneDDS>` explains how to utilize Cyclone DDS.
* :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.
If you would like to use one of the other vendors you will need to install their software separately before building.
The ROS 2 build will automatically build support for vendors that have been installed and sourced correctly.

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>`.
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>`.
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ See also: https://projects.eclipse.org/projects/iot.cyclonedds
Prerequisites
-------------

Have :doc:`rosdep installed <../../Tutorials/Intermediate/Rosdep>`.
Have :doc:`rosdep installed <../../../Tutorials/Intermediate/Rosdep>`.

Install packages
----------------
@@ -59,7 +59,7 @@ Switch from other rmw to rmw_cyclonedds by specifying the environment variable.

export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

See also: :doc:`Working with multiple RMW implementations <../../How-To-Guides/Working-with-multiple-RMW-implementations>`
See also: :doc:`Working with multiple RMW implementations <../../../How-To-Guides/Working-with-multiple-RMW-implementations>`

Run the talker and listener
---------------------------
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ For more information about GurumDDS, visit the `GurumNetworks website <https://g

Prerequisites
-------------
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>`.
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>`.

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

@@ -57,7 +57,7 @@ Option 2: Build from source code
cd ..
rosdep install --from src -i --rosdistro {DISTRO}

3. Build the worksapce using Colcon:
3. Build the workspace using Colcon:

.. code-block:: bash

@@ -72,8 +72,7 @@ Switch from other RMW implementations to rmw_gurumdds by setting the environment

export RMW_IMPLEMENTATION=rmw_gurumdds_cpp

For more information on working with multiple RMW implementations, see :doc:`Working with multiple RMW implementations <../../How-To-Guides/Working-with-multiple-RMW-implementations>`.

For more information on working with multiple RMW implementations, see :doc:`Working with multiple RMW implementations <../../../How-To-Guides/Working-with-multiple-RMW-implementations>`.

Testing the installation
------------------------
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ Set the environment variable ``RMW_IMPLEMENTATION`` to tell ROS 2 which RMW to u

export RMW_IMPLEMENTATION=rmw_connextdds

See also: :doc:`Working with multiple RMW implementations <../../How-To-Guides/Working-with-multiple-RMW-implementations>`
See also: :doc:`Working with multiple RMW implementations <../../../How-To-Guides/Working-with-multiple-RMW-implementations>`

Run the talker and listener
---------------------------
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ See also: https://www.eprosima.com/index.php/products-all/eprosima-fast-dds
Prerequisites
-------------

Have :doc:`rosdep installed <../../Tutorials/Intermediate/Rosdep>`.
Have :doc:`rosdep installed <../../../Tutorials/Intermediate/Rosdep>`.

Install packages
----------------
@@ -54,7 +54,7 @@ The eProsima Fast DDS RMW can be selected by specifying the environment variable

export RMW_IMPLEMENTATION=rmw_fastrtps_cpp

See also: :doc:`Working with multiple RMW implementations <../../How-To-Guides/Working-with-multiple-RMW-implementations>`
See also: :doc:`Working with multiple RMW implementations <../../../How-To-Guides/Working-with-multiple-RMW-implementations>`

Run the talker and listener
---------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Non-DDS-Implementations
=======================

* :doc:`Working with Zenoh <Non-DDS-Implementations/Working-with-Zenoh>` explains how to utilize Zenoh.

.. toctree::
:hidden:
:glob:

Non-DDS-Implementations/*

If you would like to use one of the other vendors you will need to install their software separately before building.
The ROS 2 build will automatically build support for vendors that have been installed and sourced correctly.

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>`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
Zenoh
=====

Zenoh is an open source communication protocol and middleware designed to facilitate efficient data distribution across heterogeneous systems.
It provides location-transparent abstractions for high performance pub/sub and distributed queries.
See also: https://zenoh.io/docs/getting-started/first-app/

Prerequisites
-------------

Have :doc:`rosdep installed <../../../Tutorials/Intermediate/Rosdep>`.

Installation packages
---------------------

The rmw implementation Zenoh can be installed via binaries, recommended for stable development.

Binary packages for supported ROS 2 distributions (see distro branches) are available on respective Tier-1 platforms for the distributions.
First ensure that your system is set up to install ROS 2 binaries by following the instructions here.

Then install rmw_zenoh binaries using the command

.. code-block:: bash

sudo apt install ros-{DISTRO}-rmw-zenoh-cpp

Build from source code
----------------------

Built from source, recommended if latest features are needed.

By default, we vendor and compile ``zenoh-cpp`` with a subset of zenoh features.
The ``ZENOHC_CARGO_FLAGS`` CMake argument may be overwritten with other features included if required.
See `zenoh_cpp_vendor/CMakeLists.txt <https://github.com/ros2/rmw_zenoh/blob/{DISTRO}/zenoh_cpp_vendor/CMakeLists.txt>`__ for more details.

1. Clone the repository

.. code-block:: bash

mkdir ~/ws_rmw_zenoh/src -p && cd ~/ws_rmw_zenoh/src
git clone https://github.com/ros2/rmw_zenoh.git -b {DISTRO}

1. Install dependencies:

.. code-block:: bash

cd ~/ws_rmw_zenoh
rosdep install --from-paths src --ignore-src --rosdistro {DISTRO} -y

3. Build the workspace using Colcon:

.. code-block:: bash

source /opt/ros/{DISTRO}/setup.bash
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release


Switch to rmw_zenoh_cpp
------------------------

Switch from other rmw to rmw_zenoh_cpp by specifying the environment variable.

.. code-block:: bash

export RMW_IMPLEMENTATION=rmw_zenoh_cpp

Run the talker and listener
---------------------------

Now run ``talker`` and ``listener`` to test Zenoh.

Start the Zenoh router

.. code-block:: bash

# terminal 1
ros2 run rmw_zenoh_cpp talker rmw_zenohd

.. 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.
Instead, nodes will receive discovery information about other peers via the Zenoh router's gossip functionality.

.. code-block:: bash

# terminal 2
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
ros2 run demo_nodes_cpp talker

.. code-block:: bash

# terminal 3
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
ros2 run demo_nodes_cpp listener

.. note:: Remember to source your ROS 2 setup script before running these commands.