View Single Post
  #2   Spotlight this post!  
Unread 24-01-2017, 19:08
SamCarlberg's Avatar
SamCarlberg SamCarlberg is offline
GRIP, WPILib. 2084 alum
FRC #2084
Team Role: Mentor
 
Join Date: Nov 2015
Rookie Year: 2009
Location: MA
Posts: 154
SamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to behold
Re: Vision Stops Returning Numbers

You're getting an IndexOutOfBoundsException on this line.

When working with lists and arrays, you need to check that it contains an item at a given index before trying to access it. This is very important to remember for FRC, because an exception will crash your code and cause your robot to not move for the entirety of the match.

I cannot stress this enough: check the list size before trying to access anything

You also need to set centerRX and centerQX in the same synchronized block, otherwise the main thread can read one new value and one old value when it updates and you'll have junk data.
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote