Log in

View Full Version : Autonomus Only Runs One Iteration Issue


wre136
29-03-2013, 12:05
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?

Andrew Lobos
29-03-2013, 12:13
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.

Joe Ross
29-03-2013, 12:19
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?

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.

John Sabath
29-03-2013, 14:44
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.

http://i.imgur.com/0zsaNn2.png

Gregor
29-03-2013, 22:12
Have you checked to see if the solenoid valve was firing? Did you have pressure, was your release valve open?

Kusha
29-03-2013, 22:26
Could we see your code?

wre136
30-03-2013, 22:12
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?

Greg McKaskle
31-03-2013, 07:46
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