Pioneer 2 Operating System
For example,
sfRobotComInt (35,4); /* select AN4 to b in the standard SIP */
later…
if (sfRobot.timer & 0xff = = 4 && sfRobot.analog > 200)
/* E-Stop button pressed and engaged */
else
/* E-stop not engaged. */
Extended Packets
Several different, additional types of server information packets come with P2OS to
better support the ActivMedia Robotics community. On request from the client by a
related P2OS command, the P2OS server packages and sends one or a continuous
stream (one per cycle) of information packets back to the client over the Host serial
communication line. Extended packets get intermingled with the standard SIP that
P2OS sends to your client every 100 or 50 milliseconds, depending on the SinfoCycle
parameter.21
Packet Processing
Like the standard SIP, all P2OS server information packets get encapsulated with a
header (0xFA, 0xFB), byte count, packet type byte, and trailing checksum. It is up to the
client to parse the packets, sorted by type for content. Please consult the respective
client application programming manuals for details.
Saphira, for example, has an internal parser for the PSOS/P2OS packet type 0x3S (S=0-2;
aka “standard” SIP), but not for the P2OS extended packets we describe in this section.
However, you are able to program and add packet handlers to Saphira: either as a
special plugin program as found at the http://robots.activmedia.com support
website (look for details in the contributed directory) or directly in your own Saphira
client. A sample packet processor is included with the Saphira distribution—packet.c in
the apps/ directory, and see the AUX serial SIP processing code in the following section.
CONFIGpac and CONFIG Command
21 You may have to adjust the Host port serial baud rate to accommodate the additional communications
traffic.
40