|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#31
|
||||
|
||||
|
Re: Autonomous runs during Teleop
OK Greg, the ball's in your court :-)
~ |
|
#32
|
|||||
|
|||||
|
Re: Autonomous runs during Teleop
Quote:
For any others having this problem this is a good first thing to check. To use Autonomous Independent, the only thing you have to do is make sure that the enum at the top of Begin.VI is set to Independent and then place your code inside the existing Autonomous Independent VI accessed from the Project Explorer. |
|
#33
|
||||
|
||||
|
Re: Autonomous runs during Teleop
Quote:
Do you know if there's a document somewhere which clearly explains this? If so, I want to make sure our programmers go read it thoroughly. They're working on autonomous now. Thanks. ~ |
|
#34
|
|||
|
|||
|
Re: Autonomous runs during Teleop
So I should replace auto indep in robot main with the iteritive VI, and then that code should work?
|
|
#35
|
|||
|
|||
|
Re: Autonomous runs during Teleop
that, and from what it sounds like, make sure that the begin.vi states that you are using the autonomous independent function instead of iteritive. this seems a little counter intuitive to me but if it works then it would save people a lot of time.
please try it and let us know how it goes |
|
#36
|
|||||
|
|||||
|
Re: Autonomous runs during Teleop
Quote:
Because your call was separate it was not being aborted by the Get Competition Mode VI. Ether, I will look around and see if this is spelled out in any documentation I have at the moment or not. I learned a lot of this through reading the comments that are in the default code and poking around inside some of the VIs such as the Get Competition Mode VI. |
|
#37
|
|||
|
|||
|
Re: Autonomous runs during Teleop
Our robot is currently out of the bag for the next hour and 45 minutes, so I will test this adjustment when build gets build problems out of the way (I might not get to try this today, but should be able to try tomorrow).
Edit: I was able to test it today, and the change of having Iteritive in Robot Main got Independent to kick out on time. I don't understand why though. Anyone mind explaining in the clearest way possible why Iteritive needs to run if you want Independent? All help given is greatly appreciated, and I doubt I'm the only one to have changed Robot Main like this. Last edited by garrettg : 15-03-2010 at 20:24. Reason: Didn't want to double post. |
|
#38
|
|||
|
|||
|
Re: Autonomous runs during Teleop
I just got home from work and looked at the code. To fix the auto that won't stop, delete the call from the Robot Main. It is not necessary to call the iterative there as it is an empty template anyway.
Begin VI is still set for using Independent, and the AutoIndependent VI is the one that it will call and abort. I'll post again with more explanation of what the framework does, why this behaved the way it did, and where the docs are. Good Luck with your auto. Greg McKaskle |
|
#39
|
|||
|
|||
|
Re: Autonomous runs during Teleop
There are tutorials on NI.com/first and on the LVMastery.com sites. I'll admit that I didn't write them, and I haven't watched all of them for correctness, but they should show how to write the autonomous that works.
The other documentation on the framework is in the code itself. The green comment to the left of the loop in RobotMain states Quote:
Back on topic, the auto was supported in two ways, independent and iterative. Iterative is basically the same as TeleOp -- called for each packet, expected to complete in under 20ms, and no easy support of sequences or repetitive code. Independent, on the other hand, is called once asynchronously, is automatically aborted when auto is over, making it east to do sequences and repetitive tasks. The way Iterative is called is pretty obvious, a subVI call for each packet. Independent is less obvious. In Begin, a VI reference is designated as being the AutoIndependent VI reference. Then the Get Mode VI in the Robot Main loop will automatically run the referenced VI when auto begins and abort it when the period completes. The syntax for calling and aborting was intentionally hidden in part because it is complicated by the different state transitions of the DS, and partly to prevent it form becoming broken by curious programmers. By adding a subVI call to Auto Independent, the Run method will return an error. It is a little complicated, but VIs have a number of states they can be in (Broken, Idle, Active, Running, Reserved, Suspended, and I'm sure more that I can't remember off the top of my head) which define the operations that are valid on the VI. Run only works on Idle VIs. SubVIs are Reserved by their caller, so are not runnable because the are callable. Anyway, For that reason, I'm pretty sure the VI refnum was invalid so that Abort also failed. To be more sure what the value of the refnum was from the failed Run, I'll need to run that app. Anyway, if there are any more questions or any more things to learn from this, fire away. Greg McKaskle |
|
#40
|
||||
|
||||
|
Re: Autonomous runs during Teleop
Our bot is definately doing the same thing but I'm Build and Chairman's team so I have no idea what you're talking about lol I'll get our programmer to look at this.
|
|
#41
|
|||
|
|||
|
Re: Autonomous runs during Teleop
If you can't find the issue, post code to this thread. There are lots of people willing to help.
Greg McKaskle |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Directions During Autonomous | helenajoy | NI LabVIEW | 2 | 22-02-2010 19:30 |
| HELP!!!! we need help w/ compressors/pneumatics for teleop/autonomous in LABVIEW | rokenboker | NI LabVIEW | 9 | 05-02-2010 17:10 |
| Scoring During Autonomous Mode | KrakatoaCoo | Rules/Strategy | 7 | 15-01-2010 16:16 |
| Labview Autonomous AND Teleop | Two-Face | Programming | 1 | 14-02-2009 18:33 |
| No Tracking During Autonomous | jdejoannis | Programming | 4 | 10-02-2007 14:46 |