beautypg.com

Pioneer 2 User Manual

Page 35

background image

Pioneer Mobile Robots

29

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

PTU

unsigned integer

Pulse width of position servo #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 reading—multiply by

RangeConvFactor

for mm

…rest of the sonar readings…

Timer

unsigned int

Currently selected analog port number 1-5

Analog

byte

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

Digin

byte

User digital input

Digout

byte

User digital output

Checksum

integer

Checksum (see previous section)

Factors refer to values in Saphira parameter file. See Appendix C.

To be fully compatible with the original PSOS and supporting clients like Saphira, the standard P2OS SIP
will not change. Newer versions of the P2OS SIP will be implemented as a different packet type.

Client Commands

P2OS implements a structured command format for receiving and responding to directions from a client for
control and operation of the robot or its simulator. The number of client commands per second you may
send depends on the serial baud rate and average number of data bytes per command. Do note that the
P2OS server may not be up to the task of managing a deluge of commands, so we recommend that you time
commands with the internal processing clock of the server, settable to either 100 milliseconds or 50
milliseconds per cycle with Pioneer 2. You may exceed those rates; just do it sparingly.

The client must send a command at least once every two seconds or so (

watchdog

parameter; see

Updating & Reconfiguring P2OS, Chapter 7); otherwise, the communication watchdog server will stop the
robot’s onboard drives.

Table 6-4. 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 subsequent command bytes plus
checksum, not including Byte Count.
Maximum of 200 bytes.

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