ubuntu12.04 32bit
首先确保系统安装来python,gcc,g++,如果没有则安装:
$ sudo apt-get install build-essential
$ sudo apt-get install gcc
$ sudo apt-get install g++
从nodeJS官网 http://nodejs.org/ 下载最新源代码包:node-v0.10.26.tar.gz, 解压,
$ cd node-v0.10.26
默认安装,
$ ./configure
$ make
$ sudo make install
或选择目录方式安装:,
$ ./configure –prefix=/usr/node
$ make -j 5 #5=CPU核数+1
$ sudo make install
安装结束,可以用下面的命令检查安装的版本:
$ node --version
v0.10.26
Install via Github to get the latest version:
Or, if you're fine with missing some cutting edge stuff, go for npm:
repl.js
file like this:
var client = arDrone.createClient() ;
client.createRepl() ;
Using this REPL, you should be able to have some fun:
Now you could write an autonomous program that does the same:
var client = arDrone.createClient() ;
client.takeoff() ;
client
.after( 5000, function() {
this.clockwise( 0. 5) ;
})
.after( 3000, function() {
this.stop() ;
this.land() ;
}) ;
Ok, but what if you want to make your drone to interact with something? Well, you could start by looking at the sensor data:
Not all of this is handled by the Client library yet, but you should at the very least be able to receive droneState
and demo
data.
A good initial challenge might be to try flying to a certain altitude based on the navdata.demo.altitudeMeters
property.
Once you have manged this, you may want to try looking at the camera image. Here is a simple way to get this as PngBuffers (requires a recent ffmpeg version to be found in your $PATH
):
pngStream.on('data', console. log) ;