Go to Post The great thing about posting questions here is everybody can see the answers. - Kevin Thorp [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 01-21-2016, 11:06 PM
mlyhoops mlyhoops is offline
Registered User
AKA: Matthew Yamamoto
FRC #1197 (TorBots)
Team Role: Alumni
 
Join Date: Dec 2012
Rookie Year: 2012
Location: Torrance
Posts: 16
mlyhoops is an unknown quantity at this point
NETWORK TABLE HELP! (ROBOREALM)

I was wondering if anyone knows how to get the Network Table values from RoboRealm to eclipse so I can use that data for vision tracking. right now we are just getting the default values for the network table. If you need a picture of the network table or the code then email me at mlyhoops@hotmail.com

Last edited by mlyhoops : 01-21-2016 at 11:14 PM.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-20-2016, 11:58 PM
faraz5557's Avatar
faraz5557 faraz5557 is offline
BB-R8ER
AKA: Faraz Masroor
FRC #5557 (BB R8ERS)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Miami, FL.
Posts: 15
faraz5557 is an unknown quantity at this point
Re: NETWORK TABLE HELP! (ROBOREALM)

Have you gotten a response? My team is having the same issues.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-21-2016, 10:56 AM
An Outlier An Outlier is offline
Registered User
AKA: Julian Bernard
FRC #5687 (The Outliers)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2015
Location: Milky Way Galexy
Posts: 31
An Outlier is an unknown quantity at this point
Re: NETWORK TABLE HELP! (ROBOREALM)

MY Team is ALSO having the same problems, only with a Raspberry PI.

We can see the NetworkTables in the LabView dashboard, but according to the code on our RoboRio, our "GRIP" Table does not exist.

We also tried sending the values to a Sub-Table, and just writing the variables in the SmartDashboard table.

No matter where we put them, the LabView dashboard COULD see them, and our RoboRio code COULD NOT.

Any help would be fantastic, our team is completely stumped.
Reply With Quote
  #4   Spotlight this post!  
Unread 02-21-2016, 10:13 PM
s-taylor s-taylor is offline
Scott Taylor
FRC #1735 (Green Reapers)
Team Role: Mentor
 
Join Date: Feb 2014
Rookie Year: 2014
Location: Auburn, MA
Posts: 22
s-taylor has a spectacular aura abouts-taylor has a spectacular aura about
Re: NETWORK TABLE HELP! (ROBOREALM)

It might be helpful to run the OutlineViewer and attach it to your networkTable and then browse the entries to see where they ended up (sometimes they have an extra or missing level of hierarchy than what you were expecting.
c:\users\<username>\wpilib\tools\OutlineViewer

set the address to roborio-####-frc.local (#### being your team number) and run the client. This will let you snoop on the data and see what's going on. If you see nothing, then it's possible that either your vision processing code isn't writing data, or is even writing it to a different table instance entirely (e.g. to localhost, instead of to the RIO's networkTable instance)

in a pinch, you can just jam data into the table that way and see if your robot code sees it-- that might get you moving on the consumption side while someone debugs the producer side in parallel...
Reply With Quote
  #5   Spotlight this post!  
Unread 02-21-2016, 10:27 PM
s-taylor s-taylor is offline
Scott Taylor
FRC #1735 (Green Reapers)
Team Role: Mentor
 
Join Date: Feb 2014
Rookie Year: 2014
Location: Auburn, MA
Posts: 22
s-taylor has a spectacular aura abouts-taylor has a spectacular aura about
Re: NETWORK TABLE HELP! (ROBOREALM)

FWIW, here's the code we were running earlier today to extract the vision data for target tracking.

in vision.java (autogenerated subsystem from RobotBuilder):
Code:
	// create a new constructor
	public Vision() {		
    // Get a pointer to the networkTable.  "StrongholdContours" is the name we entered into the publish box in GRIP
    table = NetworkTable.getTable("GRIP/StrongholdContours");
	}
and here's the actual function. We had some issues with null sets (if no contours found) and hit some race conditions where the two array reads got different sizes because of an intervening update and some noise. I hacked around those for the moment, but will have to figure something a little better. But, anyway... this did produce the right X values for left-right tracking. All the other reads were pretty much the same. the xRes variable was the pixel resolution in the X direction, which was 320 for us.

Code:
    public double getRawTargetXpos() {
    	double xPos; // return value
    	
    	// 1) Get the current list of targets found.  There might be more than one visible at a time
       	// first, get the vision system data for the target
    	double[] defaultValue = new double[0]; // set up a default value in case the table isn't published yet

    	// Get all needed table items at the same time, in case the table updates between reads.
    	// (could end up with different array sizes)
    	double[] targetX = table.getNumberArray("centerX", defaultValue);
		double[] areas = table.getNumberArray("area", defaultValue);
		if (targetX.length != areas.length) {
			// here the table updated in the middle; we'll have to punt
			System.out.println("NetworkTable udpated in the middle of getRawTargetXpos; returning first valid entry");
	    	if (targetX.length==0)
	    	{
	    		// we didn't find ANY object.  Return a perfectly centered answer so that the system doesn't
	    		// try to adapt
	    		xPos = xRes/2;
	    	}
	    	else xPos = targetX[0];
	    	return xPos;
		}
   	
    	// For initial debug, just print out the table so we can see what's going on
/*
    	System.out.print("centerX: ");
    	for (double xval : targetX) { // for each target found,
    		System.out.print(xval + " ");
    	}
    	System.out.println();
*/    	
    	
    	// 2) Choose the one that has the largest area.  This is PROBABLY the closest target (and most in-line)
    	//    Don't want to choose the one closest to the center because that might actually be the target
    	//    for a different face that's very oblique to our robot position.
		int largestIdx = 0;
    	if (targetX.length > 1) {
    		double largest = 0;
    		for (int c = 0; c < areas.length; c++) {
    			if (areas[c] > largest){
    				largest = areas[c];
    				largestIdx = c;
    			}
    		}
    	}
    	
    	if (targetX.length==0)
    	{
    		// we didn't find ANY object.  Return a perfectly centered answer so that the system doesn't
    		// try to adapt
    		xPos = xRes/2;
    	}
    	else xPos = targetX[largestIdx];
    	
    	return xPos;
    }
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 08:59 AM.

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