Skip to main content

Zenoh Communication

AI Worker uses ROS 2 Jazzy with Zenoh RMW for communication between robot-side nodes, Docker containers, and external PCs. This page explains how to connect an external PC to the robot and how rmw_zenoh fits into the ROS 2 communication stack.

External PC Control

To control AI Worker from an external PC, set up the AI Worker Docker container on the external PC. Then connect the container's Zenoh client to the Zenoh router running on the robot.

Inside the external PC's AI Worker container, set the following environment variable:

export ZENOH_CONFIG_OVERRIDE='transport/shared_memory/enabled=true;mode="client";connect/endpoints=["tcp/robot_ip:7447"]'

Replace robot_ip with the real IP address of the AI Worker robot. Use the robot's Wi-Fi IP address when both devices are connected over Wi-Fi, or use the robot's LAN IP address when the external PC is connected through Ethernet.

Find the robot IP address

Replace SNPR48A0000 with the serial number printed on the back of the robot body.

Option 1: Resolve the mDNS hostname

AI Worker advertises itself as ffw-SNPR48A0000.local. From your external PC, run:

ping -c 1 ffw-SNPR48A0000.local

Use the IP address shown in the response (for example 192.168.6.2).

Option 2: Check the IP on the robot

SSH into the robot and run:

ssh robotis@ffw-SNPR48A0000.local
hostname -I

Use the address on the same network as your external PC (Wi-Fi or LAN, depending on how you connected).

For connection setup details, see Software Setup.

For example, if the robot's IP address is 192.168.0.42:

export ZENOH_CONFIG_OVERRIDE='transport/shared_memory/enabled=true;mode="client";connect/endpoints=["tcp/192.168.0.42:7447"]'

The AI Worker Docker image enables Zenoh RMW by default. You can check or manually set it with:

export RMW_IMPLEMENTATION=rmw_zenoh_cpp

Keep ROS_DOMAIN_ID consistent across terminals and containers when the AI Worker environment expects a specific ROS domain. Even though Zenoh does not rely on DDS multicast discovery, the ROS 2 process environment should remain consistent across the robot-side stack.

What is rmw_zenoh?

rmw_zenoh is the ROS 2 RMW (ROS Middleware) implementation for Zenoh. The implementation package is rmw_zenoh_cpp, and it maps the ROS 2 middleware API onto Zenoh APIs. Existing ROS 2 publishers, subscribers, services, clients, parameters, and command-line tools can keep using normal ROS 2 interfaces while Zenoh handles discovery and transport.

Zenoh is a pub/sub/query protocol designed to move data efficiently across local processes, robot networks, edge computers, and cloud systems. For AI Worker, this means the robot control software can use normal ROS 2 topics while Zenoh provides a lightweight communication layer that is easier to route across containers and hosts than multicast-heavy DDS discovery.

Main Components

ComponentRole
rmw_zenoh_cppROS 2 RMW implementation selected by RMW_IMPLEMENTATION=rmw_zenoh_cpp.
rmw_zenohdZenoh router executable packaged with rmw_zenoh_cpp. It provides discovery information and host-to-host routing.
Zenoh sessionCommunication session used internally by ROS 2 contexts. Publishers, subscribers, services, and clients share the session.
Zenoh router configurationControls how routers listen, connect, and bridge communication between containers, the robot, and remote PCs.

How Communication Works

  • ROS 2 nodes continue to publish and subscribe to normal topics such as /joint_states, /tf, or controller command topics.
  • rmw_zenoh_cpp converts the ROS 2 middleware calls into Zenoh operations.
  • A local Zenoh router is normally started so nodes can discover each other.
  • On the same host, message data can use direct peer-to-peer paths instead of forcing every sample through the router.
  • Across multiple hosts, configure the external PC container as a Zenoh client connected to the robot's Zenoh router endpoint.

Quick Checks

Use these commands inside the AI Worker container to confirm that Zenoh RMW is active and that the ROS graph is visible:

echo $RMW_IMPLEMENTATION
echo $ZENOH_CONFIG_OVERRIDE
ros2 node list
ros2 topic list
ros2 topic echo /joint_states

If topics appear but messages are not flowing, check that:

  • ZENOH_CONFIG_OVERRIDE uses the robot's real IP address.
  • The robot and external PC are on the same reachable network.
  • Port 7447 is reachable from the external PC.
  • The AI Worker container is running with the expected network configuration.
  • Old ROS 2 daemon state has been stopped with ros2 daemon stop.

References