Java Custom Dashboard Difficulties

I was wondering if anybody knew any good tutorials for making a custom dashboard in Java. I HAVE found out about the dashboard example project, although editing it does not seem to do anything to the dashboard.

Another thing I have found out is that I can make the dashboard itself in LabView and transfer data between the two somehow. That is where I hit the dead end. I was never really great in LabView and am having trouble figuring out what I would need to change or add to the project to make it receive MY data from the robot. (I understand that something does this automatically when there are no custom clusters coming through. I would also like to know if i need to override anything to make it work).

Thanks to anyone who can help me with this.

Are you talking about building an entire dashboard from scratch or customizing a pre-packaged one?

The dashboard that comes by default with the driver station is done in LabView. You’ve got a few choices there. You can either use lowDashData, TCP/UDP, or the NetworkTables implementation that’s being added to FRC LabView this year. It’s not super-well documented but a couple google searches should pull up some useful materials.

Otherwise (and this is what I recommend), you could use the SmartDashboard, which is similar except that it was designed more specifically toward Java/C++ teams. Here you would use NetworkTables for everything, basically, and it’s a bit less frustrating than trying to get LabView and Java/C++ to play nicely together.

I am having trouble understanding what I am to do with smart dashboard. I have run the installer and found the client application. How do I implement this so that I can use it in my code? I can’t find any good documentation on it and when I try to use functions from the Library it doesn’t really do anything. To be completely honest, I don’t know what I’m doing.

There are two types of extendable SmartDashboard elements: Widgets and StaticWidgets. Widgets show up on the dashboard in response to code on the robot calling SmartDashboard.put() (or putDouble(), etc.); I don’t think many teams created this type of widget during the 2012 season because it wasn’t well documented and was pretty entrenched in the overall SmartDashboard system. However, there seems to be new documentation regarding them (here), so I think they will be more used in 2013. StaticWidgets are not made in response to data, and are instead added to the dashboard manually. The CameraExtension that many teams based their image processing on was a StaticWidget, and other StaticWidgets can be found under View->Add.

See also the official SmartDashboard documentation wiki and the responses to this post

I actually did make a (less than spectacular) nonstatic Widget because I couldn’t find the line chart option in the number widget. The one that I eventually found packed in SmartDashboard was way better in my opinion. :o

Here’s a link to my code for it if anyone wants to look at how a custom Widget works

Eventually the buffer size, max/min, etc. would have been configurable properties but I found the built-in one before I got that far I think.

Wait, aren’t there built in widgets? putData doesnt seem to work and the robot doesnt seem to be connecting with it either. Lastly, I can’t seem to understand how to get it to launch upon startup of the driverstation, as it is a .jar file.

Please, I am very confused and need answers. This thing is driving me nuts.

Ok, so there’s 3 download on that website. One is the bare .jar file, one is the installer (.exe), and one is the “InstallerCreator.”

If you have the driverstation installed and updated, using the installer will automatically change the driverstation’s dashboard over to the SmartDashboard, and install the SmartDashboard in the Program Files folder on your computer. Do this, if you have not already.

Navigate to C:\Program Files\SmartDashboard\extensions. Drop your custom extensions in that folder. Now go back up one directory and double-click the smartdashboard .jar. Your static extensions should now show up under View>Add

So, to make it clear, there are no default extensions included. They all need to be made from scratch?

There are a bunch included. In most situations you will not need to make your own extensions.

Hmm. So it seems then that the robot is not connecting to the dashboard according to the connection indicator. I suspect the issue might be that I am using iterative robot, not command based java. Can anyone confirm?

I would also like to ask if there are any objects that need to be created in the code if it is not absolutely necessary to use command based java, and if there are any necessary commands to call.

Command-based is not required. I don’t believe you need to create any extra objects. It is a little fuzzy but looking at out last year’s code you should just need to refer to SmartDashboard statically (i.e. SmartDashboard.putInt(“Integer”, myInt); ). I don’t have immediate access to our computers but I think there is an IP address setting in the SmartDashboard settings in the application. Is it configured correctly?

In case you never found a solution…

We had a similar problem (dashboard never showing anything) and it turned out to be a configuration problem. In one of the sections of the SmartDashboard pulldowns is a “settings” tab. Make sure that you have your team number set in the settings or NOTHING will show up.

Just a thought.

I am one of the programmers on my team, and it has become my little project to create a custom dashboard, using SmartDashboard. We use java to program our robot, and although I have compiled and run the code, the dashboard does not see the info., even though I loaded the smart dash board in the Driver Station. Here is what I have so far, for testing purposes.

 * To change this template, choose Tools | Templates
 * and open the template in the editor.
package com.PhoebusHighSchool.PhoebusRobotics.UltimateAscent;

import edu.wpi.first.wpilibj.NamedSendable;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;

 * @author jmiller015
public class DriverStation
    UltimateAscentBot robot;
    SmartDashboard dash; 
     * DriverStation
     * This constructor initializes the DriverStation and gives it an
     * UltimateAscentBot
     * @param bot 
    public DriverStation(UltimateAscentBot bot)
        robot = bot;
        dash = new SmartDashboard();
     * updateDashboard()
     * This method will update the Driver Station to the current values for 
     * the # of discs, true/false shooter ready, distance to target, 
     * degrees to target.
    public void updateDashboard()
        dash.putNumber("Discs Remaining", robot.getDiscCount());
        dash.putBoolean("Shooter Ready", robot.isShooterCocked());
        dash.putNumber("Distance to target", robot.getDistanceToTarget());
        dash.putNumber("Degrees to target", robot.getDegreesToTarget());

Personally, I like going the LabVIEW dashboard + Java robot route. You can transfer data back to the robot using NetworkTables.

yeah. I did that and now everything works fine. turns out labVIEW is good for VIEWing things. If only I had figured that out earlier.:]