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)

JStein 31-01-2017 14:44

Re: Set Auto Selector choices on default dashboard from Java robot code?
 
Argos typically uses switches on the actual robot. We've been let down by the dashboard methods in the past. The Huskie Board has DIP switches specifically for this reason, as do other expansion boards. People could forget to flip the switches, obviously, but that hasn't been an issue for us.

-Justin

rich2202 31-01-2017 16:11

Re: Set Auto Selector choices on default dashboard from Java robot code?
 
Another real problem with Smart Dashboard during competition, is if you can't get your Driver Station to connect (for whatever reason), they will give you a generic Driver Station to use. The may not give you time to setup your Smart Dashboard (as it has been a long enough delay waiting to get your DS to connect).

Rob Heslin 06-02-2017 16:51

Re: Set Auto Selector choices on default dashboard from Java robot code?
 
To answer the OP question, the LabVIEW default dashboard does not use a SendableChooser. Rather it requires an array of strings in SmartDashboard called "Auto List" and the user's choice is a single string "Auto Selector". The difficulty is that SmartDashboard.java has many methods that are static, but putStringArray() isn't one of them. Here is a starting point.
Code:

public class Robot extends IterativeRobot {
  SmartDashboard dash = new SmartDashboard();//needed for non-static methods
  String AutoModeSelected;
  public void robotInit() {
    dash.putStringArray("Auto List",ArrayOfAutonomousStrings);
  }
  public void autonomousInit() {
    String AutoModeSelected = dash.getString("Auto Selector");
  }
}

I will say in 2016 the major problem with SmartDashboard.exe is that it independently resolved the RobotIP using mDNS, when the DriverStation program resolved using DNS. mDNS had a tendency not to work often, or take a long time to resolve. The LabVIEW dashboard for sometime, has actually just been given the RobotIP address through TCP port 1741 with the DriverStation program. The option to chose mDNS or the static 10.XX.YY.2 as a way to resolve RobotIP in the SmartDashboard.exe is gone, or at least I can't find it. So SMartDashboard.exe might be using that TCP port data.


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

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