Multiple AR Drones

Mani Monajjemi edited this page Jan 8, 2013 · 5 revisions
Clone this wiki locally

Summary

This instruction will show you how to configure single or multiple AR-Drone 2.0s to connect to a managed wifi network (e.g. a wifi router) without breaking the default ad-hoc network connection.

Disclaimer

Please be advised that this instruction is for advanced users with high technical skills. Changing anything on your AR-Drone may void its warranty. You may damage your AR-Drone firmware(software) or hardware permanently if making mistakes. No warranty or guarantee is provided for this instruction; you follow them at your own risk. If you are at all uncomfortable or inexperienced please reconsider doing the job yourself.

Requirements

  • A dedicated wireless router for the setup
  • At least one AR-Drone 2.0 quadrocopter

Step 1: Configure wifi Network

Configure your wireless router to create a managed wifi network without security (e.g. dronenet). In my experiments I was not able to make drones connect to WEP/WPA secured networks. This might be because of either a bug in firmware or in my connection script. Configure the router to have the IP address of 192.168.1.1 on subnet 255.255.255.0. Configure the router's DHCP server to give clients IP addresses starting from 192.168.1.100, we will reserve smalled IP addresses for drones.

Step 2: Configure Each Drone

In this step we create a file called wifi.sh on the drone which will make the drone connect to pre-defined wifi network whenever triggered. The steps are as follows:

  • Connect to your AR-Drone's ad-hoc wifi network

  • Telnet to your drone

mani@pc# telnet 192.168.1.1

Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.



BusyBox v1.14.0 () built-in shell (ash)
Enter 'help' for a list of built-in commands.
  • Create a file named wifi.sh in /data/ directory on the drone:
vi /data/wifi.sh
  • Change network SSID in line 3 and IP number in line 4 of the following code, then copy & paste it into the file. The SSID is what you set up in step 1. The IP should be unique for each drone from the reserved range.
killall udhcpd
ifconfig ath0 down
iwconfig ath0 mode managed essid dronenet
ifconfig ath0 192.168.1.10 netmask 255.255.255.0 up

Hint if you are not familiar with vi: Press i in vi to go to insert mode, paste the code by pressing shift-ctrl-v, press ESC to exit insert mode. Type :wq to write and quit.

  • Make the newly created file executable
chmod +x /data/wifi.sh
  • Close the telnet connection
exit

Step 3: Run the wifi.sh from PC

While Steps 1 & 2 should only be done once, this step should be executed whenever you want to make the Drone connect to your wireless network (for example everytime you turn the drone on).

  • Connect to your drone's ad-hoc wireless network

  • Remotely execute wifi.sh

mani@pc# echo "./data/wifi.sh" | telnet 192.168.1.1
  • Connect your PC to the hidden wireless network

  • Test the connection to the drone by pinging its IP address

ping 192.168.1.10

Step 4: Run the ROS Driver

ardrone_autonomy driver accepts a command line argument named -ip to connect to a drone configure with an IP address other than default 192.168.1.1.

  • From Command Line:
rosrun ardrone_autonomy ardrone_driver -ip 192.168.1.10
  • In a launch file:
<node name="ardrone_driver" pkg="ardrone_autonomy" type="ardrone_driver" args="-ip 192.168.1.10" />