Quote:
Originally Posted by Zme
since i was mentioned i thought i should write in and describe what we did for teams that could be having a similar issue
in the beginning of the autonomous independent (before any loops) we got the tick count (in ms) and added 14500 to it, then inside of each loop it would get the tick count and compare it to that, if it was greater than it then the exit condition became true and it went on with the show, the extra 8 seconds there is being used up by the setup they used for autonomous (they have some wait commands in there and it has to cycle through all of the iterations before it will exit.)
It is a really roundabout way of doing things thought, any chance that for next year the labview side of things could get a IsOperatorControl() function so that it could be used to exit out of the loops if it switches over to teleop? i know it has saved our team more than once with runaway code
|
You didn't say what language you are using.
As mentioned earlier in this thread, the LabVIEW framework automatically terminates autonomous independent when teleop is commanded.
Since you are adding code to exit from autonomous when time is up, I assume you are using C or Java.
If such is the case, why don't you break out of the code immediately when the tick count reaches the target, rather than letting the code "cycle through all of the iterations before it will exit" ?
~