1616
1717public class Robot extends TimedRobot {
1818 private AutoCommandInterface m_autonomousCommand ;
19- private static final Logger logger = LoggerFactory . getLogger ( Robot . class ) ;
19+ private static Logger logger ;
2020
2121 private RobotContainer m_robotContainer ;
2222 private boolean haveAlliance ;
2323
2424 @ Override
2525 public void robotInit () {
2626 m_robotContainer = new RobotContainer ();
27+ logger = LoggerFactory .getLogger (Robot .class );
28+ logger .info (
29+ "Event: {}, Match Type: {}, Match #: {}, Replay #: {}" ,
30+ DriverStation .getEventName (),
31+ DriverStation .getMatchType (),
32+ DriverStation .getMatchNumber (),
33+ DriverStation .getReplayNumber ());
2734 haveAlliance = false ;
2835
2936 Shuffleboard .getTab ("Match" )
@@ -49,7 +56,7 @@ public void robotPeriodic() {
4956 haveAlliance = true ;
5057 m_robotContainer .setAllianceColor (alliance );
5158 logger .info ("Set Alliance {}" , alliance );
52- // m_robotContainer.getAutoSwitch().getAutCommand ().generateTrajectory();
59+ m_robotContainer .getAutoSwitch ().getAutoCommand ().generateTrajectory ();
5360 }
5461 }
5562 }
@@ -62,6 +69,7 @@ public void disabledInit() {
6269 @ Override
6370 public void disabledPeriodic () {
6471 m_robotContainer .getAutoSwitch ().checkSwitch ();
72+ m_robotContainer .checkCameraOnline ();
6573 }
6674
6775 @ Override
@@ -71,12 +79,12 @@ public void disabledExit() {}
7179 public void autonomousInit () {
7280 logger .info ("Autonomous Init" );
7381 m_robotContainer .setAuto (true );
74- // m_autonomousCommand = m_robotContainer.getAutoSwitch().getAutCommand ();
75- // if (m_autonomousCommand != null) {
76- // if (!m_autonomousCommand.hasGenerated()) m_autonomousCommand.generateTrajectory();
77- // m_autonomousCommand.schedule();
78- // }
79- m_robotContainer .getAutoCommand ().schedule ();
82+ m_autonomousCommand = m_robotContainer .getAutoSwitch ().getAutoCommand ();
83+ if (m_autonomousCommand != null ) {
84+ if (!m_autonomousCommand .hasGenerated ()) m_autonomousCommand .generateTrajectory ();
85+ m_autonomousCommand .schedule ();
86+ }
87+ // m_robotContainer.getAutoCommand().schedule();
8088 }
8189
8290 @ Override
@@ -92,7 +100,7 @@ public void teleopInit() {
92100 m_autonomousCommand .cancel ();
93101 }
94102 m_robotContainer .zeroElevator ();
95- // m_robotContainer.setAuto(false); commented out for now - to allow testing in Tele
103+ m_robotContainer .setAuto (false ); // commented out for now - to allow testing in Tele
96104 }
97105
98106 @ Override
0 commit comments