Go to Post I've come to believe that the current alliance selection system is just like democracy. It's the worst system possible, aside from all the other ones. - DampRobot [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 03-01-2016, 10:10 PM
MikeF1617 MikeF1617 is offline
Registered User
AKA: Michael Fischler
FRC #1124 (UberBots)
Team Role: Programmer
 
Join Date: Sep 2013
Rookie Year: 2013
Location: United States
Posts: 15
MikeF1617 is an unknown quantity at this point
Exclamation SmartDashboard Variable Not Updating...Sometimes

I have a LabVIEW dashboard running sending data to Java robot code. Most of the time it works, but sometimes the variable being read in the Java robot code as shown below stops updating and continues outputting the last value. If there is an exception, it should return -1, not the last value, so I'm not sure what's happening.

Code:
/** 
* Polls the target dimensions from the dashboard.
* If they are not present, it returns {-1, -1}.
*  
* @return an array of the {x center of mass, y center of mass}
* */
public double[] getTargetCenterOfMass(){
	double x = -1;
	double y = -1;
		
	try{
		x = SmartDashboard.getNumber("vision_target_x_cm");
		y = SmartDashboard.getNumber("vision_target_y_cm");
	}catch(Exception e){
		e.printStackTrace();
	}
	
	double data[] = {x, y};
	
	return data;
}
I attached a screenshot of the console where I was debugging our targeting when this started happening (and it has happened many times before, but only this season since we just started using Java this year).

I can see through the Network Variables tab on the LabVIEW dashboard that the values are indeed being updated, yet the Java SmartDashbord.getNumber() is not reflecting the changes. Sometimes disconnecting, waiting, and reconnecting to the robot fixes it. Other times I have to reboot the robot.

Does anyone know why this would happen?
Thanks in advance.
Attached Thumbnails
Click image for larger version

Name:	CD_bug.png
Views:	97
Size:	65.0 KB
ID:	20244  
Reply With Quote
 


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 07:28 AM.

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