|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
||||
|
||||
|
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);
});
|
|
#3
|
|||
|
|||
|
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(); |
|
#4
|
||||
|
||||
|
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.
|
|
#5
|
|||
|
|||
|
Re: Need NetworkTables to update??(Grip)
Quote:
if (!pipeline.filterContoursOutput().isEmpty()) { Rect r = Imgproc.boundingRect(pipeline.filterContoursOutput ().get(0)); SmartDashboard.putString("opencv", "at (" + r.x + ',' + r.y + ')' ); |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|