mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
Updated to 2024.4.8.3
This commit is contained in:
@@ -35,6 +35,14 @@ public class SparkMaxEncoderSwerve extends SwerveAbsoluteEncoder
|
||||
*/
|
||||
public SparkMaxEncoderSwerve(SwerveMotor motor, int conversionFactor)
|
||||
{
|
||||
failureConfiguring = new Alert(
|
||||
"Encoders",
|
||||
"Failure configuring SparkMax Analog Encoder",
|
||||
Alert.AlertType.WARNING_TRACE);
|
||||
offsetFailure = new Alert(
|
||||
"Encoders",
|
||||
"Failure to set Absolute Encoder Offset",
|
||||
Alert.AlertType.WARNING_TRACE);
|
||||
if (motor.getMotor() instanceof CANSparkMax)
|
||||
{
|
||||
encoder = ((CANSparkMax) motor.getMotor()).getAbsoluteEncoder(Type.kDutyCycle);
|
||||
@@ -44,14 +52,6 @@ public class SparkMaxEncoderSwerve extends SwerveAbsoluteEncoder
|
||||
{
|
||||
throw new RuntimeException("Motor given to instantiate SparkMaxEncoder is not a CANSparkMax");
|
||||
}
|
||||
failureConfiguring = new Alert(
|
||||
"Encoders",
|
||||
"Failure configuring SparkMax Analog Encoder",
|
||||
Alert.AlertType.WARNING_TRACE);
|
||||
offsetFailure = new Alert(
|
||||
"Encoders",
|
||||
"Failure to set Absolute Encoder Offset",
|
||||
Alert.AlertType.WARNING_TRACE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user