Go to Post The biggest thing is you don't have to make your robot like another teams. Come up with something unique and go from there. RAISE THE BAR..... - camtunkpa [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 25-01-2017, 08:02
MarlyM64 MarlyM64 is offline
Registered User
FRC #1660 (Harlem Knights)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: New York City
Posts: 2
MarlyM64 is an unknown quantity at this point
Need NetworkTables to update??(Grip)

How do I get the NetworkTables to update when the camera is plugged into the roboRio? (Grip related issue)

When the camera USB is plugged into the computer our networkTables update fine, and the GripPipeline code that Grip generated works fine, but we cannot get grip to publish networkTables that update when the camera is connected to the robot.
Reply With Quote
  #2   Spotlight this post!  
Unread 25-01-2017, 10:32
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: Need NetworkTables to update??(Grip)

GRIP only generates the vision processing code. You have to write the NetworkTables part.

If you take a look at this screensteps page, you can publish to NetworkTables inside the callback in the second code block. Something like

Code:
visionThread = new VisionThread(camera, new Pipeline(), pipeline -> {
  ...
  centerX = ...
  centerY = ...
  NetworkTables.getTable("vision").putNumber("centerX", centerX);
  NetworkTables.getTable("vision").putNumber("centerY", centerY);
});
We should also have an example for sending results to the SmartDashboard up in the next few days.
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote
  #3   Spotlight this post!  
Unread 25-01-2017, 14:14
MarlyM64 MarlyM64 is offline
Registered User
FRC #1660 (Harlem Knights)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: New York City
Posts: 2
MarlyM64 is an unknown quantity at this point
Re: Need NetworkTables to update??(Grip)

yes i have code similar to i, but it still won't work ._.



visionThread = new VisionThread(camera, new GripPipeline(), pipeline -> {
if (!pipeline.filterContoursOutput().isEmpty()) {

System.out.println(pipeline.filterContoursOutput() .get(0));
//SmartDashboard.putNumber("opencv",pipeline.filterC ontoursOutput().get(0));
table = NetworkTable.getTable("GRIP/marly");

double[] def = new double[0];
double[] areas = table.getNumberArray("width", def);
System.out.println(areas[0]);
}
});
visionThread.start();
Reply With Quote
  #4   Spotlight this post!  
Unread 25-01-2017, 14:24
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: Need NetworkTables to update??(Grip)

You're doing vision processing, but not using the results. You need to be putting values into the table.
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote
  #5   Spotlight this post!  
Unread 25-01-2017, 16:44
wlogeais wlogeais is offline
Registered User
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2016
Rookie Year: 2011
Location: Minnesota
Posts: 18
wlogeais is an unknown quantity at this point
Re: Need NetworkTables to update??(Grip)

Quote:
Originally Posted by MarlyM64 View Post
yes i have code similar to i, but it still won't work ._.


if (!pipeline.filterContoursOutput().isEmpty()) {

System.out.println(pipeline.filterContoursOutput() .get(0));
//SmartDashboard.putNumber("opencv",pipeline.filterC ontoursOutput().get(0));
Seems to me your goal is really how to 'get' and display?

if (!pipeline.filterContoursOutput().isEmpty()) {
Rect r = Imgproc.boundingRect(pipeline.filterContoursOutput ().get(0));
SmartDashboard.putString("opencv", "at (" + r.x + ',' + r.y + ')' );
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 13:22.

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