Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit 23b2066

Browse files
committed
Removed all code related to the intake sensor
1 parent 1a59d99 commit 23b2066

File tree

6 files changed

+13
-46
lines changed

6 files changed

+13
-46
lines changed

src/main/java/frc/robot/Robot.java

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -169,28 +169,13 @@ private void configureBindings() {
169169
.x()
170170
.onTrue(robotCommands.outtakeCommand())
171171
.onFalse(robotCommands.stowCommand());
172-
hardware
173-
.operatorController
174-
.a()
175-
.onTrue(robotCommands.stowCommand());
176-
hardware
177-
.operatorController
178-
.povUp()
179-
.onTrue(robotCommands.climbUpCommand());
180-
hardware
181-
.operatorController
182-
.povDown()
183-
.onTrue(robotCommands.climbDownCommand());
172+
hardware.operatorController.a().onTrue(robotCommands.stowCommand());
173+
hardware.operatorController.povUp().onTrue(robotCommands.climbUpCommand());
174+
hardware.operatorController.povDown().onTrue(robotCommands.climbDownCommand());
184175
hardware
185176
.operatorController
186177
.povLeft()
187178
.onTrue(robotCommands.unjamCommand())
188179
.onFalse(robotCommands.stowCommand());
189-
190-
191-
192-
193-
194-
195180
}
196181
}

src/main/java/frc/robot/config/CompConfig.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ class CompConfig {
6666
999,
6767
CANIVORE_NAME,
6868
999,
69-
999,
7069
new TalonFXConfiguration()
7170
.withClosedLoopRamps(CLOSED_LOOP_RAMP)
7271
.withOpenLoopRamps(OPEN_LOOP_RAMP)
@@ -77,8 +76,7 @@ class CompConfig {
7776
centeringMotor -> {
7877
centeringMotor.setSmartCurrentLimit(20);
7978
centeringMotor.burnFlash();
80-
},
81-
new Debouncer(3.0 * 0.02)),
79+
}),
8280
new ArmConfig(
8381
CANIVORE_NAME,
8482
999,

src/main/java/frc/robot/config/RobotConfig.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ public record IntakeConfig(
3939
int mainMotorID,
4040
String mainMotorCanBusName,
4141
int centeringMotorID,
42-
int sensorID,
4342
TalonFXConfiguration mainMotorConfig,
44-
Consumer<CANSparkMax> centeringMotorConfig,
45-
Debouncer debouncer) {}
43+
Consumer<CANSparkMax> centeringMotorConfig) {}
4644

4745
public record ArmConfig(
4846
String canBusName,

src/main/java/frc/robot/intake/IntakeSubsystem.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
public class IntakeSubsystem extends StateMachine<IntakeState> {
1212
private final TalonFX mainMotor;
1313
private final CANSparkMax centeringMotor;
14-
private boolean sensorHasNote = false;
15-
private boolean debouncedSensorHasNote = false;
1614
private final Debouncer debouncer = RobotConfig.get().intake().debouncer();
1715

1816
public IntakeSubsystem(TalonFX mainMotor, CANSparkMax centeringMotor) {
@@ -29,20 +27,11 @@ public void setState(IntakeState newState) {
2927
setStateFromRequest(newState);
3028
}
3129

32-
@Override
33-
protected void collectInputs() {
34-
debouncedSensorHasNote = debouncer.calculate(sensorHasNote);
35-
}
36-
3730
@Override
3831
protected IntakeState getNextState(IntakeState currentState) {
3932
return currentState;
4033
}
4134

42-
public boolean hasNote() {
43-
return debouncedSensorHasNote;
44-
}
45-
4635
@Override
4736
protected void afterTransition(IntakeState newState) {
4837
switch (newState) {
@@ -65,7 +54,5 @@ public void robotPeriodic() {
6554
DogLog.log("Intake/StatorCurrent", mainMotor.getStatorCurrent().getValueAsDouble());
6655
DogLog.log("Intake/SupplyCurrent", mainMotor.getSupplyCurrent().getValueAsDouble());
6756
DogLog.log("Intake/AppliedVoltage", mainMotor.getMotorVoltage().getValueAsDouble());
68-
DogLog.log("Intake/RawSensor", sensorHasNote);
69-
DogLog.log("Intake/DebouncedSensor", hasNote());
7057
}
7158
}

src/main/java/frc/robot/robot_manager/RobotCommands.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,18 @@ public Command subwooferCommand() {
8989
return Commands.runOnce(robot::prepareSubwooferRequest, requirements)
9090
.andThen(robot.waitForState(RobotState.IDLE_NO_GP));
9191
}
92-
public Command climbUpCommand(){
92+
93+
public Command climbUpCommand() {
9394
return Commands.runOnce(robot::nextClimbStateRequest, requirements)
9495
.andThen(robot.waitForState(RobotState.CLIMBING_2_HANGING));
9596
}
96-
public Command climbDownCommand(){
97+
98+
public Command climbDownCommand() {
9799
return Commands.runOnce(robot::previousClimbStateRequest, requirements)
98100
.andThen(robot.waitForState(RobotState.CLIMBING_1_LINEUP));
99101
}
100-
public Command unjamCommand(){
102+
103+
public Command unjamCommand() {
101104
return Commands.runOnce(robot::unjamRequest, requirements)
102105
.andThen(robot.waitForState(RobotState.IDLE_NO_GP));
103106
}

src/main/java/frc/robot/robot_manager/RobotManager.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected RobotState getNextState(RobotState currentState) {
7676
shooter.atGoal() && arm.atGoal() ? RobotState.SUBWOOFER_SCORING : currentState;
7777
case UNJAM -> currentState;
7878
case INTAKING -> queuer.hasNote() ? RobotState.IDLE_WITH_GP : currentState;
79-
case OUTTAKING -> queuer.hasNote() || intake.hasNote() ? currentState : RobotState.IDLE_NO_GP;
79+
case OUTTAKING -> queuer.hasNote() ? currentState : RobotState.IDLE_NO_GP;
8080
};
8181
}
8282

@@ -343,11 +343,7 @@ public void prepareFeedRequest() {
343343
public void stopShootingRequest() {
344344
// If we are actively taking a shot, ignore the request to avoid messing up shooting
345345
switch (getState()) {
346-
case SPEAKER_SCORING,
347-
SUBWOOFER_SCORING,
348-
AMP_SCORING,
349-
FEEDING_SHOOTING,
350-
PASS_SHOOTING -> {}
346+
case SPEAKER_SCORING, SUBWOOFER_SCORING, AMP_SCORING, FEEDING_SHOOTING, PASS_SHOOTING -> {}
351347
default -> setStateFromRequest(RobotState.IDLE_WITH_GP);
352348
}
353349
}

0 commit comments

Comments
 (0)