Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ros2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:
zenoh: false
- distro: kilted
container: carter12s/roslibrust-ci-kilted:rust_1_94
features: ros2_zenoh_test,rosbridge_ros2_test,ros2_test
features: hiroz_test,rosbridge_ros2_test,ros2_test
zenoh: true
- distro: rolling
container: carter12s/roslibrust-ci-rolling:rust_1_94
features: ros2_zenoh_test,rosbridge_ros2_test,ros2_test
features: rosbridge_ros2_test,ros2_test
zenoh: true

name: ${{ matrix.distro }}
Expand Down
196 changes: 101 additions & 95 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ members = [
"roslibrust_zenoh",
"roslibrust",
"roslibrust_rosapi",
"roslibrust_ros2",
"roslibrust_hiroz",
]

[workspace.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async fn relay<T: TopicProvider>(ros: T) -> roslibrust::Result<()> {

#[tokio::main]
async fn main() -> roslibrust::Result<()> {
// Experimental support in roslibrust_ros2, not yet released on crates.io
// Experimental support in roslibrust_hiroz, not yet released on crates.io
// Relay messages over a native ROS2 connection using Zenoh
// #[cfg(feature = "ros2")]
// {
Expand Down
5 changes: 2 additions & 3 deletions book/src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ RosLibRust provides several implementations of the `Ros` trait:
- [roslibrust_ros1](https://docs.rs/roslibrust_ros1/latest/roslibrust_ros1/) - Implements the TCPROS protocol that was the backbone of ROS1
- [roslibrust_zenoh](https://docs.rs/roslibrust_zenoh/latest/roslibrust_zenoh/) - Implements a variant of ROS1 communication used by [zenoh-ros1-bridge](https://github.com/eclipse-zenoh/zenoh-plugin-ros1)
- [roslibrust_rosbridge](https://docs.rs/roslibrust_rosbridge/latest/roslibrust_rosbridge/) - Implements the [rosbridge_suite](https://github.com/RobotWebTools/rosbridge_suite) websocket protocol
- COMING SOON [roslibrust_ros2](https://docs.rs/roslibrust_ros2/latest/roslibrust_ros2/) - Implements the Zenoh communication used by [rmw_zenoh](https://github.com/ros2/rmw_zenoh) in ROS2 from Kilted onwards
- COMING SOON `roslibrust_hiroz` - Implements the Zenoh communication used by [rmw_zenoh](https://github.com/ros2/rmw_zenoh) in ROS2 from Kilted onwards
- [roslibrust_mock](https://docs.rs/roslibrust_mock/latest/roslibrust_mock/) - Implements a mock ROS perfect for testing

Typically we don't depend on these crates directly, but instead use them by enabling their corresponding features on `roslibrust`.
Expand All @@ -107,7 +107,7 @@ The full list of features is:
- `zenoh` - Enables the [roslibrust_zenoh](https://docs.rs/roslibrust_zenoh/latest/roslibrust_zenoh/) backend
- `rosbridge` - Enables the [roslibrust_rosbridge](https://docs.rs/roslibrust_rosbridge/latest/roslibrust_rosbridge/) backend
- `mock` - Enables the [roslibrust_mock](https://docs.rs/roslibrust_mock/latest/roslibrust_mock/) backend
- `ros2` - COMING SOON Enables the [roslibrust_ros2](https://docs.rs/roslibrust_ros2/latest/roslibrust_ros2/) backend
- `hiroz` - COMING SOON Enables the `roslibrust_hiroz` backend
- `codegen` - Provides access to the [roslibrust_codegen](https://docs.rs/roslibrust_codegen/latest/roslibrust_codegen/) crate for generating ROS message types in build.rs.
- `macro` - Provides access to the [roslibrust_codegen_macro](https://docs.rs/roslibrust_codegen_macro/latest/roslibrust_codegen_macro/) crate for generating ROS message types using a proc-macro.
- `all` - Enables all of the above features.
Expand Down Expand Up @@ -141,4 +141,3 @@ The second approach is brittle, slow, and often a bottle neck for test times.

RosLibRust provides a mock implementation of ROS for testing that allows deterministic "time traveling" tests.
See [extended getting started guide](extended_getting_started.md#writing-tests-for-our-node) for an example.

4 changes: 2 additions & 2 deletions docker/kilted_compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ services:
volumes:
# Mounting in the repo for internal development, and devcontainer access
- ../:/roslibrust
# Mount in sibling ros-z repo so we can also test it within the docker image
- ../../ros-z:/ros-z
# Mount a sibling hiroz repo so it can also be tested within the docker image
- ../../hiroz:/hiroz
5 changes: 2 additions & 3 deletions docker/rolling_compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ services:
volumes:
# Mounting in the repo for internal development, and devcontainer access
- ../:/roslibrust
# Mount in sibling ros-z repo so we can also test it within the docker image
- ../../ros-z:/ros-z

# Mount a sibling hiroz repo so it can also be tested within the docker image
- ../../hiroz:/hiroz
5 changes: 4 additions & 1 deletion roslibrust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ roslibrust_ros1 = { path = "../roslibrust_ros1", version = "0.21", optional = tr
roslibrust_rosbridge = { path = "../roslibrust_rosbridge", version = "0.21", optional = true }
roslibrust_zenoh = { path = "../roslibrust_zenoh", version = "0.21", optional = true }
roslibrust_mock = { path = "../roslibrust_mock", version = "0.21", optional = true }
roslibrust_hiroz = { path = "../roslibrust_hiroz", optional = true }
roslibrust_codegen = { path = "../roslibrust_codegen", version = "0.21", optional = true }
roslibrust_codegen_macro = { path = "../roslibrust_codegen_macro", version = "0.21", optional = true }

Expand All @@ -42,7 +43,7 @@ ntest = "0.9"
# default feature is pure traits only with no implementations
default = []
# `all` enables all "useful" features to end users, other features are for testing purposes
all = ["codegen", "macro", "ros1", "rosbridge", "zenoh", "mock"]
all = ["codegen", "macro", "ros1", "rosbridge", "zenoh", "mock", "hiroz"]
# Provides a ros1 xmlrpc / TCPROS client
ros1 = ["roslibrust_ros1"]
# Provides a backend using the rosbridge websocket protocol
Expand All @@ -51,6 +52,8 @@ rosbridge = ["roslibrust_rosbridge"]
zenoh = ["roslibrust_zenoh"]
# Provides a mock backend useful for writing tests around nodes
mock = ["roslibrust_mock"]
# Provides a native ROS 2 backend built on hiroz and rmw_zenoh.
hiroz = ["roslibrust_hiroz"]
# Provides a macro for generating types from ROS messages
codegen = ["roslibrust_codegen"]
# Provides macros for generating types from ROS messages
Expand Down
4 changes: 4 additions & 0 deletions roslibrust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ pub use roslibrust_zenoh as zenoh;
#[cfg(feature = "mock")]
pub use roslibrust_mock as mock;

// If the hiroz feature is enabled, export the native ROS 2 backend under hiroz.
#[cfg(feature = "hiroz")]
pub use roslibrust_hiroz as hiroz;

// If the codegen feature is enabled, export the roslibrust_codegen crate under codegen
#[cfg(feature = "codegen")]
pub use roslibrust_codegen as codegen;
Expand Down
9 changes: 4 additions & 5 deletions roslibrust_ros2/Cargo.toml → roslibrust_hiroz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "roslibrust_ros2"
name = "roslibrust_hiroz"
version = "0.1.0"
edition = "2021"
publish = false
Expand All @@ -12,17 +12,16 @@ env_logger = "0.11"
cdr = "0.2"
roslibrust_common = { path = "../roslibrust_common", version = "0.21" }
anyhow = "1.0"
# Main as of May 16th 2026
ros-z = { git = "https://github.com/ZettaScaleLabs/ros-z.git", rev = "9bb6305" }
hiroz = { version = "0.1.0", default-features = false, features = ["kilted", "rmw-zenoh"] }
log = "0.4"
# Used for cancellation token
tokio-util = "0.7"
# Needed for now because of ros-z type incompatibility
# Needed for the serde wrapper around roslibrust message types.
serde = { workspace = true }

[dev-dependencies]
roslibrust_test = { path = "../roslibrust_test" }

[features]
# Used to enable tests that rely on a locally running ros2 rmw_zenohd
ros2_zenoh_test = []
hiroz_test = []
2 changes: 1 addition & 1 deletion roslibrust_ros2/README.md → roslibrust_hiroz/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# roslibrust_ros2
# roslibrust_hiroz

Experimental ROS2 backend for roslibrust via zenoh.
Loading
Loading