Pioneer 2 / PeopleBot User Manual

Page 37

Advertising
background image

ActivMedia Robotics

provides very reliable links; radio modem-mediated communication is much less reliable.

Accordingly, when designing client applications that may use radio modems, do not
expect to receive every information packet intact, nor can you expect the server to

accept every command.

Table 4. Standard P2OS Server Information Packet (SIP)

Name Data

Type

Description

Header integer

Exactly

0xFA,

0xFB

Byte Count

byte

Number of data bytes + 2 (checksum); must be
less than 201 (0xC9)

Status/Packet

byte = 0x3S; where S =

Motors status

Type

2

Motors stopped

3

Robot moving

Xpos

unsigned integer (15 ls-bits)

Wheel-encoder integrated coordinates; platform-
dependent units; multiply by DistConvFactor

Ypos

unsigned integer (15 ls-bits)

to convert to millimeters.

Th pos

signed integer

Orientation in platform-dependent units—
multiply by AngleConvFactor

for degrees.

L vel

signed integer

Wheel velocities (respectively Left and Right)
in platform-dependent units;

R vel

signed integer

multiply by VelConvFactor

—currently 1.0 for

all—to convert into millimeters per second.

Battery

byte

Battery charge in tenths of volts

Stall and
Bumpers

integer

Motor stall and bumper accessory indicators. Bit
0 of the lsbyte is the left wheel stall indicator =
1 if stalled. Bits 1-5 of that same byte
correspond to the bump switch states (1=on) for
the rear bumpers accessory. Bit 0 of the msbyte
is the right wheel stall; the bits 1-5 of that same
msbyte correspond to the front bumpers switch
states.

Control

signed integer

Setpoint of the server’s angular position servo—
multiply by AngleConvFactor

for degrees

FLAGS
(was PTU)

unsigned integer

b0 – motors flag (1=motors enabled)
b1 – sonar flag: enabled if 1.

Compass

byte

Compass heading in 2-degree units

Sonar

readings

byte

Number of new sonar readings included in
information packet; readings follow:

Sonar

number

byte Sonar

number

Sonar
range

unsigned integer

Sonar range; multiply by RangeConvFactor

currently 0.268 for all—for millimeters

…rest of the sonar readings…

Timer

unsigned int

Selected analog port number 1-5

Analog

byte

User Analog input (0-255=0-5 VDC) reading on
selected port

Digin

byte

User I/O digital input

Digout

byte

User I/O digital output

Checksum

integer

Checksum

(see previous section)

Factors see Table 17 Appendix D and Saphira’s parameter definition file for your robot

Because of the real-time nature of the client/server interaction, we made a conscious

decision to provide an unacknowledged packet interface. Re-transmitting server
information or command packets would serve no useful purpose, because old data

would be virtually useless in maintaining responsive client-server interaction.

31

Advertising