Skip to content

Commit

Permalink
disable leading correction
Browse files Browse the repository at this point in the history
  • Loading branch information
robo7660 committed Apr 6, 2024
1 parent 62043dd commit 325f024
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/frc/robot/subsystems/SwerveSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public SwerveSubsystem(File directory)
{
throw new RuntimeException(e);
}
swerveDrive.setHeadingCorrection(true); // Heading correction should only be used while controlling the robot via angle.
swerveDrive.setHeadingCorrection(false); // Heading correction should only be used while controlling the robot via angle.
swerveDrive.setCosineCompensator(!SwerveDriveTelemetry.isSimulation); // Disables cosine compensation for simulations since it causes discrepancies not seen in real life.
setupPathPlanner();

Expand Down Expand Up @@ -221,7 +221,7 @@ public Command driveToPose(Pose2d pose)
public Command driveCommand(DoubleSupplier translationX, DoubleSupplier translationY, DoubleSupplier headingX,
DoubleSupplier headingY)
{
swerveDrive.setHeadingCorrection(true); // Normally you would want heading correction for this kind of control.
swerveDrive.setHeadingCorrection(false); // Normally you would want heading correction for this kind of control.
return run(() -> {
double xInput = Math.pow(translationX.getAsDouble(), 3); // Smooth controll out
double yInput = Math.pow(translationY.getAsDouble(), 3); // Smooth controll out
Expand All @@ -244,7 +244,7 @@ public Command driveCommand(DoubleSupplier translationX, DoubleSupplier translat
*/
public Command simDriveCommand(DoubleSupplier translationX, DoubleSupplier translationY, DoubleSupplier rotation)
{
swerveDrive.setHeadingCorrection(true); // Normally you would want heading correction for this kind of control.
swerveDrive.setHeadingCorrection(false); // Normally you would want heading correction for this kind of control.
return run(() -> {
// Make the robot move
driveFieldOriented(swerveDrive.swerveController.getTargetSpeeds(translationX.getAsDouble(),
Expand Down

0 comments on commit 325f024

Please sign in to comment.