09-19-2012 04:39 AM - edited 09-19-2012 04:48 AM
Hello I am creating a program and is facing difficulty. I am tasked to design a flight pattern for my AR drone using LABView via wifi without the aid of any controls(Joystick, keyboard,Mobile). I have look through the book titled 'LABview for everyone' and found 3 possible ways to do it. Sequence Structure(what I am working on), event structure, state machine.
Example of flight pattern: When I press start in front panel, my drone will take off and stay on air at a certain height(maybe 1m) for 10sec, after which it will Yaw(rotating clockwise 360degrees) for 4 times or dance like what is shown in the video, drone fly to 2m this time, last but not least it will end off with a land.
Examples: http://www.youtube.com/watch?v=-cZv5oKABPQ
http://www.youtube.com/watch?v=S-dkonAXOlQ&feature=related
http://www.youtube.com/watch?v=geqip_0Vjec&feature=relmfu
Can anyone give me tips to work on? 🙂
09-19-2012 08:56 AM
Hi John1982. Sounds like fun. We used to fly our drones with LabVIEW and a joystick; never got around to tackling autonomous flight.
I would start by looking at queued state machines. A sequence structure may be ok for a very brief sequence of events, but is very
restrictive once you start putting together a real program. There is an example here: Queued State Machine Lots of other examples
on the forums. Also, make sure you have a good flow diagram for you app, including error cases, before you start 😉
Are you going to use the data coming back from the drone to conclude your steps, i.e. send a command to go to 1m, then wait for feedback
telling you the drone has achieved the desired altitude? Makes your program more complicated, but potentially much more robust.
I would also include an error handler that will continuously send a 'soft land' command in the event of loss of comm or drone fault. Probably
won't make any difference, but might possibly work.
For handling communication, I would look at an Action Engine. Ben Rayner has a great nugget.
Hope this helps, ask questions as you explore.
Matt
09-19-2012 10:21 PM
Thanks man. I read throught queue state machine but it is too complicated for me to understand and build.. How about falt sequence? My friend suggested to me to start from flat sequence cause it is easier 🙂
09-19-2012 10:43 PM - edited 09-19-2012 11:10 PM
@John1982 wrote:
Thanks man. I read throught queue state machine but it is too complicated for me to understand and build.. How about falt sequence? My friend suggested to me to start from flat sequence cause it is easier 🙂
flat sequence is like multiple state cases,but the disadvantage of a flat sequence is you cannot go backwards, but forward in a defined manner as oppose to a simple state machine...you can point to any statement case and it is not limited to a certain sequence of events...again, there are caveats in using flat sequences
btw, there are many different labview design patterns...state machines,queued state machine,event driven state machine,event machine,event handling loop,continuous loop,parallel loops, master slave loop,producer consumer loop,unconventional state machine,functional global...but never heard of the flat sequence machine? goto Execution Structures
09-19-2012 11:09 PM - edited 09-19-2012 11:12 PM
Here's what I have come up with using flat sequence nothing seem to be working. Can anyone guide me? I have just started using Labview so my VI might look stupid and retarded. Please help thanks a lot 🙂 I mean flat sequence structure not machine. My bad. Can anyone look into my VI and tell me whats wrong with it 😛
09-20-2012 02:58 AM - edited 09-20-2012 02:58 AM
Nevermind somehow i managed to solve this problem. Thanks for the help