LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

keyboard control for AR.drone help

Hi guys, I had been trying to modify the AR.drone LabView toolkit given in order to add a keyboard interface. I am a newbieSmiley Sad. I tried a lot of ways but I still can't control the AR.drone by my keyboard. Can anyone help me with it? Smiley Sad

0 Kudos
Message 1 of 10
(3,506 Views)

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

Lewis Gear CLA
LabVIEW UAV

0 Kudos
Message 2 of 10
(3,489 Views)

Yeah I did look at it and try every possible way but still invalid.....

0 Kudos
Message 3 of 10
(3,482 Views)
Message 4 of 10
(3,470 Views)

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

0 Kudos
Message 5 of 10
(3,452 Views)

Anyone ?

0 Kudos
Message 6 of 10
(3,426 Views)

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.

0 Kudos
Message 7 of 10
(3,416 Views)

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 Smiley Frustrated

0 Kudos
Message 8 of 10
(3,404 Views)

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.

Message 9 of 10
(3,386 Views)

Thanks for the tipsSmiley Happy

0 Kudos
Message 10 of 10
(3,368 Views)