This project provides an open source firmware for the AR.Drone quadrocopter by Parrot.
WARNING: This project is not supported nor endorsed by Parrot S.A., using this sofware will most likely void your warranty and might destroy your drone or make it fly away into deep space. Use at your own risk.
Click here to download the Custom Firmware or browse the source code on github
The new firmware for the drone is called ‘fly’. Upon start it will listen on UDP port 7777, waiting for the PC based controller called ‘OpenFlight’ to connect. Once OpenFlight connects, ‘fly’ kills the Parrot firmware ‘program.elf’ and takes control of the drone. Now you can fly the drone with the PC keyboard. OpenFlight logs the flight data to a file called YYYYMMDDHHMMSS_navlog.csv.
Known Issues
- The PID controller parameters have not been optimized yet and currently only use ‘P’ parameters. In particular the height controller will probably settle below the target height, or the drone might not have enough power to take off.
- The OpenFlight user interface is very rudimentary.
- No soft landing function is implemented. In order to land: fly the drone to minimum altitude and then switch off the motors.
- ‘Flat Trim’ parameters are not saved and are estimated after OpenFlight connects. Place the drone on a horizontal surface before connecting with OpenFlight.
- No battery voltage monitoring. The drone will fall out of the sky once the battery is drained.
Install
1) FTP the folder ardrone/bin to your drone
2) Open a telnet session to your drone and execute:
# chmod 777 /data/video/bin/*
# /data/video/bin/fly
3) On your pc, start OpenFlight.exe and follow the instructions on screen.
4) (Optional) Execute the following command to make ‘fly’ start everytime you powerup the drone:
# echo -e “\n\n/data/video/bin/fly &” >> /etc/init.d/rcS
Other telnet commandline demo programs on the drone are:
You’ll need to execute `killall program.elf` before using these programs!
# /data/video/bin/navboard – to see the navboard raw sensor data (3-axis accelleration, 3-axis gyro, sonar echos)
# /data/video/bin/attitude – to see the navboard attitude data (pitch angle, roll angle, yaw angle, height)
# /data/video/bin/motorboard – to control the motors/leds
# /data/video/bin/vbat – to see the on board voltages
# /data/video/bin/video – turns the drone into a giant optical mouse, keep it about 1 meter above ground and move it parallel to the ground. The program should report the movement.
Directories
ardrone/bin – Pre-compiled binaries. FTP these files to your drone and run them in a telnet session.
ardrone/fly – Custom firmware to fly the drone, the controller is in directory /pc/OpenFlight
ardrone/navboard – Navboard driver and demo getting raw data from the navboard and converting it to realworld units
ardrone/attitude – Attitude driver and demo calculating attitude (pitch,roll,yaw and height) estimates from navboard data
ardrone/motorboard – Motorboard driver and demo control of the 4 motors and leds
ardrone/vbat – Battery voltage driver and demo
ardrone/gpio – GPIO driver and demo
ardrone/video – Video driver and demo (needs start&kill of program.elf to init the video)
ardrone/util – Utilities
pc/OpenFlight – C# controller for /ardrone/bin/fly
Compiling
For ardrone source code:
1) Download and install arm-2011.03-41-arm-none-linux-gnueabi.exe “Sourcery G++ Lite 2011.03-41 for ARM GNU/Linux” from http://www.codesourcery.com/sgpp/lite/arm/portal/release1803
2) On Windows: open a command prompt and cd to one of the directories
3) Run the make.bat batch file to compile the program in that directory
For pc source code
1) Download and install Visual Studio C# 2010 Express
2) Open pc/OpenFlight.sln
Changelog
19-Sep-2011 V03 Added ardrone/fly and pc/OpenFlight
20-Jul-2011 V02 Added video
17-Jul-2011 V01 Initial release
> With lower speed values than 0×66 the motor will not start.
On my AR.Drone, my test shows that 0×33 is the minimum speed value.
For safe test with AR.Drone motors, I removed the spin-blades. But I got motor CUTOUT after ~3 seconds of running. How to avoid it and make a continued long running? (So I’m able to test the speed changes with different PWM values)
Hey everyone,
I followed the same procedure proposed by MAPGPS(i.e. I removed the propellers for safety measures) and when I send commands to the drone I also got motor CUTOUT after ~2 sec. I went through the codes to see any break or stop routine and I changed a lot of values but it doesn’t work!
What can be the problem? Hugo/MAPGPS, any idea?
Thanks
Awesome work Perquin
I guess that if you publish that code on github or bitbucket, other developers could reach you and/or help you better.
Keep up the good work !
Thanks for the suggestion! I’ve published the code here: https://github.com/ardrone/ardrone
Awaiting for your first addition
Yes, yes my aim is to mod my Ar drone to make it substantially lighter, just need a way to greatly reduce the speed of the motors. This I am hoping when I have finished with my brilliant plan to also get longer flight time and coverage. Please let me know if this can be done easily.
You probably can fly your superlight drone with the stock Parrot software, I would expect the controllor to adapt the motor speeds accordingly.
If you really want to experiment you can use the software I just published on this page, but be prepared for some nasty crashes of both sofware and hardware!!!
Is the version from github up to date? It seems to be still marked as September 11, 2011 First commit.
Now it is, still learning github…
Dear Hugo,
Thanks for the great effort towards writing the open source firmware for the ARdrone. I have a couple of questions to ask please. I need to implement some control algorithms on the AR.drone and I need to write an application which can easily access the motors(Send PWM commands) and get the feedback from the sensors so that I can plugin every control algorithms I like into the application and validate the results. I don’t really want to use the original firmware by Parrot as it looks complicated and unnecessarily large in terms of codes and files!
I am not a professional programmer but I do have some general C/C++ and VC++ knowledge! Do you think working on your codes for the aforementioned task would lead me to results in a couple of weeks? Do you have any recommendation or advice regarding this issue?
Thanks so much
P.S: Is there any documentation for your codes so one can start up quickly?
Another question!! Is there any UML for the source code?
Thanks
Mohammad
Hi Sep, please have a look at the comments in source code itself. Each module, for example motor control, has its own demo progam that explains how to use it. Happy hacking
Thanks hugo, you’ve done a great job!
Sep
Hi,
I am trying to test the opensource firmware but it doesn’t work form me. I do the followings:
I am using windows XP SP3
1. I ftp the bin folder to the drone (Using a windows explorer and typing ftp://192.168.1.1/ in address bar and then copy the bin folder into the window!)
2. telnet the drone through cmd window (telnet 192.168.1.1)
3. execute the two commands
# chmod 777 /data/video/bin/*
# /data/video/bin/fly
it returns :
/bin/sh: /data/video/bin/fly: Permission denied
what should be wrong?
I run then the OpentFlight.exe but no response!
Thanks folks
Sep
Check your paths, it is most likely that the path to your binary is /data/bin/fly (or wherever you put it)
e.g.
# chmod 777 /data/bin/*
# /data/bin/fly
Did you type the “#” as part of the command? If so, try again without the # …
Dear Bubble and Hugo,
Thanks for the responses! I don’t really know why should I ever use chmod 777/data/video/bin/* (the address format) as I just copied the bin folder into the wind XP windows explorer with ftp://192.168.1.1/ in the address bar! However when I use the two commands
chmod 777 /data/video/bin/*
/data/video/bin/fly
in the telnet session the path looks correct as it finds the files but denies the permission!(if I use the same command with a file which does not exist let’s say dummyfly it says /…/dummyfly: not found)
I am suspecting the way I ftp the bin folder into drone! Is it simply the following steps:
1. Connect to the drone and Open a window explorer
2. type ftp://192.168.1.1/ at the address bar(I also tried to ftp the bin folder into ftp://192.168.1.1/data/video/bin/ but it doesn’t give me the permission to copy any folder in it!)
3. copy the bin folder into this window(this window is empty by default)?
@ Hugo: I write the commands without # sign since the Microsoft telnet session has it by default!(I telnet to drone from Win XP Command Prompt)
Regards
Sep
Solved! A minor mistake;)
Sep
What type of communications are you doing between the ARdrone and the PC. Unicast or Multicast?
One of the MAJOR problems I’ve found with the ARdrone is that if you don’t support Multicast, then you’re SOL.
The program.elf binary specifically uses Multicast (booo) and it doesn’t look like I can change that behavior.
Does your code (on the drone) send the navdata/video back to a specific IP address, or does it try to use Multicast?
Thanks for the great work!!!!!
Dear Hugo,
I am confused with an issue in your nice codes. Some times when I send PWM commands which are not probably chosen the motors suddenly stop and the LEDs go red and I need to restart my drone for sending new commands. Which part of the codes are in charge of this action exactly(i.e. stopping the motors and turning the LEDs red when sending improper PWM commands) regardless of the reason behind it? I check all sub-functions routines in mot.c motorboard.c etc. and functions such as Run_motor, mot_SetLeds, mot_SetPWM and so on!
Regards
Hi
I am trying to use the opensource firmware on the ardrone.
I do the following steps:
- I download the scource code with the bin folder from this site
- I ftp the bin folder to the drone
- I open a telnet session to the drone
- I change the permissions with the command “chmod 777 /data/video/bin/*”
- I execute fly program with the command “/data/bin/fly”
The result is “segmentation fault”.
I tried to recopile the sources with “arm-2011.03-41-arm-none-linux-gnueabi” downloaded from “https://sourcery.mentor.com/sgpp/lite/arm/portal/release1803” and installed in my Ubuntu 10.04.
I repeated the same steps and the result is again “segmentation fault”.
I tried to compile the following simple code:
int main()
{
return 0;
}
I ftped the program to the drone, changed the permissions and executed the program using telnet and the result is always “segmentation fault”.
The version of ardrone firmware is 1.3.3.
The version of the kernel inside the drone is:
2.6.27.47-parrot #1 preempt wed sep 22 15:29:06 cest 2010
What could be the problem?
What could I do?
Thanks
What are the firmware version and the kernel version on your ardrone?
Thanks
First of all, great job hugo you work is very helpful, thank you.
I was wondering if you know of a way to compile code natively on the drone?
Thank you,
yuri.
Hello Hugo
We have been using your very comprehensive AR.Drone code in a project, and we would like to contribute some tuned PID parameters we developed.
Because the controller code is a totally different implementation you may just want the parameters to implement in your version.
Go on Chirstian,
Everyone would appreciate your tuned PID parameters and codes. Provide us with a link to your codes.
Thanks