The client-server connection, Lient, Erver – Pioneer 2TM User Manual
Page 42: Onnection

ActivMedia Robotics Operating System
to AUX2 H8S serial port
GETAUX
2
67
int
Request to retrieve 1-200 bytes from the AUX2
H8S serial port; 0 flushes the buffer.
1.1 – –
CHARGE
68
int
1 to deploy autocharging mechanism; 0 to retract
1.7
–
–
ARM
70
-
81
int
Arm-related commands; see manual for details
1.3
–
–
ROTKP
82
int
Change working rotation Proportional PID value
(not FLASH default)
1.1 1.M –
ROTKV
83
int
Change working rotation Derivative PID value
(not FLASH default)
1.1 1.M –
ROTKI
84
int
Change working rotation Integral PID value (not
FLASH default)
1.1 1.M –
TRANSKP
85 int Change
working
translation
Proportional
PID
value (not FLASH default)
1.1 1.M –
TRANSKV
86
int
Change working translation Derivative PID value
(not FLASH default)
1.1 1.M –
TRANSKI
87
int
Change working translation Integral PID value
(not FLASH default)
1.1 1.M –
REVCOUNT
88 int Change
working
differential
encoder
count
(not FLASH default)
1.1 1.M
PLAYLIST
91 none Request AmigoBot sounds playlist packet
1.0
1.E
–
SOUNDTOG
92 int 0=mute
or
1=enable
buzzer
1.0 – –
SHUTDOWN
25
0
int
0=cancel shutdown; 1=simulate low-power
condition; 2=initiate computer shutdown
1.6 – –
The number of client commands you may send per second depends on the HOST serial
baud rate, average number of data bytes per command, synchronicity of the
communication link, and so on. AROS’ command processor runs on a one millisecond
interrupt cycle, but the server response speed depends on the command. Typically, limit
client commands to a maximum of one every 3-5 milliseconds or be prepared to recover
from lost commands.
T
HE
C
LIENT
-S
ERVER
C
ONNECTION
Before exerting any control, a client application must first establish a connection with the
robot server via a serial link through the robot controller’s HOST port. After establishing
the communication link, the client then sends commands to and receives operating
information from the server.
When first started or reset, AROS is in a special wait state, listening for communication
packets to establish a client-server connection.
17
To establish a connection, the client
application must send a series of three synchronization packets containing the SYNC0,
SYNC1, and SYNC2 commands in succession, and retrieve the server responses.
Specifically, and as examples of the client command protocol, the synchronization
sequence of bytes is (in hexadecimal notation):
SYNC0: 0xFA, 0xFB, 0x03, 0x00, 0x00, 0x00
SYNC1: 0xFA, 0xFB, 0x03, 0x01, 0x00, 0x01
SYNC2: 0xFA, 0xFB, 0x03, 0x02, 0x00, 0x02
When in wait mode, AROS echoes the packets verbatim back to the client. The client
should listen for the returned packets and only issue the next synchronization packet after
it has received the appropriate echo.
17
There also is monitor mode for AROS downloads and parameter updates; see next chapter for details.
36