|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Autonomous auto stopping
No. Autonomous (at least in Java) will run until it is finished. There is no way a method's execution can be "stopped".
|
|
#2
|
||||
|
||||
|
Re: Autonomous auto stopping
Ok thanks!
|
|
#3
|
||||
|
||||
|
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.
|
|
#4
|
||||
|
||||
|
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.
|
|
#5
|
||||
|
||||
|
Re: Autonomous auto stopping
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|