Package frc.robot

Class Robot

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class Robot
    extends edu.wpi.first.wpilibj.TimedRobot
    The VM is configured to automatically run this class, and to call the functions corresponding to each mode, as described in the TimedRobot documentation. If you change the name of this class or the package after creating this project, you must also update the build.gradle file in the project.
    • Constructor Summary

      Constructors 
      Constructor Description
      Robot()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void autonomousInit()
      This autonomous (along with the chooser code above) shows how to select between different autonomous modes using the dashboard.
      void autonomousPeriodic()
      This function is called periodically during autonomous.
      void disabledInit()
      This function is called once when the robot is disabled.
      void disabledPeriodic()
      This function is called periodically when disabled.
      void robotInit()
      This function is run when the robot is first started up and should be used for any initialization code.
      void robotPeriodic()
      This function is called every robot packet, no matter the mode.
      void teleopInit()
      This function is called once when teleop is enabled.
      void teleopPeriodic()
      This function is called periodically during operator control.
      void testInit()
      This function is called once when test mode is enabled.
      void testPeriodic()
      This function is called periodically during test mode.
      • Methods inherited from class edu.wpi.first.wpilibj.TimedRobot

        addPeriodic, addPeriodic, endCompetition, finalize, startCompetition
      • Methods inherited from class edu.wpi.first.wpilibj.IterativeRobotBase

        autonomousExit, disabledExit, getPeriod, loopFunc, setNetworkTablesFlushEnabled, simulationInit, simulationPeriodic, teleopExit, testExit
      • Methods inherited from class edu.wpi.first.wpilibj.RobotBase

        close, getBooleanProperty, getMainThreadId, getRuntimeType, isAutonomous, isAutonomousEnabled, isDisabled, isEnabled, isNewDataAvailable, isOperatorControl, isOperatorControlEnabled, isReal, isSimulation, isTeleop, isTeleopEnabled, isTest, startRobot, suppressExitWarning
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • period

        private double period
      • teleopPrograms

        private final edu.wpi.first.wpilibj.smartdashboard.SendableChooser<java.lang.String> teleopPrograms
      • autonomousPrograms

        private final edu.wpi.first.wpilibj.smartdashboard.SendableChooser<java.lang.String> autonomousPrograms
      • testPrograms

        private final edu.wpi.first.wpilibj.smartdashboard.SendableChooser<java.lang.String> testPrograms
      • activeMode

        private java.lang.String activeMode
    • Constructor Detail

      • Robot

        public Robot()
    • Method Detail

      • robotInit

        public void robotInit()
        This function is run when the robot is first started up and should be used for any initialization code.
        Overrides:
        robotInit in class edu.wpi.first.wpilibj.IterativeRobotBase
      • robotPeriodic

        public void robotPeriodic()
        This function is called every robot packet, no matter the mode. Use this for items like diagnostics that you want ran during disabled, autonomous, teleoperated and test.

        This runs after the mode specific periodic functions, but before LiveWindow and SmartDashboard integrated updating.

        Overrides:
        robotPeriodic in class edu.wpi.first.wpilibj.IterativeRobotBase
      • autonomousInit

        public void autonomousInit()
        This autonomous (along with the chooser code above) shows how to select between different autonomous modes using the dashboard. The sendable chooser code works with the Java SmartDashboard. If you prefer the LabVIEW Dashboard, remove all of the chooser code and uncomment the getString line to get the auto name from the text box below the Gyro

        You can add additional auto modes by adding additional comparisons to the switch structure below with additional strings. If using the SendableChooser make sure to add them to the chooser code above as well.

        Overrides:
        autonomousInit in class edu.wpi.first.wpilibj.IterativeRobotBase
      • autonomousPeriodic

        public void autonomousPeriodic()
        This function is called periodically during autonomous.
        Overrides:
        autonomousPeriodic in class edu.wpi.first.wpilibj.IterativeRobotBase
      • teleopInit

        public void teleopInit()
        This function is called once when teleop is enabled.
        Overrides:
        teleopInit in class edu.wpi.first.wpilibj.IterativeRobotBase
      • teleopPeriodic

        public void teleopPeriodic()
        This function is called periodically during operator control.
        Overrides:
        teleopPeriodic in class edu.wpi.first.wpilibj.IterativeRobotBase
      • testInit

        public void testInit()
        This function is called once when test mode is enabled.
        Overrides:
        testInit in class edu.wpi.first.wpilibj.IterativeRobotBase
      • testPeriodic

        public void testPeriodic()
        This function is called periodically during test mode.
        Overrides:
        testPeriodic in class edu.wpi.first.wpilibj.IterativeRobotBase
      • disabledInit

        public void disabledInit()
        This function is called once when the robot is disabled.
        Overrides:
        disabledInit in class edu.wpi.first.wpilibj.IterativeRobotBase
      • disabledPeriodic

        public void disabledPeriodic()
        This function is called periodically when disabled.
        Overrides:
        disabledPeriodic in class edu.wpi.first.wpilibj.IterativeRobotBase