Class RuntimeInputs
java.lang.Object
frc.robot.RuntimeInputs
- All Implemented Interfaces:
LoggableInputs
Facts about where the code is running that logic depends on, as an AdvantageKit input.
Replay always runs in Constants.Mode.REPLAY, so code that branches on "is this the
simulator?" would take the simulator's branch when replaying a real match. Anything that must
behave the way the recorded run did reads this instead: on the robot and in the sim it records
the truth; in replay it restores what the recorded run was.
-
Method Summary
Modifier and TypeMethodDescriptionstatic doubleBattery voltage for the run being executed (or replayed).static booleanWhether the controller is browned out, for the run being executed (or replayed).voidstatic booleanWhether the run being executed (or replayed) is the desktop simulator.static voidsetBrownoutApiAvailable(boolean available) Starts reading the brownout state, once the robot has found the API works.voidstatic voidupdate()Records (or in replay, restores) the inputs.
-
Method Details
-
update
public static void update()Records (or in replay, restores) the inputs. Call once per loop, first thing. -
isSimulation
public static boolean isSimulation()Whether the run being executed (or replayed) is the desktop simulator. -
batteryVoltage
public static double batteryVoltage()Battery voltage for the run being executed (or replayed). -
brownedOut
public static boolean brownedOut()Whether the controller is browned out, for the run being executed (or replayed). -
setBrownoutApiAvailable
public static void setBrownoutApiAvailable(boolean available) Starts reading the brownout state, once the robot has found the API works. -
toLog
- Specified by:
toLogin interfaceLoggableInputs
-
fromLog
- Specified by:
fromLogin interfaceLoggableInputs
-