Code:
@Override
public void robotInit() {
UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();
camera.setResolution(IMG_WIDTH, IMG_HEIGHT);
visionThread = new VisionThread(camera, new Pipeline(), pipeline -> {
if (!pipeline.filterContoursOutput().isEmpty()) {
Rect r = Imgproc.boundingRect(pipeline.filterContoursOutput().get(0));
synchronized (imgLock) {
centerX = r.x + (r.width / 2);
}
}
});
visionThread.start();
}
We are getting this error: The constructor VisionThread(UsbCamera, Pipeline, (<no type> pipeline) -> {}) is undefined.
We have included Pipeline.java in our package. The errors seems to be withing the listener lambda. We are using java 1.8 in eclipse.