yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
RDK S600 Developer Kit📖
1.RDK S600 board introduction
  • 1.1 RDK S600 board introduction
  • 1.2 System Flashing
  • 1.3 Hardware Interface Description
  • 1.4 Accessory Installation
  • 1.5 Camera Expansion Board
  • 1.6 MCU Interface Expansion Board
  • 1.7 Precautions for Using the 15.6-inch Screen
  • 1.8 System Boot Modes
2.RDK S600 basic course
  • 2.1 Network Configuration
  • 2.2 Remote Login
  • 2.3 System Update
  • 2.4 Boot Auto-Start Configuration
  • 2.5 RDK Exclusive Command Usage
  • 2.6 Linux Command Usage
  • 2.7 Examples of GPIO Read and Write Operations
  • 2.8 Using the USB Camera
  • 2.9 Solid-state mounting
  • 2.10 SSD expansionnew
3.TogetheROS.Bot Vision Applications
  • 1. About TogetheROS. Bot
  • 2. System Installation
  • 3. Object Detection(YOLO)
  • 4. Image Classification(mobilenetv2)
  • 5. Image Segmentation(mobilenet_unet)
  • 6. Perception Algorithm(BEV)
  • 7. Human Detection and Tracking (Ultralytics YOLO Pose)
4. Offline AI Large Model Development
Offline large model (Text Interaction)
  • 1. AI large model environment deployment
  • 2. Install large model dialogue platform
  • 3. Meta AI Llama 3.2 model
  • 4. Alibaba Cloud Qwen3 model
  • 5. Microsoft Phi-4 mini model
  • 6. DeepSeek - DeepSeek-R1 model
  • 7. Alibaba Cloud Qwen2.5vl Visual Multimodal Large Model
  • 8. Google Gemma3 Visual Multimodal Large Model
  • 9. Lava Visual Multimodal Large Model
  • 10. MiniCPM-V Visual Multimodal Large Model
  • 11. Multimodal visual understand application
  • 12. Multimodal text image application
  • 13. Multimodal visual localization application
  • 14. Multimodal table scanning application
  • 15. Multimodal Autonomous Agent Applications
Offline large model (Voice Interaction)
  • 0. Voice Interaction Hardware Connection (Must Read)
  • 1. Offline speech-to-text (ASR)
  • 2. Offline Text-to-Speech (TTS)
  • 3. AI large model voice interaction
  • 4. Multimodal visual understanding voice interaction
  • 5. Multimodal Text-to-Image application
  • 6. Multimodal video analytics application
  • 7. Multimodal visual localization application
  • 8. Multimodal table scanning application
  • 9. Multimodal autonomous agent application
  • 10. AI Large Model Offline Voice Assistant
5. Online AI Large Model Development
Online large model (Text Interaction)
  • 1.OpenRouter large model API aggregation platform
  • 2.Multimodal visual understand application
  • 3.Multimodal visual localization application
  • 4.Multimodal table scanning application
  • 5.Multimodal autonomous proxy application
Online large model (Voice Interaction)
  • 0.Voice interaction hardware connection (ReadMe)
  • 1.Online speech to text (ASR)
  • 2.Online text to speech (TTS)
  • 3.AI large model voice interaction
  • 4.Multimodal visual understand speech interaction
  • 5.Multimodal visual localization application
  • 6.Multimodal table scanning application
  • 7.Multimodal autonomous proxy application
  • 8.AI large model online voice assistant
6.YOLO26 tutorials
  • 01.YOLO26 environment
  • 02.CLI use
  • 03.Object detection
  • 04.Instance segmentation
  • 05.Pose estimation
  • 06.Image classification
  • 07.Oriented object detection
  • 08.Model conversion
  • 09.Dataset annotation
  • 10.Model training - conversion
  • 11.Model prediction
7.OpenClaw Advanced Development
  • 1. OpenClaw Deployment
  • 2. OpenClaw and WhatsApp Plugin Application
  • 3. OpenClaw TUI Interaction
  • 4. OpenClaw WebChat Interaction
  • 5. OpenClaw Gate Gateway Operation Manual
  • 6. OpenClaw Plugin Function Introduction
  • 7. OpenClaw Tools Introduction
  • 8. OpenClaw ClawHub Introduction (skill Installation)
  • 9.OpenClaw Application - File Management
  • 10.OpenClaw Application - Browser Control
  • 11.OpenClaw Application - Camera
  • 12.OpenClaw Application - Script Execution
  • 13.OpenClaw Application - AI Programming (Peripheral & GPIO Control)
  • 14. OpenClaw Application - Dedicated AI Assistant
  • 15. OpenClaw Configure Web Search Capability
8.ROS2 basic course
  • 1.Introduction to ROS2
  • 2.ROS2 install Jazzy
  • 3.ROS2 development environment
  • 4.ROS2 workspace
  • 5.ROS2 function package
  • 6.ROS2 node
  • 7.ROS2 topic communication
  • 8.ROS2 service communication
  • 9.ROS2 action communication
  • 10.ROS2 custom interface message
  • 11.ROS2 parameter service case
  • 12.ROS2 meta-function package
  • 13.ROS2 distributed communication
  • 14.ROS2 DDS
  • 15.ROS2 time related API
  • 16.ROS2 common command tools
  • 17.ROS2 rviz2 use
  • 18.ROS2 rqt toolbox
  • 19.ROS2 Launch startup file configuration
  • 20.ROS2 recording and playback tool
  • 21.ROS2 URDF model
  • 22.ROS2 Gazebo simulation platform
  • 23.ROS2 TF2 coordinate transformation
Download
  • System_File
  • Code
  • 3D_Model_File
  • Tools_Software
Download ZIP

Welcome to RDK S600 Developer Kit repository

13.ROS2 distributed communication

13. ROS2 Distributed Communication

Note: The accompanying reference video uses the ROS Humble version, for reference only

1. Concept

Multi-machine communication, i.e., distributed communication, refers to a communication strategy that enables data exchange between different hosts over a network.

ROS2 itself is a distributed communication framework that conveniently facilitates communication between different devices. The middleware that ROS2 is based on is DDS. When on the same network, distributed communication can be achieved through DDS's domain ID mechanism (ROS_DOMAIN_ID). The general process is: before starting nodes, you can set the domain ID value. If different nodes have the same domain ID, they can discover and communicate freely with each other. Conversely, if domain ID values are different, communication cannot be achieved. By default, all nodes use domain ID 0 when starting. In other words, as long as you are on the same network, you don't need to do any configuration. Different nodes on different ROS2 devices can achieve distributed communication.

Distributed communication has a wide range of application scenarios, including autonomous vehicle formations, drone formations, remote control, etc. All these data exchanges depend on distributed communication.

 

2. Implementation

2.1. Default Implementation

You only need to have the master and slave machines [can be multiple] on the same network, and distributed communication is already achieved. For example, the master and slave machines are connected to the same WiFi or router.

Setting the virtual machine network in Windows to [Bridge Mode] puts it on the same network as the host.

 

Testing:

  • Here we assume we have two hosts A and B. They can be any devices that can connect to the network, such as virtual machines, Raspberry Pi, Jetson, x86/ARM hosts, or single-board computers. You only need to have the same version of ROS2 installed.

  1. Execute on Host A:

ros2 run demo_nodes_py talker
  1. Execute on Host B:

xxxxxxxxxx
ros2 run demo_nodes_py listener

If the following is displayed: topics published by the host can be subscribed to by the slave in a timely manner, it means multi-machine communication has been achieved.

 

2.2. Distributed Network Grouping

Assume you are in a network where other robots are also operating. To avoid interference from other robots, you can assign your robot to a group.

ROS2 provides a DOMAIN mechanism, similar to grouping. Only computers in the same DOMAIN can communicate. We can add this configuration to the .bashrc of both the host [mainboard] and the slave [virtual machine] to put them in the same group:

xxxxxxxxxx
export ROS_DOMAIN_ID=<your_domain_id>

If the host [mainboard] and slave [virtual machine] are assigned different IDs, they cannot communicate with each other, achieving the purpose of grouping.

 

2.2.1 Example 1

  1. Execute on host [mainboard]:

xxxxxxxxxx
echo "export ROS_DOMAIN_ID=6" >> ~/.bashrc  # Here 6 is ROS_DOMAIN_ID. You don't have to use 6. As long as it follows ROS_DOMAIN_ID rules.
source ~/.bashrc
ros2 run demo_nodes_py talker
  1. Simultaneously execute on slave [virtual machine]:

xxxxxxxxxx
echo "export ROS_DOMAIN_ID=6" >> ~/.bashrc  # Keep this value consistent with the host
source ~/.bashrc
ros2 run demo_nodes_py listener

If the following is displayed: topics published by the host can be subscribed to by the slave in a timely manner, it means grouped multi-machine communication has been achieved.

 

2.2.2 Example 2

Control turtle motion through distributed communication:

  • Run command on Host A:

xxxxxxxxxx
ros2 run turtlesim turtlesim_node
  • Run command on Host B:

xxxxxxxxxx
ros2 run turtlesim turtle_teleop_key

 

3. Notes

When setting the ROS_DOMAIN_ID value, it's not arbitrary. There are some constraints:

  1. It is recommended that ROS_DOMAIN_ID be in the range [0, 101], including 0 and 101;

  2. The total number of nodes within each domain ID is limited to 120 or less;

  3. If the domain ID is 101, the total number of nodes in that domain needs to be 54 or less.

 

4. DDS Domain ID Value Calculation Rules (Advanced Knowledge)

The domain ID value calculation rules are as follows:

  1. DDS is based on TCP/IP or UDP/IP network communication protocols. Network communication requires specifying port numbers, which are represented by unsigned integers of 2 bytes, with a value range of [0, 65535];

  2. Port allocation also follows rules and cannot be arbitrary. According to the DDS protocol, 7400 is used as the starting port, meaning usable ports are [7400, 65535]. Also, by default, each domain ID occupies 250 ports. Therefore, the number of domain IDs is: (65535-7400)/250 = 232 (count), with the corresponding value range being [0, 231];

  3. The operating system also reserves some ports. When DDS uses ports, these reserved ports need to be avoided to prevent conflicts. Different operating systems have different reserved ports. The final result is: on Linux, usable domain IDs are [0, 101] and [215-231]. On Windows and Mac, usable domain IDs are [0, 166]. To be compatible across platforms, it is recommended to keep domain IDs in the range [0, 101];

  4. Each domain ID occupies 250 ports by default, and each ROS2 node needs to occupy two ports. Additionally, according to the DDS protocol, within each domain ID's port range, the 1st and 2nd ports are Discovery Multicast port and User Multicast port. Starting from the 11th and 12th ports are the first node's Discovery Unicast port and User Unicast port within the domain. The ports occupied by subsequent nodes are sequentially incremented. Therefore, the maximum number of nodes in a domain ID is: (250-10)/2 = 120 (count);

  5. Special case: When the domain ID value is 101, the latter half of its ports belong to the operating system's reserved ports, and the maximum number of nodes is 54.

You only need to be aware of the above calculation rules.

ROS2 meta-function package
ROS2 DDS

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文