Autonomus Only Runs One Iteration Issue

Our team is trying to program an autonomous that simply spins a wheel and the activate a pneumatic ram 3 times. However, all we are doing is spinning the wheel and that is it.

Does this years autonomous only run itself once and that is it or is there a way to make it loop so we can use state machines in it or at least perform all the steps in a flat sequence box?

Are you using SimpleRobot or IterativeRobot?

If iterative robot, make sure all your code that you want to run in a loop is in autonomousPeriodic()

If simple robot, you may want to wrap all your code in a while loop with the condition isAutonomous() && isEnabled() Note the “i” in “is” is capitalized in C++, lowercase in Java.

You’re missing one important piece of information, the programming language you are using. 4ndr3wl answers apply to C++ and Java.

Since you mention a flat sequence, I think you are probably using LabVIEW. For LabVIEW, autonomous independent only runs once, but you may put a while loop or for loop or a flat sequence structure to control your execution.

Joe’s correct, it’s perfectly acceptable to put a loop in Autonomous Independent. Even if it doesn’t finish execution by the time autonomous is over, the VI will be aborted.

Have you checked to see if the solenoid valve was firing? Did you have pressure, was your release valve open?

Could we see your code?

Thank you for the pointers. We are using LabVIEW and below is the snippet of code that isn’t working. We are only getting to the first box and then nothing else. Any ideas on whether this should or not and why?





I think that if you run under the debugger – open Robot Main and press the run button – you will see that the code is indeed running. Open the diagram and probe the refnum in the frames, or turn on execution highlighting.

To identify why it doesn’t seem to be running, look for an error message about your solenoid or verify that the configuration matches the robot.

Greg McKaskle