Network Tables

Following the steps specified here:
http://wpilib.screenstepslive.com/s/3120/m/7912/l/80205-writing-a-simple-networktables-program-in-c-and-java-with-a-java-client-pc-side

I am unable to create a smart dashboard extension using the network tables. I have created and successfully used an image tracking program as an extension. This is not going to be beneficial, however, should I fail to send data.

I can put/get numbers on the robot side (C++) and have proven such with the table viewer app. As I said, however, an extension made as specified in the above documentation on a fully updated version of Netbeans; built and tried on several computers, just to be sure, will not function properly.

Is there something I am missing or some further documentation. Can anyone provide example code? As an alternative, is there a way to put numbers to the smart dashboard’s network table with an extension on the smart dashboard (because there is are CPP get functions for the smart dashboard in robot code)?

Can you try running the SmartDashboard from a command line (using CMD and the java -jar SmartDashboard.jar command) to verify that it’s not throwing any exceptions.

In the SmartDashboard, NetworkTables is already initialized so you should not do the setClientMode() and setIPAddress() in your extension. Make sure those methods aren’t being called in your code.

If you do see any exceptions coming out, please post them here so we can try to diagnose the problem.

Brad

Via the link above, there is the category “The client (laptop) side of the program.” Code exactly as is shown in this will not function. The robot side is also more or less as shown and will give/take values to/from the network table viewer.

Without the specified lines,
setClientMode() and setIPAddress()
there are no errors but also no connection. It will not print status as client with if (not server) print is client nor will it do the same with connection.

With them, there are also no errors but it continuously fails to connect.

Could I get a basic primer code in java for the client and cpp for the robot to start from?

I am having the same problem. I started with Daisy’s vision code from last year and have modified it to fit our needs. The following line

Robot.getTable().putNumber("azimuth", azimuth);

prints a value to the SmartDashboard but I cannot retrieve the value from the robot side code:

SmartDashboard.getNumber("azimuth");

but i get an error saying that there is no such key. I played with this alot until I gave up and tried the NetworkTables method here but i can’t seem to get it to work either.

With the following lines, I lose camera feed on the SmartDashboard:

NetworkTable.setClientMode();
NetworkTable.setIPAddress("10.35.2.2");
NetworkTable table = NetworkTable.getTable("visiondata");
.
.
.
table.putNumber("azimuth", azimuth);

When I comment out the first 2 of those 3, I get my camera stream back but still no data output.

Any ideas??