Go to Post I would suggest spending a few more hours digesting the manual before you finalize your designs. You seem to have missed a few key rules. - GaryVoshol [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 09-01-2013, 09:32
Stonemotmot Stonemotmot is offline
Registered User
FRC #0486
 
Join Date: Sep 2011
Location: United States, Pa
Posts: 53
Stonemotmot is an unknown quantity at this point
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:
connection state: GOT_CONNECTION_FROM_CLIENT
edu.wpi.first.wpilibj.networktables2.server.Server ConnectionAdapter@14f entered
connection state: SERVER_ERROR: class
edu.wpi.first.wpilibj.networktables2.connection.Ba dMessageException: Unknown Network Table Message Type: 12
Close: edu.wpi.first.wpilibj.networktables2.server.Server ConnectionAdapter@14f
The Code I use is as follows
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);
}
The above code displays the previous error and -1(the default output)
Any help is much appreciated.

Last edited by Stonemotmot : 09-01-2013 at 11:03.
Reply With Quote
  #2   Spotlight this post!  
Unread 09-01-2013, 09:36
MagiChau's Avatar
MagiChau MagiChau is offline
Registered User
AKA: Michael Chau
FRC #0085 (B.O.B. (Built on Brains))
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Zeeland, Michigan
Posts: 875
MagiChau is just really niceMagiChau is just really niceMagiChau is just really niceMagiChau is just really nice
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 09-01-2013, 09:40
Stonemotmot Stonemotmot is offline
Registered User
FRC #0486
 
Join Date: Sep 2011
Location: United States, Pa
Posts: 53
Stonemotmot is an unknown quantity at this point
Re: Error on using network tables from smartdashboard.

Quote:
Originally Posted by MagiChau View Post
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.
The description in the java doc for getTable() is
Quote:
Gets the table with the specified key. If a table does not excist, a new table will be created. This will automatically initialize network tables if it has not been already.
to mean that means that no seprate creation is nessasary, but if im wrong how do i create one?
Reply With Quote
  #4   Spotlight this post!  
Unread 09-01-2013, 09:54
MagiChau's Avatar
MagiChau MagiChau is offline
Registered User
AKA: Michael Chau
FRC #0085 (B.O.B. (Built on Brains))
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Zeeland, Michigan
Posts: 875
MagiChau is just really niceMagiChau is just really niceMagiChau is just really niceMagiChau is just really nice
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.
Reply With Quote
  #5   Spotlight this post!  
Unread 09-01-2013, 10:15
Stonemotmot Stonemotmot is offline
Registered User
FRC #0486
 
Join Date: Sep 2011
Location: United States, Pa
Posts: 53
Stonemotmot is an unknown quantity at this point
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.
Reply With Quote
  #6   Spotlight this post!  
Unread 09-01-2013, 10:48
MagiChau's Avatar
MagiChau MagiChau is offline
Registered User
AKA: Michael Chau
FRC #0085 (B.O.B. (Built on Brains))
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Zeeland, Michigan
Posts: 875
MagiChau is just really niceMagiChau is just really niceMagiChau is just really niceMagiChau is just really nice
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()
Reply With Quote
  #7   Spotlight this post!  
Unread 09-01-2013, 11:03
Stonemotmot Stonemotmot is offline
Registered User
FRC #0486
 
Join Date: Sep 2011
Location: United States, Pa
Posts: 53
Stonemotmot is an unknown quantity at this point
Re: Error on using network tables from smartdashboard.

Quote:
Originally Posted by MagiChau View Post
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()
Oh sorry that was a miss type in the post. In my actual code they are the same. Sorry for the confusion.
Reply With Quote
  #8   Spotlight this post!  
Unread 09-01-2013, 11:55
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,590
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
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.
Reply With Quote
  #9   Spotlight this post!  
Unread 09-01-2013, 12:30
F22Rapture's Avatar
F22Rapture F22Rapture is offline
College Student, Mentor
AKA: Daniel A
FRC #3737 (4H Rotoraptors)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Goldsboro, NC
Posts: 476
F22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant future
Re: Error on using network tables from smartdashboard.

Quote:
Originally Posted by Joe Ross View Post
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.
Is there any documentation specifically for using NetworkTables2 yet? I noticed the documents for NT on screensteps are still empty.
__________________
Research is what I’m doing when I don’t know what I’m doing.
- Wernher von Braun
Attending: Raleigh NC Regional
Reply With Quote
  #10   Spotlight this post!  
Unread 09-01-2013, 16:02
mitchellweb1 mitchellweb1 is offline
Registered User
AKA: Mitchell W
FRC #0190
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Acton, MA
Posts: 30
mitchellweb1 is an unknown quantity at this point
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
Reply With Quote
  #11   Spotlight this post!  
Unread 09-01-2013, 19:26
Stonemotmot Stonemotmot is offline
Registered User
FRC #0486
 
Join Date: Sep 2011
Location: United States, Pa
Posts: 53
Stonemotmot is an unknown quantity at this point
Talking Re: Error on using network tables from smartdashboard.

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));
I have had no success repeating this on the dashboard however. If someone could post some SmartDashboard network table code from this season using the new crio image and new SmartDashboard I would very much appreciate it.
Reply With Quote
  #12   Spotlight this post!  
Unread 09-01-2013, 19:48
mitchellweb1 mitchellweb1 is offline
Registered User
AKA: Mitchell W
FRC #0190
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Acton, MA
Posts: 30
mitchellweb1 is an unknown quantity at this point
Re: Error on using network tables from smartdashboard.

You have to put values using the SmartDashboard class
For example http://wpilib.screenstepslive.com/s/...-robot-program
SmartDashboard only looks at a single table in networktables so that you can use other tables to send data to other programs but not have it show up on the SmartDashboard

You can also find more info on the SmartDashboard here http://wpilib.screenstepslive.com/s/3120/m/7932
Reply With Quote
  #13   Spotlight this post!  
Unread 09-01-2013, 20:00
Stonemotmot Stonemotmot is offline
Registered User
FRC #0486
 
Join Date: Sep 2011
Location: United States, Pa
Posts: 53
Stonemotmot is an unknown quantity at this point
Re: Error on using network tables from smartdashboard.

I might be wrong, but I thought the SmartDashboard class could only be used on the robot not in the dashboard itself(don't have it in front of me at the moment)
I am trying to send data from the dashboard to the robot not the other way around. Should I use a table called "SmartDashboard" would that work?
Reply With Quote
  #14   Spotlight this post!  
Unread 10-01-2013, 14:46
mitchellweb1 mitchellweb1 is offline
Registered User
AKA: Mitchell W
FRC #0190
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Acton, MA
Posts: 30
mitchellweb1 is an unknown quantity at this point
Re: Error on using network tables from smartdashboard.

Sorry I misunderstood your question. You should be able to do Robot.getTable() to get the SmartDashboard table from the plugin.
Reply With Quote
  #15   Spotlight this post!  
Unread 10-01-2013, 15:23
Stonemotmot Stonemotmot is offline
Registered User
FRC #0486
 
Join Date: Sep 2011
Location: United States, Pa
Posts: 53
Stonemotmot is an unknown quantity at this point
Re: Error on using network tables from smartdashboard.

Quote:
Originally Posted by mitchellweb1 View Post
Sorry I misunderstood your question. You should be able to do Robot.getTable() to get the SmartDashboard table from the plugin.
Thank you! that did it.
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 12:48.

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