yahboom
HomeTutorialsProduct
Solution
Blog
Online Store
About Us
EN/中文
Store
Jetson Orin NANO Developer Kit📖
01.Get started
  • 01. Learning route
  • 02. Get started quickly
  • 03. System Update Notes
  • 04. Disabling automatic updates and troubleshooting issues
  • 05. Jetson Orin Nano official kit screwdriver instructions
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.Retail product detection and recognition
  • 08.Person feature extraction and matching (ReID)
  • 09.Person action and pose classification
  • 10.Transformer-based person detection
  • 11.3D human skeleton detection
  • 12.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.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.Green scene removal(Human)
06.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
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
  • 9.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
  • 1.Voice interaction hardware connection (Must read)
  • 2.Offline speech to text (ASR)
  • 3.Offline text to speech (TTS)
  • 4.AI large model voice interaction
  • 5.AI large model offline 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.Quick start with 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.OpenClaw Features Overview
  • 09.OpenClawHub Introduction (Skill Installation)
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
  • 3D Model File
  • DataSheet
  • Software_Tools
  • Code
  • Manual
Download ZIP

Welcome to Jetson Orin NANO Developer Kit repository

14.ROS2 DDS

14. ROS 2 DDS

1. Introduction to DDS

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

DDS emphasizes being data-centric and can provide rich quality of service policies to ensure real-time, efficient, and flexible data distribution, meeting the needs of various distributed real-time communication applications.

References:

  • Fast DDS official website documentation: 3.3.0

  • ROS 2 official documentation on advanced DDS features: Click to jump

2. Communication Model

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

The core of DDS is communication. There are very many models and software frameworks that can implement communication. Here we list four commonly used models.

image-20220528020740057

  • The first is the point-to-point model. Many clients connect to one server, and each communication requires the two communicating parties to establish a connection. When 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 is optimized for the point-to-point model. The Broker centrally processes everyone's requests and further finds the roles that can truly 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: as the core, the processing speed of the Broker affects the efficiency of all nodes. When the system scale grows to a certain extent, the Broker will become the performance bottleneck of the entire system. What is more troublesome is that if an exception occurs in the Broker, the entire system may not be able to operate normally. The previous ROS1 system used an architecture similar to this.

  • The third is the broadcast model. 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 two communicating parties do not need to establish a separate connection. However, there are too many messages on the broadcast channel, and all nodes must care about every message, while in fact many of them have nothing to do with themselves.

  • The fourth is the data-centric DDS model. This model is somewhat similar to the broadcast model: all nodes can publish and subscribe to messages on the DataBus. But its advanced point is that the communication contains many parallel pathways, and each node can only care about the messages it is interested in and ignore the messages it is not interested in. It is somewhat like a rotating hot pot, where all kinds of delicious food are transmitted 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 several communication models, the advantages of DDS are more obvious.

3. Application of DDS in ROS 2

The position of DDS in the ROS 2 system is crucial, and all upper-layer construction is built on top of DDS. In this architecture diagram of ROS 2, the blue and red parts are DDS.

image-20220528020937717

Among the four major components of ROS, due to the addition of DDS, the comprehensive capability of the distributed communication system is greatly improved. In this way, in the process of developing robots, we do not need to struggle with communication problems and can spend more time on application development of other parts.

4. Quality of Service Policy QoS

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

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

QoS is a network transmission policy. The application specifies the required network transmission quality behavior, 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:

  • DEADLINE policy, which means that communication data must complete one communication within each deadline;

  • HISTORY policy, which means a cache size for historical data;

  • RELIABILITY policy, which means the mode of data communication. If it is configured as BEST_EFFORT, it is the best-effort transmission mode: data flow must also be guaranteed when the network condition is poor, and data loss may occur at this time. If it is configured as RELIABLE, it is the reliable mode, which can ensure the integrity of the image as much as possible during communication. We can select the appropriate communication mode according to the application function scenario;

  • DURABILITY policy, which can be configured so that a certain amount of historical data is also guaranteed to be sent to nodes that join late, allowing new nodes to quickly adapt to the system.

5. Test Case

5.1. Case 1—Configuring DDS via the Command Line

  • Open the first terminal and publish a 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 with 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 normally:

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

image-20250827115358309

  • If we use the same QoS policy as the topic publisher, the topic data can be received

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

image-20250827120250112

5.2. Case 2—Writing Topic Nodes to Configure QoS Service Policies

  • Create a new package with the following command

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 of 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 piece of 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 piece of historical data
        )
        # 2. Create a publisher: topic name /robot_cmd, message type String, QoS policy
        self.publisher = self.create_publisher(
            String, 
            "/robot_cmd", 
            self.qos_profile
        )
        # 3. Create a timer: send a command once 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, switched in a loop


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


def main(args=None):
    # Initialize ROS 2
    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 ROS 2
    node.destroy_node()
    rclpy.shutdown()


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

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 a subscriber: topic name /robot_cmd, callback function, QoS policy
        self.subscription = self.create_subscription(
            String,
            "/robot_cmd",
            self.cmd_callback,  # The callback function executed after receiving data
            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 package

xxxxxxxxxx
colcon build --packages-select learning_dds

image-20250905153611086

  • Set the environment variables. The environment variables need to be set after every recompilation

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:

  • Usually, the publisher and subscriber of topic communication need to maintain the same QoS communication policy to avoid some hidden communication layer problems;

  • The setting of 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, and other scenarios that have special requirements for the communication layer, the official Fast-DDS manual can be found in the introduction of this tutorial, which has more detailed descriptions of DDS functions;

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