Set up the ROS_DOMAIN_ID¶
The PAL Docker image and PAL robots use the ROS_DOMAIN_ID environment variable in combination with a custom Cyclone DDS configuration to establish P2P connections. This ensures stable and network-friendly connectivity when multiple ROS 2 systems operate on the same network.
The ROS_DOMAIN_ID is used to separate ROS 2 processes (values between 0 and 232, default is 0). Nodes must share the same ROS_DOMAIN_ID to communicate; otherwise, they remain isolated.
The custom PAL Cyclone DDS configuration makes topics non accessible from outside even with the same ROS_DOMAIN_ID, unless the robot is explicitly connected using the PAL Connection CLI.
Configuration¶
To set and verify the ROS_DOMAIN_ID on the robot, use the following commands:
sudo vim /etc/ros_domain_id
echo $ROS_DOMAIN_ID