|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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. |
|
#2
|
||||
|
||||
|
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 { ...
Last edited by Vyrotek : 20-01-2017 at 15:17. |
|
#3
|
||||
|
||||
|
Re: Yet Another GRIP Request
Tick the "Implement WPILib VisionPipeline" box when you're generating code.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|