Class CANCoderAdapter

All Implemented Interfaces:
DataFrameRefreshable

public class CANCoderAdapter extends XCANCoder
  • 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()
    • getHealth_internal

      public DeviceHealth getHealth_internal()
    • setPosition

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

      public double getMagnetOffset()
      Gets the magnet offset configured on the encoder device. Blocking call.
      Returns:
      The magnet offset in degrees
    • setMagnetOffset

      public boolean setMagnetOffset(double offsetInDegrees)
      Sets the magnet offset configured on the encoder device.
      Parameters:
      offsetInDegrees - The magnet offset in degrees
      Returns:
      True on success.
    • 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