ROS Domain ID
This is important to understand as you work with more and more robots. For the example, in the case of the Indy Autonomous Challenge, you have multiple ROS robots communicating over the same network. You need to make sure your ROS Domain ID is configured correctly so you you messages aren’t accidentally published to a topic used by another robot on a different domain ID.
ROS_DOMAIN_ID vs. namespace?
ROS_DOMAIN_ID
is an environment variable used to isolate multiple ROS 2 systems from each other on the same network.Namespace
in ROS is a prefix added to node and topic names to logically separate different parts of a single ROS system.So
ROS_DOMAIN_ID
operates at a higher level, they enable differentiation between different systems, whereas namespaces help differentiate within a single system.
Resources
- https://docs.ros.org/en/humble/Concepts/Intermediate/About-Domain-ID.html
- http://design.ros2.org/articles/topic_and_service_names.html
“As explained elsewhere, the default middleware that ROS 2 uses for communication is DDS. In DDS, the primary mechanism for having different logical networks share a physical network is known as the Domain ID. ROS 2 nodes on the same domain can freely discover and send messages to each other, while ROS 2 nodes on different domains cannot.
Default
All ROS 2 nodes use domain ID 0 by default.
To avoid interference between different groups of computers running ROS 2 on the same network, a different domain ID should be set for each group.”
What numbers for
ROS_DOMAIN_ID
?
ROS_DOMAIN_ID
can be any number between 0 and 253, although it is recommended to use numbers less than 101. Source
Connext Domain ID
I had to understand ROS Domain ID to understand how Connext Domain IDs work https://community.rti.com/static/documentation/connext-dds/5.2.0/doc/manuals/connext_dds/html_files/RTI_ConnextDDS_CoreLibraries_UsersManual/Content/UsersManual/ChoosingDomainID.htm