yahboom
HomeTutorialsProduct
Solution
Blog
Online Store
About Us
EN/中文
Store
Jetson Orin NX Developer Kit📖
01.Get started
  • 01.Learning route
  • 02.Quick start
  • 03.System Update Notes
  • 04.Disabling automatic updates and troubleshooting issues
02.Jetson basic course
  • 01.Jetson board introduction
  • 02.Write Jetson original system
  • 03.Installing Jetson environment
  • 04.Backup SSD system
  • 05.Restore initial image system
  • 06.Upgrade to SUPER version (Optional)
  • 07.Write SUPER boot (Must read)
  • 08.SSD expansion
  • 09.Jetpack old system upgraded to Yahboom SUPER factory system
  • 10.Write the system onto your own SSD
03.Basic setting course
  • 01.Basic knowledge
  • 02.Network configuration
  • 03.SSH remote login
  • 04.VNC remote control
  • 05.RDP remote control
  • 06.Remote file transfer
  • 07.Jtop tool
  • 08.Exchange space expansion
  • 09.Use VSCode
  • 10.Use VMware
  • 11.Modify screen resolution
04.GPIO control course
  • 01.GPIO description
  • 02.GPIO library installation
  • 03.GPIO reading
  • 04.GPIO output
  • 05.Serial communication
  • 06.I2C communication
05.Vision basic course
  • 01.CSI camera preview
  • 02.USB camera preview
  • 03.Use Jupyter Lab
  • 04.Use JetCam
06.OpenCV basic course
  • 01.Image reading
  • 02.Image saving
  • 03.Image modification
  • 04.Image scaling
  • 05.Image cropping
  • 06.Image translation
  • 07.Image mirroring
  • 08.Image grayscale conversion
  • 09.Image binarization
  • 10.Image edge detection
  • 11.Add line segments
  • 12.Add rectangles
  • 13.Add circular shape
  • 14.Add ellipses
  • 15.Add polygons
  • 16.Add Text
  • 17.Preview USB camera image
  • 18.Preview CSI camera image
07.Vision advanced course
01.Environment construction
  • 01.TensorFlow
  • 02.PyTorch
  • 03.Torchvision
02.DeepStream development
  • 01.DeepStream environment
  • 02.License plate detection and recognition
  • 03.Parallel multi-model inference
  • 04.Object embedding vector generation
  • 05.Pose recognition
  • 06.NV optical flow anomaly detection
  • 07.Single-view 3D tracking
  • 08.Multi-view 3D tracking
03.NVIDIA TAO toolkit application
  • 01.Traffic scene object detection
  • 02.Person object detection
  • 03.Vehicle brand classification
  • 04.Vehicle model classification
  • 05.License plate detection and recognition
  • 06.Person semantic segmentation
  • 07.Optical character detection and recognition
  • 08.Retail product detection and recognition
  • 09.Person feature extraction and matching (ReID)
  • 10.Person action and pose classification
  • 11.Transformer-based person detection
  • 12.3D human skeleton detection
  • 13.LiDAR 3D point cloud detection
04.YOLO11 development
  • 01.YOLO environment construction
  • 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
05.YOLO26 development
  • 01.YOLO environment construction
  • 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
06.Mediapipe development
  • 01.Mediapipe environment
  • 02.Hand detection
  • 03.Face detection
  • 04.Face effects
  • 05.3D object recognition
  • 06.Virtual brush
  • 07.Gesture recognition
  • 08.Finger control
  • 09.Posture estimation
  • 10.Face mask
  • 11.Overall detection
  • 12.Background removal(Human)
07.QR code recognition
  • QR code recognition
08.Docker basic course
  • 01.Docker introduction
  • 02.Docker installation
  • 03.Docker command
  • 04.Docker usage
  • 05.Docker interaction
09.ROS2-Jazzy
01.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
02.ROS2 vision course
  • 01.Camera preview (USB)
  • 02.Camera preview (CSI)
  • 03.Camera calibration (USB)
  • 04.Camera calibration (CSI)
  • 05.AR vision (USB)
  • 06.AR vision (CSI)
10.Large model basic course
01.Offline large model
  • 01.AI large model environment deployment
  • 02.Install large model dialogue platform
  • 03.Meta AI - Llama model
  • 04.Alibaba Cloud - Qwen model
  • 05.Microsoft - Phi-4-mini model
  • 06.DeepSeek - DeepSeek model
  • 07.Alibaba Cloud - Qwen-VL visual multimodal large model
  • 08.Google - Gemma visual multimodal large model
  • 09.Llava visual multimodal large model
  • 10.MiniCPM-V visual multimodal large model
  • 11.High-quality vision-language grounding (LocateAnything)
02.Online large model
  • 01.Tongyi Qianwen large model
  • 02.OpenRouter large model API aggregation platform
11.Large model application practice
01.Voice interaction application
  • 0.Voice interaction hardware connection (Must read)
  • 1.Speech to text (ASR)
  • 2.Text to speech (TTS)
  • 3.AI large model voice interaction
  • 4.AI large model voice assistant
02.Multimodal large model application (Online_Offline large model + Text_Voice interaction)
  • 01.Multimodal visual understand application
  • 02.Multimodal text image application
  • 03.Multimodal video analysis application
  • 04.Multi module visual position application
  • 05.Multimodal table scanning application
  • 06.Multimodal autonomous agent application
12.NVIDIA Isaac ROS course
  • 01.Build Isaac ROS environment
  • 02.Deep segmentation
  • 03.DNN stereoscopic depth
  • 04.Free space segmentation
  • 05.Image distortion processing
  • 06.Image segmentation
  • 07.3D scene reconstruction and mapping
  • 08.Object detection
  • 09.3D attitude estimation
  • 10.Visual SLAM
13.OpenClaw deployment and basic usage
01.OpenClaw deployment and introduction
  • 01.Directly use the pre-configured environment (Recommended)
  • 02.OpenClaw Deployment
  • 03.OpenClaw WhatsApp Plugin Application
  • 04.OpenClaw WebChat Interaction
  • 05.OpenClaw TUI Interaction
  • 06.OpenClaw Tools Introduction
  • 07.OpenClawGate Gateway User Manual
  • 08.OpenClawHub Introduction (Skill Installation)
  • 09.OpenClaw Features Overview
02.OpenClaw basic application
  • 01.OpenClaw Application - File Management
  • 02.OpenClaw Application - Camera
  • 03.OpenClaw Application - Browser Control
  • 04.OpenClaw Application - Script Execution
  • 05.OpenClaw Application - AI Programming (Peripheral & GPIO Control)
  • 06.OpenClaw Application - Dedicated AI Assistant
  • 07.OpenClaw Web Search Capability Configuration
03.NVIDIA official Agent Skills application
  • 01.AI-assisted development with VS Code or Cursor
  • 02.Jetson device skills
  • 03.Jetson BSP custom agent skills
14.OpenClaw advanced development
01.Preparation Before Use
  • 01. Peripheral Hardware Configuration
  • 02. OpenClaw API-KEY Configuration
  • 03. OpenClaw Model Switching
  • 04. OpenClaw Prompts
  • 05. AI Voice Interaction Configuration
  • 06. Three Dialogue Configuration Tests
02.OpenClaw AI Programming Peripheral Control
  • 1. Servo Control
  • 2. RGB Strip
  • 3. OLED Display
  • 4. Temperature and Humidity Sensor
  • 5. Camera Application
  • 6. AI Script Peripheral Control
03.OpenClaw Peripheral Integration Applications
  • 1. Plant Care Assistant
  • 2. AI Calorie Estimation
  • 3.AI Rock Paper Scissors Game
  • 4.AI Pet
  • 5.AI Weather Station
  • 6.Temperature Humidity Dashboard
  • 7.Scheduled Tasks
Download
  • System_File
  • VMFile_BootFile
  • Code
  • 3D Model File
  • DataSheet
  • Manual
Download ZIP

Welcome to Jetson Orin NX Developer Kit repository

当製品の日本語版マニュアル資料は、こちらからご取得ください。

14.ROS2 DDS

14. ROS2 DDS

1. Introduction to DDS

DDS stands for Data Distribution Service, that is, the data distribution service. It was released and maintained by the Object Management Group (OMG) in 2004. It is a data distribution/subscription standard designed specifically for real-time systems. It was first applied in the US Navy to solve the compatibility problem of large-scale software upgrades in the complex network environment of ships. Now it has become a mandatory standard.

DDS emphasizes being data-centric and can provide rich quality of service policies to ensure that data is distributed in real time, efficiently, and flexibly, satisfying the needs of various distributed real-time communication applications.

References:

  • Fast DDS official documentation: 3.3.0

  • ROS2 official documentation on advanced DDS features: Click to jump

2. Communication Model

The topics, services, and actions we learned about in the previous courses all rely on DDS for their specific underlying communication implementation. DDS is like the neural network in the ROS robot system.

The core of DDS is communication. There are many models and software frameworks capable of realizing communication; here we list the four commonly used models.

image-20220528020740057

  • The first is the peer-to-peer model, in which many clients connect to one server. Each communication requires a connection to be established between the two parties. As the number of communicating nodes increases, the number of connections also increases. Moreover, each client needs to know the specific address of the server and the services it provides; once the server address changes, all clients are affected.

  • The second is the Broker model, which optimizes the peer-to-peer model. The Broker centrally processes everyone's requests and further locates the role that can actually respond to the service. In this way, the client does not need to care about the specific address of the server. However, the problem is also obvious: the Broker is the core, and its processing speed affects the efficiency of all nodes. When the system scale grows to a certain level, the Broker becomes the performance bottleneck of the whole system. More troublesome still, if the Broker fails, the entire system may fail to operate normally. The earlier ROS1 system used an architecture similar to this.

  • The third is the broadcast model, in which all nodes can broadcast messages on the channel and all nodes can receive the messages. This model solves the problem of the server address, and the communicating parties do not need to establish a separate connection either. However, there are too many messages on the broadcast channel, and all nodes must care about every message, although many of them have nothing to do with the node itself.

  • The fourth is the data-centric DDS model. This model is somewhat similar to the broadcast model, in which all nodes can publish and subscribe to messages on the DataBus. Its advanced part lies in the fact that there are many parallel channels in the communication, and each node can care only about the messages it is interested in and ignore the ones it is not, a bit like a rotating hot pot where all the delicious food is transferred on this DataBus and we only need to take what we want to eat; the rest has nothing to do with us.

It can be seen that among these communication models, DDS has more obvious advantages.

3. Application of DDS in ROS2

DDS occupies a crucial position in the ROS2 system, and all the upper-layer constructions are built on top of DDS. In this ROS2 architecture diagram, the blue and red parts are DDS.

image-20220528020937717

Among the four major components of ROS, the addition of DDS greatly improves the overall capability of the distributed communication system. In this way, during robot development we no longer need to worry about communication problems and can spend more time on the application development of the other parts.

4. Quality of Service Policy QoS

The basic structure in DDS is the Domain, which binds various applications together for communication. Recall the DOMAIN ID we configured when setting up communication between the Raspberry Pi and the computer: it is the grouping definition of the global data space. Only the nodes in the same DOMAIN group can communicate with each other. This avoids resources being occupied by useless data.

Another important feature of DDS is the quality of service policy: QoS.

QoS is a network transmission policy. The application specifies the network transmission quality behavior it needs, and the QoS service implements the requirements of this behavior, satisfying the customer's demand for communication quality as much as possible. It can be understood as a contract between the data provider and the receiver.

The policies are as follows:

  • The DEADLINE policy means that the communication data must complete one communication within each deadline;

  • The HISTORY policy means the cache size for historical data;

  • The RELIABILITY policy means the data communication mode. Configured as BEST_EFFORT, it is the best-effort transmission mode: even when the network condition is poor, smooth data transmission is guaranteed, which may result in data loss. Configured as RELIABLE, it is the reliable mode, which can try its best to guarantee the integrity of the images during communication. We can choose the appropriate communication mode according to the functional scenario of the application;

  • The DURABILITY policy can be configured for late-joining nodes, and it also guarantees that a certain amount of historical data is sent over, so that new nodes can quickly adapt to the system.

5. Test Cases

5.1 Case 1—Configure DDS through the Command Line

  • Open the first terminal and publish the topic with the following command:

ros2 topic pub /chatter std_msgs/msg/Int32 "data: 66" --qos-reliability best_effort

image-20250827115245194

  • Open another terminal and print the topic using a different QoS. If the QoS policy used is different from that of the publisher, a warning message will appear and the topic data cannot be received properly:

xxxxxxxxxx
ros2 topic echo /chatter --qos-reliability reliable

image-20250827115358309

  • Using the same QoS policy as the topic publisher allows us to receive the topic data

xxxxxxxxxx
ros2 topic echo /chatter --qos-reliability best_effort

image-20250827120250112

5.2 Case 2—Write a Topic Node and Configure the QoS Service Policy

  • Use the following command to create a new function package

xxxxxxxxxx
ros2 pkg create learning_dds --build-type ament_python --dependencies rclpy std_msgs
  • Create a new dds_controller_pub.py file as the publisher for topic communication, and fill in the following content:

​x
import rclpy
from rclpy.node import Node
from std_msgs.msg import String
# Import QoS related classes
from rclpy.qos import QoSProfile, QoSReliabilityPolicy, QoSHistoryPolicy

class ControllerPublisher(Node):
    def __init__(self, name):
        super().__init__(name)
        # 1. Configure the QoS policy: reliable transmission, keep the last 1 historical data
        self.qos_profile = QoSProfile(
            reliability=QoSReliabilityPolicy.RELIABLE,  # Reliable transmission (retransmit lost data)
            history=QoSHistoryPolicy.KEEP_LAST,         # Keep the last N pieces of data
            depth=1                                     # Keep 1 historical data
        )
        # 2. Create the publisher: topic name /robot_cmd, message type String, QoS policy
        self.publisher = self.create_publisher(
            String, 
            "/robot_cmd", 
            self.qos_profile
        )
        # 3. Create the timer: send one command per second
        self.timer = self.create_timer(1.0, self.timer_callback)
        self.cmd_list = ["forward", "backward", "stop"]  # Command list
        self.cmd_index = 0  # Command index, switching in a loop


    def timer_callback(self):
        # Cycle through the commands (forward → backward → stop → forward...)
        current_cmd = self.cmd_list[self.cmd_index % 3]
        # Create the message and fill in the data
        msg = String()
        msg.data = current_cmd
        # Publish the message
        self.publisher.publish(msg)
        # Print the log (shows the published command)
        self.get_logger().info(f"Publish control command: {msg.data}")
        # Update the command index
        self.cmd_index += 1


def main(args=None):
    # Initialize ROS2
    rclpy.init(args=args)
    # Create the publisher node
    node = ControllerPublisher("robot_controller_pub")
    # Run the node in a loop
    rclpy.spin(node)
    # Destroy the node and shut down ROS2
    node.destroy_node()
    rclpy.shutdown()


if __name__ == "__main__":
    main()
  • The subscriber code implementation: create a new dds_robot_sub.py file and fill in the following subscriber implementation code

xxxxxxxxxx
import rclpy
from rclpy.node import Node
from std_msgs.msg import String
from rclpy.qos import QoSProfile, QoSReliabilityPolicy, QoSHistoryPolicy

class RobotSubscriber(Node):
    def __init__(self, name):
        super().__init__(name)
        # 1. Configure a QoS policy compatible with the publisher
        self.qos_profile = QoSProfile(
            reliability=QoSReliabilityPolicy.BEST_EFFORT,
            history=QoSHistoryPolicy.KEEP_LAST,
            depth=1
        )
        # 2. Create the subscriber: topic name /robot_cmd, callback function, QoS policy
        self.subscription = self.create_subscription(
            String,
            "/robot_cmd",
            self.cmd_callback,  # Callback function executed after data is received
            self.qos_profile
        )

    def cmd_callback(self, msg):
        # Callback function: process the received command
        self.get_logger().info(f"Received control command: {msg.data} → execute the corresponding action")


def main(args=None):
    rclpy.init(args=args)
    node = RobotSubscriber("robot_subscriber")
    rclpy.spin(node)
    node.destroy_node()
    rclpy.shutdown()


if __name__ == "__main__":
    main()
  • Configure the compilation file (setup.py)

xxxxxxxxxx
entry_points={
    'console_scripts': [
        # Publisher node: command name = package name . file name : main function
        'dds_controller_pub = learning_dds.dds_controller_pub:main',
        # Subscriber node
        'dds_robot_sub = learning_dds.dds_robot_sub:main',
    ],
},

image-20250905153513257

  • Open a terminal in the workspace directory and compile the function package

xxxxxxxxxx
colcon build --packages-select learning_dds

image-20250905153611086

  • Set the environment variables; they must be set every time you recompile

xxxxxxxxxx
source install/setup.bash
  • Run the publisher and subscriber nodes

xxxxxxxxxx
ros2 run learning_dds dds_controller_pub
xxxxxxxxxx
ros2 run learning_dds dds_robot_sub

image-20250905153734043

Advanced robot development:

  • Under normal circumstances, the publisher and the subscriber of a topic communication need to keep the same QoS communication policy, so as to avoid some implicit communication layer problems;

  • The Qos communication policy should be selected according to the actual application scenario;

  • If the application scenario involves drone communication, encrypted communication, real-time communication, or other scenarios with special requirements on the communication layer, find the official Fast-DDS manual in the introduction of this section for a more detailed description of the DDS features;

image-20250905155146210

ROS2 distributed communication
ROS2 time related API

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/中文