
Programming
12
P2OS Arm Commands
P2OS commands for control of the Pioneer 2 Arm originate in your client software and
thereby require that you establish a client-server connection between your PC-based
client software and the Pioneer 2 microcontroller-based P2OS. After connecting, your
client software must tell the P2OS servers to power the Arm’s servos before you can send
position commands. Note that the Arm always starts a client-server connection in its
home position and automatically returns to that home position when servo power is set
to OFF, including at the termination (CLOSE) of a client-server connection session.
Table 2. Pioneer 2 Arm P2OS command set
P2OS
Command Command
Number Value(s) Description
_INFO 70 none
Request an ARMINFOpac server-information packet
_STAT 71 0, 1 or 2 Request one or a continuous stream (one per P2OS cycle) of
ARMpac server information packets; 0 stops continuous
_INIT 72 none Warm-reset the Arm
_CHECK 73 none Has P2OS servers check to make sure Arm still responding
to commands; reflects in status byte of ARMpac.
_POWER 74 0 or 1 Switches power off (0) or on (1) to all the servos
_HOME 75 1-6 or 255 Sends all (255) or specified joint to the home position
_PARK 76 none Sends all joints to their home positions and shuts power off.
_POS 77 two bytes:
1-6, 0-255 Sends joint (1st byte) to the position specified in the 2nd
byte, subject to end-limits specified in FLASH parameters
_SPEED 78 two bytes:
1-6, 1-127 Delay in milliseconds (2nd byte) between incremental steps
to control the speed and motion of the joint (1st byte)
_STOP 79 1-6 or 255 Stop the specified (1-6) or all (255) moving joints
_AUTOPARK 80 0-65535 Disable the autopark watchdog (0) or reset it to some time
in seconds other than default AutoParkTimer in FLASH
_GRIPPARK 81 0-65535 Disable the gripper watchdog (0) or reset it to some time in
seconds other than the default GripperParkTimer
Once connected, you may query for status, current servo positions, and other salient
information as included in special Arm server-information packets, as well as modify joint
speeds. But the Arm will not move nor will the servers update joint positions unless P2OS
verifiably has communication with the Arm’s controller and the Arm’s servo power is
enabled. There is a special warm-reset protocol your client must perform in the case that
the Arm controller is not in contact with P2OS when your client software requests to
enable servo power, or in the case that communication between P2OS and the Arm
controller is lost during an active session.
Your client software must package P2OS Arm commands into a special communication
packet, and retrieve and decode the Arm-related server-information packet (SIP), as
described in the Pioneer 2 Operations Manual and supported in part by various Pioneer 2
development software, such as ARIA and Saphira.
For example, to enable power to the Arm and then raise its first joint, establish a client-
server connection between a Saphira client and your Pioneer 2 equipped with the Arm.
Then, from the Colbert interaction window, type:
sfRobotComInt(74,1); /* Apply power to the servos */
sfRobotCom2Bytes(77, 1, 127); /* Extend the 1st joint out to its mid position */
The sfRobotCom Saphira functions8package the P2OS command number, parameter
type and parameters (if needed), and a computed checksum characteristic of a valid
8sfRobotCom(cmd), sfRobotCom2Bytes(cmd, byte, byte), sfRobotComInt(cmd, int), sfRobotComStr(cmd,
string), sfRobotComStrn(cmd,string,strlen).