Skip to content

Instantly share code, notes, and snippets.

@codeforgeek codeforgeek/drone.js
Created Mar 27, 2019

Embed
What would you like to do?
const arDrone = require('ar-drone');
var drone = arDrone.createClient();
// disable emergency
drone.disableEmergency();
// take off the drone
drone.takeoff();
// take drone half meter up
drone.up(0.2);
setTimeout(() => {
drone.stop();
clearTimeout();
},2000);
//take drone one meter forward
drone.front(0.1);
setTimeout(() => {
drone.stop();
clearTimeout();
},2000);
//take drone half meter left
drone.left(0.1);
setTimeout(() => {
drone.stop();
clearTimeout();
},1000);
//turn drone 90 degrees clockwise
drone.clockwise(0.4);
setTimeout(() => {
drone.stop();
clearTimeout();
},2000);
//take drone down by half meter
drone.down(0.2);
setTimeout(() => {
drone.stop();
clearTimeout();
},2000);
//land the drone
drone.land();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.