Go to Post Cash is always better, remember that when fund raising. - LordDumpling [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 11-12-2012, 22:31
Hypnotoad's Avatar
Hypnotoad Hypnotoad is offline
Junior Assistant Secretary of Moon
no team
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: California
Posts: 114
Hypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these parts
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.
__________________
The following sentence is true.
The preceding sentence is false.
This sentence is false.
This signature is false.
My teeth are false.
Reply With Quote
  #2   Spotlight this post!  
Unread 11-12-2012, 22:52
F22Rapture's Avatar
F22Rapture F22Rapture is offline
College Student, Mentor
AKA: Daniel A
FRC #3737 (4H Rotoraptors)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Goldsboro, NC
Posts: 476
F22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant future
Re: Java Custom Dashboard Difficulties

Quote:
Originally Posted by Hypnotoad View Post
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.

http://www.chiefdelphi.com/forums/sh...d.php?t=104343

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.
__________________
Research is what I’m doing when I don’t know what I’m doing.
- Wernher von Braun
Attending: Raleigh NC Regional
Reply With Quote
  #3   Spotlight this post!  
Unread 16-12-2012, 00:54
Hypnotoad's Avatar
Hypnotoad Hypnotoad is offline
Junior Assistant Secretary of Moon
no team
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: California
Posts: 114
Hypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these parts
Re: Java Custom Dashboard Difficulties

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.
__________________
The following sentence is true.
The preceding sentence is false.
This sentence is false.
This signature is false.
My teeth are false.
Reply With Quote
  #4   Spotlight this post!  
Unread 16-12-2012, 08:56
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: Java Custom Dashboard Difficulties

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 code stuff.
Reply With Quote
  #5   Spotlight this post!  
Unread 16-12-2012, 12:14
BigJ BigJ is online now
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 947
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Re: Java Custom Dashboard Difficulties

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.

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

https://github.com/pordonj/frc1675-SmartDashboardPlot

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.
Reply With Quote
  #6   Spotlight this post!  
Unread 16-12-2012, 21:40
Hypnotoad's Avatar
Hypnotoad Hypnotoad is offline
Junior Assistant Secretary of Moon
no team
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: California
Posts: 114
Hypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these parts
Re: Java Custom Dashboard Difficulties

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.
__________________
The following sentence is true.
The preceding sentence is false.
This sentence is false.
This signature is false.
My teeth are false.
Reply With Quote
  #7   Spotlight this post!  
Unread 16-12-2012, 23:12
F22Rapture's Avatar
F22Rapture F22Rapture is offline
College Student, Mentor
AKA: Daniel A
FRC #3737 (4H Rotoraptors)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Goldsboro, NC
Posts: 476
F22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant future
Re: Java Custom Dashboard Difficulties

Quote:
Originally Posted by Hypnotoad View Post
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.
http://firstforge.wpi.edu/sf/frs/do/...tdashboard/frs

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
__________________
Research is what I’m doing when I don’t know what I’m doing.
- Wernher von Braun
Attending: Raleigh NC Regional

Last edited by F22Rapture : 16-12-2012 at 23:15.
Reply With Quote
  #8   Spotlight this post!  
Unread 17-12-2012, 20:11
Hypnotoad's Avatar
Hypnotoad Hypnotoad is offline
Junior Assistant Secretary of Moon
no team
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: California
Posts: 114
Hypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these parts
Re: Java Custom Dashboard Difficulties

So, to make it clear, there are no default extensions included. They all need to be made from scratch?
__________________
The following sentence is true.
The preceding sentence is false.
This sentence is false.
This signature is false.
My teeth are false.
Reply With Quote
  #9   Spotlight this post!  
Unread 17-12-2012, 20:21
BigJ BigJ is online now
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 947
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Re: Java Custom Dashboard Difficulties

There are a bunch included. In most situations you will not need to make your own extensions.
Reply With Quote
  #10   Spotlight this post!  
Unread 22-12-2012, 22:32
Hypnotoad's Avatar
Hypnotoad Hypnotoad is offline
Junior Assistant Secretary of Moon
no team
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: California
Posts: 114
Hypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these parts
Re: Java Custom Dashboard Difficulties

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.
__________________
The following sentence is true.
The preceding sentence is false.
This sentence is false.
This signature is false.
My teeth are false.
Reply With Quote
  #11   Spotlight this post!  
Unread 23-12-2012, 12:41
BigJ BigJ is online now
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 947
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Re: Java Custom Dashboard Difficulties

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?
Reply With Quote
  #12   Spotlight this post!  
Unread 26-12-2012, 23:13
feverittm's Avatar
feverittm feverittm is offline
Registered User
FRC #0997 (Spartans)
Team Role: Mentor
 
Join Date: Apr 2010
Rookie Year: 2010
Location: Corvallis, OR
Posts: 122
feverittm will become famous soon enoughfeverittm will become famous soon enough
Re: Java Custom Dashboard Difficulties

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.
__________________
Floyd Moore
Mentor Electrical and Pneumatics
Team 997 - Spartan Robotics
Corvallis High School, Corvallis Oregon
Reply With Quote
  #13   Spotlight this post!  
Unread 29-01-2013, 23:19
Justin m's Avatar
Justin m Justin m is offline
Registered User
FRC #2028 (Phantom Mentalists)
Team Role: Programmer
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Hampton, va
Posts: 14
Justin m is an unknown quantity at this point
Re: Java Custom Dashboard Difficulties

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.
Code:
/*
 * 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());
    }
           
    
}
Reply With Quote
  #14   Spotlight this post!  
Unread 29-01-2013, 23:57
jesusrambo jesusrambo is offline
Self-Proclaimed Programmer Messiah
AKA: JD Russo
FRC #2035 (Robo Rockin' Bots)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2010
Location: Carmel, CA
Posts: 114
jesusrambo is an unknown quantity at this point
Re: Java Custom Dashboard Difficulties

Personally, I like going the LabVIEW dashboard + Java robot route. You can transfer data back to the robot using NetworkTables.
Reply With Quote
  #15   Spotlight this post!  
Unread 08-02-2013, 23:36
Hypnotoad's Avatar
Hypnotoad Hypnotoad is offline
Junior Assistant Secretary of Moon
no team
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: California
Posts: 114
Hypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these parts
Re: Java Custom Dashboard Difficulties

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.
__________________
The following sentence is true.
The preceding sentence is false.
This sentence is false.
This signature is false.
My teeth are false.
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:48.

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