Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   We are going to Want a GRIP fourm (http://www.chiefdelphi.com/forums/showthread.php?t=141097)

gbear605 12-01-2016 08:30

Re: We are going to Want a GRIP fourm
 
Agreed, there needs to be a forum

Ti-Gars 12-01-2016 16:49

Re: We are going to Want a GRIP fourm
 
Quote:

Originally Posted by nightpool (Post 1521571)
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.

ThomasClark 12-01-2016 21:20

Re: We are going to Want a GRIP fourm
 
Quote:

Originally Posted by Ti-Gars (Post 1522223)
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?

Ti-Gars 13-01-2016 13:45

Re: We are going to Want a GRIP fourm
 
Quote:

Originally Posted by ThomasClark (Post 1522370)
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.

shlynfrhm 13-01-2016 18:40

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

ThomasClark 13-01-2016 20:12

Re: We are going to Want a GRIP fourm
 
Quote:

Originally Posted by Ti-Gars (Post 1522827)

Quote:

Originally Posted by shlynfrhm (Post 1523043)

Not sure if this will make a difference, but maybe try using "GRIP/myContoursReport" as the table name instead of "/GRIP/myContoursReport".

cpapplefamily 13-01-2016 20:26

Re: We are going to Want a GRIP fourm
 
Quote:

Originally Posted by jojoguy10 (Post 1520948)
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.

shlynfrhm 13-01-2016 20:56

Re: We are going to Want a GRIP fourm
 
Quote:

Originally Posted by ThomasClark (Post 1523130)
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?

cad321 13-01-2016 21:19

Re: We are going to Want a GRIP fourm
 
Quote:

Originally Posted by shlynfrhm (Post 1523169)
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.

Juxttech 13-01-2016 22:50

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?

Peter Johnson 14-01-2016 00:32

Re: We are going to Want a GRIP fourm
 
Quote:

Originally Posted by shlynfrhm (Post 1523169)
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).

cpapplefamily 14-01-2016 00:36

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.

cpapplefamily 14-01-2016 00:40

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.

jmguillemette 14-01-2016 09:53

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.

cpapplefamily 14-01-2016 10:13

Re: We are going to Want a GRIP fourm
 
Quote:

Originally Posted by jmguillemette (Post 1523442)
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?


All times are GMT -5. The time now is 07:14.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi