Class MotorSubsystem.ControlledMotor

java.lang.Object
com.team2813.lib2813.subsystems.MotorSubsystem.ControlledMotor
All Implemented Interfaces:
Motor
Enclosing class:
MotorSubsystem<T extends Supplier<Angle>>

protected final class MotorSubsystem.ControlledMotor extends Object implements Motor
A motor that is controlled by a subclass of MotorSubsystem.
  • Method Details

    • set

      public void set(ControlMode mode, double demand)
      Sets the motor to run with a specified mode of control.

      Additionally, this method disables PID control of the subsystem

      Specified by:
      set in interface Motor
      Parameters:
      mode - The mode to control the motor with
      demand - The demand of the motor. differentiating meaning with each control mode
    • set

      public void set(ControlMode mode, double demand, double feedForward)
      Sets the motor to run with a specified mode of control, and feedForward.

      Additionally, this method disables PID control of the subsystem. It does not clamp the provided value.

      Specified by:
      set in interface Motor
      Parameters:
      mode - The mode to control the motor with
      demand - The demand of the motor. differentiating meaning with each control mode
      feedForward - The feedForward to apply to the motor
    • getAppliedCurrent

      public Current getAppliedCurrent()
      Description copied from interface: Motor
      Gets the current that is being applied onto the motor
      Specified by:
      getAppliedCurrent in interface Motor
      Returns:
      The current applied current
    • stopMotor

      public void stopMotor()
      Stops the motor.

      The motor voltage will be set to zero, and the motor will not adjust to move towards the current setpoint.

      Specified by:
      stopMotor in interface Motor