Click here to Skip to main content
Click here to Skip to main content

PrograDrone

, 4 Sep 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
App for controlling Parrot AR Drone 2.0

Please note

This article is an entry in our AppInnovation Contest. Articles in this sub-section are not required to be full articles so care should be taken when voting.

Overview

PlatformAll-In-One
Category  Entertainment = All in One

Introduction   

PrograDrone is an original application, how to control your Parrot AR Drone 2.0 for touch screens. Most of apps for controlling Drone are using g-sensor and they aren't accurate. PrograDrone allows to define sequences of commands, which will be executed by Drone.

What is Parrot AR Drone? 

It's probably best amateur quadrocopter, which can be controlled by smartphone/tablet.

Parrot AR Drone 2.0 on YouTube 

Why this app?  

Number of apps for AR Drone is really small. This app will have much better precision (than g-sensors apps), and for begginers really easy to use. Also, this app is useful for promo purposes.

Background 

This app (article) participates in Intel App Innovation Contest 2013.
In order to understand this, you should have basic knowledge of C# programming and WPF (XAML). 

Used technologies  

For creation of app I use platforms C#, WPF (XAML) with IDE Visual Studio 2012.  

For communication with AR Drone (with streaming video input from Drone) will be used ARDrone2WindowsSDK .

Wireframe & Controls

 
User choose command menu and move it by Drag&Drop to playlist. In some case (if command needs that) new window appear with inputs of variable parameter of command (distance, time). 

For example: User will select Wait, new window will ask for "how long" - 10 seconds.

Some commands will be parameterizable In relative or absolute units (move top to 10 cm x move top 10 cm).

App will have two Stop commands:

  1. Regular – Drone will slowly land
  2. Emergency - Immediately stop of Drone

 Using the code   

Usage of  ARDrone2SDK (in this code speech recognization):
AppClass{
    private DroneClient _droneClient;

 if (await _droneClient.ConnectAsync())
            {
                TakeOffButton.IsEnabled = true;

                await Task.Run(async () =>
                {
                    try
                    {
                        if (_speechRecognizer == null)
                        {
                            _speechRecognizer = new SpeechRecognizer();
                            _speechRecognizer.Grammars.AddGrammarFromList("DroneCommands", new List<string>
                            {
                                "Take off", "Take off the drone", "Take the drone off", 
                                "Land", "Land the drone"
                            });
                        }
                        try
                        {
                            while (true)
                            {
                                Dispatcher.BeginInvoke(() =>
                                {
                                    if (TextRecognizer.Text != "Voice: listening...")
                                    {
                                        TextRecognizer.Foreground = new SolidColorBrush(Colors.Green);
                                        TextRecognizer.Text = "Voice: listening...";
                                    }
                                });
                                
                                var result = await _speechRecognizer.RecognizeAsync();

                                //if (result.TextConfidence == SpeechRecognitionConfidence.High)
                                if (result.Text.Length > 0)
                                {
                                    Dispatcher.BeginInvoke(() =>
                                    {
                                        switch (result.Text)
                                        {
                                            case "Take off":
                                            case "Take off the drone":
                                            case "Take the drone off":
                                                _droneClient.TakeOff();
                                                break;
                                            case "Land":
                                            case "Land the drone":
                                                _droneClient.Land();
                                                break;
                                        }
                                    });
                                    await Task.Delay(1000);
                                }
                                else
                                    await Task.Delay(500);
                            }
                        }
                        catch (Exception ex)
                        {
                            Debug.WriteLine(ex);
                        }

                        Dispatcher.BeginInvoke(() =>
                        {
                            TextRecognizer.Foreground = new SolidColorBrush(Colors.Red);
                            TextRecognizer.Text = "Voice: unknown";
                        });

                    }
                    catch (Exception ex)
                    {
                        Debug.WriteLine(ex);
                    }
                });
            }


 }


Points of Interest

I expect that I will gain experience with AR Drone SDK, which looks really interesting Smile | :)

Future extension

I would like to add Windows Azure functionality - users will be able to share "packages" of commands between them.

History

2013-09-04 - basic info about idea


License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author


Comments and Discussions

 
QuestionI would love to this the final product of this PinmemberKillBot Project4-Sep-13 18:20 
GeneralInteresting idea, I want to try this with a quadrocopter! PinmemberTomas Slavicek4-Sep-13 16:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.141022.2 | Last Updated 4 Sep 2013
Article Copyright 2013 by V. Jirovský
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid