Skip to content
This repository was archived by the owner on May 19, 2024. It is now read-only.

Commit 4d47b9e

Browse files
committed
fix(odometry): Try new method for tare.
1 parent 344486e commit 4d47b9e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/java/frc/robot/odometry/Odometry.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import edu.wpi.first.wpilibj.smartdashboard.Field2d;
1212
import edu.wpi.first.wpilibj2.command.Command;
1313
import edu.wpi.first.wpilibj2.command.Commands;
14+
import frc.lib.AllianceFlipHelper;
1415
import frc.lib.Subsystem;
1516
import frc.lib.Telemetry;
1617
import frc.robot.odometry.GyroscopeIO.GyroscopeIOValues;
@@ -148,12 +149,11 @@ public void setRotation(Rotation2d rotation) {
148149
public Command tare() {
149150
return Commands.runOnce(
150151
() -> {
151-
// if (AllianceFlipHelper.shouldFlip()) {
152-
// gyroscope.setYaw(0.5);
153-
// } else {
154-
// gyroscope.setYaw(0.0);
155-
// }
156-
gyroscope.setYaw(0.0);
152+
if (AllianceFlipHelper.shouldFlip()) {
153+
setRotation(Rotation2d.fromDegrees(180));
154+
} else {
155+
setRotation(Rotation2d.fromDegrees(0));
156+
}
157157
});
158158
}
159159

0 commit comments

Comments
 (0)