Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/rmw-zenoh-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
fi
nu scripts/test-ros-packages.nu \
--ws-dir $GITHUB_WORKSPACE/ws \
--rmw-path $GITHUB_WORKSPACE/ros-z/rmw-zenoh-rs \
--rmw-path $GITHUB_WORKSPACE/ros-z/crates/rmw-zenoh-rs \
--verbose \
--include-filter "$TEST_FILTER" \
--exclude-filter "test_count_matched|test_events"
Expand Down
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ homepage = "https://github.com/ZettaScaleLabs/ros-z"
[workspace]
resolver = "2"
members = [
"ros-z",
"ros-z-cdr",
"ros-z-codegen",
"ros-z-derive",
"ros-z-py",
"rmw-zenoh-rs",
"ros-z-msgs",
"ros-z-tests",
"ros-z-console",
"ros-z/examples/protobuf_demo",
"crates/ros-z",
"crates/ros-z-cdr",
"crates/ros-z-codegen",
"crates/ros-z-derive",
"crates/ros-z-py",
"crates/rmw-zenoh-rs",
"crates/ros-z-msgs",
"crates/ros-z-tests",
"crates/ros-z-console",
"crates/ros-z/examples/protobuf_demo",
]
default-members = ["ros-z", "ros-z-codegen"]
default-members = ["crates/ros-z", "crates/ros-z-codegen"]
# Note: protobuf_demo is an advanced example demonstrating protobuf serialization

[workspace.dependencies]
# Workspace members
ros-z = { version = "*", path = "ros-z" }
ros-z-codegen = { version = "*", path = "ros-z-codegen" }
rmw-zenoh-rs = { version = "*", path = "rmw-zenoh-rs" }
ros-z = { version = "*", path = "crates/ros-z" }
ros-z-codegen = { version = "*", path = "crates/ros-z-codegen" }
rmw-zenoh-rs = { version = "*", path = "crates/rmw-zenoh-rs" }

# Serialization
ros-z-cdr = { path = "ros-z-cdr" }
ros-z-cdr = { path = "crates/ros-z-cdr" }
serde = "1.0.219"
serde_bytes = "0.11"
serde_json = "1.0"
Expand Down
4 changes: 2 additions & 2 deletions book/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ edition = "2024"
publish = false

[dependencies]
ros-z = { path = "../ros-z" }
ros-z-msgs = { path = "../ros-z-msgs" }
ros-z = { path = "../crates/ros-z" }
ros-z-msgs = { path = "../crates/ros-z-msgs" }
tokio = { version = "1.47.1", features = ["full"] }
clap = { version = "4.5.45", features = ["derive"] }
zenoh = { version = "1.6.2", default-features = false, features = [
Expand Down
6 changes: 3 additions & 3 deletions book/QUICK_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The `mdbook test` command tests **every Rust code block** in your markdown files
# Your Chapter

\`\`\`rust,no_run
{{#include ../../../ros-z/examples/your_example.rs}}
{{#include ../../../crates/ros-z/examples/your_example.rs}}
\`\`\`
```

Expand Down Expand Up @@ -47,7 +47,7 @@ Control how code blocks are tested:

```markdown
\`\`\`rust,no_run
{{#include ../../../ros-z/examples/demo_nodes/talker.rs}}
{{#include ../../../crates/ros-z/examples/demo_nodes/talker.rs}}
\`\`\`
```

Expand Down Expand Up @@ -130,7 +130,7 @@ Runs automatically on every push and pull request.

```markdown
\`\`\`rust,no_run
{{#include ../../../ros-z/examples/my_feature.rs}}
{{#include ../../../crates/ros-z/examples/my_feature.rs}}
\`\`\`
```

Expand Down
2 changes: 1 addition & 1 deletion book/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ ros-z/ # Workspace root

- ✅ Examples in `ros-z/examples/` have access to all dependencies
- ✅ `cargo run --example name` works out of the box
- ✅ `mdbook test` finds examples via `{{#include ../../../ros-z/examples/...}}`
- ✅ `mdbook test` finds examples via `{{#include ../../../crates/ros-z/examples/...}}`
- ✅ Standard structure - no special configuration needed

See [WORKFLOW_VERIFICATION.md](WORKFLOW_VERIFICATION.md) for proof that this works.
Expand Down
8 changes: 4 additions & 4 deletions book/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Use `no_run` when the code needs to compile but shouldn't execute (e.g., runs fo

```markdown
\`\`\`rust,no_run
{{#include ../../../ros-z/examples/demo_nodes/talker.rs}}
{{#include ../../../crates/ros-z/examples/demo_nodes/talker.rs}}
\`\`\`
```

Expand Down Expand Up @@ -137,10 +137,10 @@ mdbook test book -L ./target/debug/deps

```bash
# From the book chapter:
{{#include ../../../ros-z/examples/your_file.rs}}
{{#include ../../../crates/ros-z/examples/your_file.rs}}

# The path should resolve to:
book/src/chapters/../../../ros-z/examples/your_file.rs
book/src/chapters/../../../crates/ros-z/examples/your_file.rs
# Which is: ros-z/examples/your_file.rs
```

Expand All @@ -150,7 +150,7 @@ book/src/chapters/../../../ros-z/examples/your_file.rs

```markdown
\`\`\`rust,no_run
{{#include ../../../ros-z/examples/demo_nodes/talker.rs}}
{{#include ../../../crates/ros-z/examples/demo_nodes/talker.rs}}
\`\`\`
```

Expand Down
2 changes: 1 addition & 1 deletion book/src/chapters/backends.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ graph LR
The `z_pubsub` example demonstrates backend selection for pub/sub communication. The example supports both `RmwZenoh` and `Ros2Dds` backends via command-line arguments:

```rust,ignore
{{#include ../../../ros-z/examples/z_pubsub.rs}}
{{#include ../../../crates/ros-z/examples/z_pubsub.rs}}
```

Key features of this example:
Expand Down
2 changes: 1 addition & 1 deletion book/src/chapters/protobuf.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ pub.publish(&msg)?;
The `protobuf_demo` example demonstrates both approaches:

```rust,ignore
{{#include ../../../ros-z/examples/protobuf_demo/src/demo.rs}}
{{#include ../../../crates/ros-z/examples/protobuf_demo/src/demo.rs}}
```

### Running the Demo
Expand Down
4 changes: 2 additions & 2 deletions book/src/chapters/pubsub.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ graph TD
This example demonstrates publishing "Hello World" messages to a topic. The publisher sends messages periodically, showcasing the fundamental publishing pattern.

```rust,ignore
{{#include ../../../ros-z/examples/demo_nodes/talker.rs:1:61}}
{{#include ../../../crates/ros-z/examples/demo_nodes/talker.rs:1:61}}
```

**Key points:**
Expand Down Expand Up @@ -61,7 +61,7 @@ cargo run --example demo_nodes_talker -- --max-count 10
This example demonstrates subscribing to messages from a topic. The subscriber receives and displays messages, showing both timeout-based and async reception patterns.

```rust,ignore
{{#include ../../../ros-z/examples/demo_nodes/listener.rs:1:81}}
{{#include ../../../crates/ros-z/examples/demo_nodes/listener.rs:1:81}}
```

**Key points:**
Expand Down
12 changes: 6 additions & 6 deletions book/src/chapters/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ python -m venv .venv
source .venv/bin/activate

# Install message types
pip install -e ../ros-z-msgs/python/
pip install -e ../crates/ros-z-msgs/python/

# Build and install ros-z-py
maturin develop
Expand All @@ -54,13 +54,13 @@ Here's a complete publisher and subscriber example from [`ros-z-py/examples/topi
### Publisher (Talker)

```python
{{#include ../../../ros-z-py/examples/topic_demo.py:run_talker}}
{{#include ../../../crates/ros-z-py/examples/topic_demo.py:run_talker}}
```

### Subscriber (Listener)

```python
{{#include ../../../ros-z-py/examples/topic_demo.py:run_listener}}
{{#include ../../../crates/ros-z-py/examples/topic_demo.py:run_listener}}
```

## Key Components
Expand All @@ -83,13 +83,13 @@ Examples from [`ros-z-py/examples/service_demo.py`](https://github.com/ZettaScal
### Service Server

```python
{{#include ../../../ros-z-py/examples/service_demo.py:run_server}}
{{#include ../../../crates/ros-z-py/examples/service_demo.py:run_server}}
```

### Service Client

```python
{{#include ../../../ros-z-py/examples/service_demo.py:run_client}}
{{#include ../../../crates/ros-z-py/examples/service_demo.py:run_client}}
```

```admonish tip
Expand Down Expand Up @@ -187,7 +187,7 @@ Rebuild and install the package:
```bash
cd ros-z-py
source .venv/bin/activate
pip install -e ../ros-z-msgs/python/
pip install -e ../crates/ros-z-msgs/python/
maturin develop
```
````
Expand Down
2 changes: 1 addition & 1 deletion book/src/chapters/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ An async runtime is required for ros-z. This example uses Tokio, the most popula
Here's a complete publisher and subscriber in one application:

```rust,ignore
{{#include ../../../ros-z/examples/z_pubsub.rs}}
{{#include ../../../crates/ros-z/examples/z_pubsub.rs}}
```

## Key Components
Expand Down
4 changes: 2 additions & 2 deletions book/src/chapters/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ graph TD
This example demonstrates a service server that adds two integers. The server waits for requests, processes them, and sends responses back to clients.

```rust,ignore
{{#include ../../../ros-z/examples/demo_nodes/add_two_ints_server.rs:1:47}}
{{#include ../../../crates/ros-z/examples/demo_nodes/add_two_ints_server.rs:1:47}}
```

**Key points:**
Expand Down Expand Up @@ -65,7 +65,7 @@ cargo run --example demo_nodes_add_two_ints_server -- --endpoint tcp/localhost:7
This example demonstrates a service client that sends addition requests to the server and displays the results.

```rust,ignore
{{#include ../../../ros-z/examples/demo_nodes/add_two_ints_client.rs:1:45}}
{{#include ../../../crates/ros-z/examples/demo_nodes/add_two_ints_client.rs:1:45}}
```

**Key points:**
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
54 changes: 54 additions & 0 deletions crates/ros-z-msgs/python/ros_z_msgs_py/types/action_msgs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""Auto-generated ROS 2 message types for action_msgs."""

import msgspec
from typing import ClassVar


class GoalStatus(msgspec.Struct, frozen=True, kw_only=True):
goal_info: "action_msgs.GoalInfo | None" = None
status: int = 0

__msgtype__: ClassVar[str] = "action_msgs/msg/GoalStatus"
__hash__: ClassVar[str] = (
"RIHS01_6e21370c4382c09860cbdc5089cda1fe5b802bdbd56d60fe6cfd79c12a2ec048"
)


class GoalInfo(msgspec.Struct, frozen=True, kw_only=True):
goal_id: "unique_identifier_msgs.UUID | None" = None
stamp: "builtin_interfaces.Time | None" = msgspec.field(
default_factory=lambda: {"sec": 0, "nanosec": 0}
)

__msgtype__: ClassVar[str] = "action_msgs/msg/GoalInfo"
__hash__: ClassVar[str] = (
"RIHS01_6398fe763154554353930716b225947f93b672f0fb2e49fdd01bb7a7e37933e9"
)


class GoalStatusArray(msgspec.Struct, frozen=True, kw_only=True):
status_list: list["action_msgs.GoalStatus"] = msgspec.field(default_factory=list)

__msgtype__: ClassVar[str] = "action_msgs/msg/GoalStatusArray"
__hash__: ClassVar[str] = (
"RIHS01_49d3f45fe30c84e4dd2eadb8e5125cc71dcc4e31b3f0363afd4f794fde652e27"
)


class CancelGoalRequest(msgspec.Struct, frozen=True, kw_only=True):
goal_info: "action_msgs.GoalInfo | None" = None

__msgtype__: ClassVar[str] = "action_msgs/msg/CancelGoalRequest"
__hash__: ClassVar[str] = (
"RIHS01_0894e514b8d27fc42bb40ca22eb8c44da1c0f30a2973590151bb20958c4d312e"
)


class CancelGoalResponse(msgspec.Struct, frozen=True, kw_only=True):
return_code: int = 0
goals_canceling: list["action_msgs.GoalInfo"] = msgspec.field(default_factory=list)

__msgtype__: ClassVar[str] = "action_msgs/msg/CancelGoalResponse"
__hash__: ClassVar[str] = (
"RIHS01_0894e514b8d27fc42bb40ca22eb8c44da1c0f30a2973590151bb20958c4d312e"
)
24 changes: 24 additions & 0 deletions crates/ros-z-msgs/python/ros_z_msgs_py/types/builtin_interfaces.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Auto-generated ROS 2 message types for builtin_interfaces."""

import msgspec
from typing import ClassVar


class Time(msgspec.Struct, frozen=True, kw_only=True):
sec: int = 0
nanosec: int = 0

__msgtype__: ClassVar[str] = "builtin_interfaces/msg/Time"
__hash__: ClassVar[str] = (
"RIHS01_b106235e25a4c5ed35098aa0a61a3ee9c9b18d197f398b0e4206cea9acf9c197"
)


class Duration(msgspec.Struct, frozen=True, kw_only=True):
sec: int = 0
nanosec: int = 0

__msgtype__: ClassVar[str] = "builtin_interfaces/msg/Duration"
__hash__: ClassVar[str] = (
"RIHS01_e8d009f659816f758b75334ee1a9ca5b5c0b859843261f14c7f937349599d93b"
)
Loading
Loading