Skip to content

Commit 42fedc1

Browse files
committed
possiblePoses -> possiblePose
1 parent 5cc667e commit 42fedc1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/main/java/frc/robot/commands/CenterOnFeeder.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111

1212
public class CenterOnFeeder extends Command {
1313

14-
public enum PossiblePoses {
14+
public enum PossiblePose {
1515

1616
FAR_LEFT(0, 0), MIDDLE_LEFT(0, 0), CLOSE_LEFT(0, 0),
1717
CENTER(0, 0), CLOSE_RIGHT(0, 0), MIDDLE_RIGHT(0, 0), FAR_RIGHT(0, 0);
1818

1919
public final double xPose;
2020
public final double yPose;
2121

22-
PossiblePoses(double xPose, double yPose) {
22+
PossiblePose(double xPose, double yPose) {
2323
this.xPose = xPose;
2424
this.yPose = yPose;
2525
}
@@ -59,12 +59,12 @@ public void execute() {
5959
yPIDController.setPID(pidSettings.getkP(), pidSettings.getkI(), pidSettings.getkD());
6060
yPIDController.setTolerance(pidSettings.getTolerance());
6161
yFeedForwardController.setGains(feedForwardSettings);
62-
double shortestDistance = getDistanceFrom(PossiblePoses.FAR_LEFT.xPose, PossiblePoses.FAR_LEFT.yPose);
63-
PossiblePoses pose = PossiblePoses.FAR_LEFT;
64-
for (PossiblePoses possiblePoses : PossiblePoses.values()) {
65-
if (shortestDistance > getDistanceFrom(possiblePoses.xPose, possiblePoses.yPose)) {
66-
shortestDistance = getDistanceFrom(possiblePoses.xPose, possiblePoses.yPose);
67-
pose = possiblePoses;
62+
double shortestDistance = getDistanceFrom(PossiblePose.FAR_LEFT.xPose, PossiblePose.FAR_LEFT.yPose);
63+
PossiblePose pose = PossiblePose.FAR_LEFT;
64+
for (PossiblePose possiblePose : PossiblePose.values()) {
65+
if (shortestDistance > getDistanceFrom(possiblePose.xPose, possiblePose.yPose)) {
66+
shortestDistance = getDistanceFrom(possiblePose.xPose, possiblePose.yPose);
67+
pose = possiblePose;
6868
}
6969
}
7070
drivetrain.drive(xPIDController.calculate(drivetrain.getPose2d().getX(), pose.xPose) +

0 commit comments

Comments
 (0)