Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   autonomous programing for lab view (http://www.chiefdelphi.com/forums/showthread.php?t=82805)

ahudson 16-02-2010 12:03

autonomous programing for lab view
 
we need help on the autonomous part of the programming for lab view please.
we have one made but we cant seem to get it to work Thank you.

Mark McLeod 16-02-2010 12:13

Re: autonomous programing for lab view
 
Post what you've done or what you want to have done.

apalrd 16-02-2010 12:20

Re: autonomous programing for lab view
 
2 Attachment(s)
How you go about doing this depends on your programming experience. There is another thread about the topic somewhere - but I will sum up what it said:

There are two ways to do it - state-machine and sequenced.
If you have a state-machine, it will cycle through states until it reaches the end. The state-machine is in a while loop, so the code would run in Autonomous Iterative.vi. This used to be the only way to write autonomous pre-2009, so most experienced veteran teams still use it.

If you are a beginning programmer, there is another way to do it using Autonomous Independent that you might find easier. Basically, you create a SubVI for each major action (e.g. drive straight or turn degrees or kick ball) and make it wait for completion. See drive_str.vi for an example. It is fed a flow in, distance, and max speed and it drives to that position. You would just need to tune the gain and be ready to go. What you do is open Autonomous Independent and delete everything, then arrange your SubVI's as you wish. Wire the flow inputs and outputs of each to each other, and since there is a data wire between the VI's LabVIEW will always follow in that sequence. All of your SubVI's must have this flow wire, so you can string the flow wire around in the order you want. This is basically like putting your code in a Flat Sequence Structure.

The picture shows what I mean.

Notes -
*If you create a new VI and want to add inputs to use it as a SubVI, you can go to the front panel, right-click on the icon and say "Show Connector". Then, you can click on the connector position you want then click on the front-panel control or indicator, and it will link that control or indicator to that connector position.
*The flow wire can be any data type you want, I used Double because I like orange.

ninjasquid 21-02-2010 19:20

Re: autonomous programing for lab view
 
Okay that is what we are trying to do, link up the different sub VI's within Autonomous independent/using the Watchdog FEED and delay dealio.

But what is confusing is that I don't see Autonomous Independent anywhere in the Robot Main VI. How does that get called up to run as the autonomous code in place of Autonomous Iterative?

Thank you very much!

Greg McKaskle 21-02-2010 21:00

Re: autonomous programing for lab view
 
The code is launched inside of Get Mode, when the transition to autonomous begins. Get Mode is also where the autonomous independent is aborted at the end of autonomous. To do this it uses something called the VI Server, a bunch of objects, properties, and interfaces for controlling the LV editor and runtime.

If you want more detail, let me know.
Greg McKaskle

ninjasquid 21-02-2010 21:09

Re: autonomous programing for lab view
 
Okay, i think that kind of makes sense.

But i still don't understand entirely what i need to DO to make sure Autonomous Independent runs, rather than Autonomous Iterative.

If I leave Autonomous Iterative blank then will it automatically run Autonomous Independent?

Greg McKaskle 21-02-2010 21:39

Re: autonomous programing for lab view
 
The setting is inside of Begin.vi. There is an enum with two choices, iterative and independent. In fact, the framework calls iterative for each packet, even while independent is running. Because of the case statement, switching on the auto type, it will normally execute only the team code placed in independent.

Greg McKaskle


All times are GMT -5. The time now is 01:55.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi