Class WsMotorController

Direct Known Subclasses:
WsSpark, WsTalon

public abstract class WsMotorController extends AnalogOutput
Abstract class decribing those that control some kind of motor controller.
  • Constructor Details

    • WsMotorController

      public WsMotorController(String p_name)
      Generic motor controller constructor, cannot be called.
      Parameters:
      p_name - Descriptive name of the controller.
    • WsMotorController

      public WsMotorController(String p_name, double p_default)
      Generic motor controller constructor, cannot be called.
      Parameters:
      p_name - Descriptive name of the controller.
      p_default - Default output value.
  • Method Details

    • setBrake

      public abstract void setBrake()
      Sets the motor to brake mode, will not freely spin.
    • setCoast

      public abstract void setCoast()
      Sets the motor to coast mode, will freely spin.
    • getVelocity

      public abstract double getVelocity()
      Returns the quadrature velocity from an encoder.
      Returns:
      Current velocity.
    • getPosition

      public abstract double getPosition()
      Returns the quadrature position from an encoder.
      Returns:
      Current position.
    • getOutput

      public abstract double getOutput()
      Returns the current motor output percent.
      Returns:
      Current motor output as a percent.
    • getTemperature

      public abstract double getTemperature()
      Return the motor controller or motor temperature
      Returns:
      Current temperature.
    • sendDataToOutput

      public abstract void sendDataToOutput()
      Sets motor speed to current value, from -1.0 to 1.0.
      Specified by:
      sendDataToOutput in class Output
    • setSpeed

      public void setSpeed(double value)
      Wraps setValue().
      Parameters:
      value - New motor percent speed, from -1.0 to 1.0.
    • stop

      public void stop()
      Sets the motors to 0 speed.