Package frc.robot.devices.motor
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
- Direct Known Subclasses:
FeederMotor,IndexerMotor,IntakeMotor,ShooterMotor
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface frc.robot.devices.motor.MotorIO
MotorIO.MotorIOInputs -
Field Summary
Fields inherited from class frc.robot.devices.motor.AbstractMotor
log, motor, name, NOMINAL_VOLTAGE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractVelocityMotor(String name, TConfig config) Builds a velocity motor wrapper using the supplied configuration. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.revrobotics.spark.config.SparkMaxConfigconfigureMotor(com.revrobotics.spark.config.SparkMaxConfig sparkConfig) Allows subclasses to append motor-specific configuration before the object is applied to hardware.Methods inherited from class frc.robot.devices.motor.AbstractMotor
computeMechanismRadiansPerMotorRotation, getPositionRadians, getVelocityRadiansPerSecond, getVoltage, init, isInitialized, setEncoderPosition, setVoltage, stop, updateInputs
-
Constructor Details
-
AbstractVelocityMotor
Builds a velocity motor wrapper using the supplied configuration.- Parameters:
name- friendly name used for logging and dashboard keysconfig- 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:AbstractMotorAllows subclasses to append motor-specific configuration before the object is applied to hardware.- Specified by:
configureMotorin classAbstractMotor- Parameters:
sparkConfig- initialSparkMaxConfigwith default voltage compensation- Returns:
- configured
SparkMaxConfigready forSparkMax.configure(com.revrobotics.spark.config.SparkBaseConfig, com.revrobotics.spark.SparkBase.ResetMode, com.revrobotics.spark.SparkBase.PersistMode)
-