Skip to content

Commit f8cfde0

Browse files
committed
review
1 parent 7bed74e commit f8cfde0

26 files changed

Lines changed: 1799 additions & 281 deletions

.github/workflows/docs.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,34 @@ name: Docs
22
on: [push, pull_request]
33

44
jobs:
5-
test:
5+
test_doc:
6+
name: Test documentation
67
runs-on: ubuntu-latest
78
steps:
8-
- uses: actions/checkout@v4
9-
- uses: dtolnay/rust-toolchain@stable
10-
- run: cargo build
11-
- run: cargo test
12-
- uses: peaceiris/actions-mdbook@v1
13-
with:
14-
mdbook-version: '0.4.40'
15-
- run: mdbook test book -L ./target/debug/deps
9+
- uses: actions/checkout@v4
10+
- uses: dtolnay/rust-toolchain@stable
11+
- run: cargo build
12+
- uses: peaceiris/actions-mdbook@v1
13+
with:
14+
mdbook-version: '0.4.40'
15+
- run: mdbook test book -L ./target/debug/deps
1616

17-
publish:
17+
publish_doc:
18+
name: Publish to GitHub Pages
1819
if: github.ref == 'refs/heads/main'
19-
needs: test
20+
needs: test_doc
2021
runs-on: ubuntu-latest
2122
permissions:
2223
contents: write
2324
steps:
24-
- uses: actions/checkout@v4
25-
- uses: dtolnay/rust-toolchain@stable
26-
- run: cargo build
27-
- uses: peaceiris/actions-mdbook@v1
28-
with:
29-
mdbook-version: '0.4.40'
30-
- run: mdbook build book
31-
- uses: peaceiris/actions-gh-pages@v4
32-
with:
33-
github_token: ${{ secrets.GITHUB_TOKEN }}
34-
publish_dir: ./book/book
25+
- uses: actions/checkout@v4
26+
- uses: dtolnay/rust-toolchain@stable
27+
- run: cargo build
28+
- uses: peaceiris/actions-mdbook@v1
29+
with:
30+
mdbook-version: '0.4.40'
31+
- run: mdbook build book
32+
- uses: peaceiris/actions-gh-pages@v4
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
publish_dir: ./book/book

.github/workflows/semantic-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
env:
2020
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2121
with:
22-
# Configure which types are allowed (https://github.com/commitizen/conventional-commit-types)
22+
# Types (https://github.com/commitizen/conventional-commit-types)
2323
types: |
2424
fix
2525
feat

README.md

Lines changed: 24 additions & 189 deletions
Original file line numberDiff line numberDiff line change
@@ -6,215 +6,50 @@
66

77
## Overview
88

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:
1610

17-
![architecture](./assets/architecture.png)
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
2015

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+
![architecture](./assets/architecture.png)
2617

2718
## Status
2819

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.
3621

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
5923

6024
```bash
61-
# Build the workspace (ros-z + ros-z-codegen)
25+
# Build the core library (no ROS dependencies required)
6226
cargo build
6327

6428
# Run tests
6529
cargo test
6630

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
12433
```
12534

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.
15936

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
20438

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:
20740

208-
**Other features**:
41+
- Installation and build instructions
42+
- Examples and tutorials
43+
- API reference
44+
- Feature flags and configuration
45+
- Contributing guidelines
20946

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`
21248

213-
### ros-z-codegen
49+
## License
21450

215-
- `protobuf` - Enable protobuf code generation support
51+
[View license](LICENSE)
21652

217-
### ros-z-tests
53+
## Contributing
21854

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.

book/Cargo.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[package]
2+
name = "ros-z-book"
3+
version = "0.1.0"
4+
edition = "2024"
5+
publish = false
6+
7+
[dependencies]
8+
ros-z = { path = "../ros-z" }
9+
ros-z-msgs = { path = "../ros-z-msgs" }
10+
tokio = { version = "1.47.1", features = ["full"] }
11+
clap = { version = "4.5.45", features = ["derive"] }
12+
zenoh = { version = "1.6.2", default-features = false, features = [
13+
"transport_tcp",
14+
"transport_serial",
15+
] }
16+
csv = "1.3.1"
17+
anyhow = "1.0"
18+
tracing = "0.1.41"
19+
serde = "1.0.219"

book/src/SUMMARY.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@
55
# Getting Started
66

77
- [Quick Start](./chapters/quick_start.md)
8+
- [Building](./chapters/building.md)
89

910
# Core Concepts
1011

1112
- [Publishers and Subscribers](./chapters/pubsub.md)
1213
- [Simple Publisher](./chapters/simple_pub.md)
1314
- [Simple Subscriber](./chapters/simple_sub.md)
14-
- [Custom Messages](./chapters/custom_messages.md)
1515
- [Services](./chapters/services.md)
1616
- [Service Server](./chapters/service_server.md)
1717
- [Service Client](./chapters/service_client.md)
1818
- [Actions](./chapters/actions.md)
19+
- [Message Generation](./chapters/message_generation.md)
20+
- [Custom Messages](./chapters/custom_messages.md)
1921

2022
# Examples
2123

24+
- [Overview](./chapters/examples_overview.md)
2225
- [Demo Nodes](./chapters/demo_nodes.md)
2326
- [Talker](./chapters/demo_talker.md)
2427
- [Listener](./chapters/demo_listener.md)
@@ -30,7 +33,5 @@
3033
- [Laser Scan](./chapters/laser_scan.md)
3134
- [Zenoh PingPong](./chapters/z_pingpong.md)
3235

33-
# Reference
34-
35-
- [API Documentation](./chapters/api_reference.md)
36-
- [Contributing](./chapters/contributing.md)
36+
- [Feature Flags](./chapters/feature_flags.md)
37+
- [Troubleshooting](./chapters/troubleshooting.md)

book/src/chapters/battery_state_sub.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This example demonstrates subscribing to battery status messages.
44

55
## Complete Example
66

7-
```rust,no_run
7+
```rust,ignore
88
{{#include ../../../ros-z/examples/battery_state_sub.rs}}
99
```
1010

0 commit comments

Comments
 (0)