Package frc.robot.subsystems.intake.arm
Class ArmIOSpark
java.lang.Object
frc.robot.subsystems.intake.arm.ArmIOSpark
- All Implemented Interfaces:
ArmIO
Real IO implementation for the intake using REV SparkMax controllers.
This implementation configures the arm motor for position closed-loop control using motion profiling and the internal relative encoder, while continuously syncing to the absolute encoder to prevent drift and handle startup seeding.
-
Nested Class Summary
Nested classes/interfaces inherited from interface frc.robot.subsystems.intake.arm.ArmIO
ArmIO.ArmIOInputs -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ArmIOSpark and configures the SparkMax controllers. -
Method Summary
Modifier and TypeMethodDescriptionvoidClears all faults and warnings.voidsetPosition(Angle angle) Commands the arm motor to move to a specified position using closed-loop control.voidstop()Tells the motor to stop trying to reach its setpointvoidupdateInputs(ArmIO.ArmIOInputs inputs) Updates inputs by refreshing data from the SparkMax controllers.
-
Constructor Details
-
ArmIOSpark
public ArmIOSpark()Creates a new ArmIOSpark and configures the SparkMax controllers.
-
-
Method Details
-
updateInputs
Updates inputs by refreshing data from the SparkMax controllers.- Specified by:
updateInputsin interfaceArmIO- Parameters:
inputs- The inputs object to update.
-
setPosition
Description copied from interface:ArmIOCommands the arm motor to move to a specified position using closed-loop control.- Specified by:
setPositionin interfaceArmIO- Parameters:
angle- The target angle for the arm.
-
stop
public void stop()Description copied from interface:ArmIOTells the motor to stop trying to reach its setpoint -
clearFaults
public void clearFaults()Description copied from interface:ArmIOClears all faults and warnings.- Specified by:
clearFaultsin interfaceArmIO
-