Class SpectrumRobot
java.lang.Object
org.wpilib.framework.RobotBase
org.wpilib.framework.IterativeRobotBase
org.littletonrobotics.junction.LoggedRobot
frc.spectrumLib.framework.SpectrumRobot
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
Robot
Base robot class for Spectrum robots on SystemCore: AdvantageKit's
LoggedRobot, which
runs the loop, records every input, and drives replay.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleLoop length above which WPILib prints "Loop time of Xs overrun" plus a per-section epoch breakdown to the Driver Station.Fields inherited from class LoggedRobot
defaultPeriodSecs -
Constructor Summary
ConstructorsConstructorDescriptionSpectrumRobot(double periodSeconds) Starts the robot loop atperiodSecondsand sets the loop overrun watchdogs toLOOP_OVERRUN_WARNING_SECONDS. -
Method Summary
Methods inherited from class LoggedRobot
close, endCompetition, setUseTiming, startCompetitionMethods inherited from class IterativeRobotBase
autonomousExit, autonomousInit, autonomousPeriodic, disabledExit, disabledInit, disabledPeriodic, driverStationConnected, getPeriod, loopFunc, printWatchdogEpochs, robotPeriodic, simulationInit, simulationPeriodic, teleopExit, teleopInit, teleopPeriodic, utilityExit, utilityInit, utilityPeriodicMethods inherited from class RobotBase
getMainThreadId, getOpMode, getOpModeId, getRuntimeType, isAutonomous, isAutonomousEnabled, isDisabled, isEnabled, isReal, isSimulation, isTeleop, isTeleopEnabled, isUtility, isUtilityEnabled, startRobot, suppressExitWarning
-
Field Details
-
LOOP_OVERRUN_WARNING_SECONDS
public static final double LOOP_OVERRUN_WARNING_SECONDSLoop length above which WPILib prints "Loop time of Xs overrun" plus a per-section epoch breakdown to the Driver Station.0.20 s keeps the console quiet in matches. It also hides everything below it: in the 2026-09-05 roboRIO logs 60 to 90 percent of enabled loops ran over 25 ms and none of that reached the console. AdvantageKit's
/RealOutputs/LoggedRobot/*timings and theScheduler/*timers are the record of loop time.- See Also:
-
-
Constructor Details
-
SpectrumRobot
public SpectrumRobot(double periodSeconds) Starts the robot loop atperiodSecondsand sets the loop overrun watchdogs toLOOP_OVERRUN_WARNING_SECONDS.- Parameters:
periodSeconds- the robot loop period; SystemCore runs 0.01 (100 Hz) comfortably
-