thing probably won't fix the swerve code

This commit is contained in:
Tyler-J42 2024-03-27 19:32:25 -04:00
parent 15a6253e85
commit 88e76ee2e6

View File

@ -37,6 +37,10 @@ public class MAXSwerveModule {
m_drivingSparkMax = new CANSparkMax(drivingCANId, MotorType.kBrushless);
m_turningSparkMax = new CANSparkMax(turningCANId, MotorType.kBrushless);
// The periodic frame update rate for the absolute encoders for position is available to be changed at Status 5
// The update rate for absolute encoder velocity is on Status 6.
// The default update rate for the absolute encoder on both of those status frames is only 200ms which might be causing the swerve jitter
// TODO: test if these changes break the swerve drive or fix the jitter.
m_turningSparkMax.setPeriodicFramePeriod(PeriodicFrame.kStatus5, 20);
m_turningSparkMax.setPeriodicFramePeriod(PeriodicFrame.kStatus6, 20);