Class LoggedRobot

java.lang.Object
edu.wpi.first.wpilibj.RobotBase
edu.wpi.first.wpilibj.IterativeRobotBase
org.team1126.lib.logging.LoggedRobot
All Implemented Interfaces:
AutoCloseable
Direct Known Subclasses:
Robot

public class LoggedRobot extends edu.wpi.first.wpilibj.IterativeRobotBase
LoggedRobot implements the IterativeRobotBase robot program framework, and is intended to be subclassed by a user creating a robot program.

The LoggedRobot class configures the program for logging data to NetworkTables via Epilogue, which is captured by the DataLogManager alongside Driver Station values and saved to file. Loop timings are also recorded using the Profiler class.

periodic() functions from the base class are called on an interval by a Notifier instance. Additionally, utility classes with periodic methods such as Tunables.Tunable are updated on the same interval.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
    Default loop period.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor for LoggedRobot.
    protected
    LoggedRobot(double period)
    Constructor for LoggedRobot.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
     
    void
     
    void
    enableRT(boolean enabled)
    Enables real-time thread priority on the main thread while the robot is enabled.
    void
     
    void
     
    void
     
    void
     
    void
     
    void
     

    Methods inherited from class edu.wpi.first.wpilibj.IterativeRobotBase

    autonomousExit, autonomousInit, disabledExit, disabledInit, driverStationConnected, enableLiveWindowInTest, getPeriod, isLiveWindowEnabledInTest, loopFunc, printWatchdogEpochs, robotInit, setNetworkTablesFlushEnabled, simulationInit, teleopExit, teleopInit, testExit, testInit

    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
  • Field Details

    • DEFAULT_PERIOD

      public static final double DEFAULT_PERIOD
      Default loop period.
      See Also:
  • Constructor Details

    • LoggedRobot

      protected LoggedRobot()
      Constructor for LoggedRobot.
    • LoggedRobot

      protected LoggedRobot(double period)
      Constructor for LoggedRobot.
      Parameters:
      period - Period in seconds.
  • Method Details

    • enableRT

      public void enableRT(boolean enabled)
      Enables real-time thread priority on the main thread while the robot is enabled. Do not use this method if you are unaware of its side effects.
      Parameters:
      enabled - true to enable real-time priority.
    • startCompetition

      public void startCompetition()
      Specified by:
      startCompetition in class edu.wpi.first.wpilibj.IterativeRobotBase
    • endCompetition

      public void endCompetition()
      Specified by:
      endCompetition in class edu.wpi.first.wpilibj.RobotBase
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class edu.wpi.first.wpilibj.RobotBase
    • robotPeriodic

      public void robotPeriodic()
      Overrides:
      robotPeriodic in class edu.wpi.first.wpilibj.IterativeRobotBase
    • simulationPeriodic

      public void simulationPeriodic()
      Overrides:
      simulationPeriodic in class edu.wpi.first.wpilibj.IterativeRobotBase
    • disabledPeriodic

      public void disabledPeriodic()
      Overrides:
      disabledPeriodic in class edu.wpi.first.wpilibj.IterativeRobotBase
    • autonomousPeriodic

      public void autonomousPeriodic()
      Overrides:
      autonomousPeriodic in class edu.wpi.first.wpilibj.IterativeRobotBase
    • teleopPeriodic

      public void teleopPeriodic()
      Overrides:
      teleopPeriodic in class edu.wpi.first.wpilibj.IterativeRobotBase
    • testPeriodic

      public void testPeriodic()
      Overrides:
      testPeriodic in class edu.wpi.first.wpilibj.IterativeRobotBase