Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Set Auto Selector choices on default dashboard from Java robot code? (http://www.chiefdelphi.com/forums/showthread.php?t=154465)

njg 30-01-2017 13:18

Set Auto Selector choices on default dashboard from Java robot code?
 
Is there a means to set choices for the autonomous selector on the default (LabVIEW) dashboard from the robot's Java code? The iterative robot example code outlines how to accomplish this when using the Java SmartDashboard; however, for the LabVIEW dashboard it simply recommends reading whatever string the user has entered. Is there a better option?

RoboChair 30-01-2017 13:47

Re: Set Auto Selector choices on default dashboard from Java robot code?
 
Don't use the smart dashboard to set your auto mode if you know whats good for you.

Put a bank of switches on your robot and use them to set your auto.

rlance 30-01-2017 14:42

Re: Set Auto Selector choices on default dashboard from Java robot code?
 
Quote:

Originally Posted by RoboChair (Post 1638168)
Don't use the smart dashboard to set your auto mode if you know whats good for you.

Put a bank of switches on your robot and use them to set your auto.

Can you explain further what issues you have had with using the smart dashboard for this?

RoboChair 30-01-2017 14:52

Re: Set Auto Selector choices on default dashboard from Java robot code?
 
Quote:

Originally Posted by rlance (Post 1638212)
Can you explain further what issues you have had with using the smart dashboard for this?

Some people have had auto fail, not run at all, computer reboot not allowing you to fit it in time, there are many other reasons to include. But mostly having it be purely robot side will make it start as fast as possible. Some of my teams programmers will have to reply if you need more precise answers, but there are plenty of teams out there that have been burned by relying on the smart dashboard.

#Storytime?

frcguy 30-01-2017 15:06

Re: Set Auto Selector choices on default dashboard from Java robot code?
 
Quote:

Originally Posted by RoboChair (Post 1638221)
Some people have had auto fail, not run at all, computer reboot not allowing you to fit it in time, there are many other reasons to include. But mostly having it be purely robot side will make it start as fast as possible. Some of my teams programmers will have to reply if you need more precise answers, but there are plenty of teams out there that have been burned by relying on the smart dashboard.

#Storytime?

Highly recommend the onboard switch method. We had a rotary switch on our robot last year and it worked wonders for setting auto. It allowed us to have an extremely customizable range of autos that we could instantly set and never failed during a match.

wesleyac 30-01-2017 15:27

Re: Set Auto Selector choices on default dashboard from Java robot code?
 
It's not quite as cut-and-dry as Devin makes it sound, but it's true that we've used an auto selector switch in the past with great success.

The main issue with the default WPILib one* (or at least the implementation that many team seem to use) is that it has a network read to figure out what auto mode to run at the start of auto. We don't want to use that, because we tend to do a lot of buzzer-beater autos (2016 two-ball, 2015 chokehold, 2014 three ball, etc). Having the round trip latency from a network read would have killed us.

Other than that though, we tend not to trust NetworkTables/SmartDashboard. We've used them in the past (including last year, just not for auto selection) and have seen a lot of really weird difficult to debug issues. 1678 often ends up distrusting/not using wpilib stuff (I think that this is my second post today about it, and it's barely lunchtime :P). I don't mean for this to be a cargo cult thing, but we really have seen a lot of issues with NetworkTables and SmartDashboard. I've seen it not connect, not send values, display old values, and randomly decide to stop working.

In the past, we've used a bank of switches to select auto modes, because it's easy and reliable. We may be switching to a custom web dashboard this year, but just because we're confident that we can pull it off.

Bottom line is that we used a switch bank for autos because it's reliable and simple, and SmartDashboard is neither of those, in our experience.

*Note that I haven't actually used this in quite a while, so it's possible that this has changed.

rich2202 30-01-2017 15:31

Re: Set Auto Selector choices on default dashboard from Java robot code?
 
I highly recommend switches attached to your Driver Station, not to your Robot. Much more time to fix errors in the switches on the DS (up until start of match) than the Robot (can't get back onto the field).

Use something like this. It works like a USB joystick with a lot of buttons.
https://smile.amazon.com/dp/B00UUROWWK

Joey1939 30-01-2017 17:09

Re: Set Auto Selector choices on default dashboard from Java robot code?
 
Quote:

Originally Posted by wesleyac (Post 1638263)
...The main issue with the default WPILib one* (or at least the implementation that many team seem to use) is that it has a network read to figure out what auto mode to run at the start of auto. We don't want to use that, because we tend to do a lot of buzzer-beater autos (2016 two-ball, 2015 chokehold, 2014 three ball, etc). Having the round trip latency from a network read would have killed us...

I was thinking about this the other day. Isn't NetworkTables implemented so that it is a server running on the RoboRIO. Meaning that when a value is changed on driver station, the change is pushed immediately to the RoboRIO, and therefore, there would be no network latency from the RoboRIO reading from its local server? I'm not sure if I'm interpreting this correctly.

I second trying to find an alternative way to set your autonomous. Last year at worlds, we didn't run an autonomous in several matches because we couldn't get the SmartDashboard to connect before the match started. We will probably stick with it though because it's just the easiest option.

rich2202 30-01-2017 17:19

Re: Set Auto Selector choices on default dashboard from Java robot code?
 
Quote:

Originally Posted by Joey1939 (Post 1638336)
I second trying to find an alternative way to set your autonomous. Last year at worlds, we didn't run an autonomous in several matches because we couldn't get the SmartDashboard to connect before the match started. We will probably stick with it though because it's just the easiest option.

Which is one of many reasons I don't like Smart Dashboard for use during competition. Debugging/development is fine. Relying upon it for competition is asking for trouble.

Switches on the Robot (either via AIO or DIO) is very easy to do. Switches on the Driver Station is a little harder, and comes with many advantages.

CurlyFries 30-01-2017 20:54

Re: Set Auto Selector choices on default dashboard from Java robot code?
 
We have had the SmartDashboard "de-sync" in a couple of matches. You can set a default that will run if it does this, but that could lead to not so good things. We're planning on making a file on the roborio that we can edit before a match and then read from to determine autonomous. The only things we'll have to watch out for are making sure that the format we use to enter data into the file stays constant and we'll need to remember to re-create the file if ever we need to re-image the roborio during comp.

euhlmann 31-01-2017 07:51

Re: Set Auto Selector choices on default dashboard from Java robot code?
 
We simply used SendableChooser last year. The only problems we had with it were due to SFX being terrible (it required us to double-select everything, and sometimes it forgot our team number, but besides that everything worked fine). There was plenty of time before auto started for NetworkTables to sync.

tr6scott 31-01-2017 08:01

Re: Set Auto Selector choices on default dashboard from Java robot code?
 
We have had good success with the dashboard displaying the selection and using joysticks to adjust the choice.

We have had the failure of setting it in the dashboard, and having it not work. This was years ago, so we don't do that anymore, may work fine now.

*We are a Labview team

fovea1959 31-01-2017 11:36

Re: Set Auto Selector choices on default dashboard from Java robot code?
 
Against all the advantages of onboard autonomous selection, doing it at the drive station handles the situation where the gates are closed on the field and everyone realizes that *no one* set the autonomous mode. You get one last chance to mouse it in....

We have not had problems with disconnects between requested autonomous and what we got, and we had upwards of 80 matches in the last year.

jreneew2 31-01-2017 13:21

Re: Set Auto Selector choices on default dashboard from Java robot code?
 
I would also like to chime in and say that we have never had any problems with the smartdashboard not syncing properly and we have been using it to select auto modes for 3 years now.

otherguy 31-01-2017 13:38

We have user sendable chooser for years now for auto selection through smart dashboard, haven't had a problem since 2013 (selected auto mode on dash wasn't being sent out to the robot randomly and required robot reboot iirc).

Sent from my 6045I using Tapatalk


All times are GMT -5. The time now is 22:46.

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