by Dzmitry Gerasimov
192.168.1.1
'AT*REF=0,512\r' +
'AT*PCMD=1,0,0,0,0,0\r'
According to tests, a satisfying control of the AR.Drone is reached by sending the ATcommands every 30 ms for smooth drone movements. To prevent the drone from considering the WIFI connection as lost, two consecutive commands must be sent within less than 2 seconds.
dgram = require 'dgram'
socket = dgram.createSocket 'udp4'
seq = 0
flying = false
emergency = false
setInterval ->
ref = (flying << 9) | (emergency << 8)
commands = [
"AT*REF=#{seq++},#{ref}"
"AT*PCMD=#{seq++},0,0,0,0,0"
].join('\r') + '\r'
buffer = new Buffer commands
socket.send buffer, 0, buffer.length, 5556, '192.168.1.1'
, 30
var arDrone = require('ar-drone');
var client = arDrone.createClient();
client.takeoff();
client
.after(5000, function() {
this.clockwise(0.5);
})
.after(3000, function() {
this.stop();
this.land();
});
var arDrone = require('ar-drone');
var client = arDrone.createClient();
client.createRepl();
var arDrone = require('ar-drone');
var client = arDrone.createClient();
client.on('navdata', console.log);