This repository was archived by the owner on May 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -149,11 +149,14 @@ public void setRotation(Rotation2d rotation) {
149
149
public Command tare () {
150
150
return Commands .runOnce (
151
151
() -> {
152
- if (AllianceFlipHelper .shouldFlip ()) {
153
- setRotation (Rotation2d .fromDegrees (180 ));
154
- } else {
155
- setRotation (Rotation2d .fromDegrees (0 ));
156
- }
152
+ // TODO needs testing!
153
+ // if (AllianceFlipHelper.shouldFlip()) {
154
+ // setRotation(Rotation2d.fromDegrees(180));
155
+ // } else {
156
+ // setRotation(Rotation2d.fromDegrees(0));
157
+ // }
158
+
159
+ gyroscope .setYaw (0.0 );
157
160
});
158
161
}
159
162
Original file line number Diff line number Diff line change 11
11
import edu .wpi .first .wpilibj2 .command .button .CommandXboxController ;
12
12
import frc .robot .RobotConstants ;
13
13
import frc .robot .odometry .Odometry ;
14
+ import frc .lib .AllianceFlipHelper ;
14
15
15
16
/** Drives the swerve using driver input. */
16
17
public class DriveCommand extends Command {
@@ -70,6 +71,11 @@ public void execute() {
70
71
71
72
Rotation2d poseHeading = odometry .getPosition ().getRotation ();
72
73
74
+ // TODO test
75
+ // if (AllianceFlipHelper.shouldFlip()) {
76
+ // poseHeading = poseHeading.plus(Rotation2d.fromDegrees(180));
77
+ // }
78
+
73
79
if (DriveRequest .startedDrifting (previousRequest , request )) {
74
80
headingGoal = wrap (new State (poseHeading .getRotations (), 0.0 ), poseHeading .getRotations ());
75
81
}
You can’t perform that action at this time.
0 commit comments