Set up the ROS_DOMAIN_ID in ROS 2#
The PAL OS Docker image and robots of PAL use the ROS_DOMAIN_ID
in combination with a custom
Cyclone DDS configuration in order to establish P2P connection between ROS 2
systems. This allows for a more stable way of connecting to different ROS 2 systems
and is more network friendly when using multiple ROS 2 systems on the same network.
Steps on how to establish a connection between a PAL OS Docker image and a robot can be found
in Set up ROS 2 communication with the robot.
The ROS_DOMAIN_ID
is an environment variable in ROS 2 that is used to separate
multiple ROS 2 processes running on the same network. Nodes with the same ROS_DOMAIN_ID
can communicate with each other, but are not able to communicate to nodes with a
different ROS_DOMAIN_ID
. By setting different ROS_DOMAIN_ID
values, you can run
multiple ROS 2 processes on the same network without interference between them. A more
detailed explanation of the ROS_DOMAIN_ID
can be found in the
ROS 2 documentation.
Important
By using the custom PAL Cyclone DDS configuration, topics are not accessible from outside even
with the same ROS_DOMAIN_ID
set, unless you explicitly connect to the robot with
the connection tool. Section Set up ROS 2 communication with the robot explains how to use the
PAL Connection CLI, which is the default way to establish communication with your robot.
To show the ROS_DOMAIN_ID
of the robot, the following command can be used inside the robot:
echo $ROS_DOMAIN_ID