GithubHelp home page GithubHelp logo

ardrone-control-.net's Introduction

License:

ARDrone Control .NET - An application for flying the Parrot AR drone in Windows.
Copyright (C) 2010, 2011 Thomas Endres, Stephen Hobley, Julien Vinel

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.

-----------------------------------------------------------------
ARDrone.Net library for the Parrot AR Drone
Stephen Hobley, Thomas Endres and Julien Vinel November 2010
-----------------------------------------------------------------
You must have the DirectX and Windows SDK installed in order to compile this solution file.

A few quick tips to get the app up and running:
- This is a Visual Studio 2010 project using .NET framework 4.0
- You need to download and install Windows SDK and a fresh copy of the DirectX SDK
  - Get DirectX from http://msdn.microsoft.com/en-us/directx/aa937788.aspx
  - Get Windows SDK from http://msdn.microsoft.com/de-de/windows/aa904949.aspx
- You need to disable the loader lock exception in Visual Studio (Debug -> Exceptions -> Managed Debugging assistents -> Disable the "Loader lock" checkbox)
- You need to set the start project to ARDRoneUI_WPF (or ARDroneUI_Detection for the detection examples)
  - Do this by right clicking the project and selecting "Set as start project" from the context menu

Once you have completed these steps, the solution should compile.
Since this application is using the Microsoft Speech API, it should not be working with Windows XP versions prior SP2.

For more information, visit our websites:
https://github.com/shtejv/ARDrone-Control-.NET
http://parrotsonjava.com
http://stephenhobley.com/blog

This software uses the following libraries:
- WiiMoteLib:				http://wiimotelib.codeplex.com/
- Aviation Instruments:		http://www.codeproject.com/KB/miscctrl/Avionic_Instruments.aspx
- AviFile Library:			http://www.codeproject.com/KB/audio-video/avifilewrapper.aspx

The software uses various tips and tricks as well as some classes from the internet. Where possible, the names of the original authors were mentioned in the legal notices.



ardrone-control-.net's People

Contributors

andersmalmgren avatar miguelbarros avatar shtejv avatar theone1984 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ardrone-control-.net's Issues

UI starts lagging after Startup

After startup everything seems to be ok. Command window shows "connected to drone" and videostream works. As soon as I click on any button, the UI starts lagging. The drone can take off but hardly reacts to keyboard inputs. CPU load is 100%.

When building solution a warning considering ARDrone.UI.vshost.exe appears twice but can be skipped. Maybe this has something to with this issue..

thanks

ARDroneUI_Detection_Forms

I am trying to use the software for tag recognition and when I run it from the Detection_Forms project it throws this error

{"The type initializer for 'Emgu.CV.CvInvoke' threw an exception."}

in the SignDetector.cs at line 73, or respectively this line

surfaceParameters = new SURFDetector(500, false);

And I havent found anything pertaining to this type of error online

Various problems

Hello,
I tried to run the binary found on http://parrotsonjava.com/ home page on various Win7 64bits computers and it crash directly without displaying anything. I guess its not supported on this system ?

I also try on a newly installed Win7 32bits computer and noticed the following :
If the adhoc connection with the drone is not established when starting the program, it crash when doing the connection test.

I connected a very old/crappy PC gamepad to the computer. When I start the program, it crashs after the connection test with an unhandle exception : SystemIO.FileNotFoundException in ARDrone.Input.KeyboardInput.GetNewInputDevices(IntPtr, System.Collections.Generic.List1<ARDrone.Input.GenericInput>)

If I dont have any pad/joystick, I get the same errors.

Is it not possible to start/use the programme without a gamepad/joystick ?
Is this "normal behaviour" (in that case, maybe should handle the exceptions to at least terminate gracefully) or is it a problem coming from my setup ? (Should I rush buy a M$ xbox pad ? :)

Any plans to modify this wonderful code for the New AR Drone 2.0?

I have just received the newest version of the AR Drone (2.0). With low to no expectations of this working with it (due to the firmware difference) I downloaded and compiled the code. Amazingly I am able to Takeoff, Control and Land. I am having problems with the Video (it doesn't work) and the HUD Controls (Altitude, Windspeed, Direction) do not seem to work either. I'm just curious if there are any plans to rework this code for any changes in the 2.0 version? Thanks in advance.

Joy stick/Keyboard not working

I have ardrone with latest firmware version 1.7.11

joy stick movement and keyboard buttons do change roll pitch..etc values but drone do not move....

but i can takeoff,land,turn off hover mode do various other functions with both keyboard and joystick except i cant move it any where!!!.....what am i missing

and i disabled hover mode!!.....

also the application crashes some times at line number 100 of NetworkWorker.cs

thanks

SDL

How to add SDL?
having problems top compile can someone explane?

control_level: problem

Hi.

There is a combined yaw mode AT command. I have looked in the code but couldn't find. Can you please tell me how to enable and disable this mode and where to amend the code.

thanks

1.7.4 video codec support

Hi Thomas. Do you have any plans of porting the new codec decoder from the 1.8 sdk? I dont think I have time for such a big port right now. I will how ever look into the losting connection problem...

New input about the socket problem

After increase of timeout I do not receive socket timeoutes anymore, but sometimes I get this error, and it only sometimes, sometimes I can fly 100s of meters away from drone without problems..

The error is always on port 5556 (Command port)

System.Net.Sockets.SocketException (0x80004005): The requested address is not valid in its context
at System.Net.Sockets.Socket.SendTo(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, EndPoint remoteEP)
at System.Net.Sockets.UdpClient.Send(Byte[] dgram, Int32 bytes, IPEndPoint endPoint)
at ARDrone.Control.Network.UdpWorker.SendMessage(Byte[] message) in C:\Users\ama\Documents\Projekt\Anders.ARDrone\ARDroneControlLibrary\Network\UdpWorker.cs:line 75
2011-09-04 16:00:44,768 [ARDrone.Control.Workers.CommandSender_WorkerThread] ERROR ProcessThreadedException
System.Net.Sockets.SocketException (0x80004005): The requested address is not valid in its context
at System.Net.Sockets.Socket.SendTo(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, EndPoint remoteEP)
at System.Net.Sockets.UdpClient.Send(Byte[] dgram, Int32 bytes, IPEndPoint endPoint)
at ARDrone.Control.Network.UdpWorker.SendMessage(Byte[] message) in C:\Users\ama\Documents\Projekt\Anders.ARDrone\ARDroneControlLibrary\Network\UdpWorker.cs:line 80
at ARDrone.Control.Network.UdpWorker.SendMessage(String message) in C:\Users\ama\Documents\Projekt\Anders.ARDrone\ARDroneControlLibrary\Network\UdpWorker.cs:line 68
at ARDrone.Control.Workers.CommandSender.ProcessWorkerThread() in C:\Users\ama\Documents\Projekt\Anders.ARDrone\ARDroneControlLibrary\Workers\CommandSender.cs:line 76
at ARDrone.Control.Network.NetworkWorker.ProcessWorkerThreadInternally() in C:\Users\ama\Documents\Projekt\Anders.ARDrone\ARDroneControlLibrary\Network\NetworkWorker.cs:line 104

Crash upon startup and drone ping

ok ive tried just about everything i know of to get this app to work and no matter what it grays out once the ui comes up and then crashes shortly after without an error

AR Drone 1.7.4 not responding to keyboard/joystick input

Not sure what I'm doing wrong, however I have compiled the source myself and am able to establish a successful connection to the drone with video link and the ability to read telemetry. I can take off and land, however the control surfaces don't seem to work, despite the values being read on the display as I move the joystick. Any ideas as to what I can do?

Missing droneConfig.xml

Hi,

When I try to run this, it complains that the droneConfig.xml file is missing from my AppData folder (which is true). Where can I download this file? I'm using the latest version.

Thanks,
cookiesrock

Interface for DI and testability

Thanks for all your hard work guys!
Each time a new version of the API is released i have to go through some steps to make it work with my program.
The biggest one is that I have to extract an interface from the DroneControl class, this is beacuse i use dependency injection to inject the concrete DroneControl class into my class instance.

Maybe we could have this interface in the main code repository so that we to not to redo this job everytime?
This is how my interface looks as of current version of API, note that I've added a public method Init and removed the constructor that takes a droneconfig, this is to make it easier for DI.

public interface IDroneControl
{
    void Init(DroneConfig droneConfig);
    event DroneErrorEventHandler Error;
    event DroneConnectionStateChangedEventHandler ConnectionStateChanged;
    event DroneNetworkConnectionStateChangedEventHandler NetworkConnectionStateChanged;
    Bitmap BitmapImage { get; }
    ImageSource ImageSourceImage { get; }
    DroneData NavigationData { get; }
    InternalDroneConfiguration InternalDroneConfiguration { get; }
    bool IsConnecting { get; }
    bool IsConnected { get; }
    bool IsFlying { get; }
    bool IsHovering { get; }
    bool IsEmergency { get; }
    DroneCameraMode CurrentCameraType { get; }
    bool CanTakeoff { get; }
    bool CanLand { get; }
    bool CanCallEmergency { get; }
    bool CanCallReset { get; }
    bool CanSendFlatTrim { get; }
    bool CanFlyFreely { get; }
    bool CanEnterHoverMode { get; }
    bool CanLeaveHoverMode { get; }
    bool CanSwitchCamera { get; }
    Size FrontCameraPictureSize { get; }
    Size BottomCameraPictureSize { get; }
    double FrontCameraFieldOfViewDegrees { get; }
    double BottomCameraFieldOfViewDegrees { get; }
    void ConnectToDrone();
    void Disconnect();
    void SendCommand(Command command);
    bool IsCommandPossible(Command command);
}

This also makes the host program easier to UnitTest... Thanks again!

Problems with joystick mapping

In the code a specific joystick is hard-coded to map (for instance) yaw to the 3rd axis and POV to Gaz. I think this should be done for any joystick that supports POV or 3rd axis (wich is testable using the DirectInput class) and not only for the T.Flight Stick X.

I don't know if the following is a problem only for my two joysticks, but the center (zero) point should be 32511 (maybe I need to calibrate them?), not (short.MaxValue - short.MinValue)/2.

Led animation function does not exist in ARDroneDLL

Although the led animation is implemented in led_animation.h and through ardrone_at_set_led_animation, it is not possible to run animations from c# code. This feature could be usefull for initial dev tests - or even for allowing the drone to communicate with the user.

Problem Building - SDL Not Found even after defining directory in properties.

Hi,

Even after following the readme line for line I am getting this error:
error C1083: Cannot open include file: 'SDL.h': No such file or directory

Here is my properties file:

C:\Program Files\Microsoft SDKs\Windows\v7.1 C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)C:\Libraries\SDL <_ProjectFileVersion>10.0.30319.1 $(WinSDKDir) $(DXSDKDir) $(SDLDir)

Thanks,
Christian

Detection Forms, Problem!

Hello, I'm having a problem with the recognition of the movement, that I can not follow an object because the program reveals the movement behind me, the problem of resolution of the cam, so can not make a decision on the direction, what can I change to resolve this problem?
Have you ever used the same program, but with face recognition and tracking?

Hello, thanks
fabio

It isn't possible to change configuration values in the drone

The parrot drone has a set of configuration values (changed using the AT*CONFIG command - for instance, maximum altitude) that could be very usefull to set from the c# world. However, there isn't a c# way to do this - it could be usefull to create some exports/dllimports to do this.

Should I place this kind of suggestions here? These are not actually "issues", but more like "usefull new features" - i don't want to clutter this space...

Firmware version not read from drone

Hi.
The firmware version is staticly declared to 1.33, shouldnt this be read off the drone, the camera swtich is dependant on the correct firmware etc.

Thanks, Anders

Constantly Crashing

I am currently using a Dell XPS 15, i7 2630m, GT540m and it seems to be impossible for the app to start up. I'm not sure if it is not liking my hardware or I'm missing something but the app launches then crashes as soon as I press any button (UI or keyboard). It used to work ok, my .NET is up to date, the laptop itself is new (Christmas). What could be the problem? Any kind of assistance would be nice. Also could you please include a better system requirements other than the readme. An extra tab on your webpage perhaps? It's not hard to do and would really help clearly determine what is needed, some users don't even read the Readme (silly I know, but what can you do?). Thanks in advance!

High CPU with Xbox 360 controller

Hi my experience is with VB6 but following your instructions I have managed to build the project in win7 vs2010. It connected and ran fine with keyboard. I had some issues when trying to connect my Xbox 360 controller.

  • Cpu usage above 95% at one stage caused network dropout just when I was about to take off
  • right stick was not detected (in windows this is seen as x and y rotation)
  • also battery % was not available.
  • When trying to map another joystick with not enough buttons it would be great to be able to map keyboard as well.

It will be some time before I have enough knowledge to address these myself. Are you able to help ?

Just an update 13-Jan - I noticed that I get 100% usage even with keyboard. Is ther anything you can do to reduce this ?

Joystick POV returns only 0.0 or 1.0

The method "CalculatePOVValue" on the JoystickInput class returns 0 or 1.0. Shouldn't it return the angle of the POV (in degrees) that is, the value of the POV divided by 100?

Issue with USE_WINDOWS_CONDITION_VARIABLES define

I have followed recommendation in the updated Readme.txt file:
//-----------------------------------
Please uncomment the line
"#define USE_WINDOWS_CONDITION_VARIABLES"
in vp_os_signal_dep.h.
//-----------------------------------

  1. The line #define USE_WINDOWS_CONDITION_VARIABLES was already UNcommented in vp_os_signal_dep.h.
  2. Leaving it “as is” (uncommented) compiles project fine, however it throws an exception DLLNotFoundException (ARDroneDll.DLL) on “Startup” as described
  3. If, however, I comment the line "#define USE_WINDOWS_CONDITION_VARIABLES" then project still compiles fine and runs OK without exception when pressing “startup” button.

Compilation and runtime environment:

Windows XP SP3
Visual Studio 2010
Win SDK 7.1 (though it also compiles OK with WinSDK 7.0A, which is supplied with VS 2010)
DirectX SDK (June 2010)
SDL 1.2.14
JDK (latest)

Therefore, it is either I’ve missed something or there is misprint and the line "#define USE_WINDOWS_CONDITION_VARIABLES" should be commented, rather than UNcommented for Windows XP

ArDrone Detection Forms throws nullreference

i can start detection forms, but after i hit connect button program throw an exception : nullreference from image.width in CopyBitMap function. i think program cannot connect ar drone but even if i change values from DroneConfig.cs there is no change.

thanks.

To bring the drone out of emergency mode isn't working well (Parrot 1.0)

Hi,

When my drone is in emergency mode, I can press the button "Emergency". The leds will change to green which is good, but I can't take off after that. I think there's a small problem.

        private void Emergency()
        {
            Command emergencyCommand = new FlightModeCommand(DroneFlightMode.Emergency);

            if (droneControl.droneVersion == 1)
            {
                if (!droneControl.IsCommandPossible(emergencyCommand)) //Because the Emergency function only turns off on the AR2.0 - don't know about the AR 1, but i want to be able to un-set the emergency :)
                    return;
            }

            droneControl.SendCommand(emergencyCommand);
            UpdateUIAsync("Sending emergency signal");
        }

What can I do to fix that problem?

Thanks,

Jamie

No video

Hi,

It's great that you wrote this and open sourced it!

However, I have been struggling for many hours trying to get video to show up. I'm running Windows 7 professional.
netstat -s shows that some packets have been discarded, and this number increases while the app is connected to the drone.
Running wireshark shows no udp 5555 packets. I've disabled windows firewall and uninstalled the other firewalls, tried tweaking network settings (such as MTU) with netsh, all to no avail. Can anyone please suggest anything else I could try, since I'm out of ideas.

Thanks in advance,
Jim

DllNotFoundException - urgent !!

when we run the application throw the ARDroneUI_detection_FORM as a startup project -
the follwing error occurres:

An unhandled exception of type 'System.DllNotFoundException' occurred in Emgu.CV.dll

Additional information: Unable to load DLL 'cvextern': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

we copied the cvextern.dll file to bin/debug and all the dll files of emgu and stil the error occurred.

Does enyone knows what are we doing wrong??
it's very urgent !!!

thank's
shiran

Automatic detection of the drone wifi

I don't know if I did something wrong, but to be able to put the drone to work i had to manually connect my laptop to the drone's wifi. It could be usefull (particularly for newbies) to have the application automatically detecting potential wifi networks that could be drones, and automatically connect to them (in case there was only one).

This should be relativelly simple to do (assuming there is a way to know that a particular network belongs to a drone) and could increase the end user experience (less configuration to make the application work).

Video Feed Not Changing, Video Not Saving

Hello,
I just started working with your setup for the AR drone yesterday, downloading the newest version. The controls all work, and the video feed from the front camera shows up in the window. However, when I click the "change camera" button, nothing changes, and when I use the save video option, the file either shows up broken, or if I click "compress file" and then don't actually compress it, the file saves as a trippy, psychedelically purple version of the video. Also, if I leave the video capture program on for more than about 6 seconds, the program crashes. The snapshot program, however, seems to work fine. Any help would be appreciated, thank you.

Joystick deadzone please

Hi and congrats for this great project!
I am testing the Drone with various controllers and most of them have a small noise around the central position (especially gamepads which are extremely sensitive).

I tried using DXTweak2 and I could manage to reduce the axis sensitivity (it would be great to have a way to setup joypad axis curves or maximum drone inclinations as in most iOS drone apps), but in W7 there is no way to modify "global" deadzones.

It would be great to have a reverse axis feature as well.

Thank you, best regards

Giuliano

XamlParseException in MainWindow.xaml

'The invocation of the constructor on type 'ARDrone.UI.MainWindow' that matches the specified binding constraints threw an exception.' Line number '15' and line position '9'.

That is the error that I am recieving when trying to run the solution, it builds completely but when trying to run it I get this error and I can't find any help for it online.

Socket Errors

Hi Stephen.
Sometimes, while the Drone is Flying, the drone disconnects from the program giving more than one socket error, and the biggest problem is that I cannot connect to the drone without exiting the program and launching it again. Why does the Drone give me an error like this?This is a big problem, especially when flying at an height of 20 meters.
Thanks in advance,
Mattia

Checksum failed

Hi,

When running the sample code, there is a constant stream of errors such as the following. Everything seems to work OK, but letting you know in case this is something that needs fixing. Thanks for releasing the API!

[Navdata] Checksum failed : -858993460 (distant) / 31762 (local)
Tag 19 is not a valid navdata option tag

The second number (after the slash) varies, but the checksum failed number is always the same.

Can not us API without WIFI network

Hi.
The API crashes when you try to init the DroneControl class
It crashes at the Initialize of the NetworkConnector class when it tries to consctuct the WlanClient class

This line crashes

              Wlan.ThrowIfError(
                     Wlan.WlanOpenHandle(Wlan.WLAN_CLIENT_VERSION_XP_SP2, IntPtr.Zero, out negotiatedVersion, out clientHandle));

It throws "The service has not been started"

If i follow the stack trace i can see that the call was started at the default constructor for the control class

droneControl = new DroneControl(droneConfig);

So like the code is constructed right now it will never work for us that are not connected to a WIFI

Best regards, Anders

Ad hoc reconnection

If you use the Free.Flight AR.Drone application, if you leave the ad hoc network it will pop up saying video not available etc, and then if u move back into the ad hoc network range it will re-connect to the drone and allow you to control it again.

with this software, the ARDrone Control .NET application, if the ad hoc network is left OR has a small hiccup in connectivity, it throws a pretty hefty socket error at the user and the application has to be restarted once manually reconnected to the network. Is there any plans to improve this networking issue or am I on my own here? I am using the application to do some testing with and I would like to be able to reconnect via better means than restarting all the applications and network connections. it also appears that even if the network doesn't disconnect but possibly has a lag or hiccup it will also throw an error that requires full network reconnection and application restarting...

i can't receive video frame from external Cam

i can't receive video frame from external Cam using this project knowing that i don't have Ardrone in this time but i just need to test receiving video frames from external cam
Regards,
moamen

UI doesn't reset correctly after shutdown

On initial startup, connecting to the drone works properly and the camera images and nav data displays correctly, however on hitting shutdown various elements of the UI will no longer update when reconnected to the drone. The video box is no longer updated and no drone controls will operate the drone. Navdata still appears to be intermittently updated.

I've only had a brief look at the code so far, but it looks like this is occuring in or below the arDroneControl object rather than in the form code.

Not sure if I should place this as a separate issue given it is relatively minor, but the LED animation function is set off by one compared to the selection in comboBoxLedAnimations, so selecting a given animation actually plays the animation one above in the combobox.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.