more functionality for SwerveModule

This commit is contained in:
aarav18
2023-01-15 15:15:22 -07:00
parent b5f25b39b3
commit d055082323
@@ -125,6 +125,15 @@ public class SwerveModule extends SubsystemBase {
driveMotor.set(angleMotor.get() + feetPerSecond / SwerveDriveConstants.MAX_SPEED_FEET_PER_SECOND);
}
public void reset() {
canCoder.setPositionToAbsolute();
}
}
public double getCurrent() {
return angleMotor.getSupplyCurrent() + driveMotor.getSupplyCurrent();
}
public double getVoltage() {
return (Math.abs(angleMotor.getMotorOutputVoltage()) + Math.abs(driveMotor.getMotorOutputVoltage()));
}
}