Go to Post Let's see. There's the Dean of Students, the Dean of Admissions, The Dean of Engineering, and the Dean of Kamen? Sometimes known as the Denim Dean. - Bill_B [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 14-01-2017, 12:53
randy_pham randy_pham is offline
Registered User
FRC #0498 (Cobra Commanders)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: Arizona
Posts: 7
randy_pham is an unknown quantity at this point
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 are getting this error: The constructor VisionThread(UsbCamera, Pipeline, (<no type> pipeline) -> {}) is undefined.

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.
Reply With Quote
  #2   Spotlight this post!  
Unread 14-01-2017, 12:59
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: 136
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: GRIP example code compile error

Does the Pipeline class implement the VisionPipeline interface? eg

Code:
public class Pipeline implements VisionPipeline {
...
}
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote
  #3   Spotlight this post!  
Unread 14-01-2017, 13:49
randy_pham randy_pham is offline
Registered User
FRC #0498 (Cobra Commanders)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: Arizona
Posts: 7
randy_pham is an unknown quantity at this point
Re: GRIP example code compile error

Thank you, that fixed our problem! :0)
Reply With Quote
  #4   Spotlight this post!  
Unread 14-01-2017, 14:00
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: 136
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: GRIP example code compile error

Glad to hear! Next time, make sure to tick the "Implement WPILib VisionPipeline" button in the code generation settings
__________________
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 12:34.

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