![]() |
Listener from VisionThread? What do I put in this?
This is our first year of vision processing. I am trying to figure out what goes in for the "listener" portion for the VisionThread.
Code:
visionThread = new VisionThread(server, new GripPipeline(),?){ |
Re: Listener from VisionThread? What do I put in this?
The listener in the example is a lambda expression, or an "anonymous function". Basically, a method that's defined where it's used. It's similar to an anonymous class, but is more succinct.
Code:
visionThread = new VisionThread(camera, new GripPipeline(), pipeline -> {Code:
visionThread = new VisionThread(camera, new GripPipeline(), new VisionRunner.Listener<GripPipeline>() { |
Re: Listener from VisionThread? What do I put in this?
Thank you for your reply the only thing that doesn't work is my camera is a camera server of type CameraServer. What do I do? Here is my complete Robot.java class code.
Code:
// RobotBuilder Version: 2.0 |
Re: Listener from VisionThread? What do I put in this?
Quote:
|
Re: Listener from VisionThread? What do I put in this?
Don't copy-paste code that someone gives as an example and expect it to work.
And definitely don't copy and paste it into a program and then ask someone if it works before you even try to run it. It's lazy and very few people will be willing to help you. |
Re: Listener from VisionThread? What do I put in this?
I know. I am asking what to do to change the code from CameraServer to UsbCamera so it works.
|
Re: Listener from VisionThread? What do I put in this?
|
Re: Listener from VisionThread? What do I put in this?
I have seen this and read this multiple times today but, I just looked and found what I was looking for
Code:
UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();thank you guys! |
| All times are GMT -5. The time now is 09:45. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi