|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Error on using network tables from smartdashboard.
Hello, I am trying to send some simple double values from the smart dashboard to the robot the problem is the data does not appear to be recieved and I get a flood of messages from the network tables such as the ones below.
Quote:
Code:
SmartDashboard Code
------------------------------
public static NetworkTable table;
public int network=0;
public WPIImage processImage (WPIColorImage image)
{
if (network==0)
{
NetworkTable.setIPaddress("10.4.86.2");
table = NetworkTable.getTable("camera");
network=1
}
table.putDouble("AREA", 2);
}
Robot Code
------------------------------
public static NetworkTable cameraTable = NetworkTable.getTable("camera");
function()
{
System.out.println(cameraTable.getNumber("AREA",-1);
}
Any help is much appreciated. Last edited by Stonemotmot : 09-01-2013 at 11:03. |
|
#2
|
||||
|
||||
|
Re: Error on using network tables from smartdashboard.
I believe you have to actually create a table called camera before you can try to get anything from it. I don't have access to the javadocs for the NetworkTable right now.
|
|
#3
|
|||
|
|||
|
Re: Error on using network tables from smartdashboard.
Quote:
Quote:
|
|
#4
|
||||
|
||||
|
Re: Error on using network tables from smartdashboard.
The actual error appears to be "Unknown Network Table Message Type: 12"
I actually was on the wrong track then. It is an issue with communicating using table "camera" probably when you are trying to retrieve a number or it could be when you put the number in. Perhaps someone else more experienced can help you, I am trying to guess the most likely errors. |
|
#5
|
|||
|
|||
|
Re: Error on using network tables from smartdashboard.
I have been trying to find a solution using what you said but I still cant figure out what is wrong.
|
|
#6
|
||||
|
||||
|
Re: Error on using network tables from smartdashboard.
You put in a number under the key of "area" but you try to retrieve with the key "RED_AREA" try changing "RED_AREA" to "area" when you use getNumber()
|
|
#7
|
|||
|
|||
|
Re: Error on using network tables from smartdashboard.
Oh sorry that was a miss type in the post. In my actual code they are the same. Sorry for the confusion.
|
|
#8
|
||||||
|
||||||
|
Re: Error on using network tables from smartdashboard.
If I had to guess, I'd say your smartdashboard code is using Network Tables Version 1, while the cRIO is running a Network Tables 2 server.
|
|
#9
|
||||
|
||||
|
Re: Error on using network tables from smartdashboard.
Is there any documentation specifically for using NetworkTables2 yet? I noticed the documents for NT on screensteps are still empty.
|
|
#10
|
|||
|
|||
|
Re: Error on using network tables from smartdashboard.
Yes I believe this is the error which you will get if the smart dashboard is running the old version of Network Tables.
You can go here to get the latest version of SmartDashboard which uses NetworkTables2 http://wpilib.screenstepslive.com/s/...sion-installer |
|
#11
|
|||
|
|||
|
Thanks for everyones' input. I have re-installed the dashboard and no longer get the error. However the data is still not sent from the dashboard to the network tables. I have used the NetworkTable Viewer to determine that the Robot communicates with the Network Tables just fine, but the dashboard seems unable to. I used the code below on the robot to put and retrieve values and this works just fine.
Code:
NetworkTable.getTable("MyTable").putDouble("AREA", 5);
System.out.println(NetworkTable.getTable("MyTable").getNumber("AREA",-1));
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|