RC cars in Node.js
Wanna make your brain hurt? Try developing a hardware interfacing library for node.js.
As part of my running of JS Oxford, my company asked me to organise a hack day for the jQuery UK 2013 conference. We’d discussed doing a nodecopter event, but I wanted to do something a little different. Quadcopters are of course everso cool, but you know what else is cool? RC cars!
After some research I found the Denison WiRC smartcar, which has an iPhone and Android app, connects using WiFi and they even publish reference documents for their protocol. So how hard can it be to create a Node.js lib for it?…. well….
This turned out to be a very challenging topic indeed. As a web developer, I don’t often find myself constructing buffer streams to communicate with external hardware. I certainly don’t crack out WireShark to go UDP packet inspecting on a regular basis. However, I’d set myself a challenge, and there was no way I was going to renege on something I said I was going to do. So I got hold of one of these cars, locked myself away for a couple of weeks and figured this damn thing out.
Next up was to get a big hall, a load plywood and gaffer tape to make a track and we were racing!… Well, racing might be pushing it a bit. Most teams worked on autonomous control. Some doing edge detection and others using a marker system we’d set up. There were varying levels of success in so far as to how far around the course they got, but I haven’t seen such an excited bunch of geeks in a long time.