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

9.ROS2 action communication

9. ROS2 Action Communication

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

1. Action Communication Overview

Action communication is a communication model with continuous feedback. In communication, the client sends request data to the server, and the server responds with results to the client. However, during the process from when the server receives the request to when it generates the final response, it continuously sends feedback information to the client.

Action communication client/server model is as follows:

image8

 

2. Example Introduction

The action client submits an integer N. The action server receives the request data and accumulates all integers from 1 to N, returning the final result to the action client. Moreover, each time it accumulates, it calculates the current progress and sends feedback to the action client.

3. Create New Package

3.1. Create Action Communication Interface Package

  1. Action communication requires creating an action communication interface first:

  • In the workspace src directory, create the pkg_interfaces package:

ros2 pkg create --build-type ament_cmake pkg_interfaces

 

  1. Next, create an action folder under the pkg_interfaces package, and create a [Progress.action] file in the action folder with the following content:

xxxxxxxxxx
int64 num
---
int64 sum
---
float64 progress

image-20231030154108201

 

  1. Some dependencies need to be added in package.xml:

xxxxxxxxxx
<buildtool_depend>rosidl_default_generators</buildtool_depend>
<exec_depend>rosidl_default_runtime</exec_depend>
<depend>action_msgs</depend>
<member_of_group>rosidl_interface_packages</member_of_group>

 

  1. Add the following configuration in CMakeLists.txt:

​x
find_package(rosidl_default_generators REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
  "action/Progress.action"
)

image-20231030154828498

  1. Build the package:

xxxxxxxxxx
colcon build --packages-select pkg_interfaces

image-20250905142323197

 

  1. After building, the C++ and Python files corresponding to Progress.action will be generated in the install directory under the workspace. We can also navigate to the workspace in the terminal and use the following command to view the file definition and check if the build is normal:

xxxxxxxxxx
source install/setup.bash
ros2 interface show pkg_interfaces/action/Progress

Under normal circumstances, the terminal will output content consistent with the Progress.action file.

image-20250820112138938

3.2. Create Action Communication Package

  • In the workspace src directory, create the pkg_action package:

xxxxxxxxxx
ros2 pkg create pkg_action --build-type ament_python --dependencies rclpy pkg_interfaces --node-name action_server_demo

After executing the above command, the pkg_action package will be created, along with an action_server_demo node, and the related configuration files will already be set up.

image-20231030155311734

 

4. Action Server Implementation

4.1 Create Action Server

Next, edit [action_server_demo.py] to implement the action server functionality. Add the following code:

xxxxxxxxxx
import time
import rclpy
from rclpy.action import ActionServer
from rclpy.node import Node

from pkg_interfaces.action import Progress


class Action_Server(Node):

    def __init__(self):
        super().__init__('progress_action_server')
        # Create action server
        self._action_server = ActionServer(
            self,
            Progress,
            'get_sum',
            self.execute_callback)
        self.get_logger().info('Action server started!')

    def execute_callback(self, goal_handle):
        self.get_logger().info('Starting task....')


        # Generate continuous feedback;
        feedback_msg = Progress.Feedback()

        sum = 0
        for i in range(1, goal_handle.request.num + 1):
            sum += i
            feedback_msg.progress = i / goal_handle.request.num
            self.get_logger().info('Continuous feedback: %.2f' % feedback_msg.progress)
            goal_handle.publish_feedback(feedback_msg)
            time.sleep(1)

        # Generate final response.
        goal_handle.succeed()
        result = Progress.Result()
        result.sum = sum
        self.get_logger().info('Task completed!')

        return result


def main(args=None):

    rclpy.init(args=args)
    # Call spin function with node object
    Progress_action_server = Action_Server()
    rclpy.spin(Progress_action_server)
    Progress_action_server.destroy_node()
    # Release resources
    rclpy.shutdown()

 

4.2 Edit Configuration File

  • Open setup.py and add to the console_scripts list:

xxxxxxxxxx
'action_server_demo = pkg_action.action_server_demo:main',

image-20231030164238858

 

4.3 Build Package

xxxxxxxxxx
colcon build --packages-select pkg_action

 

4.4 Run Program

xxxxxxxxxx
ros2 run pkg_action action_server_demo

image-20231030164959631

 

Enter in another terminal:

xxxxxxxxxx
ros2 action list

image-20231030165029444

 

/get_sum is the action we need to call. Use the following command to call it:

xxxxxxxxxx
ros2 action send_goal /get_sum pkg_interfaces/action/Progress "{num: 10}"

 

Here we calculate the sum from 1 to 10:

image-20231030165504071

In the image above, the top is the server and the bottom is the client. You can see that during the calculation of the sum from 1 to 10, the server continuously sends feedback on the calculation progress. Finally, it shows task completion, and the client also received the feedback with the sum being 55.

5. Action Client Implementation

5.1 Create Action Client

Create a new file [action_client_demo.py] in the same directory as [action_server_demo.py]:

image-20231030170243256

Next, edit [action_client_demo.py] to implement the action client functionality. Add the following code:

xxxxxxxxxx
import rclpy
from rclpy.action import ActionClient
from rclpy.node import Node
from pkg_interfaces.action import Progress

class Action_Client(Node):
    def __init__(self):
        super().__init__('progress_action_client')
        # Create action client;
        self._action_client = ActionClient(self, Progress, 'get_sum')

    def send_goal(self, num):
        # Send request;
        goal_msg = Progress.Goal()
        goal_msg.num = num
        self._action_client.wait_for_server()
        self._send_goal_future = self._action_client.send_goal_async(goal_msg, feedback_callback=self.feedback_callback)
        self._send_goal_future.add_done_callback(self.goal_response_callback)

    def goal_response_callback(self, future):
        # Handle feedback after goal is sent;
        goal_handle = future.result()
        if not goal_handle.accepted:
            self.get_logger().info('Request rejected')
            return

        self.get_logger().info('Request accepted, starting task!')

        self._get_result_future = goal_handle.get_result_async()
        self._get_result_future.add_done_callback(self.get_result_callback)

    # Handle final response.
    def get_result_callback(self, future):
        result = future.result().result
        self.get_logger().info('Final calculation result:sum = %d' % result.sum)
        # 5. Release resources.
        rclpy.shutdown()

    # Handle continuous feedback;
    def feedback_callback(self, feedback_msg):
        feedback = (int)(feedback_msg.feedback.progress * 100)
        self.get_logger().info('Current progress: %d%%' % feedback)


def main(args=None):
    rclpy.init(args=args)
    action_client = Action_Client()
    action_client.send_goal(10)
    rclpy.spin(action_client)

 

5.2 Edit Configuration File

  • Open setup.py and add to the console_scripts list:

xxxxxxxxxx
'action_client_demo = pkg_action.action_client_demo:main'

image-20231030171045187

 

5.3 Build Package

xxxxxxxxxx
colcon build --packages-select pkg_action

image-20250905143944896

5.4 Run Program

Split terminal and execute:

xxxxxxxxxx
# Start action server node
ros2 run pkg_action action_server_demo
# Start action client node
ros2 run pkg_action action_client_demo

image-20231030171150033

In the image above, the top is the server and the bottom is the client. Here we calculate the sum from 1 to 10. You can see that during the calculation, the server continuously sends feedback on the calculation progress. Finally, it shows task completion, and the client received the feedback with the sum being 55.

ROS2 service communication
ROS2 custom interface message

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