Skip to content

Commit bc46fb1

Browse files
committed
code quit bug, other bugs
1 parent ae6ac2f commit bc46fb1

File tree

6 files changed

+39
-13
lines changed

6 files changed

+39
-13
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import edu.wpi.first.wpilibj2.command.InstantCommand;
2121
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
2222
import edu.wpi.first.wpilibj2.command.button.Trigger;
23+
import frc.robot.commands.algae.EjectAlgaeCommand;
2324
import frc.robot.commands.algae.IntakeAlgaeCommand;
2425
import frc.robot.commands.algae.OpenLoopAlgaeCommand;
2526
import frc.robot.commands.algae.ProcessorAlgaeCommand;
@@ -44,15 +45,14 @@
4445
import frc.robot.commands.elevator.ZeroElevatorCommand;
4546
import frc.robot.commands.robotState.AutoReefCycleCommand;
4647
import frc.robot.commands.robotState.DepthChargeHealthCheckCommand;
47-
import frc.robot.commands.robotState.EjectAlgaeCommand;
48+
import frc.robot.commands.robotState.ForceBargeCommand;
4849
import frc.robot.commands.robotState.ForceLowFloorAlgaeCommand;
4950
import frc.robot.commands.robotState.ForceProcessorCommand;
5051
import frc.robot.commands.robotState.HPAlgaeCommand;
5152
import frc.robot.commands.robotState.InterruptAutoCommand;
5253
import frc.robot.commands.robotState.LockWheelsCommand;
5354
import frc.robot.commands.robotState.OperatorRumbleCommand;
5455
import frc.robot.commands.robotState.ReefCycleCommand;
55-
import frc.robot.commands.robotState.ScoreAlgaeCommand;
5656
import frc.robot.commands.robotState.SetScoreSideCommand;
5757
import frc.robot.commands.robotState.SetScoreSideRightCommand;
5858
import frc.robot.commands.robotState.SetScoringLevelCommand;
@@ -362,10 +362,13 @@ private void configureDriverBindings() {
362362

363363
new JoystickButton(driveJoystick, Button.M_SWE.id)
364364
.onTrue(
365-
new ScoreAlgaeCommand(
366-
robotStateSubsystem, elevatorSubsystem, biscuitSubsystem, algaeSubsystem));
367-
// new ForceBargeCommand(
368-
// robotStateSubsystem, elevatorSubsystem, biscuitSubsystem, algaeSubsystem)); // for easy
365+
// new ScoreAlgaeCommand(
366+
// robotStateSubsystem, elevatorSubsystem, biscuitSubsystem, algaeSubsystem));
367+
new ForceBargeCommand(
368+
robotStateSubsystem,
369+
elevatorSubsystem,
370+
biscuitSubsystem,
371+
algaeSubsystem)); // for easy
369372
// swapping
370373
Command floorAlgaeCommand =
371374
// new FloorAlgaeCommand(
@@ -440,8 +443,7 @@ private void configureOperatorBindings() {
440443
new Trigger(() -> robotStateSubsystem.isStuckAndMisaligned())
441444
.onTrue(new OperatorRumbleCommand(robotStateSubsystem, xboxController));
442445

443-
new Trigger(() -> xboxController.getPOV() != 0)
444-
.onTrue(new EjectAlgaeCommand(algaeSubsystem, robotStateSubsystem));
446+
new Trigger(() -> xboxController.getPOV() != -1).onTrue(new EjectAlgaeCommand(algaeSubsystem));
445447

446448
// // Move biscuit
447449
// new Trigger((() -> xboxController.getRightY() < -RobotConstants.kTestingDeadband))
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package frc.robot.commands.algae;
2+
3+
import edu.wpi.first.wpilibj2.command.InstantCommand;
4+
import frc.robot.subsystems.algae.AlgaeSubsystem;
5+
6+
public class EjectAlgaeCommand extends InstantCommand {
7+
private AlgaeSubsystem algaeSubsystem;
8+
9+
public EjectAlgaeCommand(AlgaeSubsystem algaeSubsystem) {
10+
this.algaeSubsystem = algaeSubsystem;
11+
addRequirements(algaeSubsystem);
12+
}
13+
14+
@Override
15+
public void initialize() {
16+
algaeSubsystem.scoreProcessor();
17+
}
18+
}

src/main/java/frc/robot/commands/robotState/ForceBargeCommand.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,21 @@ public void initialize() {
3838

3939
@Override
4040
public boolean isFinished() {
41-
if (startState == RobotStates.PROCESSOR_ALGAE || hasEjectedToBarge) {
41+
if (startState == RobotStates.PROCESSOR_ALGAE
42+
|| startState == RobotStates.BARGE_ALGAE
43+
|| hasEjectedToBarge) {
4244
return robotStateSubsystem.getState() == RobotStates.FUNNEL_LOAD
4345
|| robotStateSubsystem.getState() == RobotStates.STOW
4446
|| !startingElevatorFinished;
45-
} else if (robotStateSubsystem.getState() == RobotStates.BARGE_ALGAE) {
47+
} else if (robotStateSubsystem.getState() == RobotStates.BARGE_ALGAE
48+
&& robotStateSubsystem.getIsAutoPlacing()) {
4649
hasEjectedToBarge = true;
50+
return false;
4751
} else {
4852
return robotStateSubsystem.getState() == RobotStates.PROCESSOR_ALGAE
53+
|| (robotStateSubsystem.getState() == RobotStates.BARGE_ALGAE
54+
&& !robotStateSubsystem.getIsAutoPlacing())
4955
|| !robotStateSubsystem.getIsBargeSafe();
5056
}
51-
return false;
5257
}
5358
}

src/main/java/frc/robot/constants/TagServoingConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class TagServoingConstants {
4141
public static final int[] kBlueTargetTag = {18, 17, 22, 21, 20, 19};
4242
public static final int[] kRedTargetTag = {7, 8, 9, 10, 11, 6};
4343

44-
// Offsets
44+
// Offsets (left is negative, right is pos)
4545
public static final double[][][] kBlueCoralOffset = {
4646
{{0, 0}, {0, 0}, {0, 0}, {0, 0}},
4747
{{0, 0}, {0, 0}, {0, 0}, {0, 0}},

src/main/java/frc/robot/subsystems/led/LEDSubsystem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public boolean getCurrentLimiting() {
172172
}
173173

174174
private void buildBase() {
175-
175+
base = LEDPattern.solid(Color.kBlack);
176176
algae =
177177
LEDPattern.steps(
178178
Map.of(

src/main/java/frc/robot/subsystems/pathHandler/PathHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ public void killPathHandler() {
331331
isHandling = false;
332332
curState = PathStates.DONE;
333333
runningPath = false;
334+
robotStateSubsystem.setLEDLoadCoral(false);
334335
robotStateSubsystem.setIsAutoPlacing(true);
335336
pathTimer.stop();
336337
pathTimer.reset();

0 commit comments

Comments
 (0)