Technology Support Posts

“Getting Started – Homebrew” Open Kinect Wiki. http://openkinect.org/wiki/Getting_Started#Homebrew

After spending a great deal of time hunting down other sources, I found that using Homebrew really would install the correct version of Freenect. I highly recommend going this route instead of the manually compiling I went through with my initial try.

McPherson, Glen. “How to setup Microsoft Kinect on Mac OS X 10.9 (Mavericks)” The Blog – Creative, Technology, Design & Code. http://blog.nelga.com/setup-microsoft-kinect-on-mac-os-x-10-9-mavericks/

This was my initial resource for seeing what was required to install Freenect and setup all the associated libraries. However, what I didn’t know until I got in and started actually following it was that the libraries McPherson mentions have fallen out of date. Even though the post was only a few months old, the code mentioned — OpenNI and NiTE specifically — had become “unofficially-official” and were no longer actively maintained, making them both questionable for basing a project on and, as it turns out, fairly hard to find, too.

Mitra, Tilo. “OpenCV on Mac OSX: A step-by-step guide” http://tilomitra.com/opencv-on-mac-osx/

While it turned out the manual installation of OpenCV was fairly simple (standard un-tar -> make -> sudo make install combination), this post included the extra options for use on a Mac and made it really easy to follow.

Node School. http://nodeschool.io/

While I haven’t used the site too much, I am looking forward to learning more about Node through actually using it. (Most of what I’ve learned has been from picking it up from practice and bits and pieces here and there.)

Learning Reflection

Damn operating systems. In just the few weeks I’ve been working on this project on and off, I’ve gone through a major Mac OSX update (Mavericks to Yosemite) and had to deal with the issues around trying to fix a Windows 7 computer while at the same time trying to install Windows 8.1 on a Macbook Pro. All of which, at least at the time of this writing, has made me just so incredibly frustrated at the poor state of interoperability between operating systems and their underlining paradigms that I’m nearly at the point of willingly switching all my systems over to Linux just to get away from the cold war between Microsoft and Apple. (But I’m not that masochistic.)

JS over C++!

Most of my current problems originate from me wanting to use JavaScript (specifically Node.js) as part of a major project. Instead of C++, as most low-level libraries are written in, I wanted to build on my growing expertise in writing more server-side focused JavaScript. Specifically, I wanted to lay the groundwork of using the Kinect as part of a future networked project that would relay images and sound from one user to another as part of some larger game-system. My hope was, in creating an initial game of a lower scope, one based in just processing the images from the Kinect in JavaScript, I could leverage that later on towards this more complex imagined project.

However, unbeknownst to me when I first started working this, the cold war between Microsoft and Apple had moved into the human-machine interface domain a little over a year ago with each company buying up all the new, emerging companies (and their code!) and basically either rolling it into preexisting projects (like the official Kinect SDK) or shutting them down completely. The result of this buying up left just the open source projects around for those who wanted to write code for the Kinect, something that should be ideal in theory but has meant some some problems in practice.

Unofficially-Official Codebases

Despite Microsoft seemingly doing their best to contain Kinect-based projects to their own software development kits (based on their own .Net framework and code), a open source community has sprung up to reserve engineer the hardware and write open software that allows people to use the Kinect without relying on commercial code and their associated licensing problems. Named Freenect, this main library is the outcome of a larger project called Open Kinect that has tried to organize the various projects around the Kinect and other sensor-based hardware into one common library and API.

However, while this project and its code have survived the purging of other libraries that happened about a year ago, most others did not. The software projects that were built on Freenect (or at least could use its API) have nearly been wiped out and all that remain, for the most part, are their old code that was saved by others and remains available via file-sharing and personal sites. Code that has been labeled as “unofficially-official” in that, while it may still work, nothing is guaranteed and, in fact, as other projects change over time, probably won’t work for much longer.

Modules, Modding, and Code Lifetimes

In trying to work around the above limitations, I have also tried to find modules that would allow me work within JavaScript while allowing me to leverage preexisting libraries. Using the Node Package Manager (NPM) registry, I hunted around for modules to match the Freenect and OpenCV libraries. I found them easily enough, but installing and using them became frustrating. (I’ve also had some limited success using a module called Node-Kinect too.)

The Node-Freenect module, while being the most comprehensive, near 1-to-1 API match between itself and the original Freenect library I’ve seen, doesn’t compile anymore because of older references to the Node.js sources. Having not been updated for a couple of years now, the likelihood of it starting to work without significant refactoring of the code is very small. (I may end up updating this code, but the amount of work involved in learning the techniques used and dealing with the source is a little daunting given the time constraints.)

Looking into the OpenCV module came about as a result of trying to find an alternative for the OpenNI library (which more or less died when Apple bought the company and shut it down). Based on the Open Source Computer Vision library, this Node module has an API for a very limited set of the full functionality that OpenCV offers. Other than some simple shape definitions (square, face-finding and circle movement tracking), it doesn’t do much else. After some testing, it also only seems to work on existing images too, not on a binary stream from a device. (I could probably write some code to fix this, but again, it’s a time issue.)

Dammit Microsoft!

Given all these issues in trying to get Freenect to work in conjunction with Node.js, I decided to investigate the official Kinect SDK. If I couldn’t get an open source solution to work, I would fall back to closed, commercial source if I had to, I thought. So, I turned to downloading the SDK and trying that.

It turns out that there is now a new version (v2) of the SDK, one which needs Windows 7 or greater and a 64-bit system. This is a requirement I don’t quite reach. Now, I write “don’t quite” there to note that, while I do have a Windows 7 system (a desktop computer), it isn’t 64-bit. For that specific requirement, I needed to turn to my Macbook Pro, a Mac OS X system.

Luckily, there is a very useful program that now comes with Macs called BootCamp. This will allow you to create a new partition on your hard drive and install Windows on it. Changing the boot options, it will also allow you to switch between a Windows or Mac OS X operating system. You can install both! (On PCs, this has been an option for a long time; on Macs, well, it’s more complicated, hence why Apple bought the company that created this software and integrated it into their operating system.)

After hunting around for a Windows 7 ISO, I finally started the whole process. However, forgetting the hard drive size of my Macbook Pro, I was quickly reminded of a harsh fact: while it is solid-state, and thus faster, it’s also not very big, at about 120 GB total. With the operating system and various development tools installed, that doesn’t leave a great deal of free space to divide into a Windows partition — about 40 GB, in fact.

Splitting that in half leaves about 20 GB for Windows 7 to install. Something, had this been an earlier version of Windows, wouldn’t actually be much of a problem. However, Windows 7 installs to around 14 GB by itself, leaving just around 5 GB left for another else, including all the updates that comes from having a new machine. Which is, of course, exactly what happened.

Once it installed a handful of updates, it quickly ate up what remained of the tiny 5 GB that I started with after the initial installation. With no space to install the SDK, let alone the tools to use it (another several GBs by themselves), I was forced to give up on that plan too. Back to the drawing board, as it were.

One thought on “ENGL766: Learn Tech & Reflect

Leave a Reply

Your email address will not be published. Required fields are marked *