Team138Entropy / Entropy2022

FIRST Robotics Team Entropy 138's code for the 2022 season
Other
3 stars 0 forks source link

Autonomous Switcher #2

Closed joecaraccio closed 2 years ago

joecaraccio commented 2 years ago

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:

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);

Nick-P-Orr commented 2 years ago

George pushed code to add the auto mode selector, and shuffle board layout.