Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Custom SmartDashboard Widget Repository (http://www.chiefdelphi.com/forums/showthread.php?t=134898)

Travis Hoffman 18-02-2015 22:57

Custom SmartDashboard Widget Repository
 
We just started using SmartDashboard this year. I really like how easy it is to display data on the screen - what I wish was better was the selection of widget types. I'd love to have access to boolean indicators that change color based on variable state (much like the connection widget), vertical sliders we could use to mimic vertical lift commanded and actual positions, etc. I know teams can create custom widgets; however, I am not a Java programmer and would not know how to create them on my own.

I bet many teams have created useful widgets for SmartDashboard. I was wondering if they'd be willing to share them (or links to them) in this thread, along with explanations as to what they do. What would especially be useful to the community would be widgets that are "universal" - not specific to a particular robot or FRC game.

Thanks in advance! :)

Ben Wolsieffer 18-02-2015 23:01

Re: Custom SmartDashboard Widget Repository
 
Quote:

Originally Posted by Travis Hoffman (Post 1446817)
I'd love to have access to boolean indicators that change color based on variable state (much like the connection widget).

Those already exist ("BooleanBox"), assuming your using the original SmartDashboard, which works better IMO.

Ben Wolsieffer 18-02-2015 23:11

Re: Custom SmartDashboard Widget Repository
 
1 Attachment(s)
I attached the slider extension that we use. Slider.zip contains the compiled .jar and the source.

I have another cool one that allows Commands to have parameters that can be set on the SD, but that one is a little more complex, so I'll probably not get around to it until tomorrow.

I've been meaning to release some of these, but haven't gotten around to it until you created this thread.

nickmcski 19-02-2015 12:14

Re: Custom SmartDashboard Widget Repository
 
If your just looking for a wide range of tools you may want to try SmartDashboard 2.0 (SFX) it comes with a lot more standard options and has a lot of styling potential. I still know a lot of people who like how basic the original SmartDashboard but I would recommend giving SFX a try.

Travis Hoffman 19-02-2015 12:22

Re: Custom SmartDashboard Widget Repository
 
Quote:

Originally Posted by nickmcski (Post 1447050)
If your just looking for a wide range of tools you may want to try SmartDashboard 2.0 (SFX) it comes with a lot more standard options and has a lot of styling potential. I still know a lot of people who like how basic the original SmartDashboard but I would recommend giving SFX a try.

We will probably move to that eventually, but I usually equate "new" with "potentially buggy". I value stability - the kind built upon the backs of those early adopters who have suffered through the trials and tribulations for me. :)

Regardless of when I make that switch, it still would be swell if we could build a bigger library of shared original SmartDashboard widgets in this thread.

I'm requesting a "standard" of posting a .jar file as a minimum contribution, along with any associated source code you might wish to share, for those intrepid Java-programming souls who might make use of it.

Thanks in advance to all who share, as well as those who have shared already!

Ben Wolsieffer 19-02-2015 17:59

Re: Custom SmartDashboard Widget Repository
 
1 Attachment(s)
Here's the other useful widget I wrote; it displays commands that have parameters, which you can set from the SmartDashboard. It requires code on the robot, which I have only written in Java, but it can be ported to C++ fairly easily.

This widget is useful for debugging commands, because you can put them on the SD and then play with parameters and make sure they react correctly.

The ParameterCommand.jar file contains the widget, while the src folder contains the source for both the widget and the robot code. The robot code includes an example (RotateToCommand.java) from our code which demonstrates the usage of the ParameterCommand.

When you want to use put the command on the SD, you simply have to call:
Code:

SmartDashboard.putData(yourParameterCommand);
If you use RobotBuilder, the "Button on SmartDashboard" checkbox also works as long as your command has a default constructor.

Brrch 21-02-2015 07:02

Re: Custom SmartDashboard Widget Repository
 
Quote:

Originally Posted by lopsided98 (Post 1447264)
Here's the other useful widget I wrote; it displays commands that have parameters, which you can set from the SmartDashboard. It requires code on the robot, which I have only written in Java, but it can be ported to C++ fairly easily.

This widget is useful for debugging commands, because you can put them on the SD and then play with parameters and make sure they react correctly.

The ParameterCommand.jar file contains the widget, while the src folder contains the source for both the widget and the robot code. The robot code includes an example (RotateToCommand.java) from our code which demonstrates the usage of the ParameterCommand.

When you want to use put the command on the SD, you simply have to call:
Code:

SmartDashboard.putData(yourParameterCommand);
If you use RobotBuilder, the "Button on SmartDashboard" checkbox also works as long as your command has a default constructor.

When I tried to copy the classes to a Robot Project it said that the import edu.wpi.first.smartdashboard could not be resolved. Which library should I use?

Ben Wolsieffer 21-02-2015 11:50

Re: Custom SmartDashboard Widget Repository
 
Quote:

Originally Posted by Brrch (Post 1447968)
When I tried to copy the classes to a Robot Project it said that the import edu.wpi.first.smartdashboard could not be resolved. Which library should I use?

Which classes? The only file that needs to in your robot project is ParameterCommand.java. The .java in the smartdashboard directory are the source for the SmartDashboard widget, which are only necessary if you want to modify the the code running in the SmartDashboard.

M3rcuriel 05-04-2015 19:00

Re: Custom SmartDashboard Widget Repository
 
Quote:

Originally Posted by lopsided98
When I tried to copy the classes to a Robot Project it said that the import edu.wpi.first.smartdashboard could not be resolved. Which library should I use?

Where did you get the libraries for SmartDashboard source - I can't seem to find them.

Ben Wolsieffer 05-04-2015 19:32

Re: Custom SmartDashboard Widget Repository
 
Quote:

Originally Posted by M3rcuriel (Post 1466220)
Where did you get the libraries for SmartDashboard source - I can't seem to find them.

Are you looking for the source for the SmartDashboard or the library jar file?

The source for the SmartDashboard is here: https://bitbucket.org/byteit101/oldsmartdashboard/src, but if you only want to write extensions for it, you need to add "HOME/wpilib/tools/SmartDashboard.jar" as a library in Eclipse/Netbeans.

M3rcuriel 05-04-2015 19:33

Re: Custom SmartDashboard Widget Repository
 
Quote:

Originally Posted by lopsided98 (Post 1466230)
Are you looking for the source for the SmartDashboard or the library jar file?

The source for the SmartDashboard is here: https://bitbucket.org/byteit101/oldsmartdashboard/src, but if you only want to write extensions for it, you need to add "HOME/wpilib/tools/SmartDashboard.jar" as a library in Eclipse/Netbeans.

Okay that makes sense. How do you deploy the widgets, then? None of this seems to be documented.

Ben Wolsieffer 05-04-2015 19:37

Re: Custom SmartDashboard Widget Repository
 
Quote:

Originally Posted by M3rcuriel (Post 1466231)
Okay that makes sense. How do you deploy the widgets, then? None of this seems to be documented.

You have to put the .jar file containing the extension in "HOME/SmartDashboard/extensions".

pjreiniger 22-07-2015 21:41

Re: Custom SmartDashboard Widget Repository
 
It's a little late for your use this season, but team 174 has just posted our code for the past season, which includes some custom SmartDashboard widgets. We used the SD to display the state of our robot, which was a huge help during our early season debugging. We also have a widget to directly modify our autonomous modes, and view feedback from our autonomous driving.

Here is a link to our chief post

We were able to use the SmartDashboard to provide a ton of unsight during our debugging process, and I hope that it can get the recognition it desrves

-PJ


All times are GMT -5. The time now is 01:42.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi