|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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.
|
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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);
}
|
|
#4
|
|||
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|