Skip to content

Commit

Permalink
slow down toShooterSlow so that there is more time for the color sens…
Browse files Browse the repository at this point in the history
…or to see the note and it just stops in place nice and nice for us (#248)
  • Loading branch information
PatribotsProgramming authored Mar 14, 2024
2 parents 5379246 + 6a60a07 commit caafe0f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
11 changes: 4 additions & 7 deletions src/main/java/frc/robot/commands/managers/PieceControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,19 @@ public Command intakeNote() {
intake.inCommand(),
trapper.intakeSlow(0.6),
indexer.toShooterSlow(),
Commands.waitUntil(colorSensor.hasNoteTrigger()),
Commands.waitUntil(colorSensor::hasNote),
setHasPiece(true),
NT.getWaitCommand("intakeToTrap1"), // 0.1
// Use the trap to index it the first time around
noteToTrap()
stopIntakeAndIndexer()
);
}

public Command toIndexerAuto() {
return Commands.sequence(
intake.inCommand(),
trapper.intake(),
indexer.stopCommand(),
Commands.waitUntil(colorSensor.hasNoteTrigger()),
indexer.toShooterSlow(),
Commands.waitUntil(colorSensor::hasNote),
setHasPiece(true),
Commands.waitSeconds(0.15),
stopIntakeAndIndexer()
);
}
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/frc/robot/subsystems/ColorSensor.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,4 @@ public void periodic() {
public boolean hasNote() {
return this.hasOrange;
}

public Trigger hasNoteTrigger() {
if (hasNoteTrigger == null) {
hasNoteTrigger = new Trigger(this::hasNote);
}
return hasNoteTrigger;
}
}
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/Indexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public Command toShooter() {
}

public Command toShooterSlow() {
return setPercentCommand(IntakeConstants.SHOOTER_TRIGGER_WHEEL_PERCENT/2.0);
return setPercentCommand(IntakeConstants.SHOOTER_TRIGGER_WHEEL_PERCENT/7.0);
}

public Command toElevator() {
Expand Down

0 comments on commit caafe0f

Please sign in to comment.