1 unstable release
Uses new Rust 2024
| 0.1.0 | Jun 8, 2026 |
|---|
#370 in Robotics
1.5MB
27K
SLoC
hiroz
Core Zenoh-native ROS 2 library (nodes, pub/sub, services, actions).
lib.rs:
hiroz — Zenoh-native ROS 2 in pure Rust
hiroz provides ROS 2-style pub/sub, services, and actions built directly
on Zenoh, with no C/C++ dependencies.
Getting started
use hiroz::prelude::*;
use hiroz_msgs::std_msgs::String as RosString;
let ctx = ZContextBuilder::default().build()?;
let node = ctx.create_node("talker").build()?;
let publisher = node.create_pub::<RosString>("/chatter").build()?;
publisher.async_publish(&RosString { data: "hello".into() }).await?;
Sync and async APIs
Most hiroz types expose both a blocking and an async variant of each operation. The naming convention is:
| Suffix | Behaviour |
|---|---|
| (none) | Blocking — safe to call from any context |
_async |
Async — must be .awaited inside a Tokio (or compatible) runtime |
For example, ZPub::publish blocks until
the put completes, while ZPub::async_publish
yields to the async executor.
Imports
The easiest way to import all common types is via the prelude:
use hiroz::prelude::*;
Or import types individually from their modules.
Dependencies
~43–78MB
~1M SLoC