ArDrone Controller - Control your drone with a joystick

Parrot SDK, Linux SDK, Java, PC, Mac, scripts for Parrot drones... etc.
LeFrenchie
Ready for take off
Posts: 14
Joined: 21 Nov 2012, 11:01
Drone Type: AR.Drone 2

ArDrone Controller - Control your drone with a joystick

Post by LeFrenchie » 21 Sep 2013, 20:33

Hello dear Drone Flyers !

A lot of programs already exist to control the ar drone from a pc, but at the time as I was looking for, I could not find what I was expecting, so I decided to write my own program.
So today I want to present my little contribution to the Ar Drone community : ArDrone Controller.


Main features:
- Support Ar Drone 1 and 2
- Video stream (front and bottom camera)
- Control using the keyboard and a joystick/joypad
- Assign the joystick axis to the wanted direction, and assign buttons to specific actions (recording, take a photo...)
- The connected joystick is recognized on startup and its configuration is loaded
- Alarm for low battery level and low wifi signal
- Switch between fullscreen or windowed display
- Configurable head up display with information about altitude, speed and direction
- Limit altitude, speed and acceleration
- Record videos on pc and/or usb
- Takes pictures
- Support custom ip addresses (if your are connected to the drone through a router for example)
- Support multiple languages (can be extended using languages files) and units (meters/feets)
- Watchdog thread to restart video, navdata or commands in case of failure, lost signal, etc...
- No installation : Unzip and start the exe (or read the .pdf help file :D)
- 32 bit application that runs on all windows platform (even 64 bit)
- Return to home function based on GPS
- [Experimental] Return to home function without GPS, based on the internal sensors of the drone

NOTES
- The return to home function based on the internal sensors (without GPS) should be used carefully, it's an estimation of the position and depends on calibration, wind, etc... and will never been as accurate as the gps based RTH !

- The return to home function based on GPS works great... if enough satellites are available !

- When recording on USB is active, or because of codec switchs, the video may become instable, an the drone sends sometimes bad pictures. Some of the errors are catched by ArDroneController, but sometimes you get just a black video output, so don't fly to far away !

Screenshot :
Image
Click to get full size

Video presentation

Direct link: http://www.youtube.com/v/PJixe7M4Y5s

One advantage of flying using a pc, is that you can add an external usb wifi adapter, with an antenna, to extend flying range. This is what I did :D


Application link:
To get the current version,and sources, follow the link.
ArDrone controller home page

Enjoy flying !
Le Frenchie

PS: This program has been presented in february 2013 for the first time, on a french forum, here is the link if you want to see the history: Drone-Multirotor
PS2: Sorry for my bad english :oops:
Last edited by LeFrenchie on 24 Apr 2015, 10:09, edited 8 times in total.

User avatar
garrock
I've been hit!!
Posts: 2089
Joined: 01 Sep 2012, 16:14
Drone Type: AR.Drone 2
Location: USA - Portsmouth, Ohio

Re: ArDrone Controller - Control your drone with a joystick

Post by garrock » 21 Sep 2013, 23:00

Looks good. Wish I had the time to evaluate the program.
DroneMod.com --- Worlds first two-drone system: Repeater-Helper and Camera-Worker drones ! --- http://www.REDbirdRF.com

LeFrenchie
Ready for take off
Posts: 14
Joined: 21 Nov 2012, 11:01
Drone Type: AR.Drone 2

Re: ArDrone Controller - Control your drone with a joystick

Post by LeFrenchie » 22 Sep 2013, 10:15

Thanks for your message !

pawelsky
Serious flight time
Posts: 1272
Joined: 02 Aug 2012, 22:01
Drone Type: Bebop
Location: Poland

Re: ArDrone Controller - Control your drone with a joystick

Post by pawelsky » 22 Sep 2013, 13:53

Looks like an interesting new app. Nice it tries to be MiruMod compatible. I'll do some test with the MiruMod on v1 and v2 and let you know how it works. Do you have any debug mode that could be enabled if things don't go well?

LeFrenchie
Ready for take off
Posts: 14
Joined: 21 Nov 2012, 11:01
Drone Type: AR.Drone 2

Re: ArDrone Controller - Control your drone with a joystick

Post by LeFrenchie » 22 Sep 2013, 19:57

Hi Pawelsky,

This would be great, I had only one feedback for a V1 drone, but the guy crashed his drone before he could test it "seriously" :o
Yes there is an Error.log file in Data\Log.

Thanks in advance !

pawelsky
Serious flight time
Posts: 1272
Joined: 02 Aug 2012, 22:01
Drone Type: Bebop
Location: Poland

Re: ArDrone Controller - Control your drone with a joystick

Post by pawelsky » 22 Sep 2013, 20:45

LeFrenchie wrote:This would be great, I had only one feedback for a V1 drone, but the guy crashed his drone before he could test it "seriously" :o
Yes there is an Error.log file in Data\Log.
Did a quick check with Drone 1 and the 'Use RC Mod' option checked.

It fails on creating the watchdog thread.

Code: Select all

[NFO] --------------------------------------------------------------
[NFO] ArDrone controller 1.5.0
[NFO] OS: Windows 7 (build 7601, Service Pack 1), 64-bit edition
[NFO] Sun Sep 22 21:27:56 2013
[NFO] --------------------------------------------------------------
[NFO] Initialize main frame
[NFO] Main frame initialized
[NFO] Try to open a connection to 192.168.1.1
[NFO] Winsock data initialized
[NFO] FFMPEG initialized
[NFO] AR Drone Version: 1.11.5

[NFO] Initialize video
[NFO] Video initialized
[NFO] Initialize Watchdog thread
[ERR] [CvDrone] _beginthreadex() was failed. (ardrone\watchdog.cpp, 28)

[ERR] Failed to connect to the drone, clean up !
[NFO] Try to close connection
[NFO] Finalize Watchdog
[NFO] Watchdog thread finalized
[NFO] Finalize video
BTW it happens even if the mod is disconnected so for sure mod is not messing up anything at this stage.

LeFrenchie
Ready for take off
Posts: 14
Joined: 21 Nov 2012, 11:01
Drone Type: AR.Drone 2

Re: ArDrone Controller - Control your drone with a joystick

Post by LeFrenchie » 23 Sep 2013, 08:11

Dooooh !!
I just feel so stupid... I did not test the rc mod option since version 1.5.0, were the watchdog thread has been added :oops:
Sorry for that, I'll make a correction asap !
Thank you for the test.

LeFrenchie
Ready for take off
Posts: 14
Joined: 21 Nov 2012, 11:01
Drone Type: AR.Drone 2

Re: ArDrone Controller - Control your drone with a joystick

Post by LeFrenchie » 24 Sep 2013, 13:49

Ok, a new version (1.5.1) is available, where the rc mod problem is corrected :D

I'm not sure the RC Mod, aka "video only" mode, will work with an ar drone V1, because the app needs to ask the new images (some kind of polling...), and as the commands cannot be send by the application, i don't think it would work...
On ar drone V2, the video is streamed even if the commands are not started on the application side (this has been tested on my V2), but i don't know what the mirumod does on drone side, hope it does not block the video ;)

Direct download link here

LeFrenchie
Ready for take off
Posts: 14
Joined: 21 Nov 2012, 11:01
Drone Type: AR.Drone 2

Re: ArDrone Controller - Control your drone with a joystick

Post by LeFrenchie » 26 Sep 2013, 12:20

Hi,

Just want to confirm that the version 1.5.1 has been tested (even on long range) and works well :D

Any feedbacks will be appreciated !

Regards
Le Frenchie

pawelsky
Serious flight time
Posts: 1272
Joined: 02 Aug 2012, 22:01
Drone Type: Bebop
Location: Poland

Re: ArDrone Controller - Control your drone with a joystick

Post by pawelsky » 27 Sep 2013, 12:14

LeFrenchie wrote:Ok, a new version (1.5.1) is available, where the rc mod problem is corrected :D

I'm not sure the RC Mod, aka "video only" mode, will work with an ar drone V1, because the app needs to ask the new images (some kind of polling...), and as the commands cannot be send by the application, i don't think it would work...
I'm afraid it doesn't work on Drone v1. With mod not connected it works fine. With mod connected program crashes when trying to connect. Here is the log:

Code: Select all

[NFO] --------------------------------------------------------------
[NFO] ArDrone controller 1.5.1
[NFO] OS: Windows 7 (build 7601, Service Pack 1), 64-bit edition
[NFO] Fri Sep 27 13:13:16 2013
[NFO] --------------------------------------------------------------
[NFO] Found 1 joysticks connected
[NFO] Joystick has rudder
[NFO] Joystick has axe Z
[NFO] Joystick has 12 available buttons
[NFO] Initialize main frame
[NFO] Main frame initialized
[NFO] Try to open a connection to 192.168.1.1
[NFO] Winsock data initialized
[NFO] FFMPEG initialized
[NFO] AR Drone Version: 1.11.5

[NFO] Initialize video
[NFO] Video initialized
[NFO] Initialize Watchdog thread
[NFO] Watchdog thread initialized
[NFO] Connection to 192.168.1.1 succesfully opened
[NFO] Set max altitude to 10 m (10000 mm)
[NFO] Wifi initialized succesfully
[NFO] connected to: PawelskyARDRONE1

LeFrenchie
Ready for take off
Posts: 14
Joined: 21 Nov 2012, 11:01
Drone Type: AR.Drone 2

Re: ArDrone Controller - Control your drone with a joystick

Post by LeFrenchie » 27 Sep 2013, 12:38

Hi Pawelsky,

Thank you for the test !
You said "With mod not connected it works fine", but with the rc mod option activated in the program, right ?
Initialization seems to be ok, but i don't know exactly what the mod does to the drone :?
Maybe the drone sends some invalid frame (this happends also on v2 when usb recording was on), I don't know, and I can't test... sorry :(

Did you test it with the V2 drone too ?

Thank you very much for your time !

pawelsky
Serious flight time
Posts: 1272
Joined: 02 Aug 2012, 22:01
Drone Type: Bebop
Location: Poland

Re: ArDrone Controller - Control your drone with a joystick

Post by pawelsky » 27 Sep 2013, 12:53

LeFrenchie wrote:You said "With mod not connected it works fine", but with the rc mod option activated in the program, right ?
Correct
LeFrenchie wrote:Initialization seems to be ok, but i don't know exactly what the mod does to the drone :?
Maybe the drone sends some invalid frame (this happends also on v2 when usb recording was on), I don't know, and I can't test... sorry :(
Any chance you could add some more detailed debug information? Also you can have a look at the at2so.c source, or have a quick chat with miru to understand what the RC mod does.
LeFrenchie wrote:Did you test it with the V2 drone too ?
Not yet, but I will and I will share the result.

LeFrenchie
Ready for take off
Posts: 14
Joined: 21 Nov 2012, 11:01
Drone Type: AR.Drone 2

Re: ArDrone Controller - Control your drone with a joystick

Post by LeFrenchie » 27 Sep 2013, 13:53

pawelsky wrote: Correct
Ok, i just wanted to clarify ;)
pawelsky wrote: Any chance you could add some more detailed debug information? Also you can have a look at the at2so.c source, or have a quick chat with miru to understand what the RC mod does.
I will check for more debug infos, but it the program crashes, it means that something very bad happened (invalid buffer lenght, ...) and it's already too late to trace.
As far as i unterstand, the rc mod take control over navdata-commands, but my hope was that it does not change anything on the video thread. It seems that some other application still display the video, so it should be possible...
It will try to look in details what the rc mod does, but... it could take time :(
pawelsky wrote: Not yet, but I will and I will share the result.
Hope it will be more succesfull :D

pawelsky
Serious flight time
Posts: 1272
Joined: 02 Aug 2012, 22:01
Drone Type: Bebop
Location: Poland

Re: ArDrone Controller - Control your drone with a joystick

Post by pawelsky » 27 Sep 2013, 14:30

LeFrenchie wrote:As far as i unterstand, the rc mod take control over navdata-commands, but my hope was that it does not change anything on the video thread. It seems that some other application still display the video, so it should be possible...
From what I remember mod takes control over the command stream, and it only allows some commands to go through (e.g. ones to swap cameras). Others will be blocked. As far as I remember navdata and video stream is not blocked. But it will be best to check with miru.

LeFrenchie
Ready for take off
Posts: 14
Joined: 21 Nov 2012, 11:01
Drone Type: AR.Drone 2

Re: ArDrone Controller - Control your drone with a joystick

Post by LeFrenchie » 07 Oct 2013, 21:18

Ooops... seems that I missed an answer :oops:

I have added a little video on the first post, but still have to take a look to the mirumod !

@pawelsky: Already some result with the ar drone 2 ? I'm still hoping that it does not have the same effect :roll:

Best Regards.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests