Package frc.alotobots

Class Robot

java.lang.Object
edu.wpi.first.wpilibj.RobotBase
edu.wpi.first.wpilibj.IterativeRobotBase
org.littletonrobotics.junction.LoggedRobot
frc.alotobots.Robot
All Implemented Interfaces:
AutoCloseable

public class Robot extends org.littletonrobotics.junction.LoggedRobot
Main robot class that handles robot lifecycle and mode transitions. This class extends LoggedRobot to integrate with AdvantageKit logging framework. It manages the robot's different operating modes (autonomous, teleop, test) and handles the scheduling of commands.
  • Constructor Details

    • Robot

      public Robot()
      Constructor for the Robot class. Initializes AdvantageKit logging and sets up the robot container. Different logging configurations are used based on whether the robot is running in real, simulation, or replay mode.
  • Method Details

    • robotPeriodic

      public void robotPeriodic()
      This function is called periodically during all modes. It runs the command scheduler with high priority to ensure consistent timing.
      Overrides:
      robotPeriodic in class IterativeRobotBase
    • disabledInit

      public void disabledInit()
      Called once when the robot is disabled.
      Overrides:
      disabledInit in class IterativeRobotBase
    • disabledPeriodic

      public void disabledPeriodic()
      Called periodically when the robot is disabled.
      Overrides:
      disabledPeriodic in class IterativeRobotBase
    • autonomousInit

      public void autonomousInit()
      Called once when autonomous mode is enabled. Schedules the autonomous command selected in RobotContainer.
      Overrides:
      autonomousInit in class IterativeRobotBase
    • autonomousPeriodic

      public void autonomousPeriodic()
      Called periodically during autonomous mode.
      Overrides:
      autonomousPeriodic in class IterativeRobotBase
    • teleopInit

      public void teleopInit()
      Called once when teleop mode is enabled. Cancels the autonomous command if it's still running.
      Overrides:
      teleopInit in class IterativeRobotBase
    • teleopPeriodic

      public void teleopPeriodic()
      Called periodically during teleop mode.
      Overrides:
      teleopPeriodic in class IterativeRobotBase
    • testInit

      public void testInit()
      Called once when test mode is enabled. Cancels all running commands when entering test mode.
      Overrides:
      testInit in class IterativeRobotBase
    • testPeriodic

      public void testPeriodic()
      Called periodically during test mode.
      Overrides:
      testPeriodic in class IterativeRobotBase
    • simulationInit

      public void simulationInit()
      Called once when simulation mode is first enabled.
      Overrides:
      simulationInit in class IterativeRobotBase
    • simulationPeriodic

      public void simulationPeriodic()
      Called periodically during simulation mode.
      Overrides:
      simulationPeriodic in class IterativeRobotBase