Skip to content

Commit

Permalink
Added auto-centering feature.
Browse files Browse the repository at this point in the history
Signed-off-by: thenetworkgrinch <thenetworkgrinch@users.noreply.github.com>
  • Loading branch information
thenetworkgrinch committed Jul 29, 2024
1 parent e973ae5 commit 08f4c9a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/swervelib/SwerveDrive.java
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,21 @@ public void restoreInternalOffset()
}
}

/**
* Enable auto-centering module wheels. This has a side effect of causing some jitter to the robot when a PID is not
* tuned perfectly. This function is a wrapper for {@link SwerveModule#setAntiJitter(boolean)} to perform
* auto-centering.
*
* @param enabled Enable auto-centering (disable antiJitter)
*/
public void setAutoCenteringModules(boolean enabled)
{
for (SwerveModule module : swerveModules)
{
module.setAntiJitter(!enabled);
}
}

/**
* Enable or disable the {@link swervelib.parser.SwerveModuleConfiguration#useCosineCompensator} for all
* {@link SwerveModule}'s in the swerve drive. The cosine compensator will slow down or speed up modules that are
Expand Down

0 comments on commit 08f4c9a

Please sign in to comment.