In this post I will talk about how to use the .NET DroneController with the ARDrone. The DroneController is created with Visual Studio 2010 and targets the .NET 3.5 framework. The main reason I target this framework is because the DroneController uses the updated WritebleBitmap class, this class exposes a BackBuffer property which allows modifying the image while is currently rendered and avoid smearing or tearing.

All code has been developed on a Windows 7 platform, using the code on Windows XP or Vista should just be fine (the only thing I am not sure about is the video encoding part, I have no clue what default functionality is available on these additional platforms). In case of issues on these part I can always take a look.

Running simple WPF client

Download the latest binaries from http://dronecontroller.codeplex.com/releases and extract to your hard disk.

Before you connect to the ARDrone make sure

  • The batteries are connected and all the green led’s are activated.
  • Your WI-FI adapter has a fixed IP address of 192.168.1.2 (this is the default address given by the ARDrone DHCP, since there is an issue on Windows platform with the ARDrone DHCP server behavior we make it a fixed address in stead of a dynamic)
  • You have connected to the adhoc network created by the ARDrone

If all goes well you should see following window:

00alzxq3

Change the Network Id with the name of the adhoc network created by your ARDrone.

Remark: Recording video and taking pictures relies on the existence of a C:Temp directory. Either make sure this directory exists or change the source code.

As you can see the interface is really simple. There are a couple of buttons and sliders to control the ARDrone. There are also two output areas, one for showing the video and another one for showing trace messages.

If you see messages like Nav:No activity on worker thread for 500 milliseconds. it means that the thread servicing the Navigation Data has timed out. Just disconnect and reconnect again.

Remark

The flight parameters you send to the ARDrone to change roll, pith, height or yaw have a value between –1 and 1. This simple interface has limited these parameters between –.1 and .1 in order to avoid making too brisk maneuvers. You can always adapt these settings if you have enough room.

In the next post I will discuss a bit more the ins and outs of creating a consumer for the .NET DroneController.