Programming
16
near their home positions. When cold reset, the P2OS servers cannot and will not drive
the Arm servos to their home positions, as they may do under other circumstances.
Accordingly, your Pioneer 2 Arm may flop dangerously if it is not in its home position, and
consequently flail erratically to its home position when its servos first get powered ON. So
be very careful to have the Arm in its home position before you turn on your robot’s Main
Power or reset the P2OS microcontroller!
The P2OS Arm servers also monitor the serial connection with the Pioneer 2 Arm controller.
If the Pioneer 2 microcontroller does not detect the Arm, or if it loses contact with the
Arm controller when the Arm’s servo are enabled, P2OS automatically shuts down
command and control, and awaits a warm-reset command from the client to re-
establish command and control of the Arm through the P2OS-based Arm servers.
In the meantime, you should manually restore the Arm to its home position. That may
mean that you switch OFF the Arm’s power manually so you can move the joints freely.
For your client to recover command and control of the Arm while remaining connected
after the communication failure, you must follow the warm-reset protocol:
1. Request status (ARM_STAT) or ARM_CHECK and wait for restoration of
communication (bit 1 of the status byte)
2. Issue the ARM_INIT command
3. Use ARM_STAT and ARM_INFO SIP requests to reinitialize any client-side variables
that my be tracking joint positions
4. Issue an ARM_POWER command to power the Arm servos
5. Resume
operation
Note that while the joint positions are reset to home, the latest joint speed settings persist.
Saphira Plugin
Software for the Pioneer 2 Arm includes a Saphira verion 6.2 plugin that provides
convenient functions and variables for its operation. To install the software, simply
expand the Linux or Windows®9x/ME/2K/NT archive file into the top-level directory of
your Saphira distribution.
For example, with Linux:
% cp p2arm.tgz $SAPHIRA/
% cd $SAPHIRA
% tar –zxvf p2arm.tgz
When prompted by the self-extracting p2arm.exe archive, target the extraction directory
to the Saphira top-level directory.
In all cases, the source C-language files for creating the plugin get put into
$SAPHIRA/devices/p2arm
, and the working Saphira
p2arm.dll
or
p2arm.so
dynamic-
load or shared library for Win32 or Linux, respectively, get put into the
$SAPHIRA/Colbert
directory.
To use the plugin, either load it interactively or programmatically from Colbert, or
integrate the code directly into a Saphira client. When used with Colbert, you may
request the list of Arm-related routines and variables supported by the plugin with the
Colbert ‘
help
arm
’ command. See the
Saphira/Colbert
and
Pioneer 2 Operations
Manuals
for more details.