ARDrone

Aus FunkFeuer Wiki
Wechseln zu: Navigation, Suche

AR.Drone

Parrot produces a very nice quadcopter called "AR.Done"

Homepage: http://ardrone.parrot.com/parrot-ar-drone/usa/

In Vienna you can get them at Mediamarkt for 300,- EUR

We plan to make a mesh of flying drones.


FAQ

  • how long can it fly?
Approximately 15 minutes
  • how much can it carry?

Approx. 200 grams


Documentation

Hardware

  • Linux myhost 2.6.27.47-parrot-01227-g93dde09 #1 PREEMPT Fri Jul 2 15:23:06 CEST 2010 armv5tejl GNU/Linux
  • Processor : ARM926EJ-S rev 5 (v5l)
  • Mykonos Parrot platform,
  • REv: 0904
  • Memory: 128MB RAM
  • Wi-Fi: AR6000
# cat /proc/cpuinfo 
Processor       : ARM926EJ-S rev 5 (v5l)
BogoMIPS        : 233.47
Features        : swp half thumb fastmult edsp java 
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant     : 0x0
CPU part        : 0x926
CPU revision    : 5
Cache type      : write-back
Cache clean     : cp15 c7 ops
Cache lockdown  : format C
Cache format    : Harvard
I size          : 32768
I assoc         : 4
I line length   : 32
I sets          : 256
D size          : 16384
D assoc         : 4
D line length   : 32
D sets          : 128
# free
              total         used         free       shared      buffers
  Mem:       126072        12480       113592            0            0
 Swap:            0            0            0
Total:       126072        12480       113592

Hardware  : Mykonos Parrot platform Revision  : 0904 Serial  : 0000000000000000

The Wi-Fi chip seems to have it's own SDIO interface driver. Anyway, the good news for us is, that ad-hoc mode works very well.

OLSRD - HowTo / Build @ Debian 5.0

Add new Source to /etc/apt/sources.list:

deb http://www.emdebian.org/debian/ lenny main

Get new Update´s!

sudo apt-get update

Copy & Paste into Shell:

sudo apt-get install emdebian-archive-keyring libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi gcc-4.3-arm-linux-gnueabi g++-4.3-arm-linux-gnueabi apt-cross dpkg-cross libncurses5-dev
sudo apt-get update

Download/Extract Latest STABLE OLSRD Release: (Example)

wget http://www.olsr.org/releases/[VERSION]/olsrd-[VERSION].tar.gz
tar xfv olsrd-[VERSION].tar.gz
cd olsrd-[VERSION]

Edit Makefile.inc:

vi Makefile.inc

Press [ i ]

CC=gcc-4.3-arm-linux-gnueabi

Press [ ESC ] & type [ :wq ] & PRESS ENTER

Compile OLSRD:

make
make libs

Now olsrd is Compiled and ready for AR.Drone!

Copy Compiled OLSRD to AR.Drone

You need:

  1. Laptop with Wireless LAN
  2. Local Webserver (MacOS X has one ;)
  3. Compiled OLSR Binary´s (Plugin´s, OLSRD)
  • Connect your Laptop with AR.Drone
  • Wait few seconds for IP (192.168.1.2)
  • Open a shell window and telnet into AR.Drone
telnet 192.168.1.1
  • Lets create some Folder´s on AR.Drone
mkdir /data/apps
mkdir /var/run
  • Copy OLSRD Binary
cd /data/apps
wget http://192.168.1.2/~[USERNAME]/olsrd
ln -s /data/apps/olsrd /bin/olsrd
chmod 777 /bin/olsrd
  • Copy OLSRD_LIB´s
cd /lib
wget http://192.168.1.2/~[USERNAME]/olsrd_txtinfo.so.0.1
wget http://192.168.1.2/~[USERNAME]/olsrd_httpinfo.so.0.1
wget http://192.168.1.2/~[USERNAME]/olsrd_watchdog.so.0.1

OLSRD Configuration and FunkFeuer Setup

(!) DO IT AT YOUR OWN RISK / BE CAREFUL (!)

  • Create olsrd.conf
vi /etc/olsrd.conf

Press [ i ] / Copy & Paste

DebugLevel              0
IpVersion               4
AllowNoInt              yes
FIBMetric               "flat"
Pollrate                0.025
RtProto                 111
TcRedundancy            2
Willingness             7
MprCoverage             7
LinkQualityFishEye      0
LinkQualityAlgorithm    "etx_ff"
LinkQualityLevel 2
UseHysteresis no
LoadPlugin "olsrd_txtinfo.so.0.1" {
    PlParam "Port"      "2006"
    PlParam "Accept"    "127.0.0.1"
}
LoadPlugin "olsrd_httpinfo.so.0.1" {
    PlParam "Net"       "0.0.0.0 0.0.0.0"
    PlParam "port"      "8000"
}
LoadPlugin "olsrd_watchdog.so.0.1"
{
       PlParam "file" "/tmp/0xffolsr_watchdog"
        PlParam "interval" "50"
}
Interface "ath0" 
{
        Mode            "mesh"
}
InterfaceDefaults
{
        HelloInterval           5.0
        HelloValidityTime       100.0
        TcInterval              3.0
        TcValidityTime          500.0
        MidInterval             30.0
        MidValidityTime         500.0
        HnaInterval             30.0
        HnaValidityTime         500.0
        Ip4Broadcast 255.255.255.255
}

Press [ ESC ] andy type [ :wq ].

  • Create startupfile with IP/BSSID/ESSID... Setting´s
vi /etc/init.d/olsr.sh

Press [ i ] / Copy & Paste

#!/bin/sh 
# kill all olsrd/httpd sessions and delete lock file...
# we can use this script to do restart´s
killall olsrd
killall httpd
rm /var/run/olsrd-ipv4.lock
# ready to setup wireless interface switch to adhoc, bssid, essid
ifconfig ath0 down
iwconfig ath0 mode ad-hoc
iwconfig ath0 channel [CHAN.NR.]
iwconfig ath0 ap [BSSID]
iwconfig ath0 essid [ESSID] #ardrone.freiesnetz.funkfeuer.at looks nice
ifconfig ath0 [IP] netmask [NETMASK] up
ifconfig ath0:1 192.168.1.1 netmask 255.255.255.0 up # be Save ;-)
olsrd

Press [ ESC ] andy type [ :wq ].

chmod 777 /etc/init.d/olsr.sh
  • Now you can test your OLSRD AR.Drone with
/etc/init.d/olsr.sh
iptables -A INPUT -p tcp --dport 23 -s 193.238.156.0/22 -j ACCEPT #Funkfeuer
iptables -A INPUT -p tcp --dport 23 -s 78.41.112.0/21 -j ACCEPT   #Funkfeuer
iptables -A INPUT -p tcp --dport 23 -j DROP

it look´s like

# /etc/init.d/olsr.sh 
killall: httpd: no process killed
 *** olsr.org - 0.6.0 ***
 Build date: 2010-11-11 21:14:10 on server1.paua.at
 http://www.olsr.org
Parsing file: "/etc/olsrd.conf"
Debug level: 0
IpVersion: 4
Noint set to 1
FIBMetric: flat
Pollrate 0.03
RtProto: 111
TC redundancy 2
Willingness: 7
MPR coverage 7
Link quality fish eye 0
LQ Algorithm: etx_ff
Link quality level 2
Hysteresis disabled
Plugin: olsrd_txtinfo.so.0.1
Plugin param key:"Port" val: "2006"
Plugin param key:"Accept" val: "127.0.0.1"
Plugin: olsrd_httpinfo.so.0.1
Plugin param key:"Net" val: "0.0.0.0 0.0.0.0"
Plugin param key:"port" val: "8000"
Plugin: olsrd_watchdog.so.0.1
Plugin param key:"file" val: "/tmp/0xffolsr_watchdog"
Plugin param key:"interval" val: "50"
setting ifs_in_curr_cfg = 0
        Mode: mesh
        HELLO interval: 5.00
        HELLO validity: 100.00
        TC interval: 3.00
        TC validity: 500.00
        MID interval: 30.00
        MID validity: 500.00
        HNA interval: 30.00
        HNA validity: 500.00
        IPv4 broadcast: 255.255.255.255 
Interface Defaults      IPv4 broadcast/multicast : 255.255.255.255
        Mode           : mesh (d)
        IPv6 multicast           : ff02::6d
        HELLO emission/validity  : 5.00 (d)/100.00 (d)
        TC emission/validity     : 3.00 (d)/500.00 (d)
        MID emission/validity    : 30.00 (d)/500.00 (d)
        HNA emission/validity    : 30.00 (d)/500.00 (d)
        Autodetect changes       : yes
        IPv4 broadcast/multicast : AUTO
        Mode           : mesh (d)
        IPv6 multicast           : ::
        HELLO emission/validity  : 0.00/0.00
        TC emission/validity     : 0.00/0.00
        MID emission/validity    : 0.00/0.00
        HNA emission/validity    : 0.00/0.00
        Autodetect changes       : no
olsr.org - 0.6.0 detaching from the current process...
# 
  • if that work´s you can go to the next Step´s...
  • Modify /etc/init.d/rcS (be careful)
vi /etc/init.d/rcS

goto line 48/49 it looks like

...
..
.
modprobe p6_sdhci
/bin/wifi_setup.sh

Press [ i ], make a new line after /bin/wifi_setup.sh and Paste

/etc/init.d/olsr.sh

goto the end of the file and Paste one more

/etc/init.d/olsr.sh

Press [ ESC ] andy type [ :wq ].

  • Now you are finished and reboot your device for the first run with olsr, open your Browser http://[IP]:8000 and you can see the OLSR Status Page

FILESYSTEM

-> /
bin       dev       factory   home      mnt       root      sys       update    var
data      etc       firmware  lib       proc      sbin      tmp       usr       www
-> /bin
ash               cp                false             ip                mv                pwd               stat              vi
busybox           cttyhack          fgrep             ipcalc            netstat           random_ip         stty              watch
cat               date              gdbserver         kill              olsr.sh           random_mac        sync             wifi_setup.sh
channelselector   dd                getopt            ln                olsrd             reset_dhcp.sh     tar               zcat
check_update.sh   df                grep              ls                pairing_setup.sh  rm                touch
checkplf          dmesg             gunzip            mkdir             pidof             rmdir             true
chgrp             echo              gzip              mknod             ping              sed               umount
chmod             egrep             hostname          mktemp            program.elf       sh                uname
chown             factory_reset_cb  httpd             mount             ps                sleep             usleep
-> /etc
fstab          hostname       httpd.conf     init.d         ld.so.cache    olsrd.conf     profile        udhcpd.conf
group          hosts          inetd.conf     inittab        nsswitch.conf  passwd         protocols
-> /etc/init.d
rcS
-> /sbin
arp          fdisk        ifconfig     insmod       iwgetid      iwspy        mdev         modprobe     rmmod        switch_root  udhcpc
blkid        halt         ifrename     iwconfig     iwlist       klogd        mkdosfs      poweroff     route        sysctl       zcip
fbsplash     hwclock      init         iwevent      iwpriv       lsmod        mkfs.vfat    reboot       setconsole   syslogd
-> /data
accs_infos.bin        emergency.bin         log_bin               syslog.bin            video
apps                  fact_accs_infos.bin   navdata_blackbox.bin  sys?og.bin            www
config.ini            fact_trims.bin        random_mac.txt        trims.bin

AR.Drone Configuration File (/data/config.ini)

# cat config.ini 
[general]
num_version_config             = 1
num_version_mb                 = 17
num_version_soft               = 1.3.3
soft_build_date                = 2010-09-22 15:30
motor1_soft                    = 0.0
motor1_hard                    = 0.0
motor1_supplier                = 0.0
motor2_soft                    = 0.0
motor2_hard                    = 0.0
motor2_supplier                = 0.0
motor3_soft                    = 0.0
motor3_hard                    = 0.0
motor3_supplier                = 0.0
motor4_soft                    = 0.0
motor4_hard                    = 0.0
motor4_supplier                = 0.0
ardrone_name                   = My ARDrone
flying_time                    = 630
navdata_demo                   = TRUE
com_watchdog                   = 2
video_enable                   = TRUE
vision_enable                  = TRUE
vbat_min                       = 9000 
[control]
accs_offset                    = { -2.1041426e+03 1.9623026e+03 2.0612791e+03 }
accs_gains                     = {  9.8346788e-01 2.0515487e-02 1.5799545e-02  -1.3670200e-02 -9.8090577e-01 1.9539831e-02   5.9470539e-03 -3.6688969e-02 -9.7911078e-01  }
gyros_offset                   = { 1.6544460e+03 1.6738420e+03 1.6580200e+03 }
gyros_gains                    = { 6.9924705e-03 -7.0605604e-03 -3.7827170e-03 }
gyros110_offset                = { 1.5891379e+03 1.6813199e+03 }
gyros110_gains                 = { 1.5292658e-03 -1.5492389e-03 }
gyro_offset_thr_x              = 4.0000000e+00
gyro_offset_thr_y              = 4.0000000e+00
gyro_offset_thr_z              = 5.0000000e-01
pwm_ref_gyros                  = 470
control_level                  = 0
shield_enable                  = 1
euler_angle_max                = 3.4906584e-01
altitude_max                   = 10000
altitude_min                   = 50
control_trim_z                 = 0.0000000e+00
control_iphone_tilt            = 5.8549303e-01
control_vz_max                 = 1.0000000e+03
control_yaw                    = 3.4906585e+00
outdoor                        = TRUE
flight_without_shell           = TRUE
brushless                      = TRUE
autonomous_flight              = FALSE
manual_trim                    = FALSE
indoor_euler_angle_max         = 2.0943952e-01
indoor_control_vz_max          = 7.0000000e+02
indoor_control_yaw             = 1.7453293e+00
outdoor_euler_angle_max        = 4.6401200e-01
outdoor_control_vz_max         = 1.3894274e+03
outdoor_control_yaw            = 5.1314220e+00
[network]
ssid_single_player             = ardrone_v1.3.3
ssid_multi_player              = ardrone_v1.3.3
infrastructure                 = TRUE
secure                         = FALSE
passkey                        = 
navdata_port                   = 5554
video_port                     = 5555
at_port                        = 5556
cmd_port                       = 0
owner_mac                      = 00:00:00:00:00:00
owner_ip_address               = 0
local_ip_address               = 0
broadcast_address              = 0
[pic]
ultrasound_freq                = 8
ultrasound_watchdog            = 3
pic_version                    = 262192
[video]
camif_fps                      = 15
camif_buffers                  = 2
num_trackers                   = 12
[detect]
enemy_colors                   = 1
enemy_without_shell            = 0
detect_type                    = 3
[syslog]
output                         = 7
max_size                       = 102400
nb_files                       = 5

API

Links / external documentation

Pics