Class MotorInputs

java.lang.Object
frc.spectrumLib.mechanism.MotorInputs
All Implemented Interfaces:
Cloneable, LoggableInputs

public class MotorInputs extends Object implements LoggableInputs, Cloneable
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 Details

    • connected

      public boolean connected
    • resetOccurred

      public boolean resetOccurred
      The 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 latencyCompensatedPositionRotations
      Position 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