edu.wpi.first.wpilibj

## Interface CANSpeedController

- All Superinterfaces:
    LiveWindowSendable, PIDInterface, PIDOutput, Sendable, SpeedController

      public interface CANSpeedController
      extends SpeedController, PIDInterface, LiveWindowSendable

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `CANSpeedController.ControlMode` Mode determines how the motor is controlled, used internally.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `SMART_DASHBOARD_TYPE` All CAN Speed Controllers have the same SmartDashboard type: "CANSpeedController".

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getBusVoltage()` Get the current input (battery) voltage.
    `CANSpeedController.ControlMode` | `getControlMode()` Gets the current control mode.
    `default double` | `getF()` Gets the feed-forward PID constant.
    `double` | `getOutputCurrent()` Get the current being applied to the motor.
    `double` | `getOutputVoltage()` Get the current output voltage.
    `double` | `getPosition()` Return the current position of whatever the current selected sensor is.
    `default java.lang.String` | `getSmartDashboardType()` The string representation of the named data type that will be used by the smart dashboard for this `Sendable`.
    `double` | `getSpeed()` Return the current velocity of whatever the current selected sensor is.
    `double` | `getTemperature()` Get the current temperature of the controller.
    `void` | `setControlMode(int mode)` Sets the control mode of this speed controller.
    `void` | `setD(double d)` Set the derivative PID constant.
    `default void` | `setF(double f)` Set the feed-forward PID constant.
    `void` | `setI(double i)` Set the integral PID constant.
    `void` | `setP(double p)` Set the proportional PID constant.
    `void` | `setVoltageRampRate(double rampRate)` Set the maximum rate of change of the output voltage.

    - ### Methods inherited from interface edu.wpi.first.wpilibj.SpeedController

      `disable, get, getInverted, set, setInverted, stopMotor`

    - ### Methods inherited from interface edu.wpi.first.wpilibj.PIDOutput

      `pidWrite`

    - ### Methods inherited from interface edu.wpi.first.wpilibj.PIDInterface

      `disable, enable, getD, getError, getI, getP, getSetpoint, isEnabled, reset, setPID, setSetpoint`

    - ### Methods inherited from interface edu.wpi.first.wpilibj.livewindow.LiveWindowSendable

      `startLiveWindowMode, stopLiveWindowMode, updateTable`

    - ### Methods inherited from interface edu.wpi.first.wpilibj.Sendable

      `initTable`

- - ### Field Detail

    - #### SMART_DASHBOARD_TYPE

          static final java.lang.String SMART_DASHBOARD_TYPE

      All CAN Speed Controllers have the same SmartDashboard type: "CANSpeedController".
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getControlMode

          CANSpeedController.ControlMode getControlMode()

      Gets the current control mode.
      Returns:
        the current control mode

    - #### setControlMode

          void setControlMode(int mode)

      Sets the control mode of this speed controller.
      Parameters:
        `mode` - the the new mode

    - #### setP

          void setP(double p)

      Set the proportional PID constant.

    - #### setI

          void setI(double i)

      Set the integral PID constant.

    - #### setD

          void setD(double d)

      Set the derivative PID constant.

    - #### setF

          default void setF(double f)

      Set the feed-forward PID constant. This method is optional to implement.

    - #### getF

          default double getF()

      Gets the feed-forward PID constant. This method is optional to implement. If a subclass does not implement this, it will always return zero.

    - #### getBusVoltage

          double getBusVoltage()

      Get the current input (battery) voltage.
      Returns:
        the input voltage to the controller (in Volts).

    - #### getOutputVoltage

          double getOutputVoltage()

      Get the current output voltage.
      Returns:
        the output voltage to the motor in volts.

    - #### getOutputCurrent

          double getOutputCurrent()

      Get the current being applied to the motor.
      Returns:
        the current motor current (in Amperes).

    - #### getTemperature

          double getTemperature()

      Get the current temperature of the controller.
      Returns:
        the current temperature of the controller, in degrees Celsius.

    - #### getPosition

          double getPosition()

      Return the current position of whatever the current selected sensor is.

      See specific implementations for more information on selecting feedback sensors.

      Returns:
        the current sensor position.

    - #### getSpeed

          double getSpeed()

      Return the current velocity of whatever the current selected sensor is.

      See specific implementations for more information on selecting feedback sensors.

      Returns:
        the current sensor velocity.

    - #### setVoltageRampRate

          void setVoltageRampRate(double rampRate)

      Set the maximum rate of change of the output voltage.
      Parameters:
        `rampRate` - the maximum rate of change of the voltage, in Volts / sec.

    - #### getSmartDashboardType

          default java.lang.String getSmartDashboardType()

      Description copied from interface: `Sendable`
      The string representation of the named data type that will be used by the smart dashboard for this `Sendable`.
      Specified by:
        `getSmartDashboardType` in interface `Sendable`
      Returns:
        The type of this `Sendable`.