Skip to content

Commit 4d22b16

Browse files
Pre-PHR (#372)
1 parent 1bfda9d commit 4d22b16

File tree

5 files changed

+56
-33
lines changed

5 files changed

+56
-33
lines changed

src/main/java/frc/robot/Constants.java

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import com.ctre.phoenix.led.CANdleConfiguration;
1515
import com.ctre.phoenix.led.RainbowAnimation;
16+
import com.ctre.phoenix.led.StrobeAnimation;
1617
import com.ctre.phoenix6.configs.CANcoderConfiguration;
1718
import com.ctre.phoenix6.configs.CANrangeConfiguration;
1819
import com.ctre.phoenix6.configs.TalonFXConfiguration;
@@ -62,11 +63,11 @@ public static class constControllers {
6263
public static final double DRIVER_LEFT_STICK_DEADBAND = 0.05;
6364
public static final boolean SILENCE_JOYSTICK_WARNINGS = true;
6465

65-
public static final double HAS_CORAL_RUMBLE_INTENSITY = 0.5;
66+
public static final double HAS_CORAL_RUMBLE_INTENSITY = 1;
6667
public static final double HAS_ALGAE_RUMBLE_INTENSITY = 1;
6768
public static final double READY_TO_PLACE_RUMBLE_INTENSITY = 0.5;
6869
public static final double READY_TO_RAISE_INTENSITY = 0.6;
69-
public static final double READY_TO_LEAVE_INTENSITY = 0.7;
70+
public static final double READY_TO_LEAVE_INTENSITY = 1;
7071

7172
}
7273

@@ -438,7 +439,7 @@ public static class constClimber {
438439
public static Angle MAX_POSITION = Units.Rotations.of(166.69);
439440
public static Angle AT_POSITION_TOLERANCE = Units.Rotations.of(10);
440441

441-
public static final double MATCH_CLIMBING_TIME = 30.0;
442+
public static final double MATCH_CLIMBING_TIME = 50.0;
442443

443444
static {
444445
CLIMBER_CONFIG.MotorOutput.NeutralMode = NeutralModeValue.Brake;
@@ -802,50 +803,49 @@ public static class constLED {
802803
public static final int LED_STRIP_START_INDEX = 1;
803804

804805
// Climbing
805-
public static final int[] LED_CLIMBER_DEPLOYING = { 242, 23, 23 }; // imposter red
806-
public static final int[] LED_CLIMBER_RETRACTING = { 0, 0, 0 }; // Placeholder values
807-
public static final int[] LED_MANUAL_CLIMBER_DEPLOYING = { 0, 0, 0 }; // Placeholder values
806+
public static final int[] LED_CLIMBER_DEPLOYING = null;
807+
public static final int[] LED_CLIMBER_RETRACTING = null;
808+
public static final int[] LED_MANUAL_CLIMBER_DEPLOYING = null;
808809

809810
// first scoring element
810-
public static final int[] LED_CLEANING_L2_REEF = { 120, 110, 0 }; // camo green
811-
public static final int[] LED_CLEANING_L3_REEF = { 210, 225, 72 }; // lime
812-
public static final int[] LED_EJECT_CORAL = { 90, 3, 3 }; // maroon
813-
public static final int[] LED_INTAKE_CORAL_HOPPER = { 0, 255, 0 };// green
814-
public static final int[] LED_INTAKE_ALGAE_GROUND = { 0, 0, 255 }; // blue
811+
public static final int[] LED_CLEANING_L2_REEF = null;
812+
public static final int[] LED_CLEANING_L3_REEF = null;
813+
public static final int[] LED_EJECT_CORAL = null;
814+
public static final int[] LED_INTAKE_CORAL_HOPPER = { 0, 0, 255 };// blue
815+
public static final int[] LED_INTAKE_ALGAE_GROUND = null;
815816

816817
// hold scoring elements
817818

818819
// TODO: Implement CANdle being commanded half & half (top half w/ algae, bottom
819820
// half w/ coral)
820-
public static final int[] LED_HAS_ALGAE = { 0, 255, 255 }; // cyan
821-
public static final int[] LED_HAS_CORAL = { 255, 0, 0 }; // red
822-
public static final int[] LED_HAS_BOTH = { 255, 0, 255 }; // Pinkish purple
821+
public static final int[] LED_HAS_ALGAE = { 89, 252, 236 }; // algae-side teal
822+
public static final int[] LED_HAS_CORAL = { 255, 255, 255 }; // elevator-side white
823+
public static final int[] LED_HAS_BOTH = null;
823824

824825
// prep algae
825-
public static final int[] LED_PREP_ALGAE_ZERO = { 0, 255, 255 };// cyan
826-
public static final int[] LED_PREP_ALGAE_ZERO_WITH_CORAL = { 0, 0, 0 }; // Placeholder values
827-
public static final int[] LED_PREP_NET = { 255, 0, 200 };// magenta
828-
public static final int[] LED_PREP_NET_WITH_CORAL = { 0, 0, 0 }; // Placeholder values
829-
public static final int[] LED_PREP_PROCESSOR = { 255, 150, 0 };// orange
830-
public static final int[] LED_PREP_PROCESSOR_WITH_CORAL = { 0, 0, 0 }; // Placeholder values
826+
public static final int[] LED_PREP_ALGAE_ZERO = null;
827+
public static final int[] LED_PREP_ALGAE_ZERO_WITH_CORAL = null;
828+
public static final int[] LED_PREP_NET = null;
829+
public static final int[] LED_PREP_NET_WITH_CORAL = null;
830+
public static final int[] LED_PREP_PROCESSOR = null;
831+
public static final int[] LED_PREP_PROCESSOR_WITH_CORAL = null;
831832

832833
// prep coral
833-
public static final int[] LED_PREP_CORAL_LV = { 80, 49, 76 };// grimace purple
834-
public static final int[] LED_PREP_CORAL_LV_WITH_ALGAE = { 0, 0, 0 }; // Placeholder values
835-
public static final int[] LED_PREP_CORAL_ZERO = { 20, 100, 0 };// forest green
836-
public static final int[] LED_PREP_CORAL_ZERO_WITH_ALGAE = { 0, 0, 0 }; // Placeholder values
834+
public static final int[] LED_PREP_CORAL_LV = null;
835+
public static final int[] LED_PREP_CORAL_LV_WITH_ALGAE = null;
836+
public static final int[] LED_PREP_CORAL_ZERO = null;
837+
public static final int[] LED_PREP_CORAL_ZERO_WITH_ALGAE = null;
837838

838839
// scoring
839-
public static final int[] LED_SCORING_ALGAE = { 196, 211, 0 };// Shreck green
840-
public static final int[] LED_SCORING_ALGAE_WITH_CORAL = { 0, 0, 0 }; // Placeholder values
841-
public static final int[] LED_PLACE_CORAL = { 251, 251, 0 }; // yellow
842-
public static final int[] LED_PLACE_CORAL_WITH_ALGAE = { 0, 0, 0 }; // Placeholder values
840+
public static final int[] LED_SCORING_ALGAE = null;
841+
public static final int[] LED_SCORING_ALGAE_WITH_CORAL = null;
842+
public static final int[] LED_PLACE_CORAL = null;
843+
public static final int[] LED_PLACE_CORAL_WITH_ALGAE = null;
843844

844845
// second scoring element
845846
public static final int[] LED_CLEANING_L2_REEF_WITH_CORAL = { 0, 0, 0 };
846847
public static final int[] LED_CLEANING_L3_REEF_WITH_CORAL = { 0, 0, 0 };
847-
public static final int[] LED_INTAKE_CORAL_WITH_ALGAE = { 0, 0, 0 };
848-
848+
public static final int[] LED_INTAKE_CORAL_WITH_ALGAE = { 0, 0, 255 };// blue
849849
// that other guy what a loser
850850
public static final int[] LED_NONE = { 0, 0, 0 }; // no color
851851

@@ -854,6 +854,19 @@ public static class constLED {
854854
public static final int[] ALGAE_ZERO_SUCCESS = { 0, 0, 0 }; // no color
855855
public static final int[] ELEVATOR_ZERO_FAILED = { 255, 0, 0 }; // red
856856
public static final int[] ELEVATOR_ZERO_SUCCESS = { 0, 0, 0 }; // no color
857+
858+
public static final StrobeAnimation READY_TO_LIFT = new StrobeAnimation(252, 179, 89,
859+
0, 0.05, LED_NUMBER, LED_STRIP_START_INDEX); // orange
860+
861+
public static final StrobeAnimation READY_TO_PLACE = new StrobeAnimation(200, 89, 252,
862+
0, 0.05, LED_NUMBER, LED_STRIP_START_INDEX); // purple
863+
864+
public static final StrobeAnimation READY_TO_LEAVE = new StrobeAnimation(0, 255, 0,
865+
0, 0.05, LED_NUMBER, LED_STRIP_START_INDEX); // green
866+
867+
public static final StrobeAnimation ENDGAME_TIMER = new StrobeAnimation(255, 0, 0,
868+
0, 0.05, LED_NUMBER, LED_STRIP_START_INDEX); // red
869+
857870
}
858871

859872
}

src/main/java/frc/robot/RobotContainer.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import frc.robot.Constants.constControllers;
4444
import frc.robot.Constants.constElevator;
4545
import frc.robot.Constants.constField;
46+
import frc.robot.Constants.constLED;
4647
import frc.robot.Constants.constVision;
4748
import frc.robot.RobotMap.mapControllers;
4849
import frc.robot.commands.AddVisionMeasurement;
@@ -398,15 +399,20 @@ private void configureSensorBindings() {
398399

399400
readyToLiftElevator.onTrue(Commands.runOnce(
400401
() -> conOperator.setRumble(RumbleType.kLeftRumble, Constants.constControllers.READY_TO_RAISE_INTENSITY)))
402+
.onTrue(Commands.runOnce(
403+
() -> subLED.setLED(constLED.READY_TO_LIFT, 0)))
401404
.onFalse(Commands.runOnce(
402405
() -> conOperator.setRumble(RumbleType.kBothRumble, 0)));
403406

404407
readytoPlaceCoral.onTrue(Commands.runOnce(
405408
() -> conOperator.setRumble(RumbleType.kBothRumble, Constants.constControllers.READY_TO_RAISE_INTENSITY)))
409+
.onTrue(Commands.runOnce(
410+
() -> subLED.setLED(constLED.READY_TO_PLACE, 0)))
406411
.onFalse(Commands.runOnce(
407412
() -> conOperator.setRumble(RumbleType.kBothRumble, 0)));
408413

409-
justScoredTrigger.onTrue(READY_TO_LEAVE_RUMBLE);
414+
justScoredTrigger.onTrue(READY_TO_LEAVE_RUMBLE).onTrue(Commands.runOnce(
415+
() -> subLED.setLED(constLED.READY_TO_LEAVE, 0)));
410416
}
411417

412418
private void configureTesterBindings(SN_XboxController controller) {

src/main/java/frc/robot/commands/states/hold_scoring_elements/HasAlgae.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void initialize() {
4848
globalElevator.setPosition(Units.Inches.zero());
4949
}
5050
globalStateMachine.setRobotState(RobotState.HAS_ALGAE);
51-
globalLED.setLED(constLED.LED_HAS_ALGAE);
51+
globalLED.setLEDMatrix(constLED.LED_HAS_ALGAE, 0, 4);
5252
}
5353

5454
// Called every time the scheduler runs while the command is scheduled.

src/main/java/frc/robot/commands/states/hold_scoring_elements/HasCoral.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ public void initialize() {
4242
globalAlgaeIntake.setAlgaePivotAngle(constAlgaeIntake.CORAL_ONLY);
4343
globalAlgaeIntake.setAlgaeIntakeMotor(0);
4444
globalElevator.setPosition(Units.Inches.zero());
45-
globalLED.setLED(constLED.LED_HAS_CORAL);
45+
globalLED.setLEDMatrix(constLED.LED_HAS_CORAL, 4, 9);
46+
4647
}
4748

4849
// Called every time the scheduler runs while the command is scheduled.

src/main/java/frc/robot/subsystems/StateMachine.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,9 @@ public Command tryState(RobotState desiredState) {
500500
case NONE:
501501
case CLIMBER_RETRACTING:
502502
case CLIMBER_DEPLOYING:
503+
case HAS_CORAL_AND_ALGAE:
504+
case HAS_ALGAE:
505+
case HAS_CORAL:
503506
case MANUAL_CLIMBER_DEPLOYING:
504507
return new ClimberDeploying(subStateMachine, subClimber, subElevator, subAlgaeIntake, subLED);
505508
}

0 commit comments

Comments
 (0)