Mini Mac Robot

Monday, September 17, 2007

Enough Vacillating, Linux Wins

I was pulled in by the elegance of Cocoa programming for the Mac. It is actually fun to program with. Kudos to Apple, however there were two major drawbacks when I started testing systems for the robot. I could never get off the ground. For some reason the Iogear's feature mac product, "USB to Serial/PDA Converter Cable
Model # GUC232A" has failed me. It worked perfectly connecting to the brainstem on my windows laptop and on my wife's iMac G5. But for some unknown reason, I could not get it to work with the Mac Mini. I got a bunch of strange USB errors in the system log and after two days of troubleshooting I gave up. It also did not help that older usb cameras are not fun to deal with on the Mac.

Anyway, the decision to go back to PPC linux on the Mac mini turned out to be a great. Within, no time I am up and running using ubuntu PPC 7.04 (feisty). Talk about easy, OpenCV was in the package system. So the two most difficult things: connecting to the brainstem boards and the vision cameras (quickcam 3000) worked 'out of the box'.

Test 1: OpenCV

After installing all the OpenCV packages in Synaptic, I downloaded the latest OpenCV off of sourceforge and recompiled it and ran the samples. Just like that the vision system is up and running. I ran the camshift demo and had it track by arm by selecting my arm in the image, see the following sequence of images that shows it tracking my arm.


































Test 2: Brainstem

After downloading the c development kit from acroname's website for the brainstem, I needed to install a bunch of prerequisites. I think most of them are: build-essential, xorg-dev(?) and something with ncurses in it. I also had to move the libraries libaIO.so and lib.so to a new ppc folder in the brainstem directory structure. I do not think they anticipated their code being compiled on PPC, I'll send them a note to double check with them. However, all compiled and I was able to run the aSimpleRange example (./aSimpleRange) in the aRelease/aUnix folder. I placed my wife's iMac G5 about 68.5 cm from the GP2D02 sensor and got back good readings (104 -105=> 70 cm) considering I have not calibrated the sensor yet.

The next step is to test each robot component one by one in their own test program to help calibrate and make sure all are working well before trying to combine them into one large program. Items to check first:

Completed

1) OpenCV: capture complete
2) Connect with brainstem: complete

Todo:

3) IR sensors, GP2D02
4) IR sensors, analog Sharp GP2D12
5) Sonar sensors
6) DC motor control (PWM out to Motor controller)
7) Read DC motor encoders (tested under windows, worked great)
8) Read R/C signals coming in from Futaba receiver and control motors with brainstem, currently had it working under direct control from transmitter
9) Connect Mini to DC-DC converter and run from battery
10) Have Mini autonomously control motors
11) Implement PI or PID controller and test accuracy
12) Speech system (this is where Cocoa on the mac was great, easy to do, linux will be much more difficult), I have used festival for speech synthesis, but I have not yet found a speech recognition engine to use.
13) Finally, combine everything and start working at the architecture level

0 Comments:

Post a Comment

<< Home