Go to Post Ahhh. The Grammar Fairy strikes again! - Cynette [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 20-01-2017, 14:14
neilmart neilmart is offline
Registered User
FRC #2130
 
Join Date: Jan 2016
Location: idaho
Posts: 4
neilmart is an unknown quantity at this point
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.
Reply With Quote
  #2   Spotlight this post!  
Unread 20-01-2017, 15:12
Vyrotek's Avatar
Vyrotek Vyrotek is offline
Registered User
AKA: Jason
FRC #0498 (Cobra Commanders)
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Arizona
Posts: 28
Vyrotek is an unknown quantity at this point
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.

Last edited by Vyrotek : 20-01-2017 at 15:17.
Reply With Quote
  #3   Spotlight this post!  
Unread 21-01-2017, 16:53
SamCarlberg's Avatar
SamCarlberg SamCarlberg is offline
GRIP, WPILib. 2084 alum
FRC #2084
Team Role: Mentor
 
Join Date: Nov 2015
Rookie Year: 2009
Location: MA
Posts: 151
SamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to behold
Re: Yet Another GRIP Request

Tick the "Implement WPILib VisionPipeline" box when you're generating code.
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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