|
Re: Timing, threads, the Field Management System, etc
^^ true
A good mental model is to imagine there's an implicit loop around your code that gets invoked each time a packet arrives from the DS. You don't want explicit loops that repeatedly check for something as well.
You should also assume that you don't know how long it will be between invocations of your code. You can see this by logging the actual time between invocations -- that value will have quite a bit of jitter when tethered, and will be much more jittery during an actual match.
I sometimes think it would be good to add a small amount of artificial jitter to WPILib, to better simulate real conditions.
__________________
2016-17 events: 10000 Lakes Regional, Northern Lights Regional, FTC Burnsville Qualifying Tournament
2011 - present · FRC 3081 Kennedy RoboEagles mentor
2013 - present · event volunteer at 10000 Lakes Regional, Northern Lights Regional, North Star Regional, Lake Superior Regional, Minnesota State Tournament, PNW District 4 Glacier Peak, MN FTC, CMP
http://twitter.com/MrRoboSteve · www.linkedin.com/in/speterson
Last edited by MrRoboSteve : 08-03-2016 at 16:37.
Reason: added last sentence.
|