Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Building a dedicated GRIP Thread (http://www.chiefdelphi.com/forums/showthread.php?t=154035)

neilmart 21-01-2017 13:41

Building a dedicated GRIP Thread
 
Our team's programmers have been hard at work trying to get GRIP to work since kickoff day, and as far as we can tell, we are one error message away from finally being able to run it in our code. We can upload the code, but when we enable it it gives us a "robots don't quit error." As far as we can can tell, this would be gone if we could figure out how to put the openCV pipeline into a dedicated thread. Anyone who's had and fixed this problem, or knows how, would be greatly appreciated.

dmelcer9 21-01-2017 16:14

Re: Building a dedicated GRIP Thread
 
You need to use VisionThread. The code to do this would look something like this:

Code:

UsbCamera camera = CameraServer.getInstance().startAutomaticCapture(...);
VisionThread vthread = new VisionThread(camera,new GeneratedGripPipeline(), new VisionListener());
vthread.start();

Of course, the VisionListener can be replaced by a Lambda if that is your style. If you already have a VisionRunner object set up, it would simply be
Code:

VisionThread vthread = new VisionThread(visionrunner);
vthread.start();



All times are GMT -5. The time now is 07:24.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi