Skip to content

Commit

Permalink
Fixes C++ example not using the correct encoder (#8)
Browse files Browse the repository at this point in the history
* Fixes C++ example not using the correct encoder

Fixes #7

* Fix comment

Co-authored-by: Jan-Felix Abellera <jfabellera@gmail.com>
  • Loading branch information
r4stered and jfabellera committed Jan 23, 2023
1 parent 19314db commit b16ba87
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/cpp/subsystems/MAXSwerveModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down

0 comments on commit b16ba87

Please sign in to comment.