AR Drone: Microsoft.Net API control, first successful trial

by Stephen Hobley on October 16, 2010

Post image for AR Drone: Microsoft.Net API control, first successful trial

It’s still early days yet, but I just completed my first successful test of a .Net Windows Forms control to control the Parrot AR Drone.

I still need to pass in the Window handle of the control itself to use as the video rendering window, but so far it’s looking very promising.

The code is tricky to work with, as it uses DirectX and a bunch of other libraries to handle some of the functions. It’s also very much “Unix/Linux/C” code, and needs a bit of tweaking to get it to behave under the .Net framework.

I was going to work on a new laser harp this weekend, but since this was so successful I might continue to develop the control library.

The first test - Connect, file transfer and video rendering, all within a Windows Form App

Once I’d got through the linker errors (the code is a little “scattered” throughout multiple folders – is this a Linux thing?) a few of the types presented problems – especially int8_t. I think it’s been about 10 years since I’ve done any Win32 programming – rusty is not the word…

Stay tuned, I’ll be posting something as soon as I get it release ready.

UPDATE : I’ve noticed that the connection to the drone seems to time out after a while – I’ve traced into the unmanaged code and it seems like the WiFi connection goes away. It could be just the firewall or something elementary like that. Need to install WireShark and see what’s going on under the hood… I did manage to get the video rendering into the windows control itself, so that’s small victory.

Video window integrated

I can also attest to the durability of the drone – so far 3 nasty crashes and one WiFi freakout and it’s still in good shape.

Now with funky joystick controls...

UPDATE UPDATE: I managed to sort out the connectivity issue – something to do with the frequency of calling the “update” routine. Added some funky joystick controls courtesy of http://www.jasonlabbe3d.com. The only problem remaining is CPU usage – it seems unusually high, this is the same with the example code. I’ve tried to do some balancing of the threads involved, but so far it’s still peaking at about 80% – which is way too high.

Further Update: I’m looking for a couple of people to help with this http://www.stephenhobley.com/blog/2010/10/22/looking-for-2-coders-to-help-with-the-ardrone-net-library/

Share

{ 7 comments… read them below or add one }

lumiere October 16, 2010 at 6:16 am

any code source to share any soon?
Keep it up! good luck

Thomas October 16, 2010 at 8:05 am

Could you please show us the code to hook into the API?
I tried it myself, but couldn’t figure out how to communicate between the low level code provided by the API and high level C# code.

Unsafe code blocks would be OK, but there is nothing like a reasonable interface that you could use for that purpose …

Pleaaase :-)

Stephen Hobley October 16, 2010 at 8:32 am

Yes, I will be putting something together as soon as I can cleanup the messy bits.

It took about 3 goes to get it working, and I still have a few problems with the int8_t * type – VS2010 doesn’t like this at all and I have to keep casting it to other types, but the code seems to be running OK.

I was hoping to post a flight video last night, but it got too late – and I was waaay too tired. :)

Thomas October 16, 2010 at 8:52 am

Gr8 … Looking forward to flying the object-oriented style :-)

Symon October 16, 2010 at 1:01 pm

Great work, please keep it up.
You’ve now got a following from http://www.ardrone-flyers.com

I wrote a short article about what your doing for the members.
http://ardrone-flyers.com/news/69-net-librarys-being-developed.html

All the best
Symon

Chida October 19, 2010 at 5:14 am

hello,
I would be interested in developing a client in silverlight, with all the problems.
To speed development, you can post the source of your project? at least now I can see if I can do (probably will take a webservices.).
thanks

RobotBlogg October 23, 2010 at 6:55 pm

Hello,

I would also be interested that you would post your code somewhere.
My interest is more orirented to the Microsoft Robotics platform, but your code would be very valuable.

Whatever, I will follow your advances via your blog.
Keep it up,

Fred

Leave a Comment

Comments links could be nofollow free.

Previous post:

Next post: