|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
GRIP example code compile error
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 have included Pipeline.java in our package. The errors seems to be withing the listener lambda. We are using java 1.8 in eclipse. |
|
#2
|
||||
|
||||
|
Re: GRIP example code compile error
Does the Pipeline class implement the VisionPipeline interface? eg
Code:
public class Pipeline implements VisionPipeline {
...
}
|
|
#3
|
|||
|
|||
|
Re: GRIP example code compile error
Thank you, that fixed our problem! :0)
|
|
#4
|
||||
|
||||
|
Re: GRIP example code compile error
Glad to hear! Next time, make sure to tick the "Implement WPILib VisionPipeline" button in the code generation settings
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|