|
6 | 6 |
|
7 | 7 | ## Overview |
8 | 8 |
|
9 | | -ROS 2 was designed to be independent from the underlying communication |
10 | | -middleware. This is a nice architectural property, yet it does not come for |
11 | | -free. What if we were to streamline ROS 2 and implement it natively on Zenoh? |
12 | | -ROS-Z, a Zenoh-native ROS 2 stack, answers this question. ROS-Z preserves |
13 | | -portability for RCL-C/CPP/Py-based applications and provides an extremely |
14 | | -optimised stack for Rust users that interoperates with any Zenoh RMW-based |
15 | | -ROS 2. |
| 9 | +**ROS-Z** is a Zenoh-native ROS 2 stack that: |
16 | 10 |
|
17 | | - |
18 | | - |
19 | | -## Goals |
| 11 | +- Provides a pure-Rust ROS 2 implementation built directly on Zenoh |
| 12 | +- Preserves portability for RCL-C/CPP/Py-based applications |
| 13 | +- Delivers optimized performance for Rust users |
| 14 | +- Interoperates seamlessly with Zenoh RMW-based ROS 2 |
20 | 15 |
|
21 | | -**ROS-Z** was started as an experiment to understand what we could gain from |
22 | | -verticalisation while at the same time providing (1) a pure-Rust stack to ROS2 |
23 | | -users, and (2) zenoh-native implementation of RCL-C. We hope that the lesson |
24 | | -learned through this experiment will help the ROS community making ROS 2 even |
25 | | -better. |
| 16 | + |
26 | 17 |
|
27 | 18 | ## Status |
28 | 19 |
|
29 | | -**ROS-Z** is experimental software. It is tested with ROS 2 Jazzy and should |
30 | | -be interoperable with ROS 2 Rolling, but we make no guarantees with respect to |
31 | | -official distributions. |
32 | | - |
33 | | -## Documentation |
34 | | - |
35 | | -Comprehensive documentation with examples is available: |
| 20 | +**ROS-Z** is experimental software. It is tested with ROS 2 Jazzy and should be interoperable with ROS 2 Rolling, but we make no guarantees with respect to official distributions. |
36 | 21 |
|
37 | | -- **Online**: [ros-z Documentation](https://zettascalelabs.github.io/ros-z/) (GitHub Pages) |
38 | | -- **Local**: Build and view locally with `mdbook serve book` (see [book/README.md](book/README.md)) |
39 | | - |
40 | | -The documentation includes: |
41 | | - |
42 | | -- Getting started guide |
43 | | -- Publisher/subscriber examples |
44 | | -- Service examples |
45 | | -- Demo nodes compatible with ROS 2 |
46 | | -- API reference |
47 | | - |
48 | | -For contributing to the documentation, see [CONTRIBUTING.md](CONTRIBUTING.md). |
49 | | - |
50 | | -## Building |
51 | | - |
52 | | -ROS-Z is designed to work without ROS dependencies by default. |
53 | | -ROS-dependent features are opt-in. |
54 | | - |
55 | | -### Default Build (No ROS Dependencies) |
56 | | - |
57 | | -The default workspace build includes only the core library and works without |
58 | | -ROS 2: |
| 22 | +## Quick Start |
59 | 23 |
|
60 | 24 | ```bash |
61 | | -# Build the workspace (ros-z + ros-z-codegen) |
| 25 | +# Build the core library (no ROS dependencies required) |
62 | 26 | cargo build |
63 | 27 |
|
64 | 28 | # Run tests |
65 | 29 | cargo test |
66 | 30 |
|
67 | | -# Build example with custom Rust-defined messages (no ros-z-msgs required) |
68 | | -cargo build -p ros-z --example z_custom_message |
69 | | -``` |
70 | | - |
71 | | -### Building with ros-z-msgs (still no ROS required) |
72 | | - |
73 | | -The `ros-z-msgs` package includes bundled message definitions (std_msgs, |
74 | | -geometry_msgs, sensor_msgs, nav_msgs) and can be built without ROS: |
75 | | - |
76 | | -```bash |
77 | | -# Build ros-z-msgs with bundled messages (default, no ROS required) |
78 | | -cargo build -p ros-z-msgs |
79 | | - |
80 | | -# Build examples that use bundled ros-z-msgs types |
81 | | -cargo build -p ros-z --example z_pubsub # Uses std_msgs |
82 | | -cargo build -p ros-z --example z_pingpong # Uses std_msgs |
83 | | -cargo build -p ros-z --example twist_pub # Uses geometry_msgs |
84 | | -cargo build -p ros-z --example battery_state_sub # Uses sensor_msgs |
85 | | -cargo build -p ros-z --example laser_scan # Uses sensor_msgs |
86 | | -``` |
87 | | - |
88 | | -### With ROS 2 Installation (Optional) |
89 | | - |
90 | | -Only needed for RCL bindings or external message packages not bundled with |
91 | | -roslibrust: |
92 | | - |
93 | | -```bash |
94 | | -# Build RCL bindings (requires ROS 2) |
95 | | -cargo build -p rcl-z |
96 | | - |
97 | | -# Build ros-z-msgs with external message packages (requires ROS 2) |
98 | | -cargo build -p ros-z-msgs --features external_msgs |
99 | | - |
100 | | -# Build example that uses external messages (requires ROS 2) |
101 | | -cargo build --example z_srvcli --features external_msgs |
102 | | -``` |
103 | | - |
104 | | -### Using Nix (Optional) |
105 | | - |
106 | | -If you're using Nix, we provide development shells with all dependencies |
107 | | -pre-configured: |
108 | | - |
109 | | -```bash |
110 | | -# Default development environment (with ROS 2 Jazzy) |
111 | | -nix develop |
112 | | - |
113 | | -# Specific ROS distros |
114 | | -nix develop .#ros-jazzy # ROS 2 Jazzy |
115 | | -nix develop .#ros-rolling # ROS 2 Rolling |
116 | | - |
117 | | -# Pure-Rust |
118 | | -nix develop .#pureRust |
119 | | - |
120 | | -# CI environments (minimal, no dev tools) |
121 | | -nix develop .#ros-jazzy-ci |
122 | | -nix develop .#ros-rolling-ci |
123 | | -nix develop .#pureRust-ci |
| 31 | +# Try an example |
| 32 | +cargo run --example z_pubsub |
124 | 33 | ``` |
125 | 34 |
|
126 | | -**Note on `ros-z-msgs`:** This package can build without ROS installed! When |
127 | | -ROS is not available, it automatically falls back to using bundled message |
128 | | -definitions from the roslibrust git dependency. The build system searches for |
129 | | -ROS packages in this order: |
130 | | - |
131 | | -1. System ROS installation (via `AMENT_PREFIX_PATH` or `CMAKE_PREFIX_PATH`) |
132 | | -2. Common ROS installation paths (`/opt/ros/{rolling,jazzy,iron,humble}`) |
133 | | -3. Roslibrust git dependency (`~/.cargo/git/checkouts/roslibrust-*/assets/`) |
134 | | - |
135 | | -This allows `ros-z-msgs` to generate message types even in environments without |
136 | | -ROS 2 installed. The default `common_interfaces` feature includes `std_msgs`, |
137 | | -`geometry_msgs`, and `sensor_msgs` which are all available in roslibrust |
138 | | -assets. Note that `example_interfaces` is **not** included in the default build |
139 | | -as it requires a ROS 2 installation. |
140 | | - |
141 | | -### Workspace Structure |
142 | | - |
143 | | -**Default workspace members** (no ROS dependencies): |
144 | | - |
145 | | -- **ros-z**: Core Zenoh-native ROS 2 library |
146 | | -- **ros-z-codegen**: Message and service code generation utilities |
147 | | - |
148 | | -**Optional packages** (excluded from default build): |
149 | | - |
150 | | -- **ros-z-msgs**: Auto-generated ROS 2 message types (default features work |
151 | | - without ROS; external message packages require ROS 2) |
152 | | -- **ros-z-tests**: Integration tests (requires ros-z-msgs) |
153 | | - |
154 | | -**ROS-dependent packages** (excluded from default build): |
155 | | - |
156 | | -- **rcl-z**: RCL C bindings (requires ROS 2 RCL libraries) |
157 | | - |
158 | | -### Examples |
| 35 | +See the [Quick Start Guide](https://zettascalelabs.github.io/ros-z/chapters/quick_start.html) for more details. |
159 | 36 |
|
160 | | -Examples are categorized by their dependencies: |
161 | | - |
162 | | -- **Custom Rust messages** (no ros-z-msgs required): |
163 | | - - `z_custom_message` - Demonstrates pub/sub and service with custom |
164 | | - Rust-defined messages |
165 | | - |
166 | | -- **Bundled messages** (no ROS required, uses roslibrust assets): |
167 | | - - `z_pubsub` - Publisher/subscriber using std_msgs |
168 | | - - `z_pingpong` - Ping-pong latency benchmark using std_msgs |
169 | | - - `twist_pub` - Twist publisher using geometry_msgs |
170 | | - - `battery_state_sub` - Battery state subscriber using sensor_msgs |
171 | | - - `laser_scan` - Laser scan publisher using sensor_msgs |
172 | | - |
173 | | -- **External messages** (requires ROS 2 installation): |
174 | | - - `z_srvcli` - Service client/server using example_interfaces |
175 | | - - Build with: `cargo build --example z_srvcli --features external_msgs` |
176 | | - |
177 | | -- **Advanced** (requires protobuf feature): |
178 | | - - `protobuf_demo` - Demonstrates protobuf serialization with both ROS |
179 | | - messages and custom protobuf messages |
180 | | - - Build with: `cargo build -p protobuf_demo` |
181 | | - |
182 | | -## Feature Flags |
183 | | - |
184 | | -### ros-z |
185 | | - |
186 | | -- `protobuf` - Enable protobuf serialization support (requires `prost`) |
187 | | -- `rcl-z` - Enable RCL integration features |
188 | | -- `external_msgs` - Enable examples that require external ROS message packages |
189 | | - (propagates to `ros-z-msgs/external_msgs`) |
190 | | - |
191 | | -### ros-z-msgs |
192 | | - |
193 | | -Messages are organized into two categories: |
194 | | - |
195 | | -**Bundled messages** (no ROS installation required): |
196 | | - |
197 | | -- `bundled_msgs` (default) - All bundled message packages |
198 | | -- `std_msgs`, `geometry_msgs`, `sensor_msgs`, `nav_msgs` - Individual bundled |
199 | | - packages |
200 | | -- `common_interfaces` - Convenience feature for std_msgs, geometry_msgs, |
201 | | - sensor_msgs |
202 | | - |
203 | | -**External messages** (require ROS 2 installation): |
| 37 | +## Documentation |
204 | 38 |
|
205 | | -- `external_msgs` - All external message packages |
206 | | -- `example_interfaces` - Individual external package |
| 39 | +📚 **[Read the Book](https://zettascalelabs.github.io/ros-z/)** for comprehensive documentation including: |
207 | 40 |
|
208 | | -**Other features**: |
| 41 | +- Installation and build instructions |
| 42 | +- Examples and tutorials |
| 43 | +- API reference |
| 44 | +- Feature flags and configuration |
| 45 | +- Contributing guidelines |
209 | 46 |
|
210 | | -- `all_msgs` - Enable both bundled and external messages (requires ROS 2) |
211 | | -- `protobuf` - Generate protobuf types (requires `ros-z/protobuf`) |
| 47 | +**Local Development:** `mdbook serve book` |
212 | 48 |
|
213 | | -### ros-z-codegen |
| 49 | +## License |
214 | 50 |
|
215 | | -- `protobuf` - Enable protobuf code generation support |
| 51 | +[View license](LICENSE) |
216 | 52 |
|
217 | | -### ros-z-tests |
| 53 | +## Contributing |
218 | 54 |
|
219 | | -- `ros-msgs` - Enable tests with ros-z-msgs dependency |
220 | | -- `interop-tests` - ROS interoperability tests (requires `ros-msgs`) |
| 55 | +Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details. |
0 commit comments