Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void initialize() {


leftTrigger.whileActiveContinuous(
new IntakeCommand(feeder, () -> beamBreak.isBeamBreakOn(), Constants.Feeder.DEFAULT_INTAKE_POWER, 0.6)
new IntakeCommand(feeder, () -> beamBreak.isBeamBreakOn(), Constants.Feeder.DEFAULT_INTAKE_POWER, 0)
);
leftBumper.whileActiveContinuous(
new IntakeCommand(feeder, () -> false, -Constants.Feeder.DEFAULT_INTAKE_POWER, -Constants.Feeder.DEFAULT_INDEX_POWER)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public class IntakeCommand extends CommandBase {
private BooleanSupplier breamBreak;
private double intakePower, indexPower;
private static final long INDEX_FEED_PULSE_MS = 180L;
private static final double INDEX_FEED_PULSE_POWER = 0.6;
private static final double INDEX_FEED_PULSE_POWER_INTAKE = 0.35;
private static final double INDEX_FEED_PULSE_POWER_ACTIVE = 0.6;

private boolean beamBlockedLatched;
private long indexFeedUntilNanos;
Expand Down Expand Up @@ -66,11 +67,11 @@ public void execute() {

private double getIndexPulsePower() {
if (Math.abs(indexPower) < 1e-6) {
return INDEX_FEED_PULSE_POWER;
return INDEX_FEED_PULSE_POWER_INTAKE;
}

return Math.copySign(
Math.min(Math.abs(indexPower), INDEX_FEED_PULSE_POWER),
Math.min(Math.abs(indexPower), INDEX_FEED_PULSE_POWER_ACTIVE),
indexPower
);
}
Expand Down