1515import frc .robot .Constants .HandConstants ;
1616import frc .robot .Constants .IntakeConstants ;
1717import frc .robot .Constants .RobotStateConstants ;
18- import frc .robot .Constants .VisionConstants ;
1918import frc .robot .subsystems .ArmSubsystem .ArmState ;
2019import frc .robot .subsystems .DriveSubsystem .DriveStates ;
2120import frc .robot .subsystems .HandSubsystem .HandStates ;
@@ -320,6 +319,7 @@ public void toAutoDrive() {
320319 "Starting AutoDrive. Gamepiece: {}, TargetCol: {}" , gamePiece .toString (), tempTargetCol );
321320 driveSubsystem .driveToPose (tempTargetCol ); // FIXME
322321 }
322+
323323 /**
324324 * @param isOnAllianceSide Is the robot on the alliance side of the charge station(Towards Tori)
325325 */
@@ -430,13 +430,14 @@ public boolean shouldFastStowArm() {
430430 public void periodic () {
431431 switch (currRobotState ) {
432432 case STOW :
433- // if (!hasZeroedHand && handSubsystem.getVel() <= HandConstants.kHandVelocityThreshold) {
434- // stableHandVel++;
435- // if (stableHandVel >= HandConstants.kHandVelStable) {
436- // stableHandVel = 0;
437- // handSubsystem.zeroHand();
438- // hasZeroedHand = true;
439- // }
433+ // if (!hasZeroedHand && handSubsystem.getVel() <=
434+ // HandConstants.kHandVelocityThreshold) {
435+ // stableHandVel++;
436+ // if (stableHandVel >= HandConstants.kHandVelStable) {
437+ // stableHandVel = 0;
438+ // handSubsystem.zeroHand();
439+ // hasZeroedHand = true;
440+ // }
440441 // }
441442 if (currRobotState != nextRobotState ) {
442443 switch (nextRobotState ) {
@@ -937,7 +938,7 @@ public void periodic() {
937938 // INDICATOR STATE
938939
939940 // if (driveSubsystem.currDriveState == DriveStates.AUTO_BALANCE_FINISHED) {
940- // //Auto_Balance_Finished
941+ // //Auto_Balance_Finished
941942 // }
942943 break ;
943944 case CHECK_AMBIGUITY :
@@ -950,11 +951,11 @@ public void periodic() {
950951 currRobotState = RobotState .SHELF_WAIT_TRANSITION ;
951952 }
952953 // if (visionSubsystem.lastUpdateWithinThresholdTime(
953- // VisionConstants.kLastUpdateCloseEnoughThreshold)) {
954- // rgbLightsSubsystem.setColor(0.0, 1.0, 1.0);
955- // // toAutoDrive();
954+ // VisionConstants.kLastUpdateCloseEnoughThreshold)) {
955+ // rgbLightsSubsystem.setColor(0.0, 1.0, 1.0);
956+ // // toAutoDrive();
956957 // } else {
957- // rgbLightsSubsystem.setColor(1.0, 0.0, 0.0);
958+ // rgbLightsSubsystem.setColor(1.0, 0.0, 0.0);
958959 // }
959960 break ;
960961 case RECOVER_GAMEPIECE :
@@ -987,11 +988,7 @@ public void periodic() {
987988 && driveSubsystem .getPoseMeters ().getX ()
988989 <= (RobotStateConstants .kFieldMaxX - DriveConstants .kPastBumpIndicateX )))
989990 && !driveSubsystem .isAutoDriving ()) {
990- if (visionSubsystem .lastUpdateWithinThresholdTime (
991- VisionConstants .kLastUpdateCloseEnoughThreshold
992- - VisionConstants .kDifferenceCloseEnoughThreshold )
993- && (visionSubsystem .getBufferedVelocity () <= DriveConstants .kMaxSpeedForCamUpdate ))
994- rgbLightsSubsystem .setCubeColor ();
991+ if (true ) rgbLightsSubsystem .setCubeColor ();
995992 else rgbLightsSubsystem .setColor (1.0 , 0.0 , 0.0 );
996993 }
997994 }
@@ -1048,35 +1045,37 @@ public Pose2d getAutoPlaceDriveTarget(double yCoord, TargetCol tempTargetCol) {
10481045 }
10491046
10501047 // public double autoDriveYawRight(double yCoord) {
1051- // int gridIndex =
1052- // ((yCoord > Constants.RobotStateConstants.kBound1Y) ? 1 : 0)
1053- // + ((yCoord > Constants.RobotStateConstants.kBound2Y) ? 1 : 0);
1054- // // CHECK VISION
1055- // double tempYaw = driveSubsystem.getGyroRotation2d().getDegrees();
1056- // if (getAllianceColor() == Alliance.Red)
1057- // tempYaw = driveSubsystem.getGyroRotation2d().getDegrees() - 180;
1058- // logger.info("grid Index: {}", gridIndex);
1059- // if (!visionSubsystem.lastUpdateWithinThresholdTime(0.05)) {
1060- // // && visionSubsystem.getHasTargets() == 0) {
1061- // logger.info("Threshold and no targets");
1062- // if (driveSubsystem.getPoseMeters().getY() <
1048+ // int gridIndex =
1049+ // ((yCoord > Constants.RobotStateConstants.kBound1Y) ? 1 : 0)
1050+ // + ((yCoord > Constants.RobotStateConstants.kBound2Y) ? 1 : 0);
1051+ // // CHECK VISION
1052+ // double tempYaw = driveSubsystem.getGyroRotation2d().getDegrees();
1053+ // if (getAllianceColor() == Alliance.Red)
1054+ // tempYaw = driveSubsystem.getGyroRotation2d().getDegrees() - 180;
1055+ // logger.info("grid Index: {}", gridIndex);
1056+ // if (!visionSubsystem.lastUpdateWithinThresholdTime(0.05)) {
1057+ // // && visionSubsystem.getHasTargets() == 0) {
1058+ // logger.info("Threshold and no targets");
1059+ // if (driveSubsystem.getPoseMeters().getY() <
10631060 // Constants.RobotStateConstants.kGridY[gridIndex]) {
1064- // // left of tag on grid {gridIndex} GYRO POSITIVE IS COUNTERCLOCKWISE (Yaw/Look To The
1065- // // Right)
1066- // logger.info("Left Of Tag, Look Right(Yaw CounterClockwise), tempYaw: {}", tempYaw);
1067- // return 1;
1068- // } else {
1069- // // right of tag GYRO NEGATIVE IS CLOCKWISE (Yaw/Look To The LEFT)
1070- // logger.info("Right Of Tag, Look Left(Yaw Clockwise), tempYaw: {}", tempYaw);
1071- // return 2;
1072- // }
1073- // }
1074- // logger.info(
1075- // "Returned 0, tempYaw: {}, withThresholdVisUpdate: {}",
1076- // tempYaw,
1077- // visionSubsystem.lastUpdateWithinThresholdTime(
1078- // Constants.VisionConstants.kLastUpdateCloseEnoughThresholdYaw));
1079- // return 0;
1061+ // // left of tag on grid {gridIndex} GYRO POSITIVE IS COUNTERCLOCKWISE
1062+ // (Yaw/Look To The
1063+ // // Right)
1064+ // logger.info("Left Of Tag, Look Right(Yaw CounterClockwise), tempYaw: {}",
1065+ // tempYaw);
1066+ // return 1;
1067+ // } else {
1068+ // // right of tag GYRO NEGATIVE IS CLOCKWISE (Yaw/Look To The LEFT)
1069+ // logger.info("Right Of Tag, Look Left(Yaw Clockwise), tempYaw: {}", tempYaw);
1070+ // return 2;
1071+ // }
1072+ // }
1073+ // logger.info(
1074+ // "Returned 0, tempYaw: {}, withThresholdVisUpdate: {}",
1075+ // tempYaw,
1076+ // visionSubsystem.lastUpdateWithinThresholdTime(
1077+ // Constants.VisionConstants.kLastUpdateCloseEnoughThresholdYaw));
1078+ // return 0;
10801079 // }
10811080
10821081 public boolean isBlueAlliance () {
0 commit comments