Class ArmIOSpark

java.lang.Object
frc.robot.subsystems.intake.arm.ArmIOSpark
All Implemented Interfaces:
ArmIO

public class ArmIOSpark extends Object implements 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.

  • Constructor Details

    • ArmIOSpark

      public ArmIOSpark()
      Creates a new ArmIOSpark and configures the SparkMax controllers.
  • Method Details

    • updateInputs

      public void updateInputs(ArmIO.ArmIOInputs inputs)
      Updates inputs by refreshing data from the SparkMax controllers.
      Specified by:
      updateInputs in interface ArmIO
      Parameters:
      inputs - The inputs object to update.
    • setPosition

      public void setPosition(Angle angle)
      Description copied from interface: ArmIO
      Commands the arm motor to move to a specified position using closed-loop control.
      Specified by:
      setPosition in interface ArmIO
      Parameters:
      angle - The target angle for the arm.
    • stop

      public void stop()
      Description copied from interface: ArmIO
      Tells the motor to stop trying to reach its setpoint
      Specified by:
      stop in interface ArmIO
    • clearFaults

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