M
OBILE
R
OBOTS
Because of the real-time nature of client-server mobile-robotics interactions, we made a
conscious decision to provide an unacknowledged communication packet interface.
Retransmitting server information or command packets typically serves no useful purpose
because old data is useless in maintaining responsive robot behaviors.
Nonetheless, the client-server interface provides a simple means for dealing with ignored
command packets: Most of the client commands alter state variables in the server. By
examining those values in respective SIPs, client software may detect ignored
commands and re-issue them until achieving the correct state.
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 AmigoBot’s
Host
serial port. After establishing
the communication link, the client then sends commands to and receives operating
information from the AmigoSH servers.
When first started or reset, AmigoSH is in a special wait state, listening for communication
packets to establish a client-server connection.
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 described below, the
sequence of synchronization bytes is:
SYNC0: 250, 251, 3, 0, 0, 0
SYNC1: 250, 251, 3, 1, 0, 1
SYNC2: 250, 251, 3, 2, 0, 2
When in wait mode, AmigoSH 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.
Autoconfiguration (SYNC2)
AmigoSH automatically sends robot identifying information back to the client following
the last synchronization packet (
SYNC2
). The configuration values are three NULL-
terminated strings that comprise the robot’s FLASH-stored
name
,
class
, and
subclass
.
You may uniquely
name
your
Activ
Media robot with the FLASH configuration tool we
provide. For AmigoBot, the
class
is
Pioneer
and the
subclass
is
AmigoBot
. Clients
use these identifying strings to self-configure their own operating parameters. ARIA, for
instance, loads and uses the
amigo-sh.p
AmigoBot SH-related parameter file found in
the
Aria/params
directory.
Opening the Servers—OPEN
Once you’ve established a connection with AmigoSH, your client should send the
OPEN
command #1 (250, 251, 3, 1, 0, 1) to the server, which causes the robot controller to
perform a few housekeeping functions, start its various servers, such as for the sonar and
motor controllers, and begin transmitting server information to the client.
Note that when at first connected, your robot's motors are disabled, regardless of their
state when last connected. To enable the motors after starting a connection, you must
either do it manually (press the black Motors/Test button on the User Control Panel) or
have your client send an
ENABLE
client command #4 with an integer argument of 1. See
Client Commands below).
8
There also is maintenance mode for AmigoSH downloads and parameter updates; see next chapter for
details.
23