Cosine Compensation
This is helpful, sometimes
How Cosine Compensation works?
How do I enable it?
/**
* Initialize {@link SwerveDrive} with the directory provided.
*
* @param directory Directory of swerve drive config files.
*/
public SwerveSubsystem(File directory)
{
// Configure the Telemetry before creating the SwerveDrive to avoid unnecessary objects being created.
SwerveDriveTelemetry.verbosity = TelemetryVerbosity.HIGH;
swerveDrive = new SwerveParser(directory).createSwerveDrive(Constants.MAX_SPEED);
swerveDrive.setCosineCompensator(false); // Disables cosine compensation for simulations since it causes discrepancies not seen in real life.
}Last updated