Go to Post Wait is that how they got there, well how does one spotlight? - AlexD744 [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 15-01-2017, 14:26
YairZiv's Avatar
YairZiv YairZiv is online now
Registered User
FRC #5951 (Makers Assemble)
Team Role: Programmer
 
Join Date: Oct 2016
Rookie Year: 2016
Location: Tel Aviv, Israel
Posts: 34
YairZiv is an unknown quantity at this point
VisionThread Listener?

Hello, this year my team and I want to try using vision assistance in our code. We have created an opencv program to find what we're looking for but we don't understand how to use it. When we tried constructing a VisionThread object, the last parameter was a listener of a type that extends VisionPipeline. Where do I find that? Or how do I create one? Thanks in advence. Yair Ziv from team MA 5951.
Reply With Quote
  #2   Spotlight this post!  
Unread 15-01-2017, 22:30
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: VisionThread Listener?

The listener is more or less a function that gets called every time the pipeline runs. You can write it as a lambda:

Code:
VisionThread visionThread = new VisionThread(usbCamera, myPipeline, () -> {
        // listener code here
    });
Otherwise you just have a class that implements VisionRunner.Listener. The lambda is good because it makes synchronization easier (see this screensteps page)
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote
  #3   Spotlight this post!  
Unread 16-01-2017, 06:03
YairZiv's Avatar
YairZiv YairZiv is online now
Registered User
FRC #5951 (Makers Assemble)
Team Role: Programmer
 
Join Date: Oct 2016
Rookie Year: 2016
Location: Tel Aviv, Israel
Posts: 34
YairZiv is an unknown quantity at this point
Re: VisionThread Listener?

Quote:
Originally Posted by SamCarlberg View Post
The listener is more or less a function that gets called every time the pipeline runs. You can write it as a lambda:

Code:
VisionThread visionThread = new VisionThread(usbCamera, myPipeline, () -> {
        // listener code here
    });
Otherwise you just have a class that implements VisionRunner.Listener. The lambda is good because it makes synchronization easier (see this screensteps page)
This gives me an error saying: "The constructor VisionThread(CameraServer, VisionImplementation(A class I've created that extends VisionPipeline), () -> {}) is not defined.". What am I doing wrong?
Reply With Quote
  #4   Spotlight this post!  
Unread 16-01-2017, 07:04
YairZiv's Avatar
YairZiv YairZiv is online now
Registered User
FRC #5951 (Makers Assemble)
Team Role: Programmer
 
Join Date: Oct 2016
Rookie Year: 2016
Location: Tel Aviv, Israel
Posts: 34
YairZiv is an unknown quantity at this point
Re: VisionThread Listener?

NVM, found the problem, the problem was not in the listener, it was that CameraServer does not extend VideoSource , should have found the solution earlier. Thanks for helping though!
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:35.

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