Pioneer 2 User Manual

Page 37

Advertising
background image

Pioneer Mobile Robots

31

cm/sec increments

GRIPPER

33

int

Pioneer 1 and Pioneer 2 Gripper
server command. See the Pioneer
Gripper manuals for details.

4.0

1.3

ADSEL

35

int

Select the A/D port number for
analog value in SIP. Selected port
reported in SIP Timer value.

1.2

GRIPPERVAL

36

int

Pioneer 2 gripper server value. See
P2 Gripper Manual for details.

PTUPOS

41

int

Msb is the port number (1-4) and lsb
is the pulse width in 100µsec units
PSOS or 10µsec units P2OS

4.5

1.2

TTY2

42

string

Send string argument to serial device
connected to AUX port on
microcontroller

4.2

1.0

GETAUX

43

int

Request to retrieve 1-200 bytes from
the aux serial channel; 0 flushes the
aux serial input buffer.

1.4

BUMPSTALL

44

int

Stop and register a stall if front (1),
rear (2) or either (3) bump-ring
contacted. Off (default) is 0.

1.5

TCM2

45

int

TCM2 Module commands; see P2
TCM2 Manual for details.

1.6

E_STOP

55

none

Emergency stop, overrides
deceleration

1.8

STEP

64

none

Single-step mode (simulator only)

3.x

1.0

The byte order is least-significant byte first. Negative integers are transmitted as their absolute value
(unlike information packets, which use sign extension for negative integers; see below). The argument is an
integer, a string, or nothing, depending on the command.

Saphira Client Command Support

Saphira, as well as Ayllu, PAI, and P-LOGO, all fully supports P2OS client commands with useful library
functions. You can find prototypes in

$(SAPHIRA)/handler/include/saphira.h

and

saphira.pro

. Saphira’s P2OS command names have the prefix

sfCOM

followed by the command names

listed in subsequent tables. (See the Saphira Software Manual for details.)

For example, to enable the motors from the Colbert interaction window on the Saphira client, type:

sfRobotComInt(sfCOMENABLE,1);

Or to have it play a tune (albeit rather tinny), type:

sfRobotComStrn(sfCOMSAY,"\1\6\2\105",4);

Programming P2OS

You may create your own P2OS interface, or use the convenience functions available through the various
applications development software that comes with your Pioneer 2.

Synchronization—SYNC

Before exerting any control, a client application must first establish a connection to the Pioneer server via
its RS-232 serial link. Over that established communication link, the client then sends commands to and
receives operating information from the server.

When first started, the Pioneer 2 robot is in a “wait” state; P2OS listens for communication packets over its
designated port. To establish a connection, the client application must send a series of three synchronization
packets through the host communication port—

SYNC0, SYNC1, and SYNC2,

in succession, and retrieve

the server responses.

Advertising