Lego Robot
In spring 2007, I took an undergrad course in Artificial Intelligence at Xavier. In the second half of the course, we were taksed with building a robot out of Legos and programming it to meet various challenges. I started with the Lego RCX platform provided to all of the students, but I didn’t like the severe limitations it placed on the number of input and output ports that could be used, so I switched over to the Handyboard platform, which is used by many hobbyist roboticists.


WordPress won’t let me embed this video for some reason.
The final challenge was to build a robot that would seek a light source positioned somewhere above a raised platform made of several tables, while navigating around immovable obstacles, and beating another robot to the light source. Once the robot made it to the light source, it had to stay put and prevent another robot from pushing it off the table.
I used a ’subsumption architecture’ which means that the robot had several helper threads running at once, each issuing commands to a central ‘brain’ thread. The brain thread chose which of the helper threads it wanted to listen to, and followed whatever commands it issued. Eventually I added in an aspect of ’state’ to the program as well. The code was written in Interactive-C, a language based upon C designed specifically for the handyboard.
The two boxy looking things in the front are infra-red sensors at the front of the robot, which are used to make sure it doesn’t drive off the edge of the table. The wheels on the back are part of a mechanism I termed the “murder motor.” Once my robot made it to the light, it spun this set of wheels. My hope was that if another robot was trying to push mine off of the table, it would be redirected by the spinning wheel and hopefully knocked off the edge of the table. It also made a nice menacing noise.
Naturally, My robot won the competition. I put a lot of time into this project, and I was auditing the course, so I didn’t really have to do anything. When you stay up until 4 AM working on a project that will earn you no grade simply because you love working on the project, you know you belong in grad school. Or something.
The most rewarding part of the project was watching my robot push another group’s robot off the table. I still don’t know why it did that; there was no code in there to look for other robots. It hit the edge of the table, and it should have turned itself to point toward the brightest direction. Instead, it went on an intercept path for the other robot, blindsiding it and pushing it off the table. It then stopped, turned toward the light source, and went straight for it. I felt like a proud father watching his kid beat up the nerdy kid next door.