Class FlywheelIOSpark

java.lang.Object
frc.robot.subsystems.shooter.flywheel.FlywheelIOSpark
All Implemented Interfaces:
FlywheelIO

public class FlywheelIOSpark extends Object implements FlywheelIO
Real IO implementation for the shooter flywheel using a SparkFlex motor controller (Neo Vortex).

This implementation configures the motor for MAXMotion velocity control, which generates a smooth trapezoidal acceleration profile to reach the target velocity. Feedforward gains (kS, kV, kA) are configured directly in the controller, eliminating the need for manual feedforward calculations.

  • Constructor Details

    • FlywheelIOSpark

      public FlywheelIOSpark()
      Creates a new FlywheelIOSpark and configures the motor controller.
  • Method Details

    • updateInputs

      public void updateInputs(FlywheelIO.FlywheelIOInputs inputs)
      Description copied from interface: FlywheelIO
      Updates the set of loggable inputs with the latest data from the flywheel hardware.
      Specified by:
      updateInputs in interface FlywheelIO
      Parameters:
      inputs - The inputs object to update.
    • setAngularVelocity

      public void setAngularVelocity(AngularVelocity velocity)
      Description copied from interface: FlywheelIO
      Commands the flywheel to spin at a specific angular velocity.
      Specified by:
      setAngularVelocity in interface FlywheelIO
      Parameters:
      velocity - The target angular velocity for the flywheel.
    • runCharacterization

      public void runCharacterization(Voltage voltage)
      Description copied from interface: FlywheelIO
      Runs a characterization routine on the flywheel to determine its feedforward constants.
      Specified by:
      runCharacterization in interface FlywheelIO
      Parameters:
      voltage - The voltage to apply during characterization.
    • stop

      public void stop()
      Description copied from interface: FlywheelIO
      Stops the flywheel motor.
      Specified by:
      stop in interface FlywheelIO
    • clearFaults

      public void clearFaults()
      Description copied from interface: FlywheelIO
      Clears all faults and warnings.
      Specified by:
      clearFaults in interface FlywheelIO