feat(go): implement Go bindings Phase 1 — pub/sub, codegen, examples#112
feat(go): implement Go bindings Phase 1 — pub/sub, codegen, examples#112YuanYuYuan wants to merge 27 commits intomainfrom
Conversation
|
| select {} // block forever | ||
| } | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Missing instruction to create hello_sub/go.mod
There was a problem hiding this comment.
Added — hello_sub/go.mod block now appears immediately after the subscriber code.
|
|
||
| ```bash | ||
| # Publisher + subscriber in parallel (Ctrl+C to stop) | ||
| just -f crates/ros-z-go/justfile demo |
There was a problem hiding this comment.
Missing instruction to start the router. If not started, the subscriber receives nothing.
There was a problem hiding this comment.
Fixed — the Run section now starts with Terminal 1 for the router before launching subscriber and publisher.
| ``` | ||
|
|
||
| You should see the subscriber printing messages published by the publisher. | ||
|
|
There was a problem hiding this comment.
You should add instructions to test against the ROS 2 demo_nodes_cpp. E.g.:
- on ROS 2 host run
ros2 run rmw_zenoh_cpp rmw_zenohdandros2 run demo_nodes_cpp talker - on ros-z-go host, run
cargo run --example zenoh_router -- -e tcp/<ROS2_HOST_IP>:7447andcd hello_sub && CGO_LDFLAGS="-L/path/to/ros-z/target/release" go run main.go
There was a problem hiding this comment.
Added a dedicated ROS 2 Interoperability chapter covering Rust, Python, and Go against demo_nodes_cpp. It's linked from the Go Quick Start "What's next" section. The chapter focuses on the single-host scenario where one Zenoh router (any flavour — rmw_zenohd, zenohd, Docker, etc.) connects all participants.
7b4f329 to
eb77480
Compare
… mermaid diagrams
…doc uses run-example
…ion A/B with diagrams
…wo-host topologies
…nk to Networking chapter
eb77480 to
5da6872
Compare
|
The port collision issue will be covered in #121 |
Summary
Adds Go pub/sub bindings for ros-z (Phase 1): publisher, subscriber, typed helpers, QoS presets, graph introspection, CDR serialization, and a Go code generation tool for
.msgtypes. No ROS 2 installation required for bundled message types. Quick start: https://zettascalelabs.github.io/ros-z/pr-preview/pr-112/chapters/go_quick_start.htmlKey Changes
crates/ros-z/src/ffi/— Rust CGO FFI layer (context, node, publisher, subscriber, serialize, QoS, graph) with cbindgen-generated headercrates/ros-z-go/rosz/— Goroszpackage: builder-pattern API for context, node, publisher, subscriber, typed subscriber, QoS, graph introspection, error types, channel-based handlerscrates/ros-z-go/testdata/— CDR serialization tests (no FFI dependency)crates/ros-z-codegen-go/— Go tool that reads codegen JSON manifest and emits Go message structs withSerializeCDR/DeserializeCDRcrates/ros-z-codegen/—export_jsonbinary and JSON generator backend, consumed byros-z-codegen-gocrates/ros-z-go/examples/— talker (publisher), listener (subscriber), channel-based subscriber (subscriber_channel)crates/ros-z-go/justfile— build, codegen, test, and demo targets; no ROS 2 needed fortest-goci.yml—go-testsjob (ubuntu + macos, Go 1.23, no ROS 2)book/— Go Bindings and Go Quick Start chapters; service/action sections stubbed for v0.2Acknowledment
This work is sponsored by