Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Autonomus Only Runs One Iteration Issue (http://www.chiefdelphi.com/forums/showthread.php?t=115560)

wre136 29-03-2013 12:05

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?

Andrew Lobos 29-03-2013 12:13

Re: Autonomus Only Runs One Iteration Issue
 
Quote:

Originally Posted by wre136 (Post 1254225)
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

Re: Autonomus Only Runs One Iteration Issue
 
Quote:

Originally Posted by wre136 (Post 1254225)
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

Re: Autonomus Only Runs One Iteration Issue
 
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.


Gregor 29-03-2013 22:12

Re: Autonomus Only Runs One Iteration Issue
 
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

Re: Autonomus Only Runs One Iteration Issue
 
Could we see your code?

wre136 30-03-2013 22:12

Re: Autonomus Only Runs One Iteration Issue
 
1 Attachment(s)
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

Re: Autonomus Only Runs One Iteration Issue
 
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


All times are GMT -5. The time now is 03:10.

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