Skip to content
This repository was archived by the owner on Dec 6, 2025. It is now read-only.

Commit 309c027

Browse files
Fixed attached absolute encoders on brushed sparkmaxes.
Signed-off-by: thenetworkgrinch <[email protected]>
1 parent 1113d22 commit 309c027

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/main/java/swervelib/motors/SparkMaxBrushedMotorSwerve.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import edu.wpi.first.math.system.plant.DCMotor;
1919
import edu.wpi.first.wpilibj.Alert;
2020
import edu.wpi.first.wpilibj.Alert.AlertType;
21-
import edu.wpi.first.wpilibj.DriverStation;
2221
import edu.wpi.first.wpilibj.Timer;
2322
import java.util.Optional;
2423
import java.util.function.Supplier;
@@ -37,19 +36,19 @@ public class SparkMaxBrushedMotorSwerve extends SwerveMotor
3736
/**
3837
* Config retry delay.
3938
*/
40-
private final double configDelay = Milliseconds.of(5).in(Seconds);
39+
private final double configDelay = Milliseconds.of(5).in(Seconds);
4140
/**
4241
* SparkMAX Instance.
4342
*/
4443
private final SparkMax motor;
4544
/**
4645
* Absolute encoder attached to the SparkMax (if exists)
4746
*/
48-
public Optional<SwerveAbsoluteEncoder> absoluteEncoder;
47+
public Optional<SwerveAbsoluteEncoder> absoluteEncoder = Optional.empty();
4948
/**
5049
* Integrated encoder.
5150
*/
52-
public Optional<RelativeEncoder> encoder = Optional.empty();
51+
public Optional<RelativeEncoder> encoder = Optional.empty();
5352
/**
5453
* Closed-loop PID controller.
5554
*/
@@ -77,7 +76,7 @@ public class SparkMaxBrushedMotorSwerve extends SwerveMotor
7776
/**
7877
* Configuration object for {@link SparkMax} motor.
7978
*/
80-
private SparkMaxConfig cfg = new SparkMaxConfig();
79+
private SparkMaxConfig cfg = new SparkMaxConfig();
8180

8281
/**
8382
* Initialize the swerve motor.

0 commit comments

Comments
 (0)