Communication Architecture
basic_server Protocol
Section titled “basic_server Protocol”Based on TCP or UDP protocol (selected according to development needs), suitable for communication between the robot body and a host computer (external board or system).
Protocol Layers
Section titled “Protocol Layers”| This Protocol | Application Layer (Layer 7) |
|---|---|
| TCP/IP or UDP/IP | Transport Layer (Layer 4) |
| Network Layer (Layer 3) | |
| Ethernet | Data Link Layer (Layer 2) |
| Physical Layer (Layer 1) | |
| Note: Layers 5 and 6 are not used |
Protocol Port Numbers
Section titled “Protocol Port Numbers”When using this protocol, the robot body acts as the TCP/UDP server, and the external board or system acts as the TCP/UDP client.
- UDP Server Address: 10.21.31.103:30000
- TCP Server Address: 10.21.31.103:30001
Interaction Mechanism
Section titled “Interaction Mechanism”This protocol primarily uses a request/response mechanism. The host computer can proactively initiate data or status query requests to the robot body, and the robot body responds to some requests.
Application Protocol Data Unit
Section titled “Application Protocol Data Unit”The APDU (Application Protocol Data Unit) of this protocol adopts a “Protocol Header + ASDU (Application Service Data Unit)” structure, where each APDU can carry one ASDU.
Protocol Header
Section titled “Protocol Header”| No. | Content | Length | Value/Description |
|---|---|---|---|
| 1-4 | Sync Characters | 4 bytes | 0xeb 0x91 0xeb 0x90 |
| 5-6 | Length | 2 bytes | ASDU byte length (little-endian), max 65535 |
| 7-8 | Message ID | 2 bytes | Request/Response frame matching identifier (little-endian) |
| 9 | ASDU Format | 1 byte | 0x00=XML, 0x01=JSON |
| 10-16 | Reserved | 7 bytes | Fill with 0x00 |
ASDU (Application Service Data Unit)
Section titled “ASDU (Application Service Data Unit)”The ASDU uses JSON or XML format. JSON format is recommended (faster processing performance and more comprehensive data structure), containing the following fields:
| Field | Meaning |
|---|---|
| Type | Message type |
| Command | Message command code |
| Time | Message send time (YYYY-MM-DD HH:MM:SS) |
| Items | Parameter items |
ROS2/DDS Interface
Section titled “ROS2/DDS Interface”Provides ROS2-compatible topic and service interfaces through the DrDDS middleware, suitable for complex algorithm development and multi-node collaboration.
Note: Before using ROS2 tools to receive topics, check frequencies, etc., you need to source the environment variables with
source /opt/robot/scripts/setup_ros2.sh.