Skip to content

Commit 077bb7d

Browse files
committed
Update Zenoh learing path content, add queryable computing by rust
1 parent 912fb39 commit 077bb7d

5 files changed

Lines changed: 234 additions & 64 deletions

File tree

content/learning-paths/cross-platform/zenoh-multinode-ros2/1_intro-zenoh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Introduction Zenoh
2+
title: Introduction to Zenoh
33
weight: 2
44

55
### FIXED, DO NOT MODIFY

content/learning-paths/cross-platform/zenoh-multinode-ros2/2_zenoh-install.md

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ weight: 3
66
layout: learningpathall
77
---
88

9-
### Installation: Setting Up Zenoh on Arm Devices
9+
## Setting Up Zenoh on Arm Devices
1010

1111
The following instructions are verified on both Raspberry Pi 4/5 and Arm Virtual Hardware, but you can implement them on any Cortex-A Linux device.
1212

1313
Before building Zenoh, make sure your system has the necessary development tools and runtime libraries.
1414

15-
#### Install the Rust build environment
15+
### Install the Rust build environment
1616

1717
First, we need to install the [Rust](https://www.rust-lang.org/) build environment, since the core of Zenoh is totally developed using Rust to keep it safe and efficient.
1818

@@ -30,16 +30,15 @@ Rust is installed now. Great!
3030

3131
For more details, refer to [Rust’s official install guide.](https://doc.rust-lang.org/cargo/getting-started/installation.html#install-rust-and-cargo)
3232

33-
#### Install ROS 2
33+
### Install ROS 2
3434

3535
[Robot Operating System](https://www.ros.org/) is a set of software libraries and tools that help you build robot applications. From drivers to state-of-the-art algorithms, and with powerful developer tools, ROS has what you need for your next robotics project. And it's all open source.
3636

3737
Since ROS was started in 2007, a lot has changed in the robotics and ROS community. The goal of the [ROS 2](https://docs.ros.org/en/rolling/index.html) project is to adapt to these changes, leveraging what is great about ROS 1 and improving what isn’t.
3838

3939
Here is the quick [installation guide](https://learn.arm.com/install-guides/ros2/) about how to install ROS 2 in Arm platform.
4040

41-
42-
## Download and build the Zenoh source
41+
### Download and build the Zenoh source
4342

4443
Now, we can clone the Zenoh.
4544

@@ -59,35 +58,44 @@ This will take several minutes depending on your device. Once the installation i
5958

6059
```output
6160
cargo build --release --all-targets -j $(nproc)
61+
Updating crates.io index
62+
Downloaded humantime v2.2.0
63+
Downloaded spin v0.10.0
64+
Downloaded crossbeam-channel v0.5.14
65+
Downloaded uhlc v0.8.1
66+
Downloaded 4 crates (182.5 KB) in 2.19s
6267
warning: output filename collision.
63-
The lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-storage-manager)` has the same output filename as the lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-storage-manager)`.
64-
Colliding filename is: /home/ubuntu/zenoh/zenoh/target/release/deps/libzenoh_plugin_storage_manager.so
68+
The lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)` has the same output filename as the lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)`.
69+
Colliding filename is: /home/ubuntu/zenoh/target/release/deps/libzenoh_plugin_storage_manager.so
6570
The targets should have unique names.
6671
Consider changing their names to be unique or compiling them separately.
6772
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
6873
warning: output filename collision.
69-
The lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-storage-manager)` has the same output filename as the lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-storage-manager)`.
70-
Colliding filename is: /home/ubuntu/zenoh/zenoh/target/release/deps/libzenoh_plugin_storage_manager.so.dwp
74+
The lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)` has the same output filename as the lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)`.
75+
Colliding filename is: /home/ubuntu/zenoh/target/release/deps/libzenoh_plugin_storage_manager.so.dwp
7176
The targets should have unique names.
7277
Consider changing their names to be unique or compiling them separately.
7378
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
7479
warning: output filename collision.
75-
The lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-storage-manager)` has the same output filename as the lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-storage-manager)`.
76-
Colliding filename is: /home/ubuntu/zenoh/zenoh/target/release/deps/libzenoh_plugin_storage_manager.rlib
80+
The lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)` has the same output filename as the lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)`.
81+
Colliding filename is: /home/ubuntu/zenoh/target/release/deps/libzenoh_plugin_storage_manager.rlib
7782
The targets should have unique names.
7883
Consider changing their names to be unique or compiling them separately.
7984
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
80-
Compiling zenoh-plugin-storage-manager v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-storage-manager)
81-
Compiling zenoh-ext-examples v1.3.0 (/home/ubuntu/zenoh/zenoh/zenoh-ext/examples)
82-
Compiling zenoh-plugin-rest v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-rest)
83-
Compiling zenohd v1.3.0 (/home/ubuntu/zenoh/zenoh/zenohd)
84-
Compiling zenoh-backend-example v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-backend-example)
85-
Compiling zenoh-examples v1.3.0 (/home/ubuntu/zenoh/zenoh/examples)
86-
Compiling zenoh-ext v1.3.0 (/home/ubuntu/zenoh/zenoh/zenoh-ext)
87-
Compiling zenoh_backend_traits v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-backend-traits)
88-
Compiling zenoh-plugin-example v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-example)
89-
Compiling zenoh v1.3.0 (/home/ubuntu/zenoh/zenoh/zenoh)
90-
Finished `release` profile [optimized] target(s) in 8m 12/home/ubuntu/zenoh/zenoh/plugins/zenoh-backend-examples
85+
Compiling proc-macro2 v1.0.86
86+
Compiling unicode-ident v1.0.13
87+
Compiling libc v0.2.158
88+
Compiling version_check v0.9.5
89+
Compiling autocfg v1.3.0
90+
...
91+
Compiling zenoh-link-quic v1.4.0 (/home/ubuntu/zenoh/io/zenoh-links/zenoh-link-quic)
92+
Compiling zenoh_backend_traits v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-backend-traits)
93+
Compiling zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)
94+
Compiling zenoh-ext v1.4.0 (/home/ubuntu/zenoh/zenoh-ext)
95+
Compiling zenoh-ext-examples v1.4.0 (/home/ubuntu/zenoh/zenoh-ext/examples)
96+
Compiling zenoh-plugin-example v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-example)
97+
Compiling zenoh-backend-example v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-backend-example)
98+
Finished `release` profile [optimized] target(s) in 6m 28s
9199
```
92100

93101
After the build process, the binary executables will be stored under the directory of `~/zenoh/target/release/examples/`.
@@ -96,3 +104,4 @@ After the build process, the binary executables will be stored under the directo
96104
Installation time may vary depending on your device’s processing power.
97105
{{% /notice %}}
98106

107+
With Zenoh successfully compiled, you’re ready to explore how nodes communicate using the Zenoh runtime.

content/learning-paths/cross-platform/zenoh-multinode-ros2/3_zenoh-multinode.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Setup Multi-Node Environment
2+
title: Setting Up a Multi-Node Environment
33
weight: 4
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
### Deploying Zenoh on Multiple Raspberry Pi Devices Using Docker
9+
## Deploying Zenoh on Multiple Raspberry Pi Devices Using Docker
1010

1111
After building Zenoh and its core examples, your next step is to deploy them across multiple Arm-based devices.
1212

@@ -16,7 +16,7 @@ You’ll learn how to use Docker to deploy the environment on physical devices,
1616

1717
This setup lets you simulate `real-world`, `cross-node communication`, making it ideal for validating Zenoh’s performance in robotics and industrial IoT use cases.
1818

19-
#### Install Docker on Raspberry Pi
19+
### Install Docker on Raspberry Pi
2020

2121
To simplify this process and ensure consistency, you’ll use Docker to containerize your Zenoh and ROS 2 environment.
2222
This lets you quickly replicate the same runtime on any device without needing to rebuild from source.
@@ -32,7 +32,7 @@ sudo usermod -aG docker pi
3232

3333
Log out and back in, or run newgrp docker to activate Docker group permissions.
3434

35-
#### Create a ROS 2 + DDS Docker Image
35+
### Create a ROS 2 + DDS Docker Image
3636

3737
In a working directory, create a `Dockerfile` with the following content to create the ROS 2 / DDS docker image.
3838

@@ -47,55 +47,58 @@ CMD bash
4747
Under the directory where the above Dockerfile exists, run the following command to generate the docker image.
4848

4949
```bash
50-
$ docker build -t ros2-docker .
50+
$ docker build -t zenoh-node .
5151
```
5252

5353
After this has been done, the created ROS 2 docker image can be seen by the following command.
5454

5555
```bash
56-
$ docker images | grep ros2-docker
56+
$ docker images | grep zenoh-node
5757
```
5858

5959
```output
60-
ros2-docker latest b7a9c27cf8a8 About a minute ago 962MB
60+
zenoh-node latest b7a9c27cf8a8 About a minute ago 962MB
6161
```
6262

63-
#### Transfer the Docker Image on Another RPi
63+
### Transfer the Docker Image on Another RPi
6464

6565
You now need to transfer the Docker image to your second device. Choose one of the following methods:
6666

67-
There are two of option you can do:
67+
You have two options:
6868

6969
Option 1: Save and copy via file
7070

7171
```bash
72-
docker save ros2-docker > ros2-docker.tar
73-
scp ros2-docker.tar pi@<target_ip>:/home/pi/
72+
docker save zenoh-node > zenoh-node.tar
73+
scp zenoh-node.tar pi@<target_ip>:/home/pi/
7474
```
7575

7676
On the target device:
7777
```bash
78-
docker load < ros2-docker.tar
78+
docker load < zenoh-node.tar
7979
```
8080

8181
Option 2: Push to a container registry (e.g., DockerHub or GHCR).
8282

8383
You can also push the image to Docker Hub or GitHub Container Registry and pull it on the second device.
8484

85-
#### Run the Docker Image
85+
### Run the Docker Image
8686

87-
Once you success load the image into second device, you can run the container by
87+
Once the image is successfully loaded into second device, you can run the container by
8888

8989
```bash
9090
docker run -it --network=host zenoh-node
9191
```
9292

9393
Now, all the Zenoh example binaries are now available within this container, allowing you to test pub/sub and query flows across devices.
9494

95-
### Another Duplicate Settup Option on Arm Virtual Hardware RPi devices (Optional)
95+
### Another Duplicate Setting Option on Arm Virtual Hardware
9696

9797
If you have [Corellium](https://www.corellium.com/) account, you can
9898

9999
1. Set up and install Zenoh on a single AVH instance.
100100
2. Use the [Clone](https://support.corellium.com/features/snapshots) function to duplicate the environment.
101101
3. Optionally, you may optionally rename the device to avh* for easy device recognition by changing the setting in the `/etc/hostname` file.
102+
103+
104+
With your multi-node environment in place, you’re now ready to run and test Zenoh communication flows across distributed edge devices.

content/learning-paths/cross-platform/zenoh-multinode-ros2/4_zenoh-examples.md

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Run Zenoh in Multi-Node Environment
2+
title: Running Zenoh Examples in a Multi-Node Environment
33
weight: 5
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
### Run Zenoh in Multi-Node Environment
9+
## Run Zenoh in Multi-Node Environment
1010

1111
This section illustrates the procedures to run the Zenoh examples so as to demonstrate the primary capabilities of Zenoh
1212
1. Basic Pub/Sub – for real-time message distribution
@@ -17,31 +17,31 @@ The source of the examples written in Rust and Python will be provided, and both
1717

1818
They are located in the `$ZENOH_LOC/target/release/examples/` directory.
1919

20-
### Example 1: Simple Pub/Sub
20+
## Example 1: Simple Pub/Sub
2121

2222
This first test demonstrates Zenoh’s real-time publish/subscribe model using two Raspberry Pi devices.
2323

2424
The following command is to initiate a subscriber for a key expression `demo/example/**`, i.e. a set of topics starting with the path `demo/example`.
2525

26-
#### Step 1: Run Subscriber
26+
### Step 1: Run Subscriber
2727

28-
Log in to an Pi using any of the methods:
28+
Log in to Pi using any of the methods:
2929

3030
```bash
31-
$ cd zenoh/target/release/examples
32-
$ ./z_sub
31+
cd zenoh/target/release/examples
32+
./z_sub
3333
```
3434

35-
#### Step 2: Run Publisher
35+
### Step 2: Run Publisher
3636

3737
Then, log in to another machine Pi.
3838

3939
```bash
40-
$ cd zenoh/target/release/examples
41-
$ ./z_pub
40+
cd zenoh/target/release/examples
41+
./z_pub
4242
```
4343

44-
The result will looks like:
44+
The result will look like:
4545
![img1 alt-text#center](ex1_pub_sub.gif "Figure 1: Simple Pub/Sub")
4646

4747
In the left-side window, I have logged into the device Pi4 and run the z_sub program.
@@ -50,7 +50,7 @@ It receives values with the key `demo/example/zenoh-rs-pub` continuously publish
5050
This basic example shows Zenoh’s zero-config discovery and low-latency pub/sub across physical nodes.
5151

5252

53-
### Example 2: Storage and Query
53+
## Example 2: Storage and Query
5454

5555
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.
5656

@@ -63,7 +63,7 @@ In this example, you’ll run the zenohd daemon with in-memory storage and use z
6363
This is especially useful for distributed systems where nodes may intermittently connect or request snapshots of state from peers.
6464

6565

66-
#### Step 1: Start the Zenoh Daemon with In-Memory Storage
66+
### Step 1: Start the Zenoh Daemon with In-Memory Storage
6767

6868
On one Raspberry Pi, launch the Zenoh daemon with a configuration that enables in-memory storage for keys under demo/example/**:
6969

@@ -77,7 +77,7 @@ This starts the Zenoh daemon with in-memory storage support.
7777
You should see log messages indicating that the storage_manager plugin is loaded.
7878
If port 7447 is already in use, either stop any previous Zenoh processes or configure a custom port using the listen.endpoints.router setting.
7979

80-
#### Step 2: Publish Data
80+
### Step 2: Publish Data
8181

8282
On 2nd device, use z_put to send a key-value pair that will be handled by the zenohd storage:
8383

@@ -89,20 +89,20 @@ cd ~/zenoh/target/release/examples
8989
This command stores the string `Hello from storage!` under the key demo/example/test1.
9090

9191

92-
#### Step 3: Query the Data
92+
### Step 3: Query the Data
9393

9494
Back on first Raspberry Pi, you can now query the stored data from any Zenoh-connected node:
9595

9696
```bash
9797
cd ~/zenoh/target/release/examples
98-
./z_put -s demo/example/test1 "Hello from storage!"
98+
./z_get -s demo/example/test1
9999
```
100100

101101
You should see an output similar to:
102102

103103
```bash
104-
Sending Query 'demo/example/example2'...
105-
>> Received ('demo/example/example2': 'Hello from storage!')
104+
Sending Query 'demo/example/test1'...
105+
>> Received ('demo/example/test1': 'Hello from storage!')
106106
```
107107

108108
{{% notice tip %}}
@@ -112,19 +112,19 @@ If you have more than two Raspberry Pi devices, you can run the z_get command on
112112
This example shows how Zenoh’s Storage + 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.
113113

114114

115-
### Example 3: Computation on Query using Queryable
115+
## Example 3: Computation on Query using Queryable
116116

117117
In this final example, 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.
118118

119119
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 (e.g., sensor fusion, AI inference results, or diagnostics).
120120

121-
#### Use Case: On-Demand Battery Health Estimation
121+
### Use Case: On-Demand Battery Health Estimation
122122

123123
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.
124124

125125
This saves bandwidth and enables edge compute optimization using Zenoh’s Queryable.
126126

127-
#### Step 1: Launch a Queryable Node
127+
### Step 1: Launch a Queryable Node
128128

129129
On one Raspberry Pi device, run the built-in Zenoh example to register a queryable handler.
130130

@@ -144,7 +144,7 @@ Press CTRL-C to quit...
144144

145145
The node is now ready to accept queries on the key demo/example/zenoh-rs-queryable and respond with a predefined message.
146146

147-
#### Step 2: Trigger a Query from Another Node
147+
### Step 2: Trigger a Query from Another Node
148148

149149
On another Raspberry Pi device or terminal, run:
150150

@@ -156,19 +156,21 @@ cd ~/zenoh/target/release/examples
156156
You should see:
157157

158158
```
159-
pi@raspberrypi:~/zenoh/target/release/examples$ ./z_queryable
159+
./z_get -s demo/example/zenoh-rs-queryable
160160
Opening session...
161-
Declaring Queryable on 'demo/example/zenoh-rs-queryable'...
162-
Press CTRL-C to quit...
161+
Sending Query 'demo/example/zenoh-rs-queryable'...
162+
>> Received ('demo/example/zenoh-rs-queryable': 'Queryable from Rust!')
163163
```
164164

165165
The value you receive comes not from storage, but from the computation inside the queryable handler.
166166

167-
#### Real-World Application: Distributed Inference & Computation
167+
### Real-World Application: Distributed Inference & Computation
168168

169169
This model enables edge-based intelligence, such as:
170170
- Executing custom logic in response to a query (e.g., “calculate load average”)
171171
- Triggering ML inference (e.g., “classify image X on demand”)
172172
- Decentralized diagnostics (e.g., “report actuator status”)
173173

174174
Queryable is a key feature for data-in-use scenarios, allowing fine-grained, on-demand compute inside your Zenoh-powered architecture.
175+
176+
Next, you’ll extend this Queryable pattern to perform parameterized computation — simulating edge diagnostics and adaptive inference.

0 commit comments

Comments
 (0)