Software and Programming
Software and Programming
Chapter 3
The Pioneer Arm’s controller is attached to and controlled through an
AUX
serial port on your robot’s
controller. The robot controller, on the other hand, is connected with your robotics programs through
its
HOST
serial port. This means that your command and control client programs communicate with
your Pioneer Arm through the Pioneer controller, not directly with the Pioneer Arm’s controller.
Generic versus Server Programming
We connect the Pioneer Arm through the robot’s controller for several reasons: It means that you
need only a single communication channel for all client-server communications with your robot and its
accessories, thereby obviating the need for additional wireless modems or an expensive onboard PC
with multiple serial ports. Perhaps more importantly, we’ve included special servers in your robot
controller’s embedded software that provide control features and watchdogs not available with the
Pioneer Arm’s generic control software and not easily performed from a standard PC.
Even so, Pioneer’s controller servers also support pass-through servers that transfer serial
communications directly to and from the
HOST
and
AUX
serial ports, so that you may control your
Pioneer Arm with its generic command set, if you prefer.
Generic Controls
The Pioneer Arm’s generic controller responds to a simple set of commands that enable/disable
power to the servos and position the servo-driven joints. It also lets you query the controller software
version number and accessory digital I/O.
However, the Pioneer Arm’s generic controller has no provision for controlling joint speeds. The servo
motors adjust to their new position as fast as they can, leading to some pretty wild swings unless you
are careful. Nor, with the generic commands, can you query for the current position of a joint.
Your robot’s Pioneer Arm support servers, on the other hand, give you control over joint speeds and
maintain current position information, as well as a variety of other advanced and convenient features.
Which is why we recommend that you program to the Pioneer Arm servers and not to the arm’s generic
command set.
Generic Command Syntax
The Pioneer Arm’s generic control protocols consist of a header byte (255; 0xFF) followed by a
command byte and, sometimes, one command parameter.
The most significant bit (b
7
) of the command byte determines the mode—set the bit for query mode;
clear it for servo-positioning or digital output port commands. The next three most significant bits of
the command byte (b
4-6
) select the board number; always 0 for the Pioneer Arm. The remaining bits
of the command byte depend on the command mode.
Generic Commands
The Pioneer Arm’s generic commands let you enable/disable power to the servos and query for the
controller’s software version number and analog/digital port states. The native Arm controller
supports three digital control bits and two analog input channels. Digital channel 0 is connected to
and controls power to the Pioneer Arm’s servo motors. Channel 1 is connected to the status LED
inside the Arm controller box.
You may use the Pioneer Arm controller’s generic servo-positioning command to move a joint. The
command consists of three bytes: The header (255; 0xFF), a servo-selector byte, and the position
value byte. The servo-selector byte’s most significant bit (b7) always is OFF (0) to distinguish servo-
positioning commands from query commands. Its remaining bits (b
0-6
) select the servo number, for a
total of up to eight joints. Only joints one—the base swivel—through six—the gripper—are active with
the Pioneer Arm.
10
The servo-positioning byte allows up to 255 different servo positions, although in practice the range of
positions for any individual joint and depending on the individual arm varies to roughly 200 positions