Class AbstractVelocityMotor<TConfig extends MotorConfig>

java.lang.Object
frc.robot.devices.motor.AbstractMotor
frc.robot.devices.motor.AbstractVelocityMotor<TConfig>
Type Parameters:
TConfig - concrete motor config type
All Implemented Interfaces:
Motor, MotorIO
Direct Known Subclasses:
FeederMotor, IndexerMotor, IntakeMotor, ShooterMotor

public abstract class AbstractVelocityMotor<TConfig extends MotorConfig> extends AbstractMotor
SparkMax-backed motor for velocity-controlled mechanisms (flywheels, rollers, belts) with baked-in gearing and coast-mode idle.

All positions and velocities are reported in mechanism radians and radians per second after applying the configured gear ratio. The motor idles in coast mode so it does not fight deceleration when the mechanism is stopped. Concrete subclasses only need to supply their specific motor config and a friendly name for logging.

  • Constructor Details

    • AbstractVelocityMotor

      protected AbstractVelocityMotor(String name, TConfig config)
      Builds a velocity motor wrapper using the supplied configuration.
      Parameters:
      name - friendly name used for logging and dashboard keys
      config - motor configuration containing CAN ID, gear ratio, inversion, and current limits
  • Method Details

    • 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)