Controlling a Quadcopter like a Jedi Using a Leap Motion (TM)

Recently I went to an event entitled ‘NodeBots’. If you’ve ever heard of Node.js, you might already see where this is going. The event describes itself as “Robots powered by JavaScript”. Anyone even vaguely familiar with JavaScript will know that it is mainly used for websites. More specifically, it is used for client-side scripting of websites. Plainly, this means a web page can run code on your computer to power the fancy transition effects of drop down menus and all the other dynamic actions of the Web 2.0(!). Anyone familiar with JavaScript knows it has a bit of a controversial reputation. As a language, it has very little static checking and will keep on chugging even when an error is encountered. This can make it quite difficult to debug. So it might seem a little strange that the idea of this event is to control robots using JavaScript.The idea is that participants use a popular JavaScript platform called ‘Node.js’. Node.js is a platform that allows JavaScript programs to run natively, eschewing the requirement for a web browser. Explaining why anyone would want native JavaScript is a bit complicated and is beyond the scope of this post. I took the NodeBots opportunity to get familiar with JavaScript, and use it to control a quadcopter. A quadcopter essentially being a miniature helicopter, with 4 rotors instead of the traditional set up of a main rotor and a tail. These four rotors are places at the corners of the ‘drone’ such that it can tilt in any direction to control pitch and yaw, and causing it to drift in the tilted direction. Note that when I use ‘drone’ above, I mean an unmanned aerial vehicle. The military uses much larger and deadlier ‘drones’ but the one I was playing with was the size of a garbage can lid and completely unarmed. Also note that ‘unmanned’ does not imply automated, since I was in fact controlling the drone with a ‘Leap Motion’.

[Read More]
Tags: drone hackathon