Tcm2pac and tcm2 command, Input / output (i/o), Digin, timer, and adsel – Pioneer 2 / PeopleBot User Manual

Page 49: Nput, Utput, I/o)

Advertising
background image

ActivMedia Robotics

Table 10. GRIPPERpac state byte

bit Function

State

0

Grip limit

paddles fully open when 0; otherwise between or closed

1

Lift limit

Lift fully up or down when 0; otherwise in between

2

Outer breakbeam obstructed when 0; nothing in between when 1

3

Inner breakbeam

obstructed when 0; nothing in between when 1

4

Left paddle

grasping when 0

5

Right paddle

grasping when 0

6

Lift

moving when 1

7

Gripper

moving when 1

The AmigoBot Sounds playlist consists of a series of one to 255 24-byte long sound
references, followed by individual sound data. Sound references may be NULL or

redundant.

Sound references consist of a 16-byte sound name followed by two long integers, which
specify the sound data position and length in the playlist. The PLAYLIST P2OS command
#91 with any or no argument responds with a packet of 25 NULL bytes, telling the client
that your P2OS-based robot does not have any onboard sounds.

TCM2pac and TCM2 Command

The TCM2 accessory is an integrated inclinometer, magnetometer, thermometer, and

compass that attaches to the AUX serial port of the P2OS microcontroller. When

attached and enabled, special TCM2 compass servers read and report the heading as
the compass byte in the standard SIP. Use the TCM2 command to request additional
information from the device in the form of the TCM2pac. See the TCM2 Manual and
supporting software that accompanies the device for details.

Input / Output (I/O)

Your Pioneer 2 or PeopleBot comes with a number of I/O ports that you may use for

sensor and other accessories and custom attachments. See Appendix A for port

locations on the microcontroller. The various I/O states and readings appear in the
standard SIP and may be manipulated with P2OS client commands. P2OS 1.E also

introduced a new SIP for convenient access to your Pioneer 2’s I/O (see a subsequent

section for details).

DIGIN, TIMER, and ADSEL

The states of the eight digital input ports, native to the controller, get mapped as a single
byte, whose value is continuously updated and reported in each standard SIP (Table 4).
For example, examine Saphira's sfRobot structure value digin:

sfSMessage("Digin is %i",sfRobot.digin);

When not connected, the digital input port values may vary and change without

warning.

The digital input ports 4-7 (ID4-7) also may be used as A/D input ports (see below). Use
the ADSEL client command to select the A/D port that is to appear in the P2OS SIP
analog

value. The default port is #5, the dedicated A/D port on the system. The P2OS

SIP reports the currently selected analog input port number.

In the following example, the first Saphira statement queries for the current analog port

and its A/D value. The second Saphira command changes the selected port which

value gets reported through the last Saphira command in the example:

43

Advertising