FRC Paradigm Shift #1259
Documentation for the 2021 Robot
Robot.h
Go to the documentation of this file.
1 // Copyright (c) FIRST and other WPILib contributors.
2 // Open Source Software; you can modify and/or share it under the terms of
3 // the WPILib BSD license file in the root directory of this project.
4 
5 #pragma once
6 
7 #include <frc/TimedRobot.h>
8 #include <frc2/command/Command.h>
9 
10 #include "RobotContainer.h"
11 
12 class Robot : public frc::TimedRobot {
13  public:
14  void RobotInit() override;
15  void RobotPeriodic() override;
16  void DisabledInit() override;
17  void DisabledPeriodic() override;
18  void AutonomousInit() override;
19  void AutonomousPeriodic() override;
20  void TeleopInit() override;
21  void TeleopPeriodic() override;
22  void TestPeriodic() override;
23 
24  private:
25  // Have it null by default so that if testing teleop it
26  // doesn't have undefined behavior and potentially crash.
27  frc2::Command* m_autonomousCommand = nullptr;
28 
30 };
void AutonomousInit() override
Definition: Robot.cpp:37
void TeleopInit() override
Definition: Robot.cpp:47
void TestPeriodic() override
Definition: Robot.cpp:68
frc2::Command * m_autonomousCommand
Definition: Robot.h:27
void DisabledPeriodic() override
Definition: Robot.cpp:31
Definition: Robot.h:12
void DisabledInit() override
Definition: Robot.cpp:29
void AutonomousPeriodic() override
Definition: Robot.cpp:45
RobotContainer m_container
Definition: Robot.h:29
void RobotInit() override
Definition: Robot.cpp:10
void RobotPeriodic() override
Definition: Robot.cpp:20
void TeleopPeriodic() override
Definition: Robot.cpp:63