View Single Post
  #5   Spotlight this post!  
Unread 08-03-2016, 16:36
MrRoboSteve MrRoboSteve is offline
Mentor
AKA: Steve Peterson
FRC #3081 (Kennedy RoboEagles)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Bloomington, MN
Posts: 581
MrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond repute
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.