Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Autonomous auto stopping (http://www.chiefdelphi.com/forums/showthread.php?t=114830)

Merfoo 10-03-2013 18:01

Autonomous auto stopping
 
At regionals does fms enable autonomous then disable disable autonomous? So that if you had an autonomous 20 secs long only 15 secs of it will execute, or will the whole thing execute and you would get a penalty?

joelg236 10-03-2013 18:47

Re: Autonomous auto stopping
 
Nope. FMS just tells your program "Hey, your teleop now!". Your program doesn't need to respond in any way. Your robot could be fully autonomous if you really wanted to.

Merfoo 10-03-2013 18:51

Re: Autonomous auto stopping
 
So if the autonomous was 20 secs only 15 would be executed then.

joelg236 10-03-2013 19:03

Re: Autonomous auto stopping
 
Quote:

Originally Posted by Merfoo (Post 1246136)
So if the autonomous was 20 secs only 15 would be executed then.

No. Autonomous (at least in Java) will run until it is finished. There is no way a method's execution can be "stopped".

Merfoo 10-03-2013 19:11

Re: Autonomous auto stopping
 
Ok thanks!

F22Rapture 10-03-2013 19:38

Re: Autonomous auto stopping
 
Would just like to point out that if you're using the Command-based template there is a line in the RobotMain class under TeleopInit() that cancels the autonomous command. If you want it to keep running, delete that line.

Ginto8 10-03-2013 22:27

Re: Autonomous auto stopping
 
If you're using the Iterative template as it's intended (meaning periodic() doesn't hang), then your autonomous mode code will be automatically stopped when you leave autonomous mode. In the Command-based setup, since the Scheduler handles running everything, you have to make sure you cancel any Commands if you don't want them to keep running (the default template does this). SimpleRobot gives absolute control, and it makes it your responsibility as the programmer to check for the current mode and exit when necessary.

CodeYeti 11-03-2013 16:26

Re: Autonomous auto stopping
 
Quote:

Originally Posted by joelg236 (Post 1246145)
No. Autonomous (at least in Java) will run until it is finished. There is no way a method's execution can be "stopped".

Well, if you really wanted to design it this way, then you could have things running in threads, then interrupt them, or set a boolean and have them return. That was part of my team's architecture last year.


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

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