Draft #1 (9th July 2011)
NUI Chapter 6. Controlling a Robot Arm
[Note: all the code for this chapter is available online at http://fivedots.coe.psu.ac.th/~ad/jg/??; only important fragments are described here.]
In chapter 4, I developed a controller for a toy missile launcher, utilizing libusb-win32 and LibusbJava. I'll be using the same libraries again here, to control the OWI-535 robotic arm (http://www.owirobot.com/products/Robotic-Arm-Edge.html) shown in
Figure 1.
Figure 1. The OWI-535 Robotic Arm with USB Interface.
To be precise, I'm using the UK version of the arm, available from Maplin Electronics
(http://www.maplin.co.uk/robotic-arm-kit-with-usb-pc-interface-266257). It's the same product but the box includes a OWI USB interface, which is not part of the basic OWI-535 package.
One downside of the arm is its under-powered control software which only offers time-based movement of the arm's joints (e.g. rotate the wrist for 0.5 second). It would be much more useful to define joint rotations using absolute and relative angles, or to specify (x, y, z) locations (e.g. move the arm's grippers to (10, 15, 7)).
I'll be implementing control software that offers all these features. The code forms a loose hierarchy – the lowest level moves the arm using USB control transfers while the top-tier utilizes coordinates. Each level is implemented using capabilities supplied by the next level down, as illustrated in Figure 2.
1
© Andrew Davison 2011
Java Prog. Techniques for Games. NUI Chapter 6. Robot Arm
Draft #1 (9th July 2011)
Figure 2. The Robot Arm Functionality Hierarchy.
The USB control transfer software at the lowest level is quite similar to the missile launcher code from chapter 4 (so I won't be explaining all the details again).
However, for the protocol detection work, I turned to the popular freeware,
SnoopyPro (http://sourceforge.net/projects/usbsnoop/),