Skip to content

Commit 8902209

Browse files
Fixed absolute encoder read the same as everything else.
Signed-off-by: thenetworkgrinch <thenetworkgrinch@users.noreply.github.com>
1 parent f684201 commit 8902209

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/main/java/swervelib/SwerveModule.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ public void updateTelemetry()
830830
{
831831
if (absoluteEncoder != null)
832832
{
833-
rawAbsoluteAnglePublisher.set(absolutePositionCache.getValue());
833+
rawAbsoluteAnglePublisher.set(absoluteEncoder.getAbsolutePosition());
834834
}
835835
if (SwerveDriveTelemetry.isSimulation && SwerveDriveTelemetry.verbosity == TelemetryVerbosity.HIGH)
836836
{

src/main/java/swervelib/motors/SparkMaxSwerve.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,12 @@ public void configureIntegratedEncoder(double positionConversionFactor)
345345
cfg.closedLoop.feedbackSensor(FeedbackSensor.kAnalogSensor);
346346

347347
cfg.signals
348+
.analogVelocityAlwaysOn(true)
348349
.analogVoltageAlwaysOn(true)
349350
.analogPositionAlwaysOn(true)
350351
.analogVoltagePeriodMs(20)
351-
.analogPositionPeriodMs(20);
352+
.analogPositionPeriodMs(20)
353+
.analogVelocityPeriodMs(20);
352354

353355
cfg.analogSensor
354356
.positionConversionFactor(positionConversionFactor)

0 commit comments

Comments
 (0)