Go to Post I wish I were on the GDC, just to watch everyone struggle to grasp the meaning of this. - Brandon_L [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 28-01-2014, 20:45
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,567
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
LabVIEW Dashboard Interfacing With Java Code

I was recently asked the following question via PM, but I thought the answers might be helpful for other people, and so that other more experienced people could chime in.

Quote:
Have you been able to interface Java with LabVIEW so that sensor data is automatically shown. What I mean by this is something like when I call

SmartDashboard.put ("Intake Roller", intakeRollerSpeed);

in the SmartDashboard this would automatically populate with a label Intake Roller and the value would get updated accordingly. Is there someway I can implement automatic population in a custom LabVIEW Dashboard and a Java coded robot?
I have not looked very much at the 2014 LabVIEW Dashboard, but I expect it would be similar to 2013. The 2013 dashboard had a tab called Operation. Any controls you placed on that tab would be automatically bound to the SmartDashboard variable of the same name as the control. This isn't quite as easy as the Java Smartdashboard since the controls don't appear automatically, but it's very easy to drag a new control to the tab and rename. This will also transmit any changes made to the control on the front panel. It will not transmit any changes made programmatically, so you can't use this, for example, to send vision data that was processed on the dashboard to the robot.

Additionally, the Variables tab shows all Smartdashboard variables in a tree format.

Quote:
From my understanding I have to send my data to a NetworkTable with a key and value in my Java code and call upon the same key in my LabVIEW Dashboard to view the feedback.
This is the more flexible way to do it. I would recommend using the SmartDashboard class in Java and the SmartDashboard VIs in LabVIEW (NetworkTable is a little lower level). You can do additional calculations in LabVIEW either before transmittal or before display.

Last year, we used a nicely configured LabVIEW dashboard with large indicators and controls that the drivers could use. When the programmers wanted to debug something, we would bring up the java smartdashboard, because it was more convenient to send and receive arbitrary variables. You can even have both of them running at the same time.

Last edited by Joe Ross : 28-01-2014 at 20:59.
  #2   Spotlight this post!  
Unread 29-01-2014, 02:07
TuxCoding TuxCoding is offline
Alumni programming mentor
FRC #1662 (Raptor Force Engineering)
Team Role: Alumni
 
Join Date: Jan 2014
Rookie Year: 2011
Location: California
Posts: 1
TuxCoding is an unknown quantity at this point
Re: LabVIEW Dashboard Interfacing With Java Code

Yeah, we are trying to do that this year, since we switched our robot code from Labview to Java. We keep running into "Table Key not found" errors (basically not finding the values on the Dashboard and saying "Output not updated often enough"). I tried both Networktables and SmartDashboard, and was wondering how you set up the VI and .java file?
  #3   Spotlight this post!  
Unread 29-01-2014, 07:38
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: LabVIEW Dashboard Interfacing With Java Code

Quote:
Originally Posted by TuxCoding View Post
Yeah, we are trying to do that this year, since we switched our robot code from Labview to Java. We keep running into "Table Key not found" errors (basically not finding the values on the Dashboard and saying "Output not updated often enough"). I tried both Networktables and SmartDashboard, and was wondering how you set up the VI and .java file?
The "Output not updated often enough" message is from the motor safety stuff, most likely from a RobotDrive object you created in your code. The idea is that if the RobotDrive outputs aren't updated often (every 100ms by default) it assumes that the program crashed and stops the PWM output to the motors. You can either make sure to keep updating motor values in any loops you have or disable the motor safety with:
Code:
yourRobotDriveObject.setSafetyEnabled(false);
To address the "Table key not found" error, you can see what values are in NetworkTables using the OutlineViewer.jar program. Just run it on your driver station computer and it will show you all the keys and values in NetworkTables. Then you can verify that the key is being written. For the SmartDashboard supplied with C++ and Java the keys need to be in a subtable called "SmartDashboad". I'm not sure about the LabVIEW dashboard, but will find out and add it to this post a little later today.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #4   Spotlight this post!  
Unread 29-01-2014, 08:32
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: LabVIEW Dashboard Interfacing With Java Code

The LV dashboard defaults to binding a control or indicator named XXX to the variable named /SmartDashboard/XXX.

This should match the other dashboards. Please let me know if you find out differently.

Greg McKaskle
  #5   Spotlight this post!  
Unread 29-01-2014, 12:11
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,567
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: LabVIEW Dashboard Interfacing With Java Code

Quote:
Originally Posted by BradAMiller View Post
To address the "Table key not found" error, you can see what values are in NetworkTables using the OutlineViewer.jar program. Just run it on your driver station computer and it will show you all the keys and values in NetworkTables. Then you can verify that the key is being written. For the SmartDashboard supplied with C++ and Java the keys need to be in a subtable called "SmartDashboad". I'm not sure about the LabVIEW dashboard, but will find out and add it to this post a little later today.
You can also look at the Variables tab in the LabVIEW dashboard.

Quote:
Originally Posted by TuxCoding View Post
Yeah, we are trying to do that this year, since we switched our robot code from Labview to Java. We keep running into "Table Key not found" errors (basically not finding the values on the Dashboard and saying "Output not updated often enough"). I tried both Networktables and SmartDashboard, and was wondering how you set up the VI and .java file?
One thing that we do is put a default value for each variable in the constructor, so we know there's always something to get.
Closed Thread


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 02:37.

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