RMW & ROS Domain ID
This guide explains how to change the ROS 2 middleware and domain ID used by AI Worker.
Environment Variables
These settings are managed through environment variables inside the ai_worker container. The container image sets the following defaults in ~/.bashrc:
| Environment variable | Purpose | Default |
|---|---|---|
RMW_IMPLEMENTATION | Selects the ROS 2 middleware implementation. | rmw_zenoh_cpp |
ROS_DOMAIN_ID | Selects the ROS 2 domain. | 30 |
ROS 2 environments that need to communicate with each other must use the same domain ID and compatible middleware settings. Configure other participating environments, such as Cyclo Intelligence and external PCs, separately.
Change the Settings
-
Connect to the robot through SSH and enter the AI Worker container.
-
Open the container's shell configuration:
nano ~/.bashrc -
Find the existing lines and change the values as needed. For example, these are the defaults:
export RMW_IMPLEMENTATION=rmw_zenoh_cppexport ROS_DOMAIN_ID=30To use Fast DDS, set
RMW_IMPLEMENTATIONtormw_fastrtps_cpp. Choose a domain ID appropriate for your ROS 2 network. -
Save the file with Ctrl+O, press Enter, and exit with Ctrl+X.
-
Exit the container and restart it from the robot PC to apply the changes to newly started services:
exitdocker restart ai_worker -
Enter the container again and check the values:
echo "$RMW_IMPLEMENTATION"echo "$ROS_DOMAIN_ID"Bring up the robot again and check the service logs if needed. The commands above show the current shell's settings; other already-running processes retain the environment they started with.
Changes made only inside the container can be lost if it is removed and recreated. Repeat the configuration after recreating it.
For Zenoh connections from another PC, see External ROS 2 Communication. The Zenoh daemon and client configuration in that guide apply when using Zenoh RMW.