View Single Post
  #7   Spotlight this post!  
Unread 09-02-2017, 00:00
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: Need NetworkTables to update??(Grip)

Code:
while (camRunning) {
This is something I've seen quite a lot of and I'm not really sure why people are doing it. The callback is called after the pipeline runs. It's intended to copy the outputs to variables the rest of the robot program can use, and maybe do a little processing on the outputs (like the bounding rects). Putting in a loop will make the vision thread run the pipeline exactly once and then enter the loop. In your case, the loop only exits if the vision thread was interrupted, which will very likely never happen. So the pipeline will never run again after that first time.

So why did you decide to add a loop? I'd like to improve the documentation so that it's clearer that this is not the right way to do this.

The Javadoc for VisionRunner.Listener, which is what that lambda is
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote