Monday, December 13, 2010

Pong 3.5D and CraftBots

Pong 3.5D (ME-84: Take home midterm)
As a take home midterm in ME-84, we were challenged to make use of everything we had learned so far, along with a new set of 3D rendering tools in LabView, to create an avatar that could walk around a 3D world. The task was broken down into separate sections so that we could demonstrate what we'd learned about user interface, image processing, NXT input, and haptics.

Because I'm not actually taking the class for credit, I didn't worry too much about jumping through all the assessment hoops, and instead concentrated on making a game that I thought was pretty cool *and* covered all the important elements of the task in one program.

The game I ended up with was Pong in 2.5 Dimensions. This was intended to be Pong 3D, but it was pointed out to me that although the playing field is *rendered* in 3D, the movements of ball and paddles are limited to 2D, so it only counts for about 2.5D!

Here's how the game works...
- requires an NXT with motors attached to Ports A & B (and the NXT volume turned on!).
- it's a game for two players, Player 1 (red) and Player 2 (blue).
- each player's avatar (paddle) moves in a direction corresponding to where the webcam sees most of their colour (i.e. hold a red object to the left, and their paddle moves left).
- each player score a point when their opponent misses the ball
- first to five wins
- the angle of each players' view window can be adjusted by the corresponding motor.

The playing field is rendered in 3D, and the paddles are controlled by the position of red and blue balls in front of a web-cam. I programmed this as an assignment for ME-84, using LabView Education Edition. Thanks as always to Christoffer and Alex for demonstrating the game, and big thanks to Christoffer for producing the awesome video...

CraftBots (ME-84: Final project)
All good things and all that...

After a very stressful week of playing with breadboards, multimeters, wire strippers, drills, saws, and far too much solder for my liking... I was ready to present my craft-based robotics system to a group of first graders. The challenge, that we've been working on over the past two months, was to create a cheap educational robot. I came up with an idea that I called "CraftBots", where students would be able to make robots out of craft materials and then automate them in some way by incorporating electronic components (sensors, and actuators) that I provided.

The concept was that instead of having the students program using a computer, I would remove the computer entirely, and replace it with physical blocks that represent each programming action. Originally I had in mind a suite of blocks to represent AND, OR, and NOT. Sensors would plug into these blocks as inputs, and actuators as the outputs. The blocks could be combined in different ways to produce a wide range of logic-based behaviours. I quickly realised that this was going to be far more complex than necessary for a demonstration of the basic concept, so instead I settled on the production of blocks that would come in two "flavours".

Both types of blocks contain two AA batteries and some simple circuitry. They have one input, one output, an on/off switch, and a potentiometer to set the threshold of the input. In both blocks the output is either on or off depending on the value of the input. For one of the blocks, the output is on by default, in the other, the output is off by default.

The original prototype was made out of Lego and programmed on the NXT...

From ME-84: Introduction to Robotics

In both the Lego-based prototype and the final version, I demonstrated a few different examples of the sorts of things that were possible. For example, a bed that shakes when the sun comes up, and a cake with candles (lights) that go out when you press a button, and a robot chicken with eyes that glow when it's patted or when it gets dark.

From ME-84: Introduction to Robotics

For some photos of the other students' final projects as well as more photos of my CraftBots and even a brief video see ME-84: Introduction to Robotics.