So I've been mucking about with headtracking over the last few months and said I'd write it up for folks.
And Comrade Fer has even promised to release the puppy unharmed if I do so promptly.
Anyway, the whole motivation behind it was that it looked really cool when the Big Names (you know who I mean) showed off
explained by example on Youtube what they could do with headtracking and why it was so useful to them
. And muggins here thought "well duurp, if I had dur tools, I could do dur job, right?"
. Ahem. Yes, it doesn't quite work that way, but
it does make it a hell of a lot easier. I mean, forget freelook. Forget the hatswitch on your joystick. Head-tracking gives you, to use an analogy, more buttons and another hand to use them independently of everything else you already use (and the person who doesn't need more buttons in arma doesn't exist or is an octopus with fingers). But TrackIR isn't cheap. Today, the cheapest deal I've found was ebay where it costs 130 euro including shipping for the base model of version 4 using the hat with the reflective bits on. Version 5 with the LED point tracker costs the guts of 200 euro including shipping and look, that's silly money. I can buy a perfectly good laptop for that (yeah, second-hand, but a second-hand properly refurbished high-end thinkpad, not some cheap broken thing).
So I went and did some research and looked for any downsides to pursuade myself not to buy one, and found lots of people very irate at the business practices of the company that makes the TrackIR (changing protocols to maintain a proprietary edge, that sort of thing). I'm not a huge fan of those kind of things because they tend to mean that the stuff you buy never gets better, it being cheaper to hire a marketer to advertise a new version that's the old version in a new colour; than some engineers who actually improve the thing. And then I looked at the hardware specs (and I spent a little while in a vision lab and did target tracking myself for some PhD work, which is what head-tracking does at the core of things so I was in reasonably familiar territory) and I basically came to the conclusion that while the TrackIR stuff works and is solid and if you want an absolute no-thought-required turnkey solution (or if your CPU is kindof old and pokey) it's what you want; if you didn't want to spend 200 euro on the thing, then you could put together a technically better
system for waaaaay less money.
So the optical kind of head-tracking has two key components; a camera, and three LEDs mounted to a frame (which those of you with a TrackIR will recognise as being the TrackIR pro bundle). The LEDs aren't anything special - but by using infrared ones and sticking an infrared filter over the camera, you can improve performance enormously by physically filtering out lots of background detail and such and making it far easier to track the LEDs in the image. Did I make that sound technically complex? Well, for "infrared filter"
read "bit of exposed film from a camera stuck over the lens with sellotape"
and for "infrared LED"
read "I went into Maplin and asked for three LEDs you'd normally use in a TV remote control"
. There are lots of guides to building the electronics on the web, this one is probably the clearest to follow
and honestly, electronics projects don't get very much simpler than this, it's LEDs and resistors and batteries (or a USB cable). You don't even need to solder it all really, if you wrap wires well (but I'd recommend you do solder them). If you've ever done any ham radio stuff, any robotics, any electronics of any kind including O-level physics experiments, then this will be insultingly easy.
You will need something to mount the LEDs on, of course, they have to be fixed in space in relation to each other for the math done by the tracking software to work. You can bend a wire clothes hanger into the shape you need and sellotape the LEDs in place (no, really, people have done this and it's quite serviceable). You can get all woodwork-y or metalwork-y and handcraft something from raw materials, or you can do what I did and find a design on thingiverse
and send it off to be 3D-printed by one of the companies that do that these days
. I mainly did that because I wanted to try out 3D printing and was looking about for a project to try. It works quite well actually.
Did all that sound terribly fiddly? Well, you can just say screw it and buy a Delan clip
for 30 quid off ebay as well. If I hadn't been looking to do a project at the time, that would have been exactly what I'd have done.
So what about the other half, the camera? Time was, this was difficult. But mass production and cost reduction means that now it's trivial. Go on ebay or amazon, get a PS/eye camera for around a fiver:
Is it any good? Spend $3 and buy the CL Eye drivers
and now the camera can do 640x480 at a little over 120fps and a 56 or 75 degree angle (the TrackIR camera does 75fps at 51 degrees at that resolution). Or you can crank down the resolution to 320x240 (which is about what the TrackIR 4 camera had) and it'll do 190fps to the TrackIR4's 120fps. The more fps the smoother the tracking in this case.
So what does it look like? Ask our glamorous assistant!
Those are my old cans by the way. And the point model (the thing with the LEDs) is a lot more robust than some of the reports I've heard about the TrackIR Pro clip.
How does it play? Perfectly well, once you setup the software (which consists of installation and tweaking the response curve to your liking). I currently use OpenTrack
as it seems to have the most development time right now, but I've used FreeTrack
(all with the PointTracker plugin
installed), and they've all performed well. The response curves map dead zones (like in a joystick) and how far your head turning corresponds to how far your avatar's head turns, and it doesn't have to be linear - opentrack has a nice graphical interface to let you draw out the curve. I tend to have a small dead zone dead ahead, and exponentially increase the turn rate so that by the time I turn my head as far as the bezel of the monitor, my avatar's staring at his own arse.
But. (No, not butt, this is the "and there's always a but" part now). If the overhead light is on in the room, it can confuse the sensor if the sensor can see it. You could mount the camera somewhere that it can see your head but not the light; or you could play with the light off; either works.
But I was starting to wonder, was there some alternative, and then someone mentioned EdTracker
elsewhere and then here and I thought "feck, that's got to be worth trying". Basically, that sensor buried in your smartphone that tells it if it's upright or rotated when you take a photo in portrait or landscape mode? Someone took that, stuck it to an arduino (a small CPU built to make these projects easier) and wrote code to send the orientation of the MEMS gyro in the sensor to your PC. And later they added a magnetometer (think "digital compass") to the design to counter long-term drift of the gyro.
All of which translates to this: it's smaller, cheaper, lighter and has less moving parts and is more robust than optical headtracking. Here's what the EdTracker looks like on my new cans with the old optical tracker stuff still attached:
(The LEDs aren't purple btw, that's what the infrared looks like to the smartphone camera). The actual box for the EdTracker is tiny, it's smaller in two dimensions than a box of matches, weighs less and is only about 2-3mm taller than the matchbox:
So how much? Well, I didn't do the electronics project route on this one, I just bought a premade version. Cost me 50 euro including delivery. If you're in the UK, it's £30 including delivery
I think, but those are the last of the hand-built ones they have in stock, and when they run out they're not making more, they're switching over to the fully mass-produced version for £45
. And the fully mass-produced one doesn't come with an included cable either.
But if you go down the electronics route, you buy their kit with the PCB and box
, the USB micro-B cable
(you want about 2m of cable), a Gy-9150 development board
and the actual Arduino
itself and that's all the parts. There are instructions for building it on the website and if you searched on ebay and were clever about it, you could put it together for under £20. People *have* done it for under £10, using the older 6050 sensor instead of the 9150 sensor and it works fine for them (the newer sensor isn't more accurate, it just has a magnetometer in it to counter long-term drift but 90% or more of people have no trouble with the older sensor).
That £30 deal is a pretty good deal though, they're not very far past break-even on the components there from what I can see.
And it works as well as the optical system. I've been playing and editing for a few days with it now and honestly, I prefer it. I can keep the light on, it's faster and more responsive -- the DIY optical headtracker uses the main machine's CPU to do the visual tracking and with Arma being such a CPU hog, you're losing a frame or two from Arma for the head-tracking; but the EdTracker does it all on the chip and OpenTrack is just reading it like it'd read any joystick so you get those CPU cycles and the FPS they represent, back. BTW, that's the other thing the TrackIR does, it offloads a lot of the processing to the actual sensor itself - so if you don't have an i5 or something similar in your gaming rig, that might help your FPS (if you do have an i5 or i7, it's negligible).
But knowing what I know now, and if money was no object, which would I take? The Edtracker. Without any hesitation. It's cheaper, more robust, does the job perfectly well, and it's tiny (seriously, even in the box on mine, there's a lot of room left in the box; if you were clever about it, you could build the damn thing into the frame of a headset, and we might start seeing that as a standard thing in a few years in gaming headsets...)