Skip to content

Commit

Permalink
fix swerve field relative
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelLesirge committed Mar 29, 2024
1 parent e274d15 commit 3518428
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/SwerveDrivetrain.java
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public void setDesiredState(ChassisSpeeds speeds, boolean fieldRelative) {
SmartDashboard.putNumber("Spin", speeds.omegaRadiansPerSecond);

if (fieldRelative)
speeds = ChassisSpeeds.fromFieldRelativeSpeeds(speeds, getHeading().plus(Rotation2d.fromDegrees(180)));
speeds = ChassisSpeeds.fromFieldRelativeSpeeds(speeds, getHeading());
speeds = ChassisSpeeds.discretize(speeds, TimedRobot.kDefaultPeriod);

SwerveModuleState[] states = kinematics.toSwerveModuleStates(speeds);
Expand Down

0 comments on commit 3518428

Please sign in to comment.