09-25-2012 02:58 AM
Hi guys, I had been trying to modify the AR.drone LabView toolkit given in order to add a keyboard interface. I am a newbie. I tried a lot of ways but I still can't control the AR.drone by my keyboard. Can anyone help me with it?
09-25-2012 07:35 AM
Search the NI Example Finder for "keyboard" and look at the Basic Input Demo.vi.
This should be a good start for you.
Kind Regards
09-25-2012 08:05 PM
Yeah I did look at it and try every possible way but still invalid.....
09-25-2012 11:44 PM
Is this somehow related to this thread: http://forums.ni.com/t5/LabVIEW/Send-a-keyboard-event-from-labview-to-C/m-p/2164518?
09-26-2012 02:40 AM
I started doing a certain part of the program but my keyboard parameters program can't seem to toggle the 3 important button ( takeoff , hover and stop) after connect to the the control of the drone program. You may want to see the VI
09-27-2012 01:14 AM
Anyone ?
09-27-2012 11:12 AM
Your ZIP file is missing the key file "SelectKeyDownUpMOD1.vi." Does it look like the included "SelectKeyDownUp.vi"? It's not really clear what you're trying to do. The SelectKeyDownUp VI has a while loop with an event structure, which is the right idea. However, its outputs are wired to the inputs of the AR Drone example, so the AR Drone example won't run until the SelectKey VI exits. That's probably not what you want. I would add an event structure directly to the AR Drone example, in a separate parallel while loop, and use a notifier or similar to pass key events to the control loop. As a first pass you could even do this with local variables, which would make it easy to see that the key press is doing the same thing as clicking a boolean button.
09-27-2012 08:26 PM - edited 09-27-2012 08:35 PM
SelectKeyDownUpMOD1.vi is SelectKeyDownUp.vi. Sorry, I am newbie. For example, I would like to press '1' or anything other keys that the user select in the takeoff toggle keyboard parameters and takeoff toggle will activate the actual takeoff in the AR.Drone example and then the AR.drone will take off. The led will light up. Same goes for the other switches like Hover Toggle and Emergency Stop. I am not exactly sure how to do what you really tell me... Sorry
09-28-2012 04:45 PM
Do you understand why your code doesn't work now? If not, that would be the first step.
Put the event structure into the same VI that controls the drone, but put it inside a separate while loop. In the event structure, handle Key Down and Key Up events. When you get a Key Down event, set a local variable for the corresponding control to TRUE; when you get a Key Up event, set the corresponding local variable to FALSE. That will be a good start. Eventually you might want to use a notifier or queue, but the local variables will get you started.
10-01-2012 01:36 AM
Thanks for the tips