You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/cross-platform/zenoh-multinode-ros2/3_zenoh-multinode.md
+50-12Lines changed: 50 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,18 +6,17 @@ weight: 4
6
6
layout: learningpathall
7
7
---
8
8
9
-
## Deploying Zenoh on Multiple Raspberry Pi Devices Using Docker
9
+
## Deploying Zenoh on Multiple Raspberry Pi Devices
10
10
11
11
After building Zenoh and its core examples, your next step is to deploy them across multiple Arm-based devices.
12
12
13
-
In this section, you’ll use Raspberry Pi boards to simulate a scalable, distributed environment, but the same workflow applies to any Arm Linux system, including Arm cloud instances.
13
+
Once you’ve successfully installed Zenoh on an Arm Cortex-A or Neoverse platform in the previous session, you can either transfer the compiled binaries from `~/zenoh/target/release/`to your Raspberry Pi devices, or use Docker to quickly deploy them across multiple RPi nodes.
14
14
15
-
You’ll learn how to use Docker to deploy the environment on physical devices.
15
+
In this session, you’ll use Raspberry Pi boards to simulate a scalable, distributed environment—but the same workflow applies to any Arm Linux system, including Arm cloud instances and Arm Virtual Hardware.
16
16
17
17
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.
18
18
19
-
### Install Docker
20
-
19
+
### Install Docker on Raspberry Pi
21
20
To simplify this process and ensure consistency, you can use Docker to containerize your Zenoh and ROS 2 environment.
22
21
This lets you quickly replicate the same runtime on any device without needing to rebuild from source.
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.
34
35
35
-
In a working directory, create a `Dockerfile` with the following content to create the ROS 2 / DDS docker image.
36
+
This Dockerfile uses a multi-stage build process based on the ros:galactic environment.
37
+
In the first stage, it installs Rust and compiles the Zenoh binaries directly from source.
38
+
In the second stage, it installs essential ROS 2 demo tools and copies the Zenoh executables into the final runtime image.
36
39
37
40
```bash
38
-
FROM ros:galactic
39
-
RUN apt-get update
40
-
RUN apt-get install -y ros-galactic-demo-nodes-cpp ros-galactic-rmw-cyclonedds-cpp ros-galactic-turtlesim
41
+
# Stage 1: Build Zenoh using ROS base with Rust toolchain
42
+
FROM ros:galactic AS builder
43
+
44
+
RUN apt-get update && apt-get install -y \
45
+
curl \
46
+
git \
47
+
build-essential \
48
+
pkg-config \
49
+
clang \
50
+
libssl-dev \
51
+
cmake
52
+
53
+
RUN curl -sSf https://sh.rustup.rs -o rustup-init.sh && \
54
+
chmod +x rustup-init.sh && \
55
+
./rustup-init.sh -y --no-modify-path && \
56
+
rm rustup-init.sh
57
+
58
+
ENV PATH="/root/.cargo/bin:${PATH}"
59
+
60
+
WORKDIR /root
61
+
RUN git clone https://github.com/eclipse-zenoh/zenoh.git
62
+
WORKDIR /root/zenoh
63
+
RUN cargo build --release --all-targets -j $(nproc)
0 commit comments