Go to Post Breathe in and out.... *altoids mint* breathes in more... *looks at countdown until kickoff*...30 DAYS!!! *competition anxiety disorder* - Conor Ryan [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 06-02-2013, 18:01
frankthelyon frankthelyon is offline
Registered User
FRC #2557
 
Join Date: Jan 2012
Location: Tacoma
Posts: 23
frankthelyon is an unknown quantity at this point
NetworkTable Troubles

Hello, my team is trying to use NetworkTables for our robot this year, and we have run into a couple of issues. Specifically, we are trying to have a SmartDashboard widget write data to NetworkTables for the robot to access (our dashboard will process images and send data to the robot-theoretically). To test this out, I wrote a simple program following the example online that seems to work fine:

Code:
import edu.wpi.first.smartdashboard.robot.Robot;
import edu.wpi.first.wpilibj.networktables.NetworkTable;


public class NetworkTablesDesktopClient {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new NetworkTablesDesktopClient().run();

	}

	static void run() {

		NetworkTable.setTeam(2557); //sets our team number
		NetworkTable table = (NetworkTable) Robot.getTable(); 

		while (true) {
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			
			table.putNumber("Q", 11); //puts the number "11" into a key called "Q"
			
			
			System.out.println(table.getNumber("Q")); //Gets the value "Q" that we put in earlier
		}
		
	}

}
When we run java program, it successfully prints the "Q" value that we put into the table earlier. But when looking at the NetworkTable via Tableviewer, no "Q" value shows up.

We took two computers and ran Tableviewer, and both of them were able to see values that we put in via Tableviewer, but neither could see the values put in by the java program above. Any help is much appreciated! (Just for clarification, this program is just a standalone program at the moment, it has not been implemented into a SmartDashboard widget yet)
Thank you.
 


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 21:35.

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