From 0bdca050589be4d8f16271f997d7d024b9e26cb3 Mon Sep 17 00:00:00 2001 From: Maddy Underwood Date: Fri, 25 Jul 2025 05:02:33 +0000 Subject: [PATCH 1/9] Starting content review --- .../zenoh-multinode-ros2/1_intro-zenoh.md | 13 ++++++------- .../cross-platform/zenoh-multinode-ros2/_index.md | 15 +++++++++------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md index 5e1595325a..d2f7d642a1 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md @@ -6,7 +6,7 @@ weight: 2 layout: learningpathall --- -## The Need for Scalable Communication in Robotics and Edge Computing +## The need for scalable communication in robotics and edge computing Modern robotics and industrial IoT systems are evolving rapidly, from indoor collaborative arms on assembly lines to fleets of outdoor autonomous delivery robots. These applications must operate in real-time, often across multiple compute nodes, over networks that may span factory LANs, 5G cellular links, or even cloud data centers. @@ -20,11 +20,9 @@ A modern protocol must be: * Decentralized: No reliance on central brokers or fixed infrastructure. * Flexible: Able to run on lightweight edge devices, across WANs, or inside cloud-native environments. -Traditional communication stacks such as Data Distribution Service (DDS) serve as the backbone for middleware like ROS 2. However, DDS struggles in multi-network or wireless environments where multicast is unavailable, or NAT traversal is needed. -These constraints can severely impact deployment and performance at the edge. +Traditional communication stacks such as Data Distribution Service (DDS) serve as the backbone for middleware like ROS 2. However, DDS struggles in multi-network or wireless environments where multicast is unavailable, or NAT traversal is needed. Zenoh was developed to address these challenges with a unified approach to data movement, storage, and interaction across heterogeneous, distributed systems. - -## Zenoh: an open-source pub/sub protocol for the Industrial Edge +## Zenoh: an open-source pub/sub protocol for the industrial edge [Eclipse Zenoh](https://zenoh.io/) is a modern, open-source, data-centric communication protocol that goes beyond traditional pub/sub. Designed specifically for edge computing, industrial IoT, robotics, and autonomous systems, Zenoh unifies: @@ -44,7 +42,8 @@ In this Learning Path, you’ll use Zenoh to build and validate a multi-node dis The examples use Raspberry Pi boards, but you’re free to substitute any Cortex-A or Neoverse devices that support network connectivity running Linux. -Upon completion, you will be able to: +By the end of this Learning Path, you'll be able to: - Understand the core architecture and data flow principles behind Eclipse Zenoh, including its support for pub/sub, querying, and queryable edge functions. - Build and run distributed Zenoh examples across multiple Arm-based nodes using Raspberry Pi or other Arm Linux devices. -- Rebuild and extend the Zenoh queryable example to simulate edge-side logic. +- Rebuild and extend a Zenoh queryable node to simulate edge-side logic. + diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/_index.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/_index.md index 833978a14d..bb213fe72f 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/_index.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/_index.md @@ -1,16 +1,13 @@ --- title: Scalable Networking for Industrial and Robotics with Zenoh on Raspberry Pi -draft: true -cascade: - draft: true - minutes_to_complete: 45 -who_is_this_for: This Learning Path is for robotics developers, industrial automation engineers, and IoT system architects building distributed, scalable, and low-latency applications. Whether you are using Robot Operating System (ROS), developing autonomous systems, or designing multi-node communication frameworks, you can use Eclipse Zenoh on Arm-based platforms, both in the cloud and on local devices like Raspberry Pi. +who_is_this_for: This Learning Path is for robotics developers, industrial automation engineers, and IoT system architects building distributed, scalable, and low-latency applications. Whether you're using the Robot Operating System (ROS), developing autonomous systems, or designing multi-node communication frameworks, you can use Eclipse Zenoh on Arm-based platforms, both in the cloud and on local devices like Raspberry Pi. + learning_objectives: - - Understand Zenoh's architecture and its integration of pub/sub, storage, querying, and computation models. + - Understand Zenoh's architecture and how it integrates pub/sub, storage, querying, and computation models. - Build and run Zenoh examples on both Arm servers and Raspberry Pi. - Set up and deploy a multi-node Zenoh system. @@ -32,6 +29,7 @@ tools_software_languages: - ROS2 - C - Raspberry Pi + - Zenoh operatingsystems: - Linux @@ -50,6 +48,11 @@ further_reading: title: Eclipse Zenoh Github link: https://github.com/eclipse-zenoh/zenoh type: documentation + - resource: + title: Zenoh and ROS 2 Integration Guide + link: https://github.com/eclipse-zenoh/zenoh-plugin-ros2 + type: documentation + ### FIXED, DO NOT MODIFY From 3fbe030d92b6ca226a1e6f9c9dc7e4c3e17c0f9e Mon Sep 17 00:00:00 2001 From: Maddy Underwood Date: Fri, 25 Jul 2025 07:18:22 +0000 Subject: [PATCH 2/9] Polished Zenoh setup section: revised title, clarified instructions, and improved build output explanation --- .../zenoh-multinode-ros2/1_intro-zenoh.md | 9 +++---- .../zenoh-multinode-ros2/2_zenoh-install.md | 12 +++++---- .../zenoh-multinode-ros2/3_zenoh-multinode.md | 27 ++++++++++--------- .../zenoh-multinode-ros2/_index.md | 15 ++++++----- 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md index d2f7d642a1..a421923fb8 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md @@ -22,7 +22,7 @@ A modern protocol must be: Traditional communication stacks such as Data Distribution Service (DDS) serve as the backbone for middleware like ROS 2. However, DDS struggles in multi-network or wireless environments where multicast is unavailable, or NAT traversal is needed. Zenoh was developed to address these challenges with a unified approach to data movement, storage, and interaction across heterogeneous, distributed systems. -## Zenoh: an open-source pub/sub protocol for the industrial edge +## What is Zenoh? A scalable pub/sub protocol for the industrial edge [Eclipse Zenoh](https://zenoh.io/) is a modern, open-source, data-centric communication protocol that goes beyond traditional pub/sub. Designed specifically for edge computing, industrial IoT, robotics, and autonomous systems, Zenoh unifies: @@ -35,15 +35,14 @@ Unlike most traditional stacks, Zenoh is fully decentralized and designed to ope It supports heterogeneous platforms, is implemented in Rust for performance and safety, and also offers bindings for Python, enabling rapid prototyping. -Zenoh is particularly effective in wireless, 5G, or cross-network deployments where multicast and DDS fall short. -Its routing engine avoids excessive discovery traffic, conserves bandwidth, and supports seamless bridging between legacy ROS 2/DDS apps and modern, optimized Zenoh networks using Zenoh-Bridge-DDS, a bridge between DDS systems and Zenoh networks. +Zenoh excels in wireless, 5G, and cross-network deployments, which are environments where multicast is unavailable and DDS often struggles. Its routing engine avoids excessive discovery traffic, conserves bandwidth, and supports seamless bridging between legacy ROS 2/DDS apps and modern, optimized Zenoh networks using Zenoh-Bridge-DDS, a bridge between DDS systems and Zenoh networks. In this Learning Path, you’ll use Zenoh to build and validate a multi-node distributed communication system across multiple Arm-based platforms, gaining hands-on experience with data exchange and coordination between edge devices. -The examples use Raspberry Pi boards, but you’re free to substitute any Cortex-A or Neoverse devices that support network connectivity running Linux. +You can substitute Raspberry Pi with any Linux-based Arm device that supports networking, such as a Cortex-A or Neoverse board. By the end of this Learning Path, you'll be able to: -- Understand the core architecture and data flow principles behind Eclipse Zenoh, including its support for pub/sub, querying, and queryable edge functions. +- Explain the core architecture and data flow principles behind Eclipse Zenoh protocol, including its support for pub/sub, querying, and queryable edge functions. - Build and run distributed Zenoh examples across multiple Arm-based nodes using Raspberry Pi or other Arm Linux devices. - Rebuild and extend a Zenoh queryable node to simulate edge-side logic. diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md index da1a28cbe4..f42cb6d7a9 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md @@ -1,14 +1,16 @@ --- -title: Setting Up Zenoh on Arm Devices +title: Install and build Zenoh on Arm devices + weight: 3 ### FIXED, DO NOT MODIFY layout: learningpathall --- -## Setting Up Zenoh on Arm Devices +## Set up Zenoh on Arm devices + -The following instructions have been verified on both Raspberry Pi 4 and 5 devices, but you can implement them on any Arm Linux device. +The following instructions have been verified on both Raspberry Pi 4 and 5 devices, but you can implement them on any Arm Linux device. These steps show how to install Zenoh on Raspberry Pi and other Arm-based Linux platforms. Before building Zenoh, make sure your system has the necessary development tools and runtime libraries. @@ -40,7 +42,7 @@ You can learn more using the [Rust install guide](/install-guides/rust/) for Arm [Robot Operating System](https://www.ros.org/) is a set of software libraries and tools that help you build robot applications. ROS provides everything from drivers to state-of-the-art algorithms, as well as developer tools. It is completely open-source. -Follow the [ROS2 installation guide](/install-guides/ros2/) to install ROS 2 on your Arm platforms. +If your use case involves ROS 2 integration, you should install ROS 2 before proceeding with Zenoh-related development. Follow the [ROS2 installation guide](/install-guides/ros2/) to install ROS 2 on your Arm platforms. ### Download and build the Zenoh source @@ -104,7 +106,7 @@ This may become a hard error in the future; see Date: Fri, 25 Jul 2025 10:39:40 +0000 Subject: [PATCH 3/9] Finalized Zenoh container deployment section and validated multi-node instructions --- .../zenoh-multinode-ros2/2_zenoh-install.md | 31 ++++++++++--------- .../zenoh-multinode-ros2/3_zenoh-multinode.md | 16 +++++++--- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md index f42cb6d7a9..50359df8be 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md @@ -1,5 +1,5 @@ --- -title: Install and build Zenoh on Arm devices +title: Get started with Zenoh on Raspberry Pi and Arm Linux weight: 3 @@ -9,14 +9,15 @@ layout: learningpathall ## Set up Zenoh on Arm devices +This section shows how to install and build the open-source Eclipse Zenoh protocol on Arm-based devices like Raspberry Pi. -The following instructions have been verified on both Raspberry Pi 4 and 5 devices, but you can implement them on any Arm Linux device. These steps show how to install Zenoh on Raspberry Pi and other Arm-based Linux platforms. +The following instructions have been verified on Raspberry Pi 4 and 5, but you can use any Arm Linux device. These steps apply to Raspberry Pi and other Arm-based Linux platforms. Before building Zenoh, make sure your system has the necessary development tools and runtime libraries. ### Install the Rust development environment -First, install the [Rust](https://www.rust-lang.org/) environment, since the core of Zenoh is developed using Rust to keep it safe and efficient. +First, install the [Rust](https://www.rust-lang.org/) environment. The core of Zenoh is developed in Rust for performance and safety. ```bash sudo apt update @@ -24,25 +25,24 @@ sudo apt install -y curl gcc curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ``` -Near the end of the installation you will see the success message: +Near the end of the installation, you should see the message: ```output Rust is installed now. Great! ``` - -Make sure to source the environment to add Rust to your shell environment: +Source your shell environment to activate Rust: ```bash source "$HOME/.cargo/env" ``` -You can learn more using the [Rust install guide](/install-guides/rust/) for Arm Linux. +For more information, see the [Rust Install Guide](/install-guides/rust/) for Arm Linux. ### Install ROS 2 [Robot Operating System](https://www.ros.org/) is a set of software libraries and tools that help you build robot applications. ROS provides everything from drivers to state-of-the-art algorithms, as well as developer tools. It is completely open-source. -If your use case involves ROS 2 integration, you should install ROS 2 before proceeding with Zenoh-related development. Follow the [ROS2 installation guide](/install-guides/ros2/) to install ROS 2 on your Arm platforms. +If you plan to use Zenoh alongside ROS 2, for example, to bridge DDS-based nodes, you should install ROS 2 before proceeding. See the [ROS2 Installation Guide](/install-guides/ros2/) to install ROS 2 on your Arm platforms. ### Download and build the Zenoh source @@ -52,15 +52,13 @@ Clone the Zenoh repository: cd $HOME git clone https://github.com/eclipse-zenoh/zenoh.git ``` - -After cloning, use cargo to build the source: +Build the source using Cargo: ```bash cd zenoh cargo build --release --all-targets -j $(nproc) ``` - -This process will take several minutes depending on your device. Once the installation is complete, you should see: +This process will take several minutes depending on your device. When complete, you should see output like: ```output Updating crates.io index @@ -103,13 +101,16 @@ This may become a hard error in the future; see plugins/zenoh-plugin-storage-manager/tests/operations.rs:91:55 @@ -122,7 +123,7 @@ Edit the file `./plugins/zenoh-plugin-storage-manager/tests/operations.rs` and c use crate::path::to::Plugin; ``` -Run the build again: +Then rebuild: ```bash cargo clean && cargo build diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/3_zenoh-multinode.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/3_zenoh-multinode.md index 8c70d34d48..2655ab48d9 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/3_zenoh-multinode.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/3_zenoh-multinode.md @@ -1,5 +1,5 @@ --- -title: Set up a multi-node environment +title: Containerize and deploy Zenoh across multiple Raspberry Pi devices weight: 4 @@ -15,7 +15,7 @@ If you’ve already installed Zenoh on an Arm Cortex-A or Neoverse platform as s However, to streamline deployment across multiple devices and ensure repeatability, this section demonstrates how to package Zenoh into a Docker image for batch rollout and scalable testing. -This containerized approach not only simplifies deployment on Raspberry Pi, but also integrates seamlessly with Arm cloud platforms such as AWS Graviton Arm Cortex-A Linux or Arm Virtual Hardware—enabling a consistent cloud-to-edge development and validation workflow. +This containerized approach not only simplifies deployment on Raspberry Pi, but also integrates seamlessly with Arm cloud platforms such as AWS Graviton Arm Cortex-A Linux or Arm Virtual Hardware, enabling a consistent cloud-to-edge development and validation workflow. In this session, you’ll use Raspberry Pi boards to simulate a scalable distributed environment. The same workflow applies to any Arm Linux system, including cloud instances and virtual hardware. @@ -108,6 +108,9 @@ You can pull it directly using: ```bash docker pull odinlmshen/zenoh-node ``` +{{% notice Tip %}} +Once built, you can reuse this Docker image across multiple Arm-based nodes, including Raspberry Pi, AWS Graviton, and Arm Virtual Hardware. +{{% /notice %}} ### Transfer the Docker image to the other Raspberry Pi @@ -130,7 +133,10 @@ Option 2: Push the image to a container registry such as Docker Hub You can also push the image to Docker Hub or GitHub Container Registry and pull it on the second device. -### Run the Docker Image + + + +### Run the Docker image Once the image is successfully loaded on the second device, you can run the container to start the Zenoh environment. @@ -144,8 +150,8 @@ The Zenoh example binaries are now available within this container, allowing you You’re now ready to run and test Zenoh communication flows across distributed edge devices. -The following examples are written in Rust and precompiled in your container image. They're fully interoperable and can be used to demonstrate Zenoh's key capabilities across devices. The -Rust binaries are already available under: `$ZENOH_LOC/target/release/examples/` directory. +The following examples are written in Rust and precompiled in your container image. They're fully interoperable and can be used to demonstrate Zenoh's key capabilities across devices. The Rust binaries are available in the `$ZENOH_LOC/target/release/examples/` directory. If you haven't set `ZENOH_LOC`, they can be found under `~/zenoh/target/release/examples/`. + The following sections illustrate the procedures to run the Zenoh examples so as to demonstrate the primary capabilities of Zenoh: - Basic pub/sub – for real-time message distribution From 8ebd4f4d83baf4826b8e6359920057dace759a09 Mon Sep 17 00:00:00 2001 From: Maddy Underwood Date: Fri, 25 Jul 2025 11:16:34 +0000 Subject: [PATCH 4/9] Finalized Zenoh pub/sub example: added tip for single-device testing and clarified peer discovery behavior --- .../4_zenoh-ex1-pubsub.md | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/4_zenoh-ex1-pubsub.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/4_zenoh-ex1-pubsub.md index 6075c7cf3e..8d6f2bf388 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/4_zenoh-ex1-pubsub.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/4_zenoh-ex1-pubsub.md @@ -1,18 +1,18 @@ --- -title: Zenoh Example-1 Simple Pub/Sub +title: Run a simple Zenoh pub/sub example weight: 5 ### FIXED, DO NOT MODIFY layout: learningpathall --- -## Example 1: Simple pub/sub +## Test Zenoh pub/sub across two devices -This first test demonstrates the real-time publish/subscribe model using two Raspberry Pi devices. +This example demonstrates Zenoh's real-time publish/subscribe model across two Raspberry Pi devices. -The following command is to initiate a subscriber for a key expression `demo/example/**`, a set of topics starting with the path `demo/example`. +The subscriber listens for all data published under the key expression `demo/example/**`, which matches any topic beginning with `demo/example/`. -### Step 1: Run subscriber +## Start the subscriber node Run the subscriber example on one of the Raspberry Pi systems. @@ -21,7 +21,7 @@ cd ~/zenoh/target/release/examples ./z_sub ``` -### Step 2: Run publisher +## Start the publisher node Then, log in to the other Raspberry Pi and run the publisher. @@ -30,12 +30,19 @@ cd ~/zenoh/target/release/examples ./z_pub ``` +{{% notice Tip %}} +You can run both `z_sub` and `z_pub` on the same device for testing, but running them on separate Raspberry Pis demonstrates Zenoh’s distributed discovery and cross-node communication. +{{% /notice %}} + +## Observe the pub/sub data flow + The result is shown below: -![img1 alt-text#center](zenoh_ex1.gif "Figure 1: Simple Pub/Sub") +![img1 Zenoh subscriber receiving messages from a publisher in a two-terminal view#center](zenoh_ex1.gif "Simple Pub/Sub") The left-side window shows the `z_sub` program. It receives values with the key `demo/example/zenoh-rs-pub` continuously published by `z_pub` running in the right-side window. -This basic example shows Zenoh's zero-config discovery and low-latency pub/sub across physical nodes. +This example confirms that Zenoh’s zero-configuration peer discovery and real-time pub/sub communication are working correctly across physical nodes. + From ab1019c43eb7568944056e3f9ce2b3feab88b19c Mon Sep 17 00:00:00 2001 From: Maddy Underwood Date: Fri, 25 Jul 2025 11:34:47 +0000 Subject: [PATCH 5/9] Updates --- .../zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md | 6 ++++-- .../zenoh-multinode-ros2/6_zenoh-ex3-queryable.md | 8 +++++--- .../zenoh-multinode-ros2/7_zenoh-querycomp.md | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md index 4de6612a67..7976148a81 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md @@ -1,5 +1,6 @@ --- -title: Zenoh Example-2 Storage and Query +title: Run a Zenoh storage and query example + weight: 6 ### FIXED, DO NOT MODIFY @@ -12,7 +13,8 @@ The second example adds Zenoh's data storage and querying capabilities by enabli Building on the previous pub/sub example, you’ll now explore how Zenoh supports persistent data storage and on-demand querying, a powerful feature for robotics and IIoT applications. -In a typical warehouse or factory scenario, autonomous robots may periodically publish sensor data such as position, temperature, battery level, and a central system or another robot—may later need to query the latest state of each unit. +In a typical warehouse or factory scenario, autonomous robots can periodically publish sensor data,such as position, temperature, or battery level—that a central system or peer robot may later need to query. + Unlike Pub/Sub, which requires live, real-time message exchange, Zenoh's storage and query model enables asynchronous access to data that was published earlier, even if the original publisher is no longer online. diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/6_zenoh-ex3-queryable.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/6_zenoh-ex3-queryable.md index ed9d07ea5e..6928b25cef 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/6_zenoh-ex3-queryable.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/6_zenoh-ex3-queryable.md @@ -1,5 +1,6 @@ --- -title: Zenoh Example-3 Computation on Query using Queryable +title: Run a Zenoh queryable example for edge computation + weight: 7 ### FIXED, DO NOT MODIFY @@ -56,9 +57,10 @@ Sending Query 'demo/example/zenoh-rs-queryable'... The result is shown below: -![img3 alt-text#center](zenoh_ex3.gif "Figure 3: Computation on Query using Queryable") +![img3 Zenoh queryable node responding to on-demand queries from a remote device#center](zenoh_ex3.gif "Figure 3: Computation on Query using Queryable") + +The value you receive is generated in real time by the function defined in the queryable handler, not from pre-stored data. -The value you receive comes not from storage, but from the computation inside the queryable handler. ### Real-world application: distributed inference and computation diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/7_zenoh-querycomp.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/7_zenoh-querycomp.md index 1afd3c1103..ee2c54bec0 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/7_zenoh-querycomp.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/7_zenoh-querycomp.md @@ -1,5 +1,5 @@ --- -title: Zenoh Example-4 Dynamic Queryable with Computation +title: Run a Zenoh queryable with parameterized computation weight: 8 ### FIXED, DO NOT MODIFY From b33c662d5f54ee399a1656c2cc46019b5f38cf81 Mon Sep 17 00:00:00 2001 From: Maddy Underwood Date: Fri, 25 Jul 2025 15:51:12 +0000 Subject: [PATCH 6/9] Updated the Zenoh queryable example for clarity and consistency. Improved structure, simplified language, and clarified the battery health calculation. --- .../zenoh-multinode-ros2/1_intro-zenoh.md | 22 +++++++-------- .../zenoh-multinode-ros2/2_zenoh-install.md | 6 ++-- .../zenoh-multinode-ros2/3_zenoh-multinode.md | 19 +++++-------- .../4_zenoh-ex1-pubsub.md | 16 +++++------ .../5_zenoh-ex2-storagequery.md | 28 +++++++++++++------ .../6_zenoh-ex3-queryable.md | 19 +++++++------ .../zenoh-multinode-ros2/7_zenoh-querycomp.md | 27 ++++++++++-------- 7 files changed, 74 insertions(+), 63 deletions(-) diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md index a421923fb8..9d77e9aca6 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md @@ -15,10 +15,10 @@ Such systems require fast, reliable, and scalable data communication between nod This includes not just broadcasting sensor updates or actuator commands (pub/sub), but also performing state queries, storing values for later use, and even distributed computation across nodes. A modern protocol must be: -* Low-latency: Immediate delivery of time-critical messages. -* High-throughput: Efficient data flow across many devices. -* Decentralized: No reliance on central brokers or fixed infrastructure. -* Flexible: Able to run on lightweight edge devices, across WANs, or inside cloud-native environments. +* Low-latency: immediate delivery of time-critical messages +* High-throughput: efficient data flow across many devices +* Decentralized: no reliance on central brokers or fixed infrastructure +* Flexible: able to run on lightweight edge devices, across WANs, or inside cloud-native environments Traditional communication stacks such as Data Distribution Service (DDS) serve as the backbone for middleware like ROS 2. However, DDS struggles in multi-network or wireless environments where multicast is unavailable, or NAT traversal is needed. Zenoh was developed to address these challenges with a unified approach to data movement, storage, and interaction across heterogeneous, distributed systems. @@ -26,10 +26,10 @@ Traditional communication stacks such as Data Distribution Service (DDS) serve a [Eclipse Zenoh](https://zenoh.io/) is a modern, open-source, data-centric communication protocol that goes beyond traditional pub/sub. Designed specifically for edge computing, industrial IoT, robotics, and autonomous systems, Zenoh unifies: -- Data in motion through a powerful and efficient pub/sub model. -- Data at rest via geo-distributed storage plugins. -- Data in use with direct query support. -- On-demand computation via queryable nodes that can generate data dynamically. +- Data in motion through a powerful and efficient pub/sub model +- Data at rest via geo-distributed storage plugins +- Data in use with direct query support +- On-demand computation via queryable nodes that can generate data dynamically Unlike most traditional stacks, Zenoh is fully decentralized and designed to operate across cloud-to-edge-to-thing topologies, making it ideal for industrial robotics, autonomous systems, and smart environments. @@ -42,7 +42,7 @@ In this Learning Path, you’ll use Zenoh to build and validate a multi-node dis You can substitute Raspberry Pi with any Linux-based Arm device that supports networking, such as a Cortex-A or Neoverse board. By the end of this Learning Path, you'll be able to: -- Explain the core architecture and data flow principles behind Eclipse Zenoh protocol, including its support for pub/sub, querying, and queryable edge functions. -- Build and run distributed Zenoh examples across multiple Arm-based nodes using Raspberry Pi or other Arm Linux devices. -- Rebuild and extend a Zenoh queryable node to simulate edge-side logic. +- Explain the core architecture and data flow principles behind Eclipse Zenoh protocol, including its support for pub/sub, querying, and queryable edge functions +- Build and run distributed Zenoh examples across multiple Arm-based nodes using Raspberry Pi or other Arm Linux devices +- Rebuild and extend a Zenoh queryable node to simulate edge-side logic diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md index 50359df8be..2fdac32559 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md @@ -9,11 +9,9 @@ layout: learningpathall ## Set up Zenoh on Arm devices -This section shows how to install and build the open-source Eclipse Zenoh protocol on Arm-based devices like Raspberry Pi. +This section shows you how to install and build the open-source Eclipse Zenoh protocol on Arm-based devices like Raspberry Pi. -The following instructions have been verified on Raspberry Pi 4 and 5, but you can use any Arm Linux device. These steps apply to Raspberry Pi and other Arm-based Linux platforms. - -Before building Zenoh, make sure your system has the necessary development tools and runtime libraries. +The following instructions have been verified on Raspberry Pi 4 and 5, but you can use any Arm Linux device. These steps apply to Raspberry Pi and other Arm-based Linux platforms. Before building Zenoh, make sure your system has the necessary development tools and runtime libraries. ### Install the Rust development environment diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/3_zenoh-multinode.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/3_zenoh-multinode.md index 2655ab48d9..89eb8b05ca 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/3_zenoh-multinode.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/3_zenoh-multinode.md @@ -11,21 +11,16 @@ layout: learningpathall After building Zenoh and its core examples, the next step is to deploy them across multiple Arm-based devices. -If you’ve already installed Zenoh on an Arm Cortex-A or Neoverse platform as shown in the previous section, you can simply copy the compiled binaries from `~/zenoh/target/release/` to each of your Raspberry Pi devices. +If you’ve already installed Zenoh on an Arm Cortex-A or Neoverse platform as shown in the previous section, you can copy the compiled binaries from `~/zenoh/target/release/` to each of your Raspberry Pi devices. -However, to streamline deployment across multiple devices and ensure repeatability, this section demonstrates how to package Zenoh into a Docker image for batch rollout and scalable testing. +To simplify and scale deployment across multiple devices, this section shows how to containerize Zenoh with Docker for streamlined distribution and consistent multi-node testing. This containerized approach enables repeatable rollouts and makes it easier to test distributed communication across Raspberry Pi, Arm cloud instances (like AWS Graviton), and Arm Virtual Hardware. -This containerized approach not only simplifies deployment on Raspberry Pi, but also integrates seamlessly with Arm cloud platforms such as AWS Graviton Arm Cortex-A Linux or Arm Virtual Hardware, enabling a consistent cloud-to-edge development and validation workflow. - -In this session, you’ll use Raspberry Pi boards to simulate a scalable distributed environment. The same workflow applies to any Arm Linux system, including cloud instances and virtual hardware. - -This setup allows you to simulate real-world, cross-node communication scenarios, making it ideal for evaluating Zenoh’s performance in robotics and industrial IoT applications. +In this session, you’ll use Raspberry Pi boards to simulate a scalable distributed environment. The same workflow applies to any Arm Linux system, including cloud instances and virtual hardware. This setup allows you to simulate real-world, cross-node communication scenarios, making it ideal for evaluating Zenoh’s performance in robotics and industrial IoT applications. Zenoh is ideal for robotics and industrial IoT systems that require fast, decentralized communication. It supports scalable data exchange across devices using pub/sub, storage, and query models. ### Install Docker on Raspberry Pi -To simplify this process and ensure consistency, you can use Docker to containerize your Zenoh and ROS 2 environment. -This lets you quickly replicate the same runtime on any device without needing to rebuild from source. +To simplify this process and ensure consistency, you can use Docker to containerize your Zenoh and ROS 2 environment. This lets you quickly replicate the same runtime on any device without needing to rebuild from source. -This enables multi-node testing and real-world distributed communication scenarios. +This enables scalable, multi-node testing in realistic distributed environments. First, install Docker on each Raspberry Pi device: @@ -146,9 +141,9 @@ docker run -it --network=host zenoh-node The Zenoh example binaries are now available within this container, allowing you to test pub/sub and query flows across devices. -## Run Zenoh in a multi-node environment +## Run Zenoh examples in a multi-node environment -You’re now ready to run and test Zenoh communication flows across distributed edge devices. +With Zenoh running inside containers across devices, you’re now ready to explore real-time communication using prebuilt examples. The following examples are written in Rust and precompiled in your container image. They're fully interoperable and can be used to demonstrate Zenoh's key capabilities across devices. The Rust binaries are available in the `$ZENOH_LOC/target/release/examples/` directory. If you haven't set `ZENOH_LOC`, they can be found under `~/zenoh/target/release/examples/`. diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/4_zenoh-ex1-pubsub.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/4_zenoh-ex1-pubsub.md index 8d6f2bf388..b1b5571c0e 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/4_zenoh-ex1-pubsub.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/4_zenoh-ex1-pubsub.md @@ -12,18 +12,18 @@ This example demonstrates Zenoh's real-time publish/subscribe model across two R The subscriber listens for all data published under the key expression `demo/example/**`, which matches any topic beginning with `demo/example/`. -## Start the subscriber node +### Start the subscriber node -Run the subscriber example on one of the Raspberry Pi systems. +Run the subscriber example on one of the Raspberry Pi systems: ```bash cd ~/zenoh/target/release/examples ./z_sub ``` -## Start the publisher node +### Start the publisher node -Then, log in to the other Raspberry Pi and run the publisher. +Then, log in to the other Raspberry Pi and run the publisher: ```bash cd ~/zenoh/target/release/examples @@ -34,15 +34,13 @@ cd ~/zenoh/target/release/examples You can run both `z_sub` and `z_pub` on the same device for testing, but running them on separate Raspberry Pis demonstrates Zenoh’s distributed discovery and cross-node communication. {{% /notice %}} -## Observe the pub/sub data flow +### Observe the pub/sub data flow -The result is shown below: +The results are shown below: ![img1 Zenoh subscriber receiving messages from a publisher in a two-terminal view#center](zenoh_ex1.gif "Simple Pub/Sub") -The left-side window shows the `z_sub` program. - -It receives values with the key `demo/example/zenoh-rs-pub` continuously published by `z_pub` running in the right-side window. +The left-side window shows the `z_sub` program. It receives values with the key `demo/example/zenoh-rs-pub` continuously published by `z_pub` running in the right-side window. This example confirms that Zenoh’s zero-configuration peer discovery and real-time pub/sub communication are working correctly across physical nodes. diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md index 7976148a81..ffed116367 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md @@ -7,14 +7,17 @@ weight: 6 layout: learningpathall --- -## Example 2: Storage and query +## Query historical data using Zenoh’s storage engine -The second example adds Zenoh's data storage and querying capabilities by enabling nodes to retrieve historical values on demand. +This example demonstrates Zenoh's data storage and query model which enables nodes to retrieve previously published values—even after the original publisher goes offline. -Building on the previous pub/sub example, you’ll now explore how Zenoh supports persistent data storage and on-demand querying, a powerful feature for robotics and IIoT applications. +Building on the previous pub/sub example, you’ll now run a lightweight Zenoh daemon that stores key–value pairs in memory. Then, you’ll publish data with `z_put` and retrieve it using `z_get`. -In a typical warehouse or factory scenario, autonomous robots can periodically publish sensor data,such as position, temperature, or battery level—that a central system or peer robot may later need to query. +This pattern is ideal for robotics and IIoT scenarios where devices intermittently connect or request snapshots of remote state. +For example, in a warehouse or factory: +- Robots can periodically publish position, temperature, or battery level +- A central system or peer node can later query these values on demand Unlike Pub/Sub, which requires live, real-time message exchange, Zenoh's storage and query model enables asynchronous access to data that was published earlier, even if the original publisher is no longer online. @@ -22,7 +25,7 @@ In this example, you’ll run the `zenohd` daemon with in-memory storage and use This is especially useful for distributed systems where nodes may intermittently connect or request snapshots of state from peers. -### Step 1: Start the Zenoh daemon with in-memory storage +### Start the Zenoh daemon with in-memory storage On one Raspberry Pi, launch the Zenoh daemon with a configuration that enables in-memory storage for keys in the `demo/example/**` directory. @@ -37,7 +40,7 @@ You should see log messages indicating that the storage_manager plugin is loaded If port 7447 is already in use, either stop any previous Zenoh processes or configure a custom port using the `listen.endpoints.router` setting. -### Step 2: Publish data +### Publish a value On 2nd Raspberry Pi device, use `z_put` to send a key-value pair that will be handled by the `zenohd` storage. @@ -48,7 +51,7 @@ cd ~/zenoh/target/release/examples This command stores the string `Hello from storage!` under the key demo/example/test1. -### Step 3: Query the data +### Query the stored value Back on first Raspberry Pi, you can now query the stored data from any Zenoh connected node. @@ -68,9 +71,18 @@ The result is shown below: ![img2 alt-text#center](zenoh_ex2.gif "Figure 2: Storage and Query") -{{% notice tip %}} +{{% notice Tip %}} If you have more than two Raspberry Pi devices, you can run the `z_get` command on a third device to validate that storage queries work seamlessly across a multi-node setup. {{% /notice %}} This example shows how Zenoh's storage with query model supports asynchronous data access and resilient state-sharing—critical capabilities in robotics and industrial IoT systems where network connectivity may be intermittent or system components loosely coupled. +## What's next + +Now that you've seen how Zenoh handles pub/sub and storage-based queries, you're ready to build reactive and intelligent edge nodes. + +In the next example, you’ll implement a **Zenoh queryable** that responds to runtime parameters,such as battery level and temperature, by computing and returning a real-time health score. This showcases how Zenoh supports on-demand edge computation without needing to pre-store data. + + + + diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/6_zenoh-ex3-queryable.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/6_zenoh-ex3-queryable.md index 6928b25cef..acc348768c 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/6_zenoh-ex3-queryable.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/6_zenoh-ex3-queryable.md @@ -1,5 +1,5 @@ --- -title: Run a Zenoh queryable example for edge computation +title: Run a Zenoh queryable node for on-demand edge computation weight: 7 @@ -7,19 +7,19 @@ weight: 7 layout: learningpathall --- -## Example 3: Computation on query +## Computation on query -Next, you’ll explore Zenoh's queryable capability, which lets a node dynamically respond to data queries by executing a custom computation or data generation function. +This example demonstrates Zenoh's queryable capability, which lets a node respond to incoming data requests by computing results in real time, rather than returning previously stored values. Unlike `zenohd` which simply returns stored data, a queryable node can register to handle a specific key expression and generate responses at runtime. This is ideal for distributed computing at the edge, where lightweight devices, such as Raspberry Pi nodes, can respond to requests with calculated values. This enables sensor fusion, AI inference results, and diagnostics. -### Use Case: On-Demand battery health estimation +### Use case: estimate battery health on demand Imagine a robot fleet management system where the central planner queries each robot for its latest battery health score, which is not published continuously but calculated only when queried. -This saves bandwidth and enables edge compute optimization using Zenoh's Queryable. +This reduces bandwidth usage and enables edge-side optimization using Zenoh's queryable feature. -### Step 1: Launch a queryable node +### Launch a queryable node On one Raspberry Pi device, run the `z_queryable` Zenoh example to register a queryable handler. @@ -38,7 +38,7 @@ Press CTRL-C to quit... The node is now ready to accept queries on the key `demo/example/zenoh-rs-queryable` and respond with a predefined message. -### Step 2: Trigger a query from another node +### Trigger a query from another node On the other Raspberry Pi device, run the `z_get` example. @@ -71,4 +71,7 @@ This model enables edge-based intelligence, such as: Queryable is a key feature for data-in-use scenarios, allowing fine-grained, on-demand compute inside your Zenoh-powered architecture. -Next, you’ll extend this Queryable pattern to perform parameterized computation, simulating edge diagnostics and adaptive inference. \ No newline at end of file +## What's next + +In the next example, you'll extend this queryable pattern to support **runtime parameters**, such as battery level and temperature, allowing each node to return a calculated health score on demand. + diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/7_zenoh-querycomp.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/7_zenoh-querycomp.md index ee2c54bec0..5708a5f219 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/7_zenoh-querycomp.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/7_zenoh-querycomp.md @@ -1,5 +1,5 @@ --- -title: Run a Zenoh queryable with parameterized computation +title: Run a Zenoh queryable with parameterized Rust computation weight: 8 ### FIXED, DO NOT MODIFY @@ -14,7 +14,7 @@ You’ll learn how to use Zenoh's Queryable API in Rust to build a parameterized This extends a previous example by supporting runtime query parameters like battery level and temperature. -## Use Case: Real-time battery health via computation +## Use case: real-time battery health through on-demand computation In robotic fleet management, a central controller may need to assess each robot’s battery health on demand. @@ -22,7 +22,7 @@ Instead of streaming data continuously, robots expose a queryable endpoint that This saves bandwidth and enables lightweight edge-side decision-making. -### Step 1: Create a new Zenoh rust project +### Create a new Zenoh rust project On any Raspberry Pi: @@ -40,7 +40,7 @@ tokio = { version = "1", features = ["full"] } url = "2" ``` -### Step 2: Implement the queryable node +### Implement the queryable node Next, log in to the other Raspberry Pi. @@ -103,8 +103,14 @@ Inside the callback: - A health score is computed from these inputs. - The result is sent back to the querying client using query.reply(). +{{% notice Tip %}} +You can extend this queryable pattern to respond to other real-time diagnostics, such as CPU load, camera snapshots, or local ML inference results. +{{% /notice %}} + This design pattern enables efficient, on-demand data exchange with minimal bandwidth usage. This is ideal for edge computing scenarios where resources and connectivity are constrained. +### Battery health estimation formula + The health score is calculated using the following logic: ```rust @@ -115,16 +121,15 @@ This formula estimates battery health as a percentage, considering both battery - battery: Current battery level (default 50%) - temp: Current temperature (default 25°C) -The health estimation logic begins with the battery level as the baseline score. -If the temperature rises above 25°C, the score is adjusted downward—specifically, for every 2°C above this threshold, the health is reduced by 1%. +This logic computes battery health as a percentage, adjusting for elevated temperatures. If temperature exceeds 25°C, the score is reduced by 1% for every 2°C increase. To ensure the calculation remains safe even when the temperature is below 25°C, the code uses saturating_sub(25), which prevents the result from becoming negative and avoids potential underflow errors. -For example, if battery = 88 and temp = 32, then: +For example, if `battery = 88` and `temp = 32`, then: - Temperature offset = (32 - 25) / 2 = 3 - Health = 88 - 3 = 85% -### Step 3: Build and run +### Build and run ```bash cd $HOME/zenoh/zenoh_battery_estimator @@ -138,7 +143,7 @@ After the build process, you will see: Finished `release` profile [optimized] target(s) in 1m 22s ``` -### Step 4: Query it with parameters +### Query it with parameters Run it on the Raspberry Pi you used for the build run: @@ -156,9 +161,9 @@ cd ~/zenoh/target/release/examples The result is shown below: -![img4 alt-text#center](zenoh_ex4.gif "Figure 4: Dynamic Queryable with Computation") +![img4 Estimated battery health query#center](zenoh_ex4.gif "Figure 4: Dynamic Queryable with Computation") -The excepted output is: +The expected output is: ```output >> Received ('robot/battery/estimate': 'Estimated battery health: 85%') From 008b4ec049a8ad0f6da12da1b6747ee3a9af32ae Mon Sep 17 00:00:00 2001 From: Maddy Underwood Date: Fri, 25 Jul 2025 16:24:39 +0000 Subject: [PATCH 7/9] updates --- .../cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md index 9d77e9aca6..3b46ee7423 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md @@ -1,5 +1,5 @@ --- -title: Introduction to Zenoh +title: Build scalable communication systems with Eclipse Zenoh weight: 2 ### FIXED, DO NOT MODIFY From fd5f1561acf7e87b79c36c82a82b6e9b04b1d619 Mon Sep 17 00:00:00 2001 From: Maddy Underwood Date: Fri, 25 Jul 2025 16:26:52 +0000 Subject: [PATCH 8/9] Updates --- .../zenoh-multinode-ros2/2_zenoh-install.md | 6 +++--- .../zenoh-multinode-ros2/3_zenoh-multinode.md | 19 +++++++++---------- .../4_zenoh-ex1-pubsub.md | 10 +++++----- .../5_zenoh-ex2-storagequery.md | 6 +++--- .../6_zenoh-ex3-queryable.md | 15 +++++++-------- 5 files changed, 27 insertions(+), 29 deletions(-) diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md index 2fdac32559..2c40074624 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md @@ -13,7 +13,7 @@ This section shows you how to install and build the open-source Eclipse Zenoh pr The following instructions have been verified on Raspberry Pi 4 and 5, but you can use any Arm Linux device. These steps apply to Raspberry Pi and other Arm-based Linux platforms. Before building Zenoh, make sure your system has the necessary development tools and runtime libraries. -### Install the Rust development environment +## Install the Rust development environment First, install the [Rust](https://www.rust-lang.org/) environment. The core of Zenoh is developed in Rust for performance and safety. @@ -36,13 +36,13 @@ source "$HOME/.cargo/env" For more information, see the [Rust Install Guide](/install-guides/rust/) for Arm Linux. -### Install ROS 2 +## Install ROS 2 [Robot Operating System](https://www.ros.org/) is a set of software libraries and tools that help you build robot applications. ROS provides everything from drivers to state-of-the-art algorithms, as well as developer tools. It is completely open-source. If you plan to use Zenoh alongside ROS 2, for example, to bridge DDS-based nodes, you should install ROS 2 before proceeding. See the [ROS2 Installation Guide](/install-guides/ros2/) to install ROS 2 on your Arm platforms. -### Download and build the Zenoh source +## Download and build the Zenoh source Clone the Zenoh repository: diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/3_zenoh-multinode.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/3_zenoh-multinode.md index 89eb8b05ca..bc7f7ccaf7 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/3_zenoh-multinode.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/3_zenoh-multinode.md @@ -15,9 +15,9 @@ If you’ve already installed Zenoh on an Arm Cortex-A or Neoverse platform as s To simplify and scale deployment across multiple devices, this section shows how to containerize Zenoh with Docker for streamlined distribution and consistent multi-node testing. This containerized approach enables repeatable rollouts and makes it easier to test distributed communication across Raspberry Pi, Arm cloud instances (like AWS Graviton), and Arm Virtual Hardware. -In this session, you’ll use Raspberry Pi boards to simulate a scalable distributed environment. The same workflow applies to any Arm Linux system, including cloud instances and virtual hardware. This setup allows you to simulate real-world, cross-node communication scenarios, making it ideal for evaluating Zenoh’s performance in robotics and industrial IoT applications. Zenoh is ideal for robotics and industrial IoT systems that require fast, decentralized communication. It supports scalable data exchange across devices using pub/sub, storage, and query models. +In this session, you’ll use Raspberry Pi boards to simulate a scalable distributed environment. The same workflow applies to any Arm Linux system, including cloud instances and virtual hardware. This setup allows you to simulate real-world, cross-node communication scenarios, making it ideal for evaluating Zenoh’s performance in robotics and industrial IoT applications. This setup simulates real-world, cross-node communication scenarios, making it ideal for robotics and industrial IoT applications that require fast, decentralized messaging using pub/sub, storage, and query models. -### Install Docker on Raspberry Pi +## Install Docker on Raspberry Pi To simplify this process and ensure consistency, you can use Docker to containerize your Zenoh and ROS 2 environment. This lets you quickly replicate the same runtime on any device without needing to rebuild from source. This enables scalable, multi-node testing in realistic distributed environments. @@ -29,7 +29,7 @@ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh sudo usermod -aG docker $USER ; newgrp docker ``` -### Create a ROS 2 + Zenoh Docker image +## Create a Docker image with ROS 2 and Zenoh To ensure compatibility with ROS-related tools, create a `Dockerfile` based on `ros:galactic `, and use the official Rust installation method to build Zenoh, as shown below. @@ -107,11 +107,12 @@ docker pull odinlmshen/zenoh-node Once built, you can reuse this Docker image across multiple Arm-based nodes, including Raspberry Pi, AWS Graviton, and Arm Virtual Hardware. {{% /notice %}} -### Transfer the Docker image to the other Raspberry Pi +## Transfer the Docker image to another Raspberry Pi + There are two options to transfer the Docker image to your second device. Choose one of the following methods. -Option 1: Save and copy via file +1. Save and copy using the file: ```bash docker save zenoh-node > zenoh-node.tar @@ -124,14 +125,11 @@ On the target device: docker load < zenoh-node.tar ``` -Option 2: Push the image to a container registry such as Docker Hub +2. Push the image to a container registry such as Docker Hub: You can also push the image to Docker Hub or GitHub Container Registry and pull it on the second device. - - - -### Run the Docker image +## Run the Docker image Once the image is successfully loaded on the second device, you can run the container to start the Zenoh environment. @@ -154,3 +152,4 @@ The following sections illustrate the procedures to run the Zenoh examples so as - Queryable – for enabling on-demand remote computation - Dynamic queryable with computation – for executing dynamic logic across nodes +With your Zenoh examples running across containers, you’re now ready to build and benchmark real-time communication flows across nodes, which is ideal for simulating robotic fleets or industrial systems. \ No newline at end of file diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/4_zenoh-ex1-pubsub.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/4_zenoh-ex1-pubsub.md index b1b5571c0e..08c889a2ef 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/4_zenoh-ex1-pubsub.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/4_zenoh-ex1-pubsub.md @@ -8,11 +8,11 @@ layout: learningpathall ## Test Zenoh pub/sub across two devices -This example demonstrates Zenoh's real-time publish/subscribe model across two Raspberry Pi devices. +This example demonstrates how to use Zenoh’s real-time publish/subscribe model to exchange messages between two Raspberry Pi devices over a local network. -The subscriber listens for all data published under the key expression `demo/example/**`, which matches any topic beginning with `demo/example/`. +Pub/sub is a core Zenoh communication pattern where data producers (publishers) send values to a key, and data consumers (subscribers) receive updates for matching key expressions. In this case, the subscriber listens for all messages published under the key expression `demo/example/**`, which matches any topic that begins with `demo/example/`. This enables flexible topic filtering and lightweight data dissemination across distributed systems. -### Start the subscriber node +## Start the subscriber node Run the subscriber example on one of the Raspberry Pi systems: @@ -21,7 +21,7 @@ cd ~/zenoh/target/release/examples ./z_sub ``` -### Start the publisher node +## Start the publisher node Then, log in to the other Raspberry Pi and run the publisher: @@ -34,7 +34,7 @@ cd ~/zenoh/target/release/examples You can run both `z_sub` and `z_pub` on the same device for testing, but running them on separate Raspberry Pis demonstrates Zenoh’s distributed discovery and cross-node communication. {{% /notice %}} -### Observe the pub/sub data flow +## Observe the pub/sub data flow The results are shown below: diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md index ffed116367..f8f51f79e1 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md @@ -25,7 +25,7 @@ In this example, you’ll run the `zenohd` daemon with in-memory storage and use This is especially useful for distributed systems where nodes may intermittently connect or request snapshots of state from peers. -### Start the Zenoh daemon with in-memory storage +## Start the Zenoh daemon with in-memory storage On one Raspberry Pi, launch the Zenoh daemon with a configuration that enables in-memory storage for keys in the `demo/example/**` directory. @@ -40,7 +40,7 @@ You should see log messages indicating that the storage_manager plugin is loaded If port 7447 is already in use, either stop any previous Zenoh processes or configure a custom port using the `listen.endpoints.router` setting. -### Publish a value +## Publish a value On 2nd Raspberry Pi device, use `z_put` to send a key-value pair that will be handled by the `zenohd` storage. @@ -51,7 +51,7 @@ cd ~/zenoh/target/release/examples This command stores the string `Hello from storage!` under the key demo/example/test1. -### Query the stored value +## Query the stored value Back on first Raspberry Pi, you can now query the stored data from any Zenoh connected node. diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/6_zenoh-ex3-queryable.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/6_zenoh-ex3-queryable.md index acc348768c..5787eebfb2 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/6_zenoh-ex3-queryable.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/6_zenoh-ex3-queryable.md @@ -9,17 +9,17 @@ layout: learningpathall ## Computation on query -This example demonstrates Zenoh's queryable capability, which lets a node respond to incoming data requests by computing results in real time, rather than returning previously stored values. +This example shows how to use Zenoh’s queryable feature to return computed results in real time, instead of serving pre-stored values. -Unlike `zenohd` which simply returns stored data, a queryable node can register to handle a specific key expression and generate responses at runtime. This is ideal for distributed computing at the edge, where lightweight devices, such as Raspberry Pi nodes, can respond to requests with calculated values. This enables sensor fusion, AI inference results, and diagnostics. +Unlike `zenohd` which simply returns stored data, a queryable node can register to handle a specific key expression and generate responses at runtime. This is ideal for distributed computing at the edge, where lightweight devices, such as Raspberry Pi nodes, can respond to requests with calculated values. This pattern is ideal for sensor fusion, lightweight AI inference, and dynamic system diagnostics on resource-constrained edge devices. -### Use case: estimate battery health on demand +## Use case: estimate battery health on demand Imagine a robot fleet management system where the central planner queries each robot for its latest battery health score, which is not published continuously but calculated only when queried. This reduces bandwidth usage and enables edge-side optimization using Zenoh's queryable feature. -### Launch a queryable node +## Launch a queryable node On one Raspberry Pi device, run the `z_queryable` Zenoh example to register a queryable handler. @@ -38,7 +38,7 @@ Press CTRL-C to quit... The node is now ready to accept queries on the key `demo/example/zenoh-rs-queryable` and respond with a predefined message. -### Trigger a query from another node +## Trigger a query from another node On the other Raspberry Pi device, run the `z_get` example. @@ -59,10 +59,9 @@ The result is shown below: ![img3 Zenoh queryable node responding to on-demand queries from a remote device#center](zenoh_ex3.gif "Figure 3: Computation on Query using Queryable") -The value you receive is generated in real time by the function defined in the queryable handler, not from pre-stored data. +The response is generated dynamically by the queryable handler, and not fetched from stored data. - -### Real-world application: distributed inference and computation +## Real-world use cases This model enables edge-based intelligence, such as: - Executing custom logic in response to a query such as “calculate load average” From bd15adce029bd50ea692cbd2e8f5c3103b94fe18 Mon Sep 17 00:00:00 2001 From: Maddy Underwood Date: Fri, 25 Jul 2025 16:37:35 +0000 Subject: [PATCH 9/9] final --- .../zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md | 6 +++--- .../zenoh-multinode-ros2/6_zenoh-ex3-queryable.md | 2 +- .../zenoh-multinode-ros2/7_zenoh-querycomp.md | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md index f8f51f79e1..c7bb8846ab 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/5_zenoh-ex2-storagequery.md @@ -16,8 +16,8 @@ Building on the previous pub/sub example, you’ll now run a lightweight Zenoh d This pattern is ideal for robotics and IIoT scenarios where devices intermittently connect or request snapshots of remote state. For example, in a warehouse or factory: -- Robots can periodically publish position, temperature, or battery level -- A central system or peer node can later query these values on demand +- Robots can periodically publish position, temperature, or battery level. +- A central system or peer node can later query these values on demand. Unlike Pub/Sub, which requires live, real-time message exchange, Zenoh's storage and query model enables asynchronous access to data that was published earlier, even if the original publisher is no longer online. @@ -77,7 +77,7 @@ If you have more than two Raspberry Pi devices, you can run the `z_get` command This example shows how Zenoh's storage with query model supports asynchronous data access and resilient state-sharing—critical capabilities in robotics and industrial IoT systems where network connectivity may be intermittent or system components loosely coupled. -## What's next +## What's next? Now that you've seen how Zenoh handles pub/sub and storage-based queries, you're ready to build reactive and intelligent edge nodes. diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/6_zenoh-ex3-queryable.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/6_zenoh-ex3-queryable.md index 5787eebfb2..8bd96ce9c0 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/6_zenoh-ex3-queryable.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/6_zenoh-ex3-queryable.md @@ -70,7 +70,7 @@ This model enables edge-based intelligence, such as: Queryable is a key feature for data-in-use scenarios, allowing fine-grained, on-demand compute inside your Zenoh-powered architecture. -## What's next +## What's next? In the next example, you'll extend this queryable pattern to support **runtime parameters**, such as battery level and temperature, allowing each node to return a calculated health score on demand. diff --git a/content/learning-paths/cross-platform/zenoh-multinode-ros2/7_zenoh-querycomp.md b/content/learning-paths/cross-platform/zenoh-multinode-ros2/7_zenoh-querycomp.md index 5708a5f219..c017ec8ca1 100644 --- a/content/learning-paths/cross-platform/zenoh-multinode-ros2/7_zenoh-querycomp.md +++ b/content/learning-paths/cross-platform/zenoh-multinode-ros2/7_zenoh-querycomp.md @@ -22,7 +22,7 @@ Instead of streaming data continuously, robots expose a queryable endpoint that This saves bandwidth and enables lightweight edge-side decision-making. -### Create a new Zenoh rust project +## Create a new Zenoh rust project On any Raspberry Pi: @@ -40,7 +40,7 @@ tokio = { version = "1", features = ["full"] } url = "2" ``` -### Implement the queryable node +## Implement the queryable node Next, log in to the other Raspberry Pi. @@ -109,7 +109,7 @@ You can extend this queryable pattern to respond to other real-time diagnostics, This design pattern enables efficient, on-demand data exchange with minimal bandwidth usage. This is ideal for edge computing scenarios where resources and connectivity are constrained. -### Battery health estimation formula +## Battery health estimation formula The health score is calculated using the following logic: @@ -129,7 +129,7 @@ For example, if `battery = 88` and `temp = 32`, then: - Temperature offset = (32 - 25) / 2 = 3 - Health = 88 - 3 = 85% -### Build and run +## Build and run ```bash cd $HOME/zenoh/zenoh_battery_estimator @@ -143,7 +143,7 @@ After the build process, you will see: Finished `release` profile [optimized] target(s) in 1m 22s ``` -### Query it with parameters +## Query it with parameters Run it on the Raspberry Pi you used for the build run: