View Single Post
  #5   Spotlight this post!  
Unread 16-08-2016, 07:32
azaclauson azaclauson is offline
Registered User
FRC #5593
 
Join Date: Jul 2016
Location: Tasmania
Posts: 17
azaclauson is an unknown quantity at this point
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);
}
Reply With Quote