Interface IMotorControllerEnhanced

All Superinterfaces:
IFollower, IInvertable, IMotorController, IOutputSignal
All Known Implementing Classes:
BaseTalon, TalonFX, TalonSRX, WPI_TalonFX, WPI_TalonSRX

public interface IMotorControllerEnhanced
extends IMotorController
Interface for enhanced motor controllers
  • Method Details

    • configSelectedFeedbackSensor

      ErrorCode configSelectedFeedbackSensor​(FeedbackDevice feedbackDevice, int pidIdx, int timeoutMs)
      Select the feedback device for the motor controller.
      Parameters:
      feedbackDevice - Feedback Device to select.
      pidIdx - 0 for Primary closed-loop. 1 for auxiliary closed-loop.
      timeoutMs - Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
      Returns:
      Error Code generated by function. 0 indicates no error.
    • configSupplyCurrentLimit

      Configures the supply (input) current limit.
      Parameters:
      currLimitCfg - Current limit configuration
      timeoutMs - Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
      Returns:
      Error Code generated by function. 0 indicates no error.
    • setStatusFramePeriod

      ErrorCode setStatusFramePeriod​(StatusFrameEnhanced frame, int periodMs, int timeoutMs)
      Sets the period of the given status frame. User ensure CAN Bus utilization is not high. This setting is not persistent and is lost when device is reset. If this is a concern, calling application can use hasResetOccurred() to determine if the status frame needs to be reconfigured.
      Parameters:
      frame - Frame whose period is to be changed.
      periodMs - Period in ms for the given frame.
      timeoutMs - Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
      Returns:
      Error Code generated by function. 0 indicates no error.
    • getStatusFramePeriod

      int getStatusFramePeriod​(StatusFrameEnhanced frame, int timeoutMs)
      Gets the period of the given status frame.
      Parameters:
      frame - Frame to get the period of.
      timeoutMs - Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
      Returns:
      Period of the given status frame.
    • getOutputCurrent

      Deprecated.
      Use getStatorCurrent/getSupplyCurrent instead.
      Gets the output current of the motor controller. In the case of TalonSRX class, this routine returns supply current for legacy reasons. In order to get the "true" output current, call GetStatorCurrent(). In the case of TalonFX class, this routine returns the true output stator current.
      Returns:
      The output current (in amps).
    • configVelocityMeasurementPeriod

      Sets the period over which velocity measurements are taken.
      Parameters:
      period - Desired period for the velocity measurement. @see com.ctre.phoenix.sensors.SensorVelocityMeasPeriod
      timeoutMs - Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
      Returns:
      Error Code generated by function. 0 indicates no error.
    • configVelocityMeasurementPeriod

      Deprecated.
      Use the overload with SensorVelocityMeasPeriod instead.
      Sets the period over which velocity measurements are taken.
      Parameters:
      period - Desired period for the velocity measurement. @see com.ctre.phoenix.sensors.SensorVelocityMeasPeriod
      timeoutMs - Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
      Returns:
      Error Code generated by function. 0 indicates no error.
    • configVelocityMeasurementWindow

      ErrorCode configVelocityMeasurementWindow​(int windowSize, int timeoutMs)
      Sets the number of velocity samples used in the rolling average velocity measurement.
      Parameters:
      windowSize - Number of samples in the rolling average of velocity measurement. Valid values are 1,2,4,8,16,32. If another value is specified, it will truncate to nearest support value.
      timeoutMs - Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
      Returns:
      Error Code generated by function. 0 indicates no error.
    • configForwardLimitSwitchSource

      ErrorCode configForwardLimitSwitchSource​(LimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int timeoutMs)
      Configures the forward limit switch for a remote source. For example, a CAN motor controller may need to monitor the Limit-F pin of another Talon or CANifier.
      Parameters:
      type - Remote limit switch source. User can choose between a remote Talon SRX, CANifier, or deactivate the feature.
      normalOpenOrClose - Setting for normally open, normally closed, or disabled. This setting matches the Phoenix Tuner drop down.
      timeoutMs - Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
      Returns:
      Error Code generated by function. 0 indicates no error.
    • configReverseLimitSwitchSource

      ErrorCode configReverseLimitSwitchSource​(LimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int timeoutMs)
      Configures the reverse limit switch for a remote source. For example, a CAN motor controller may need to monitor the Limit-R pin of another Talon or CANifier.
      Parameters:
      type - Remote limit switch source. User can choose between a remote Talon SRX, CANifier, or deactivate the feature.
      normalOpenOrClose - Setting for normally open, normally closed, or disabled. This setting matches the Phoenix Tuner drop down.
      timeoutMs - Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
      Returns:
      Error Code generated by function. 0 indicates no error.