Chapter 11: Communication Packet Protocol - Omron Pioneer LX User Manual

Omron adept mobile robots platforms for research, education and development
Table of Contents

Advertisement

Table of Contents

Chapter 11: Communication Packet Protocol

All Pioneer 2/3 based mobile robot controllers implement the same Pioneer protocol and are compatible.
All versions of MARC firmware are backwards-compatible with previous versions.
The protocol is a bidirectional byte stream, in which sequences of byte packets represent individual
commands (when sent from client software to the robot controller), or Server Information Packets, or SIPs
or simply packets, (when sent from the robot controller back the client software). Packets consist of five
main elements: a two-byte header, a one-byte count of the number of subsequent packet bytes, a one-
byte command or packet type identifier followed by packet data, and finally a two-byte checksum.
Field
(bytes)
header
2
byte count
1
1
packet type or
command
identifier
packet data
...
checksum
2
Packet data is divided into one or more value fields. The meaning and sequence of fields are specific to
each packet or command type. Each field has a data type which determines the size of that field (in
bytes). Integer data values contained in a packet may be signed and unsigned, and are 16-bit (2-byte)
integers, least-significant byte first. Single-byte values are one 8-bit byte. Strings may be either length-
prefixed or NULL terminated (depending on packet type).
2.1 Packet Checksum
Calculate the client-server packet Checksum by successively adding data byte pairs (most-significant byte
first) to a running checksum (initially zero), disregarding sign and overflow. If there are an odd number
of data bytes, the last byte is XORed to the low-order byte of the checksum.
NOTE: The checksum integer is at the end of the packet, with its bytes in the reverse order of that used
for data; that is, b
is the high byte and b
0
// packetBuf is a character buffer char[] containing one data packet
// read from the robot
int i;
unsigned char n;
Page 117 of 134
2.1 General Packet Format
Size
Value
0xFA, 0xFB Packet header; same for client and server
...
Number of command/argument bytes plus Checksum's
two bytes, but not including Byte Count itself or the
header bytes. Maximum of 249.
0 - 255
Packet type or command identifier (see below for
lists).
...
Packet or command data (if any)
...
Packet integrity checksum
is the low byte.
1
Description

Advertisement

Table of Contents
loading

Table of Contents