Class Constants
java.lang.Object
frc.robot.Constants
AdvantageKit runtime mode. Always
Constants.Mode.REAL on SystemCore. On the desktop it is simMode: Constants.Mode.SIM for the physics sim, or Constants.Mode.REPLAY to replay a log (see
README, "Replaying a match").-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Constants.Modestatic final doubleRobot loop period.static final intReal-time priority for the robot's main thread on the real robot, 1-99; 0 leaves it as a normal thread.static final Constants.ModeDesktop mode.static final booleanTuning mode: dashboards may change params under/Tuning/(applied while disabled) and save them to the robot, and may changeTuneValues. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanWhether hardware (real or simulated) exists, i.e.
-
Field Details
-
simMode
Desktop mode. Also settable without editing code:-Dfm.replay=trueor theFM_REPLAY=1environment variable selects replay. -
currentMode
-
LOOP_PERIOD_SECONDS
public static final double LOOP_PERIOD_SECONDSRobot loop period. The 2026 roboRIO ran 0.020 (50 Hz) and was often over budget; SystemCore runs the whole cycle in a few milliseconds, so FM runs at 100 Hz. Code that assumes a 20 ms period readsRobotLoop.periodSeconds()instead.- See Also:
-
MAIN_THREAD_RT_PRIORITY
public static final int MAIN_THREAD_RT_PRIORITYReal-time priority for the robot's main thread on the real robot, 1-99; 0 leaves it as a normal thread. SystemCore shares its four cores with its own camera servers and services (~85% busy on the bench unit), and a normal-priority main thread waits its turn behind them, which shows up as late loops.1 is the lowest real-time priority: above every normal process, but below Phoenix's CAN threads (real-time 2-3 on SystemCore, 2026-09-23) and the HAL notifier (40) that wakes the loop. Do not raise it above Phoenix: the 2026 offseason bot ran its main thread at 99 on the roboRIO and starved Phoenix's frame dispatch ("CAN message is stale", WaitForAll -1003, reverted in 2026-Spectrum 704030d).
Threads the main thread starts after this is set inherit it, so it is applied at the end of robot init;
System/TopThreadsmarks real-time threads with[rt N].- See Also:
-
TUNING_MODE
public static final boolean TUNING_MODETuning mode: dashboards may change params under/Tuning/(applied while disabled) and save them to the robot, and may changeTuneValues. Off, every tunable holds its default or params-file value and nothing is published for tuning. Turn it on for a tuning session only; CI fails a PR to main that leaves it on.- See Also:
-
-
Method Details
-
hasHardware
public static boolean hasHardware()Whether hardware (real or simulated) exists, i.e. not replaying.
-