The Xbox controller in Node.js
The Node Xbox Controller library let’s you do just that and it’s really easy to setup. Install the library then run this example app to see if everything is working fine. You might have to install the gamepad drivers first: Lion/Snow Leopard, Yosemite
Driving the Drone
Luckily for this project we don’t have to use two separate libraries for reading the gamepad and driving the drone because the Xbox-Parrot library does everything for us.
Once the default app is running in your terminal the drone is ready to take off. Here’s the basic controller layout:
Front/Back => Forward / Backward
Left/Right => Strafe Left / Strafe Right
Front/Back => Up / Down
Left/Right => Rotate Counter Clockwise / Rotate Clockwise
A => Takeoff
B => Land
X => Reset Emergency
Y => Stop
I also got the camera image streaming through to the browser for flying the drone in first person view, like if it was a simulator game. For this I used the AR Drone webflight library.