An experimental implementation of the ROS 2 RMW (ROS Middleware) layer based on Zenoh.
This project was created as part of a learning exercise for Rust. The implementation is heavily inspired by rmw_zenoh.
Currently, it only works with ROS 2 Humble.
Excluding the unimplemented Events and Content Filtering, this implementation has passed most of RMW tests.
docker run -it --net=host --name rmw_zenoh_rs_test osrf/ros:humble-desktop bash
# Update ROS dependencies
rosdep update
apt update
# Set up the workspace
mkdir -p ~/ws_rmw_zenoh_rs/src && cd ~/ws_rmw_zenoh_rs/src
git clone https://github.com/quadjr/rmw_zenoh_rs.git
# Install dependencies
cd ~/ws_rmw_zenoh_rs
rosdep install --from-paths src --ignore-src --rosdistro humble -y
# Build the project
source /opt/ros/humble/setup.bash
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
Before running any commands, make sure the workspace is sourced:
cd ~/ws_rmw_zenoh_rs
source install/setup.bash
Stop any ROS 2 daemon processes started with a different RMW:
pkill -9 -f ros && ros2 daemon stop
This step is necessary because ROS 2 CLI commands (e.g., ros2 node list
) may not function correctly if the daemon was started with a different RMW.
In the first terminal:
docker exec -it rmw_zenoh_rs_test bash
cd ~/ws_rmw_zenoh_rs
source install/setup.bash
export RMW_IMPLEMENTATION=rmw_zenoh_rs
ros2 run demo_nodes_cpp talker
In a second terminal:
docker exec -it rmw_zenoh_rs_test bash
cd ~/ws_rmw_zenoh_rs
source install/setup.bash
export RMW_IMPLEMENTATION=rmw_zenoh_rs
ros2 run demo_nodes_cpp listener
The listener
node should start receiving messages on the /chatter
topic.
The default Zenoh configuration file is located at config/DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5
.
To use a custom configuration file, set the ZENOH_SESSION_CONFIG_URI
environment variable. For example:
export ZENOH_SESSION_CONFIG_URI=$HOME/MY_ZENOH_SESSION_CONFIG.json5
scouting.multicast.interface is overwritten with the loopback interface when the environment variable ROS_LOCALHOST_ONLY is set to 1.
Logging functionality has not been implemented yet.
- Events: Events has not been implemented yet.
- Content filtering: Content filtering has not been implemented yet.