Mini Mac Robot

Wednesday, September 26, 2007

Detour

I am always getting sidetracked, but this time it is for a good reason. The other night I got the idea that we need something a little more fun and possibly easier project for younger people than the Robocup. So the journey in the spirit of robocup, is to build an autonomous vehicle that will win a NASCAR event by the year 2050. Since, we have to start somewhere, autonomous R/C racing seems to fit the bill. Roboracer version 0.1 is just about ready. The hardware is all setup and this week we will begin software development. The first version is going to be as simple as possible and we will attempt to traverse an empty oval racetrack. This will be accomplished by following the wall around the racetrack with only forward looking sonar and infrared distance sensors on the side to follow and keep parallel to the wall. Passing other cars will of course be the most difficult and version 1 of the Roboracer will get a few more sensors to accomplish this. Things to do: find out how to "stiffen" the shocks, take a closer look on how the CMUcam could be utilized and ground the servo power supply pins on the brainstem so the steering servo, throttle (ESC) and all the sensors will run off the same battery.




Thursday, September 20, 2007

brainstem setup in eclipse

The goal is to get a simple Hello world example to work with the brainstem c development. The code to get compiled is

#include "aStem.h"

int main(int argc, char *argv[])
{
printf("Hello World!\n");
return 0;
}

Project Settings:

1) GCC C Compiler -> Symbols -> Defined symbols

Add

aUnix

2) GCC C Compiler -> Directories -> Include paths (-I)

Add at least the following paths

/home/bloftin/code/brainstem/aStem/aCommon
/home/bloftin/code/brainstem/aIO/aCommon
/home/bloftin/code/brainstem/aIO/aUnix
/home/bloftin/code/brainstem/aCommon
/home/bloftin/code/brainstem/aStem/aUnix

3) GCC C Linker -> Libraries

Add at least the following Libraries

aIO
aStem
m

4) GCC C Linker -> Miscellaneous

Add at least the following object files

/home/bloftin/code/brainstem/aStem/unix_aStem_Data/ppc/aDebug/aStem.o
/home/bloftin/code/brainstem/aUI/unix_aUI_Data/ppc/aDebug/aAssert.o
/home/bloftin/code/brainstem/aIO/unix_aIOTests_Data/ppc/aDebug/aUtil.o

Note that some more files may need to be added to the above steps depending on what parts of the c development kit you are using

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

Sunday, September 02, 2007

usb to serial device

This is just a reminder to install the usb to serial device for the brainstem from iogear's websit e and not acroname. The link is