Nerf Tank
For the 2015 UMBC Hackathon, Hackafé wired up an old toy tank with an automatic nerf gun, a speaker loaded with Portal turret sound effects, and configured it to be remote controlled with a wii remote. This was our third hackathon, and our first prize winner.
The tank has several different computers. In the body of the tank is a compact motherboard with a low power x86 processor that Dylan picked up for this project. The reason for using an x86 machine and not just RaspberryPis is because we intended to integrate a Kinect to allow the tank to track people on its own, and not only is the pi slow, the Kinect SDK we had only ran on x86. The tank also contained a RaspberryPi, mounted in the turret, and two teenseys, one in the turret and one in the body.
During the hackathon, we were able to put together some demo code with the Kinect, which only amounted to it outputting “Left”, “Right”, or “Fire”, depending on whether the nearest person to the kinnect was to the left, the right, or approximately in front of the tank. We didn’t have time duing the hackathon to actually integrate this into the tank.
The main code running on both the pi and the x86 machine was written in Python. For our first hackathon DuoNoxSol convinced us to try to write our software in Go, which was a huge mistake. Go is a pretty good language, but its compiler reports unused variables and imports as errors, which is good for production code, but terrible when you are hacking and need to rapidly change things. On top of this, the rest of us didn’t really know Go very well and had to keep draging him over to debug our code for us.
The tank software uses python’s xmlrpc client and server for communication between the input handler process and the motor controller process. During the hackathon, since we didn’t have time for the Kinect, we ended up running the whole thing on just the Raspberry Pi. If we had gotten the Kinect working, the controller would have run only on the x86 machine, and brodcast its commands to both the local motor controller and the motor controller on the pi, which would each have connected to different teenseys. Instead the pi broadcast commands to the two teenseys, which both ran the same code, but had different output pins hooked up.
By the end of the hackathon, we had the tank able to drive and steer (though only at half speed, because of a bug in the teensey code which we didn’t catch until later), the turret able to fire, and the speaker able to play Portal turret sounds at the press of a button. For some reason the turret, stopped rotating, and we weren’t able to fix it before the presentation. For our presentation, I drove the tank out on stage and fired the gun at the rest of the team, and we demoed the “Left”, “Right”, “Fire” with the Kinect on a laptop. We ended up winning 3rd overall, as well as some other prizes for cool uses of a Raspberry Pi.