diff --git a/src/main/cpp/subsystems/MAXSwerveModule.cpp b/src/main/cpp/subsystems/MAXSwerveModule.cpp index 0e1b25f..bef5b9d 100644 --- a/src/main/cpp/subsystems/MAXSwerveModule.cpp +++ b/src/main/cpp/subsystems/MAXSwerveModule.cpp @@ -48,6 +48,10 @@ MAXSwerveModule::MAXSwerveModule(const int drivingCANId, const int turningCANId, kTurningEncoderPositionPIDMinInput.value()); m_turningPIDController.SetPositionPIDWrappingMaxInput( kTurningEncoderPositionPIDMaxInput.value()); + + // Set the PID Controller to use the duty cycle encoder on the swerve + // module instead of the built in NEO550 encoder. + m_turningPIDController.SetFeedbackDevice(m_turningAbsoluteEncoder); // Set the PID gains for the driving motor. Note these are example gains, and // you may need to tune them for your own robot!