Class MockCANCoder

All Implemented Interfaces:
DataFrameRefreshable, ISimulatableSensor

public class MockCANCoder extends XCANCoder implements ISimulatableSensor
  • Constructor Details

  • Method Details

    • getDeviceId

      public int getDeviceId()
      Specified by:
      getDeviceId in class XAbsoluteEncoder
    • getPosition_internal

      public Angle getPosition_internal()
    • getAbsolutePosition_internal

      public Angle getAbsolutePosition_internal()
    • getVelocity_internal

      public AngularVelocity getVelocity_internal()
    • setPosition

      public void setPosition(Angle newPosition)
      Specified by:
      setPosition in class XAbsoluteEncoder
    • getPositionOffset

      public double getPositionOffset()
    • setAbsolutePosition

      public void setAbsolutePosition(Angle position)
    • ingestSimulationData

      public void ingestSimulationData(org.json.JSONObject payload)
      Specified by:
      ingestSimulationData in interface ISimulatableSensor
    • getHealth_internal

      public DeviceHealth getHealth_internal()
    • setUpdateFrequencyForPosition

      public StatusCode setUpdateFrequencyForPosition(double frequencyInHz)
      Description copied from class: XCANCoder
      Updates how often we get data about the CANCoder position.
      Specified by:
      setUpdateFrequencyForPosition in class XCANCoder
      Parameters:
      frequencyInHz - How many times per second we want to get data.
      Returns:
      The status code returned from the underlying object.
    • stopAllUnsetSignals

      public StatusCode stopAllUnsetSignals()
      Description copied from class: XCANCoder
      Stops all signals that are not explicitly set. For example, if you haven't called setUpdateFrequencyForPosition, this will stop that signal! Useful for reducing CAN bus traffic for data we're not reading.
      Specified by:
      stopAllUnsetSignals in class XCANCoder
      Returns:
      The status code returned from the underlying object.
    • clearStickyFaults

      public StatusCode clearStickyFaults()
      Specified by:
      clearStickyFaults in class XCANCoder
    • hasResetOccurred_internal

      public boolean hasResetOccurred_internal()
    • updateInputs

      public void updateInputs(XAbsoluteEncoderInputs inputs)
      Specified by:
      updateInputs in class XAbsoluteEncoder
    • updateInputs

      public void updateInputs(XCANCoderInputs inputs)
      Specified by:
      updateInputs in class XCANCoder