Class FlywheelIOSpark
java.lang.Object
frc.robot.subsystems.shooter.flywheel.FlywheelIOSpark
- All Implemented Interfaces:
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface frc.robot.subsystems.shooter.flywheel.FlywheelIO
FlywheelIO.FlywheelIOInputs -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new FlywheelIOSpark and configures the motor controller. -
Method Summary
Modifier and TypeMethodDescriptionvoidClears all faults and warnings.voidrunCharacterization(Voltage voltage) Runs a characterization routine on the flywheel to determine its feedforward constants.voidsetAngularVelocity(AngularVelocity velocity) Commands the flywheel to spin at a specific angular velocity.voidstop()Stops the flywheel motor.voidUpdates the set of loggable inputs with the latest data from the flywheel hardware.
-
Constructor Details
-
FlywheelIOSpark
public FlywheelIOSpark()Creates a new FlywheelIOSpark and configures the motor controller.
-
-
Method Details
-
updateInputs
Description copied from interface:FlywheelIOUpdates the set of loggable inputs with the latest data from the flywheel hardware.- Specified by:
updateInputsin interfaceFlywheelIO- Parameters:
inputs- The inputs object to update.
-
setAngularVelocity
Description copied from interface:FlywheelIOCommands the flywheel to spin at a specific angular velocity.- Specified by:
setAngularVelocityin interfaceFlywheelIO- Parameters:
velocity- The target angular velocity for the flywheel.
-
runCharacterization
Description copied from interface:FlywheelIORuns a characterization routine on the flywheel to determine its feedforward constants.- Specified by:
runCharacterizationin interfaceFlywheelIO- Parameters:
voltage- The voltage to apply during characterization.
-
stop
public void stop()Description copied from interface:FlywheelIOStops the flywheel motor.- Specified by:
stopin interfaceFlywheelIO
-
clearFaults
public void clearFaults()Description copied from interface:FlywheelIOClears all faults and warnings.- Specified by:
clearFaultsin interfaceFlywheelIO
-