Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Yet Another GRIP Request (http://www.chiefdelphi.com/forums/showthread.php?t=153971)

neilmart 20-01-2017 14:14

Yet Another GRIP Request
 
Hello! I have some questions regarding GRIP, and how to implement its pipeline to find the center of rectangles. I've essentially copied the example on screensteps live, and I've had some issues calling parts of the auto -generated GripPipeline class. I'll post the code and the error below, and if anyone has had this problem before and resolved it I would be incredibly appreciative.

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);
}

Upon writing this, I get an error that reads "The constructor VisionThread(UsbCamera, Pipeline, (<no type> pipeline) -> {}) is undefined" As far as I can tell, pipeline should be a part of wpilib yet seems to lack any documentation among its library.

Again, any help would be greatly appreciated, thank you for your time.

Vyrotek 20-01-2017 15:12

Re: Yet Another GRIP Request
 
We had this same issue. We had forgot to alter the generated Pipeline class to inherit from VisionPipeline.

Code:

public class GripPipeline implements VisionPipeline { ...
Also, don't forget to add a package declaration in your generated GripPipeline class file as well.

SamCarlberg 21-01-2017 16:53

Re: Yet Another GRIP Request
 
Tick the "Implement WPILib VisionPipeline" box when you're generating code.


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

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