Go to Post You can never have enough teamwork. - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 12-01-2016, 08:30
gbear605's Avatar
gbear605 gbear605 is offline
Scarebear
FRC #1768 (Nashoba Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2014
Location: United States
Posts: 31
gbear605 is an unknown quantity at this point
Re: We are going to Want a GRIP fourm

Agreed, there needs to be a forum
  #17   Spotlight this post!  
Unread 12-01-2016, 16:49
Ti-Gars's Avatar
Ti-Gars Ti-Gars is offline
Wizzard
FRC #3360 (Hyperion)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Sherbrooke, QC, Canada
Posts: 6
Ti-Gars is on a distinguished road
Re: We are going to Want a GRIP fourm

Quote:
Originally Posted by nightpool View Post
Can you read other types of NetworkTable values, such as from the Smart Dashboard or ones inserted manually in the NetworkTable Viewer? Sounds like your robot code isn't connecting to the same network/NT instance that your laptop is on.
I am connected to my robot while running my code. When my robot boot, I see in my Riolog :
Code:
NT: server: client CONNECTED: 10.33.60.25 port 56974
But I am not able to get my values. I am using this line of code to get them :
Code:
table = NetworkTable.getTable("/GRIP/myContoursReport");
double[] defaultValue = new double[0];
double[] areas = table.getNumberArray("area", defaultValue);
I also tried to see if he find my "key", but it doesn't see it.
Code:
System.out.println(table.containsKey("area");
We are guessing that our problem is that our robot is not able to connect to our Network Table who's on our laptop. Still, we don't know how to do it.
  #18   Spotlight this post!  
Unread 12-01-2016, 21:20
ThomasClark's Avatar
ThomasClark ThomasClark is offline
Registered User
FRC #0237
 
Join Date: Dec 2012
Location: Watertown, CT
Posts: 146
ThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud of
Re: We are going to Want a GRIP fourm

Quote:
Originally Posted by Ti-Gars View Post
I am connected to my robot while running my code. When my robot boot, I see in my Riolog :
Code:
NT: server: client CONNECTED: 10.33.60.25 port 56974
But I am not able to get my values. I am using this line of code to get them :
Code:
table = NetworkTable.getTable("/GRIP/myContoursReport");
double[] defaultValue = new double[0];
double[] areas = table.getNumberArray("area", defaultValue);
I also tried to see if he find my "key", but it doesn't see it.
Code:
System.out.println(table.containsKey("area");
We are guessing that our problem is that our robot is not able to connect to our Network Table who's on our laptop. Still, we don't know how to do it.
Can you post a screenshot of your GRIP pipeline?
  #19   Spotlight this post!  
Unread 13-01-2016, 13:45
Ti-Gars's Avatar
Ti-Gars Ti-Gars is offline
Wizzard
FRC #3360 (Hyperion)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Sherbrooke, QC, Canada
Posts: 6
Ti-Gars is on a distinguished road
Re: We are going to Want a GRIP fourm

Quote:
Originally Posted by ThomasClark View Post
Can you post a screenshot of your GRIP pipeline?
This is my pipeline


And this is what I am able to see in Network Table Viewer


It seems like we now need to use NetworkTables 3.0 (Source) I am presently importing :
Code:
import edu.wpi.first.wpilibj.networktables.Networktable;
And I don't know how to import the new ntcore library.

Last edited by Ti-Gars : 13-01-2016 at 14:48.
  #20   Spotlight this post!  
Unread 13-01-2016, 18:40
shlynfrhm shlynfrhm is offline
Registered User
FRC #3039 (Wildcat Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2012
Location: Cambridge, MA
Posts: 6
shlynfrhm is an unknown quantity at this point
Re: We are going to Want a GRIP fourm

Hey, I'm also having problems accessing the data from my NetworkTables. This is my code, and I've also imported NetworkTables before my program. I'm not able to see live publishing from GRIP to the Network Tables, has anyone been able to successfully do this and could give me an example? I followed the instructions on WPILib, but I feel as if I'm missing some code. Also, we program in command-based and I'm not sure where to implement this code in that format.

Code:
public class Robot extends SampleRobot {
    final String defaultAuto = "Default";
    final String customAuto = "My Auto";
    String autoSelected;
    SendableChooser chooser;
    NetworkTable table;
	
    /**
     * This function is run when the robot is first started up and should be
     * used for any initialization code.
     */
    public Robot() {
    	table = NetworkTable.getTable("/GRIP/myContoursReport");
    }
    public void robotInit() {
    	
        chooser = new SendableChooser();
        chooser.addDefault("Default Auto", defaultAuto);
        chooser.addObject("My Auto", customAuto);
        SmartDashboard.putData("Auto choices", chooser);
        double[] defaultValue = new double[0];
        while(true){
        	double[]areas=table.getNumberArray("area", defaultValue);
        	System.out.print("areas:");
        	for(double area:areas){
        		System.out.print(area + " ");
        	}
        	System.out.println();
        	Timer.delay(1);
        }
    }
Thanks!
Ashlyn
  #21   Spotlight this post!  
Unread 13-01-2016, 20:12
ThomasClark's Avatar
ThomasClark ThomasClark is offline
Registered User
FRC #0237
 
Join Date: Dec 2012
Location: Watertown, CT
Posts: 146
ThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud of
Re: We are going to Want a GRIP fourm

Quote:
Originally Posted by Ti-Gars View Post
Quote:
Originally Posted by shlynfrhm View Post
Not sure if this will make a difference, but maybe try using "GRIP/myContoursReport" as the table name instead of "/GRIP/myContoursReport".
__________________
GRIP (Graphically Represented Image Processing) - rapidly develop computer vision algorithms for FRC
  #22   Spotlight this post!  
Unread 13-01-2016, 20:26
cpapplefamily cpapplefamily is offline
Registered User
FRC #3244 (Granite City Gearheads)
Team Role: Mentor
 
Join Date: May 2015
Rookie Year: 2015
Location: Minnesota
Posts: 243
cpapplefamily has a spectacular aura aboutcpapplefamily has a spectacular aura about
Re: We are going to Want a GRIP fourm

Quote:
Originally Posted by jojoguy10 View Post
Their Wiki on GitHub is also very useful. Here is the section on running the algorithm on the RoboRIO: https://github.com/WPIRoboticsProjec...an-FRC-program
That link is no help currently.
  #23   Spotlight this post!  
Unread 13-01-2016, 20:56
shlynfrhm shlynfrhm is offline
Registered User
FRC #3039 (Wildcat Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2012
Location: Cambridge, MA
Posts: 6
shlynfrhm is an unknown quantity at this point
Re: We are going to Want a GRIP fourm

Quote:
Originally Posted by ThomasClark View Post
Not sure if this will make a difference, but maybe try using "GRIP/myContoursReport" as the table name instead of "/GRIP/myContoursReport".
I changed it and it had no effect. Does anyone know of teams with code releases who have successfully implemented GRIP?
  #24   Spotlight this post!  
Unread 13-01-2016, 21:19
cad321 cad321 is offline
Jack of all trades, Master of none
AKA: Brian Wagg
FRC #2386 (Trojans)
Team Role: Alumni
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Burlington, Ontario
Posts: 325
cad321 is just really nicecad321 is just really nicecad321 is just really nicecad321 is just really nice
Re: We are going to Want a GRIP fourm

Quote:
Originally Posted by shlynfrhm View Post
I changed it and it had no effect. Does anyone know of teams with code releases who have successfully implemented GRIP?
That will be a tough thing to find right now as GRIP is new for this season. I am unaware of any public code releases using it at the moment.
  #25   Spotlight this post!  
Unread 13-01-2016, 22:50
Juxttech Juxttech is offline
Registered User
FRC #4918
 
Join Date: Nov 2015
Location: Port Townsend, Washington
Posts: 5
Juxttech is an unknown quantity at this point
Re: We are going to Want a GRIP fourm

Hey everyone, we're trying to get our GRIP deployed to the roboRIO (using its ip address 172.22.11.2 and our team number 4918) but every time we try to deploy it, GRIP says "failed to connect". Any reason why it might be doing this?
  #26   Spotlight this post!  
Unread 14-01-2016, 00:32
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 248
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: We are going to Want a GRIP fourm

Quote:
Originally Posted by shlynfrhm View Post
I changed it and it had no effect. Does anyone know of teams with code releases who have successfully implemented GRIP?
I just tried your exact code using "GRIP/myContoursReport" (with no leading "/") and it works for me. When run with a leading "/" it doesn't work, because NetworkTable.getTable() unconditionally prepends "/" to the name you provide it.

As a side note, you really should put the operational part of your code into robotMain() instead of robotInit(), because FRCNetworkCommunication isn't getting initialized this way (you'll note it's not possible to enable your robot and the driver station says "no robot code" because you're never exiting robotInit).
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)

Last edited by Peter Johnson : 14-01-2016 at 00:34.
  #27   Spotlight this post!  
Unread 14-01-2016, 00:36
cpapplefamily cpapplefamily is offline
Registered User
FRC #3244 (Granite City Gearheads)
Team Role: Mentor
 
Join Date: May 2015
Rookie Year: 2015
Location: Minnesota
Posts: 243
cpapplefamily has a spectacular aura aboutcpapplefamily has a spectacular aura about
Re: We are going to Want a GRIP fourm

I got something to not fail by using the roboRIO.####-FRC.local in the advanced tab of deploy for an address. I then added the line
Code:
Runtime.getRuntime().exec(new String[]{"/usr/local/frc/JRE/bin/java", "-jar", "grip.jar", filename});
To my robotinit both with and without starting the image streaming but with no luck. Nothing posting to the network tables from the roborio. The code did post to the network table when grip running on my pc.

One of these days someone's going to crack this and get it working I hope they share with the rest of us. I would still like to find out how to:
1: deploy to the rio
2: use the driver station to process the usb cam

I do see my cam name is "cam1" but in grip its cam0 when plugged into the pc. All my searching on how to force the roborio cam name to cam0 resulted in just use the name it was assigned.

Last edited by cpapplefamily : 14-01-2016 at 00:44. Reason: type on a crapple I men Apple I pad
  #28   Spotlight this post!  
Unread 14-01-2016, 00:40
cpapplefamily cpapplefamily is offline
Registered User
FRC #3244 (Granite City Gearheads)
Team Role: Mentor
 
Join Date: May 2015
Rookie Year: 2015
Location: Minnesota
Posts: 243
cpapplefamily has a spectacular aura aboutcpapplefamily has a spectacular aura about
Re: We are going to Want a GRIP fourm

I also browsed the roborio for mygripprogram.grip on the rio using sftp utility as discussed on how to add files to the robot but don't know where to look.
  #29   Spotlight this post!  
Unread 14-01-2016, 09:53
jmguillemette jmguillemette is offline
Registered User
FRC #4525
 
Join Date: Jan 2016
Location: London Ontario Canada
Posts: 8
jmguillemette is an unknown quantity at this point
Re: We are going to Want a GRIP fourm

Hi Everyone,

My team has succeeded at making a GRIP vision script, loading it to the RIO and getting the values out of the network tables.

the only thing that i now want to do is be able to controll the launching and stopping of grip from my code (instead of using the GRIP UI application)

some things we tripped on getting this this point:
-The Grip deploy process
---when you deploy make sure your settings are your robot's address
---after you deploy there is a delay (about a min) then a NEW button appears just above the deploy log window (it looks like the "play" triangle) Push this button to run the GRIP process in headless mode on the rio..
No data will be published to the network tables till you do this step.

NetworkTables
---Despite the fact i told my last step in the GRIP script to publish to "Vision" which would translate to "GRIP/Vision" in networkTables .. it didnt use my value.. instead only the default value provided by the step appears to work.

in out case this was a contours publish so its "GRIP/myContoursReport"

Another Note:
GRIP will have dedicated control of the camera.. Any attempts to stream the camera after grip has started will failed with an "in use" error. If your already streaming its likely grip wont be able to access the camera and will silently fail.

If any team is looking as to how to use GRIP to do targeting i would be happy to provide a plain english write up on how we are approaching this problem and how you can use grip to solve it.

Last edited by jmguillemette : 14-01-2016 at 09:56. Reason: Typos.. many typos...
  #30   Spotlight this post!  
Unread 14-01-2016, 10:13
cpapplefamily cpapplefamily is offline
Registered User
FRC #3244 (Granite City Gearheads)
Team Role: Mentor
 
Join Date: May 2015
Rookie Year: 2015
Location: Minnesota
Posts: 243
cpapplefamily has a spectacular aura aboutcpapplefamily has a spectacular aura about
Re: We are going to Want a GRIP fourm

Quote:
Originally Posted by jmguillemette View Post
Hi Everyone,

My team has succeeded at making a GRIP vision script, loading it to the RIO and getting the values out of the network tables.

the only thing that i now want to do is be able to controll the launching and stopping of grip from my code (instead of using the GRIP UI application)

some things we tripped on getting this this point:
-The Grip deploy process
---when you deploy make sure your settings are your robot's address
---after you deploy there is a delay (about a min) then a NEW button appears just above the deploy log window (it looks like the "play" triangle) Push this button to run the GRIP process in headless mode on the rio..
No data will be published to the network tables till you do this step.

NetworkTables
---Despite the fact i told my last step in the GRIP script to publish to "Vision" which would translate to "GRIP/Vision" in networkTables .. it didnt use my value.. instead only the default value provided by the step appears to work.

in out case this was a contours publish so its "GRIP/myContoursReport"

Another Note:
GRIP will have dedicated control of the camera.. Any attempts to stream the camera after grip has started will failed with an "in use" error. If your already streaming its likely grip wont be able to access the camera and will silently fail.

If any team is looking as to how to use GRIP to do targeting i would be happy to provide a plain english write up on how we are approaching this problem and how you can use grip to solve it.
Can you clear up a few steps leading up to this.
1. When developing the Grip script where is the camera connected? PC/Rio USB/IP Web cam
2. On the PC what is the Camera Name? Cam0.1.2....
3. If USB what is the USB camera name when viewing the WebDashboard?
4. What is the Deploy address you are useing?


I have never waited for the PC deploy and didn't know I would have an option to start the script on the Robot from the PC. I'll check that out.

As for starting the GRIP Wiki say to add this to start the app with the robot.
For stopping I don't have an answer but I can see a need.

JAVA:
Code:
Runtime.getRuntime().exec(new String[]{"/usr/local/frc/JRE/bin/java", "-jar", "grip.jar", filename});
Can we not stream and us Grip at the same time?

Last edited by cpapplefamily : 14-01-2016 at 10:18. Reason: Added the Java Tag for start code
Closed Thread


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:14.

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