03 May 2008

Army of (Friendly) Robots

A few weeks ago the CS department used the colloquium period to tell us students what the professors would be working on over the summer. Professor Dodds' presentation included a slide proclaiming that he would be building an Army of (Friendly) Robots. He claimed this is because an Army of Robots should be on everyone's ToDo list, but helikes the thought of friendly robots more than the thought of unfriendly robots.

Last Thursday was the demonstration day for our robotics class. As you may remember, my team was intending to enter the Semantic Robot Vision Challenge, but unfortunately two of our 4 members were also taking VLSI which maybe sorta ate all our time and possibly our souls. We scaled it back so that we were only looking for textbooks, under the assumption that textbooks have very well-defined images, and did not implement the bounding-box stuff. Even so we were in the lab Wednesday night from 17:00 until class the next morning. We seemed to work best in shifts of two or three; you've heard that too many cooks will spoil the soup, and in this case there weren't enough different parts for all of us to work simultaneously on the project.

We each had "expertise" in a different area of the project, too; I knew how to make the wheels take the robot where I wanted it to go and had a good general feel for making Python talk to the different microcontrollers we were using (the ER1 Evolution base, the AcronameBrainStem controlling the servos, and the Arduino board controlling the sonar). Heather was the vision person and she did most of the work making our robot identify the books. Greg was the man who braved the dark waters of computer networking to get our MacBook Pro and Dell PC talking to one another via a short length of ethernet cable and even magicked up the campus network on the MacBook's wireless and shared it with the Dell. I don't understand such black arts, but he managed it. Ellen was the servo wizard. I bloody hated those things. They were built from magic and the desolation of lost souls and were even more finickey than the network to get right and always did something wrong if you looked at them cross-eyed, but she managed to bend them to her will somehow.

Next up we actually had to integrate all these pieces. We had a subversion repository full of code fragments that were each a proof of concept for controlling one element of our setup, but with three microcontrollers, two computers, and code written in both C and Python it was no mean task to get them all working together. In fact, it took all night. I was took the task of writing the main Python driver while Ellen was at a play rehersal and Greg and Heather worked on the vision code. I spend a good deal of time making it modular and following good coding procedures and I think that will really help anyone who decides to follow in our footsteps or really anyone who needs to figure out how to make any of these controllers work.

Once I had that put together, we hooked everything up, turned it on, and watched with bated breath as our robot ran headlong into a cardboard box. Turns out that the sonar sometimes returned a bad value and that would crash my program, so I caught the exception and ignored it -- potentially a dangerous thing to do, but it was a 30second fix and I was in a rush. After some confusion stemming from dead batteries powering the servos (did I mention how much I hate those things yet?) we actually got it running and completed the final tests around 07:00 Thursday morning. By this time Greg was passed out and Ellen had gone to bed leaving Heather and I to run the final tests and add in some amusing code of our own. Here is a video of our demo. Professor Dodds isn't the greatest of steadycam men, but it's probably the most exciting video of our robot so far. And for those of you who are wondering, Yes. The "Where are you hiding" is a tribute to the turrets in Valve's Portal.




~KMarsh

1 comment: