Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Autonomous runs during Teleop (http://www.chiefdelphi.com/forums/showthread.php?t=83951)

garrettg 07-03-2010 11:54

Autonomous runs during Teleop
 
Our team's robot will run in teleop just fine, and autonomous will work just fine too, but then it won't go back to teleop. It will say it's in teleop, but it is still moving like in autonomous. So, in the practice match on the DS, autonomous runs fine, then autonomous period ends and teleop period begins, but the driver has no control over the robot because it is still running in autonomous.

I am using autonomous independant, and all i changed in Begin.vi is replacing iteritive with independant.

Any ideas on why this is happening, and/or how to fix it?
Great appreciation in advance.

airnate 07-03-2010 21:37

Re: Autonomous runs during Teleop
 
Any chance you can share code, either screen shots or actual VIs?

Greg McKaskle 07-03-2010 21:55

Re: Autonomous runs during Teleop
 
If this is reproducible, PM me and I'd like to determine what the issue is.

Greg McKaskle

ideasrule 07-03-2010 22:21

Re: Autonomous runs during Teleop
 
This may be a complete red herring, but I noticed in Java that an infinite loop in autonomous will continue running if teleop is enabled after autonomous is enabled.

Greg McKaskle 07-03-2010 23:11

Re: Autonomous runs during Teleop
 
I've seen teams place calls to their autonomous code other places in the framework. I don't know why this happened, they either did it accidentally or thought it was better that way. Anyway, again, either post here or PM and we'll arrange to email.

Greg McKaskle

Ether 08-03-2010 00:20

Re: Autonomous runs during Teleop
 
Using the LabVIEW framework, if autonomous independent exceeds 15 seconds, will it continue to execute when FMS changes to teleop?

Our LabVIEW programmer tells me "No", but I thought I recalled seeing something in the documentation warning that the answer is "Yes". Maybe I was reading the Java or C++ documents.


~

jhersh 08-03-2010 01:48

Re: Autonomous runs during Teleop
 
Quote:

Originally Posted by Ether (Post 933372)
Using the LabVIEW framework, if autonomous independent exceeds 15 seconds, will it continue to execute when FMS changes to teleop?

Our LabVIEW programmer tells me "No", but I thought I recalled seeing something in the documentation warning that the answer is "Yes". Maybe I was reading the Java or C++ documents.

If you are running Autonomous Independent, the LabVIEW framework will stop your autonomous VI when the autonomous period ends, even if it's not done. I do not believe that Java or C++ will do this for you (when using the "SimpleRobot" framework).

Greg McKaskle 08-03-2010 08:00

Re: Autonomous runs during Teleop
 
LV will abort the VI that imlements auto independent. If the VI calls into a .out that never returns, then it cannot be aborted, but it is unlikely that is happening.

Greg McKaskle

garrettg 09-03-2010 21:23

Re: Autonomous runs during Teleop
 
1 Attachment(s)
Sorry about taking so long, but here's my autonomous.
It still stays in autonomous, but if I keep both the photosensor and the limit switch for the kicker returning true, it will go to teleop. Largest case strucure true will run once in autonomous, then once in teleop before finally relenquishing control to teleop. The best I can tell is it gets stuck in a loop, finishes early, and repeats autonomous again. Any ideas?

kickerlimit is a limit switch for the kicker, true means it's ready to kick
solenoid push true will kick
solenoid pull true will wind kicker
laser is a photosensor to tell if a ball is present
switcha and b are part of a 3-way switch for autonomous selection

Hope this is enough information.

Ether 12-03-2010 17:50

Re: Autonomous runs during Teleop
 
Quote:

Originally Posted by Ether (Post 933372)
Using the LabVIEW framework, if autonomous independent exceeds 15 seconds, will it continue to execute when FMS changes to teleop?

Our LabVIEW programmer tells me "No", but I thought I recalled seeing something in the documentation warning that the answer is "Yes". Maybe I was reading the Java or C++ documents.

Aha. I found it while sorting through a pile of papers:

"The Autonomous method will not quit running until it exits, so it will continue to run through the TeleOp period unless it finishes by the end of the Autonomous period."

The above excerpt is from Page 15 of a document dated 15 Sep 2008 in section "Built-in Robot Classes". I don't have the doc title or the link. I believe it may be the WPI Library tutorial.

Note: The LabVIEW Framework is different, or so I am told. It will abort the Autonomous independent when the 15 seconds expires.


~

garrettg 13-03-2010 21:25

Re: Autonomous runs during Teleop
 
I got the problem resolved right after qualification matches today (I know, it's late) and the problem was it was hanging in a while loop, and it didn't want to kick out. With the help of Matt from team 2619, we added a tick count, and used that to kill the while loops. Now, if executed just right, autonomous will not give the user control for (up to) the first 8-ish seconds, but the team is OK with that for right now. Too bad chain keeps popping off and our wheel brackets are bending... :p

Zme 14-03-2010 01:17

Re: Autonomous runs during Teleop
 
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

Racer26 14-03-2010 01:32

Re: Autonomous runs during Teleop
 
I know the C++ flavour of WPILib has IsAutonomous() and IsOperatorControl()... theres no LabVIEW equivalent?

Zme 14-03-2010 01:42

Re: Autonomous runs during Teleop
 
not one that i can easily find (mind you we used c++ for our robot)

there are some that we can find but the issue is that they require inputs to work correctly which means that they need constantly updated inputs which can be tricky with the autonomous independent because it is only called once

Ether 14-03-2010 09:03

Re: Autonomous runs during Teleop
 
Quote:

Originally Posted by Zme (Post 936655)
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" ?


~


All times are GMT -5. The time now is 04:32.

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