Class MotorInputs
java.lang.Object
frc.spectrumLib.mechanism.MotorInputs
- All Implemented Interfaces:
Cloneable, LoggableInputs
Everything a
Mechanism reads from its motors in one loop, as an AdvantageKit input.
This is what makes every Spectrum mechanism replayable without a per-subsystem IO layer: the
signals are refreshed once per loop, copied into this object, and passed through
Logger.processInputs. On the robot that records them; in replay it overwrites them with the
recorded values, and every getter on Mechanism reads from here, so the mechanism's logic
sees exactly what it saw on the field.
Logged under /Mechanisms/<name>/....
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanboolean[]boolean[]double[]doublePosition projected from the frame's own timestamp to the refresh, along the velocity.doublebooleanThe motor rebooted since last loop, so its position restarted and its signal rates went back to defaults.doubledoubledoubledoubledouble -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
connected
public boolean connected -
resetOccurred
public boolean resetOccurredThe motor rebooted since last loop, so its position restarted and its signal rates went back to defaults. Not set for a device's first report after the program starts. -
positionRotations
public double positionRotations -
latencyCompensatedPositionRotations
public double latencyCompensatedPositionRotationsPosition projected from the frame's own timestamp to the refresh, along the velocity. -
velocityRps
public double velocityRps -
voltage
public double voltage -
statorCurrentAmps
public double statorCurrentAmps -
supplyCurrentAmps
public double supplyCurrentAmps -
tempCelsius
public double tempCelsius -
followerSupplyCurrentAmps
public double[] followerSupplyCurrentAmps -
followerConnected
public boolean[] followerConnected -
followerResetOccurred
public boolean[] followerResetOccurred
-
-
Constructor Details
-
MotorInputs
public MotorInputs()
-
-
Method Details
-
toLog
- Specified by:
toLogin interfaceLoggableInputs
-
fromLog
- Specified by:
fromLogin interfaceLoggableInputs
-