Class TurretMotor

java.lang.Object
frc.robot.devices.motor.AbstractMotor
frc.robot.subsystems.turret.devices.TurretMotor
All Implemented Interfaces:
Motor, MotorIO

public class TurretMotor extends AbstractMotor
SparkMax-backed turret motor with baked-in limits, gearing, and telemetry.

Inputs are configured in degrees for approachability; this wrapper converts to radians for WPILib math and AdvantageKit logging via AbstractMotor. Provide the gear ratio as motor rotations per one turret rotation (e.g., 100:1 reduction = 100.0).

  • Method Details

    • create

      public static TurretMotor create(MotorConfig config)
      Creates a turret motor wrapper using values from the turret motor config.

      Use this factory so AbstractMotor.init() is always called after config assignment.

      Parameters:
      config - turret motor configuration containing CAN ID, gear ratio, inversion, and motion bounds (degrees)
      Returns:
      configured turret motor wrapper
    • configureMotor

      protected com.revrobotics.spark.config.SparkMaxConfig configureMotor(com.revrobotics.spark.config.SparkMaxConfig sparkConfig)
      Description copied from class: AbstractMotor
      Allows subclasses to append motor-specific configuration before the object is applied to hardware.
      Specified by:
      configureMotor in class AbstractMotor
      Parameters:
      sparkConfig - initial SparkMaxConfig with default voltage compensation
      Returns:
      configured SparkMaxConfig ready for SparkMax.configure(com.revrobotics.spark.config.SparkBaseConfig, com.revrobotics.spark.SparkBase.ResetMode, com.revrobotics.spark.SparkBase.PersistMode)