Embodied AI Glossary中文

ROS 2 Domain ID

ROS_DOMAIN_ID(域 ID)Advanced

A ROS 2 environment variable that decides which nodes can discover and talk to each other.

ROS 2 communicates over DDS middleware under the hood, and nodes on the same local network discover each other automatically. ROS_DOMAIN_ID is an environment variable used to group nodes: only nodes with the same domain ID can see one another, and the default value is 0. It comes from DDS's own concept of a “domain,” and different domain IDs map to different network ports. The official documentation recommends staying within the 0–101 range to avoid clashing with system ports. In a lab where multiple people and multiple robots share one network, forgetting to set separate domain IDs means everyone ends up receiving each other's topic data and interfering with one another — a common beginner pitfall.

ExampleTwo students each controlling a robot on the same Wi-Fi run export ROS_DOMAIN_ID=11 and export ROS_DOMAIN_ID=12 respectively in their terminals, so their topics no longer cross over.

Also called
ROS_DOMAIN_ID
Related
Robot Operating System 2 · Data Distribution Service · Middleware · Node (ROS) · Topic (ROS) · ROS 2 Quality of Service (QoS)
Sources
ROS 2 Documentation: The ROS_DOMAIN_ID

See it in the full glossary →