Skip to content

Body Monitoring Protocol (TCP)

  • 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_server

This protocol applies to communication between the robot body and a host computer (external board or system).

This protocolApplication layer (Layer 7)
TCP/IP or UDP/IPTransport layer (Layer 4)
Network layer (Layer 3)
EthernetData link layer (Layer 2)
Physical layer (Layer 1)

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.

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.

The protocol APDU (Application Protocol Data Unit) uses a “protocol header + ASDU (Application Service Data Unit)” structure, where each APDU can carry one ASDU.

The protocol header is fixed at 16 bytes:

No.ContentLengthValueRemarks
1Sync char10xebFixed
2Sync char10x91Fixed
3Sync char10xebFixed
4Sync char10x90Fixed
5Length2ASDU byte length, little-endian, low byte first. Max ASDU length: 65535 bytes
6Message ID2Unique identifier per frame, incrementing from 0, wraps at 65535. Little-endian
7Reserved80x00Reserved 8 bytes, fill with 0

The ASDU data content uses XML format with the following generic fields:

FieldDescription
TypeMessage type
CommandMessage command code
TimeSend time, local timezone, format: YYYY-MM-DD HH:MM:SS
ItemsParameter 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 ValueMessage Type
1002Get real-time basic status
1003Send navigation task
1004Cancel navigation task
1007Query navigation task execution status
1101Smart controller indicator light control
2001Battery information
2101Initialize localization
1008Get motor temperature
0Request 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>
ParameterDescriptionValue Description
ErrorCodeRequest format error typeProtocol header missing=1, Protocol header error=2, Data length abnormal=3, Data format parsing completed=4