Class Robot

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class Robot
    extends edu.wpi.first.wpilibj.TimedRobot
    Once the Main class starts this class, the VM is configured to call the functions corresponding to each mode, as described in the IterativeRobotBase documentation. In summary, this class is the root of everything that the robot does. Everytime the driver station or FMS tells the robot to enter a new mode, this class handles that instruction. In general, this class should not be modified.
    See Also:
    IterativeRobotBase
    • Field Summary

      • Fields inherited from class edu.wpi.first.wpilibj.TimedRobot

        kDefaultPeriod
    • Constructor Summary

      Constructors 
      Constructor Description
      Robot()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void autonomousInit()
      Runs when autonomous is enabled.
      void autonomousPeriodic()
      Runs repeatedly while autonomous is enabled.
      void disabledInit()
      Runs when robot is disabled, announces that the robot has been disabled.
      void disabledPeriodic()
      Runs repeatedly while robot is disabled.
      void robotInit()
      Runs on initialization, creates and configures the framework Core.
      void robotPeriodic()
      Runs repeatedly, regardless of mode and state.
      void teleopInit()
      Runs when teleoperated is enabled.
      void teleopPeriodic()
      Runs repeatedly while teleoperated is enabled.
      void testInit()
      Runs when test is enabled.
      void testPeriodic()
      Runs repeatedly while test is enabled.
      • Methods inherited from class edu.wpi.first.wpilibj.TimedRobot

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

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

        getMainThreadId, getRuntimeType, isAutonomous, isAutonomousEnabled, isDisabled, isEnabled, isReal, isSimulation, isTeleop, isTeleopEnabled, isTest, isTestEnabled, startRobot, suppressExitWarning
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Robot

        public Robot()
    • Method Detail

      • robotInit

        public void robotInit()
        Runs on initialization, creates and configures the framework Core.
        Overrides:
        robotInit in class edu.wpi.first.wpilibj.IterativeRobotBase
      • disabledInit

        public void disabledInit()
        Runs when robot is disabled, announces that the robot has been disabled.
        Overrides:
        disabledInit in class edu.wpi.first.wpilibj.IterativeRobotBase
      • autonomousInit

        public void autonomousInit()
        Runs when autonomous is enabled. Resets all the subsystems, then starts the currently selected (and locked in) auto program.
        Overrides:
        autonomousInit in class edu.wpi.first.wpilibj.IterativeRobotBase
      • teleopInit

        public void teleopInit()
        Runs when teleoperated is enabled. Cleans up from autonomous then resets all the subsystems. Note: once teleopInit() is called auto cannot be run again.
        Overrides:
        teleopInit in class edu.wpi.first.wpilibj.IterativeRobotBase
      • testInit

        public void testInit()
        Runs when test is enabled. Currently does nothing.
        Overrides:
        testInit in class edu.wpi.first.wpilibj.IterativeRobotBase
        See Also:
        robot_framework#10
      • robotPeriodic

        public void robotPeriodic()
        Runs repeatedly, regardless of mode and state. Tells the core to run each manager.
        Overrides:
        robotPeriodic in class edu.wpi.first.wpilibj.IterativeRobotBase
        See Also:
        robot_framework#26
      • disabledPeriodic

        public void disabledPeriodic()
        Runs repeatedly while robot is disabled. Currently does nothing.
        Overrides:
        disabledPeriodic in class edu.wpi.first.wpilibj.IterativeRobotBase
      • autonomousPeriodic

        public void autonomousPeriodic()
        Runs repeatedly while autonomous is enabled. Tells the core to run each manager.
        Overrides:
        autonomousPeriodic in class edu.wpi.first.wpilibj.IterativeRobotBase
      • teleopPeriodic

        public void teleopPeriodic()
        Runs repeatedly while teleoperated is enabled. Tells the core to run each manager.
        Overrides:
        teleopPeriodic in class edu.wpi.first.wpilibj.IterativeRobotBase
      • testPeriodic

        public void testPeriodic()
        Runs repeatedly while test is enabled. Currently does nothing.
        Overrides:
        testPeriodic in class edu.wpi.first.wpilibj.IterativeRobotBase
        See Also:
        robot_framework#10