Interface MotorController

All Known Implementing Classes:
Koors40, PWMMotorController, PWMSparkFlex, PWMSparkMax, PWMTalonFX, PWMTalonSRX, PWMVenom, PWMVictorSPX, RomiMotor, Spark, SparkMini, Talon, VictorSP, XRPMotor

public interface MotorController
Interface for motor controlling devices.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Disables the motor controller.
    boolean
    Gets the inversion state of the motor controller.
    double
    Gets the throttle of the motor controller.
    void
    setInverted(boolean isInverted)
    Sets the inversion state of the motor controller.
    void
    setThrottle(double throttle)
    Sets the throttle of the motor controller.
    default void
    setVoltage(double voltage)
    Sets the voltage output of the motor controller.
    default void
    Sets the voltage output of the motor controller.
  • Method Details

    • setThrottle

      void setThrottle(double throttle)
      Sets the throttle of the motor controller.
      Parameters:
      throttle - The throttle where -1 indicates full reverse and 1 indicates full forward.
    • setVoltage

      default void setVoltage(double voltage)
      Sets the voltage output of the motor controller.

      Compensates for the current bus voltage to ensure that the desired voltage is output even if the battery voltage is below 12V - highly useful when the voltage outputs are "meaningful" (e.g. they come from a feedforward calculation).

      NOTE: This function *must* be called regularly in order for voltage compensation to work properly - unlike the ordinary set function, it is not "set it and forget it."

      Parameters:
      voltage - The voltage.
    • setVoltage

      default void setVoltage(Voltage voltage)
      Sets the voltage output of the motor controller.

      Compensates for the current bus voltage to ensure that the desired voltage is output even if the battery voltage is below 12V - highly useful when the voltage outputs are "meaningful" (e.g. they come from a feedforward calculation).

      NOTE: This function *must* be called regularly in order for voltage compensation to work properly - unlike the ordinary set function, it is not "set it and forget it."

      Parameters:
      voltage - The voltage.
    • getThrottle

      double getThrottle()
      Gets the throttle of the motor controller.
      Returns:
      The throttle where -1 represents full reverse and 1 represents full forward.
    • setInverted

      void setInverted(boolean isInverted)
      Sets the inversion state of the motor controller.
      Parameters:
      isInverted - The inversion state.
    • getInverted

      boolean getInverted()
      Gets the inversion state of the motor controller.
      Returns:
      The inversion state.
    • disable

      void disable()
      Disables the motor controller.