Get my new tutorials in your inbox every week

Fly a drone with JavaScript and NodeJS

fly a drone with JavaScript and NodeJS
Fly a drone with JavaScript

Programming a drone is easy! That’s what they say. Now you can actually fly a drone with JavaScript and NodeJS modules.

All you need is NodeJS installed on your computer, then downloading the ar-drone node module. And of course, you need the Parrot AR Drone.

Where can I fly a drone with JavaScript?

There’s actually an event that happens across the world where you can participate and its called NodeCopter. NodeCopter.js is a full-day event where 15 – 60 developers team up in groups of 3. Each team receives one Parrot AR Drone 2.0 and spends the day programming and playing with it. At the end of the day, each team gets to present their work to the other attendees.

What is a Parrot AR Drone?

The Parrot AR Drone is an affordable, yet surprisingly capable quadcopter. The drone itself runs a proprietary firmware that can be controlled via WiFi using the official FreeFlight mobile app (available for iOS and Android).

And then the following piece of code will make your drone take off, move around, do a flip and carefully land again.

var arDrone = require('ar-drone');
var client = arDrone.createClient();

client.takeoff();

client
  .after(5000, function() {
    this.clockwise(0.5);
  })
  .after(3000, function() {
    this.animate('flipLeft', 15);
  })
  .after(1000, function() {
    this.stop();
    this.land();
  });

Learn more: http://www.nodecopter.com/

Read my last 3 articles:

Write a Comment

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