Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Set Driver Station Autonomous Mode Options & Commands (http://www.chiefdelphi.com/forums/showthread.php?t=149799)

azaclauson 03-08-2016 08:11

Set Driver Station Autonomous Mode Options & Commands
 
Is it possible to use the default FRC Driver Station and set the options in the autonomous mode drop down and/or the different commands on the "Commands" tab without programming (I don't need to change much and like the current UI)?

I found the .txt & .ini files in C:\Users\Public\Documents\FRC and was able to make changes to the "Checklist" tab by editing Checklist.txt. Is there a way to do the same thing for the two requests above? Perhaps by adding a new section to DashboardSettings.ini?

adciv 03-08-2016 10:53

Re: Set Driver Station Autonomous Mode Options & Commands
 
You can't change it by editing a configuration file. You can add new controls and read these on the robot. Alternatively you can read the existing controls on the robot. It depends on how complex you need them to be. What language do you use?

azaclauson 04-08-2016 08:05

Re: Set Driver Station Autonomous Mode Options & Commands
 
I get the feeling the C++ code shown below, which comes from the wpilib sample robot project, is close. The comments from the sample do state it's for the Java SmartDashboard but they don't explain how to set the chooser options for the LabView dashboard?

Code:

chooser = new SendableChooser();
chooser->AddDefault(autoNameDefault, (void*)&autoNameDefault);
chooser->AddObject(autoNameCustom, (void*)&autoNameCustom);
SmartDashboard::PutData("Auto Modes", chooser);


hardcopi 04-08-2016 08:13

Re: Set Driver Station Autonomous Mode Options & Commands
 
Not sure about other programming languages, but the dashboard is just a program. We had ours set to read in a text file and run the code from that. This would let us change the functionality of the autonomous mode on the fly.

Greg McKaskle 05-08-2016 07:45

Re: Set Driver Station Autonomous Mode Options & Commands
 
If you are talking about having the default dashboard supply parameters to your auto, the basic tab has a handful of numeric sliders and strings that the driver can set and the robot's auto read. You can modify the name of the controls by setting other Network Table variables from your robot. You can persist these by going to the Variable tab and double clicking on the variables that you want to retain their value from match to match. If you want a constant default value for them, the robot can set the variables once, but then allow the driver to update them.

And as others have said, the dashboard is just a program. In fact the default dashboard is just an exe built from the LV template dashboard.

Greg McKaskle

azaclauson 16-08-2016 07:32

Re: Set Driver Station Autonomous Mode Options & Commands
 
Thanks for the tips.

I can successfully set the string, button and slider fields on the Driver Station "Basic" tab, code snippet below. I haven't been able to find a way to set the options on the chooser on the "Drive" tab. Is that meant to be possible from the robot code or is it only possible by building a custom Driver Station app with LabView?

Code:

SendableChooser *chooser;
const std::string autoNameDefault = "Default";
const std::string autoNameCustom = "My Auto";

void RobotInit()
{
        // These work.
        SmartDashboard::PutString("DB/String 0", "33");
        SmartDashboard::PutBoolean("DB/Button 1", true);
        SmartDashboard::PutNumber("DB/Slider 0", 3.58);

        // This doesn't work.
        chooser = new SendableChooser();
        chooser->AddDefault(autoNameDefault, (void*)&autoNameDefault);
        chooser->AddObject(autoNameCustom, (void*)&autoNameCustom);
        //SmartDashboard::PutData("Auto Modes", chooser);
        SmartDashboard::PutData("DB/Auto Modes", chooser);
}


Greg McKaskle 21-08-2016 08:29

Re: Set Driver Station Autonomous Mode Options & Commands
 
The auto selector shows the value of the "Auto List" string array. It should be pretty easy to set it in some initializers so that valid autos show up in the list, always consistent with the code. If you would rather have it come from file, you can use a persisted NT variable.

And of course, you can also make a custom dashboard if you want another means of selecting.

Greg McKaskle


All times are GMT -5. The time now is 09:21.

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