beautypg.com

Server information packets, Client commands, Erver – Pioneer 2 / PeopleBot User Manual

Page 38: Nformation, Ackets, Lient, Ommands

background image

Pioneer 2 Operating System

For some operations, however, the data do not decay as rapidly: Some commands are

not overly time-sensitive—for example, those that perform such housekeeping functions
as changing the sonar polling sequence. It would be useful to have a reliable packet

protocol for these operations, and we are considering this for a future release of the

server interface.

In the meantime, the ActivMedia Robotics 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 the server information packet,
client software may detect ignored commands and re-issue them until achieving the

correct state.

Server Information Packets

Like its Pioneer 1 PSOS predecessor, P2OS automatically sends a packet of information
over the Host serial communication port to a connected client every 100 milliseconds.

17

The standard P2OS Server Information Packet (SIP) informs the client about a number of

operating states and readings, using the order and data types described in Table 4.

P2OS also supports several additional server information packet types, extending the

capabilities of the Pioneer 2 and PeopleBot robots. These include an “alternative” SIP

that currently is not supported by Saphira or ARIA.

18

See following sections in this chapter

for a description of the extended server information packet types.

Client Commands

P2OS has a structured command format for receiving and responding to directions from

a client for control and operation of your ActivMedia robot or its simulator.

Table 5. P2OS client command packet

Component Bytes

Value

Description

Header 2

0xFA,

0xFB

Packet header; same for client and server

Byte Count

1

N + 2

Number of following command bytes plus
Checksum’s two bytes, but not including Byte
Count. Maximum of 200.

Command
Number

1

0 - 255

Client command number;
see Table 4-4

Argument Type
(command
dependent)

1

0x3B or
0x1B or

0x2B

Required data type of command argument:
positive integer (sfARGINT),
negative integer or absolute value (sfARGNINT), or
string (sfARGSTR)

Argument
(command dependent)

n

data

Command argument; integer or string

Checksum 2

computed

Packet integrity checksum

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. Commands are processed at a maximum rate of one

per millisecond, although the P2OS servers may not be up to the task of managing a
deluge of commands.

32

17

Or 50 milliseconds. Read on.

18

Indeed, if enabled, the alternative SIP apparently will “break” the client software. Read carefully.