View Single Post
  #10   Spotlight this post!  
Unread 27-11-2016, 21:05
trycatch's Avatar
trycatch trycatch is offline
Registered User
FRC #5858
 
Join Date: Nov 2015
Rookie Year: 2015
Location: AL
Posts: 22
trycatch is an unknown quantity at this point
Re: IterativeRobot, CommandRobot, or SampleRobot for brand new programmers?

Quote:
Originally Posted by virtuald View Post
That is incorrect.

Use the source, Luke.

As you can see from the source of SampleRobot, if you never return from the Autonomous function, OperatorControl will never be called. No magic here.
Yeah, I found that earlier today... if there was a way to break back out of this simply without having to constantly poll, SampleRobot would honestly be perfect. I spent a bit stewing on creating a new extension to RobotBase that would spawn killable threads for autonomous and teleop, but that would require thread.stop(), which has it's own issues. If it got killed in the middle of an i2c command, it could pick up the device it was talking to.
Reply With Quote