Thread: Vision
View Single Post
  #1   Spotlight this post!  
Unread 23-01-2017, 17:02
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: 161
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

Depends what you're trying to accomplish. I'll note that the post-processing you're doing in the lambda assumes the first contour it sees is one of the boiler stripes, which may not always be the case.

centerX() should synchronize on the lock, otherwise the main robot thread may not get the most recent values (or any values at all. Threads are weird that way).

Code:
public double centerX() {
  synchronized (imgLock) {
    return centerX;
  }
}
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote