Hi I am from team #4776 ScotsBots and I need help programming the grip. So when I look on WPILIB in the using generated code section there was a code that I copied and pasted in my Robot Initializer class which is this:
@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();
drive = new RobotDrive(1, 2);
}
So when I did that new Pipeline() showed up as an error on this line
visionThread = new VisionThread(camera, new Pipeline(), pipeline -> {
and I do not know how to resolve this issue and everything else works though, it is just that one variable. Also I do not have com.ctre.CANTalon imported to my file so would that be a problem? If there is anyone who has an idea out there or a suggestion please reply to this thread.
Thank You,
ScotsBots#4776