In this case we use a "SendableChooser". There should be an example near the top of Robot.java. our SendableChooser needs to use the Template type "AutoModeBase" instead of "command". AutoModeBase is the base class of all our auto modes. Once that is setup we can add automodes to it (DoNothing, Drive StraightLine, Drive George's Lightning Bolt, etc )
The tasks for getting this working:
create and populate a SendableChooser. Robot.java has code that should do most of this for you already
send it to the smart dashboard
open the SmartDashboard, add it to the layout, and save the layout in our repo (it will be a Json file) so we have it. We usually just keep that in the root.
Here is some example code which will help, read the comments carefully:
// Add commands to the autonomous command chooser
m_chooser.setDefaultOption("Simple Auto", m_simpleAuto);
m_chooser.addOption("Complex Auto", m_complexAuto);
// Put the chooser on the dashboard
SmartDashboard.putData(m_chooser);
We are starting to integrate some autonomous modes! Only problem is we currently have no way of selecting different modes.
https://docs.wpilib.org/en/stable/docs/software/wpilib-tools/smartdashboard/choosing-an-autonomous-program-from-smartdashboard.html
In this case we use a "SendableChooser". There should be an example near the top of Robot.java. our SendableChooser needs to use the Template type "AutoModeBase" instead of "command". AutoModeBase is the base class of all our auto modes. Once that is setup we can add automodes to it (DoNothing, Drive StraightLine, Drive George's Lightning Bolt, etc )
The tasks for getting this working:
create and populate a SendableChooser. Robot.java has code that should do most of this for you already
send it to the smart dashboard
open the SmartDashboard, add it to the layout, and save the layout in our repo (it will be a Json file) so we have it. We usually just keep that in the root.
Here is some example code which will help, read the comments carefully:
// Add commands to the autonomous command chooser m_chooser.setDefaultOption("Simple Auto", m_simpleAuto); m_chooser.addOption("Complex Auto", m_complexAuto);
// Put the chooser on the dashboard SmartDashboard.putData(m_chooser);