April 30th, 2012

After Hours Project: Simulating Flight with Kinect

If you could have any superpower, what would it be? (You can’t say the power to get more powers.) If you’re like me, it’d be the power to fly. Unfortunately, I’m not a Superman, Neo, nor a bird. I’m a software engineer at Yelp; I make things happen by writing code. So I started to write code that tricks me into feeling like I’m flying. What I ended up with was a Mac app that allows you to control a quadcopter by flapping your arms like wings.

To do this I used the Microsoft Kinect, a Parrot ARDrone quadcopter, OpenNI, and the app I wrote, KinectWings.

How Does it Work?

KinectWings uses the Kinect and OpenNI to track your body position. It monitors your body for movements that look like flapping or tilting. When a flap or a tilt is recognized, KinectWings sends control messages over wifi to the ARDrone. Video from the quadcopter is transmitted over wifi back to KinectWings, where it’s displayed for the user. When used in front of a large screen, it creates the illusion that you are flying by flapping and tilting your arms.

I Want to Fly!

If you’ve got some code know-how, you too can build software to control hardware using your body! I’ve opensourced an example project for using OpenNI in Cocoa applications for OSX. This provides a good starting point for doing skeletal tracking using a Mac and Kinect. I’ve also opensourced the changes I made to the ARDrone SDK so that it works on Mac. Check them out on GitHub!

Newsflash R. Kelly! I no longer believe I can fly, I can fly.