Body Monitoring Protocol (TCP)
Software Requirements
Section titled “Software Requirements”- robot_server version V3.0.26 or later;
- Full system package version V4.0.0 or later.
To check the robot_server version, log in to the navigation host (default address 192.168.1.106) and run:
dpkg -l robot_serverProtocol General Rules
Section titled “Protocol General Rules”This protocol applies to 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) |
Protocol Port
Section titled “Protocol Port”When using this protocol, the robot body acts as the TCP server and the host computer acts as the TCP client. The TCP server port is 192.168.1.106:30000.
Interaction Mechanism
Section titled “Interaction Mechanism”This protocol primarily uses a request/response mechanism. The host computer can actively send data queries and control commands to the robot body, and the robot body replies via responses.
Application Protocol Data Unit
Section titled “Application Protocol Data Unit”The protocol APDU (Application Protocol Data Unit) uses a “protocol header + ASDU (Application Service Data Unit)” structure, where each APDU can carry one ASDU.
Protocol Header Structure
Section titled “Protocol Header Structure”The protocol header is fixed at 16 bytes:
| No. | Content | Length | Value | Remarks |
|---|---|---|---|---|
| 1 | Sync char | 1 | 0xeb | Fixed |
| 2 | Sync char | 1 | 0x91 | Fixed |
| 3 | Sync char | 1 | 0xeb | Fixed |
| 4 | Sync char | 1 | 0x90 | Fixed |
| 5 | Length | 2 | ASDU byte length, little-endian, low byte first. Max ASDU length: 65535 bytes | |
| 6 | Message ID | 2 | Unique identifier per frame, incrementing from 0, wraps at 65535. Little-endian | |
| 7 | Reserved | 8 | 0x00 | Reserved 8 bytes, fill with 0 |
ASDU Structure
Section titled “ASDU Structure”The ASDU data content uses XML format with the following generic fields:
| Field | Description |
|---|---|
| Type | Message type |
| Command | Message command code |
| Time | Send time, local timezone, format: YYYY-MM-DD HH:MM:SS |
| Items | Parameter items carried by the message |
ASDU example:
<?xml version="1.0" encoding="UTF-8"?><PatrolDevice> <Type>1002</Type> <Command>1</Command> <Time>2023-01-01 00:00:00</Time> <Items/></PatrolDevice>ASDU message types:
| Type Value | Message Type |
|---|---|
| 1002 | Get real-time basic status |
| 1003 | Send navigation task |
| 1004 | Cancel navigation task |
| 1007 | Query navigation task execution status |
| 1101 | Smart controller indicator light control |
| 2001 | Battery information |
| 2101 | Initialize localization |
| 1008 | Get motor temperature |
| 0 | Request message error feedback |
Request Message Error Feedback
Section titled “Request Message Error Feedback”When the client sends an incorrect request, the robot returns a response with Type=0:
<?xml version="1.0" encoding="UTF-8"?><PatrolDevice> <Type>0</Type> <Command>0</Command> <Time>0000-00-00 00:00:00</Time> <Items> <ErrorCode>0</ErrorCode> </Items></PatrolDevice>| Parameter | Description | Value Description |
|---|---|---|
| ErrorCode | Request format error type | Protocol header missing=1, Protocol header error=2, Data length abnormal=3, Data format parsing completed=4 |