Go to Post At this point I think I've absorbed more aluminum into my blood than the iron that was already there. - hectorcastillo [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 22-01-2013, 19:39
clandry94 clandry94 is offline
Registered User
AKA: Conor
FRC #3735 (KleinBOTS)
Team Role: Leadership
 
Join Date: Dec 2012
Rookie Year: 2011
Location: United States
Posts: 31
clandry94 is an unknown quantity at this point
Weird networktables error?

We are having trouble with a networktables issue that randomly showed up without changing any code.....


Code:
NetworkTable networktable;
networktable.getTable("robo");       
networktable.getNumber("x");
We had a simple code like this. Robo is a table made from roborealm and x is a double value from roborealm. When we run the code and start the subsystem we get this error.

Code:
[cRIO] java.lang.ClassCastException: Expected object of type class java.lang.Double but got object of type class com.sun.squawk.StringOfBytes
[cRIO]     at edu.wpi.first.wpilibj.networktables2.NetworkTableNode.getDouble(NetworkTableNode.java:52)
[cRIO]     at edu.wpi.first.wpilibj.networktables.NetworkTable.getNumber(NetworkTable.java:294)
We know for sure that the number being sent is a double so what gives?
Reply With Quote
  #2   Spotlight this post!  
Unread 22-01-2013, 19:42
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 543
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Weird networktables error?

Are you sure the value your sending in RoboRealm is a double?
Reply With Quote
  #3   Spotlight this post!  
Unread 22-01-2013, 19:44
clandry94 clandry94 is offline
Registered User
AKA: Conor
FRC #3735 (KleinBOTS)
Team Role: Leadership
 
Join Date: Dec 2012
Rookie Year: 2011
Location: United States
Posts: 31
clandry94 is an unknown quantity at this point
Re: Weird networktables error?

It was working just two days ago with the same code and no modifications so I am fairly sure it is. Even if I wasn't, i'm using putnumber so it should still work even if it isn't.
Reply With Quote
  #4   Spotlight this post!  
Unread 22-01-2013, 20:01
clandry94 clandry94 is offline
Registered User
AKA: Conor
FRC #3735 (KleinBOTS)
Team Role: Leadership
 
Join Date: Dec 2012
Rookie Year: 2011
Location: United States
Posts: 31
clandry94 is an unknown quantity at this point
Re: Weird networktables error?

It seems it is an error with Roborealm not sending a double. Does anyone know how to get roborealm to send values as doubles?
Reply With Quote
  #5   Spotlight this post!  
Unread 22-01-2013, 20:24
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 543
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Weird networktables error?

Quote:
Originally Posted by clandry94 View Post
It seems it is an error with Roborealm not sending a double. Does anyone know how to get roborealm to send values as doubles?
I just spent the last two hours working on roborealm and im incredibilly frustrated.

My main problem is that the variable [BOUNDING_COORDINATES] does not update! Im able to send a string that has the different values of the bounding rects but when i move the robot the variable doesnt update it unless i change it to a different variable than change it back to [BOUNDING_COORDINATES]

also, it seems that your unable to change the values of the keys. You have to get a new key but define it as a double before you use it
Reply With Quote
  #6   Spotlight this post!  
Unread 22-01-2013, 20:26
clandry94 clandry94 is offline
Registered User
AKA: Conor
FRC #3735 (KleinBOTS)
Team Role: Leadership
 
Join Date: Dec 2012
Rookie Year: 2011
Location: United States
Posts: 31
clandry94 is an unknown quantity at this point
Re: Weird networktables error?

Quote:
Originally Posted by Arhowk View Post
I just spent the last two hours working on roborealm and im incredibilly frustrated.

My main problem is that the variable [BOUNDING_COORDINATES] does not update! Im able to send a string that has the different values of the bounding rects but when i move the robot the variable doesnt update it unless i change it to a different variable than change it back to [BOUNDING_COORDINATES]

also, it seems that your unable to change the values of the keys. You have to get a new key but define it as a double before you use it
How would I define it as a double? Also, in response to the problem you are having: make sure to restart roborealm after each time you upload code to the robot or else networktables won't update from the sent variable anymore!
Reply With Quote
  #7   Spotlight this post!  
Unread 22-01-2013, 21:04
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 543
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Weird networktables error?

Quote:
Originally Posted by clandry94 View Post
How would I define it as a double? Also, in response to the problem you are having: make sure to restart roborealm after each time you upload code to the robot or else networktables won't update from the sent variable anymore!
i had that issue too, but updating from .17 > .18 fixed that.

to edfine it as a double, use


NetworkTable.getTable(?).remove(your key)
NetworkTable.getTable(?).putNumber(your key)
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:47.

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