Skip to content

Commit fb28c84

Browse files
authored
Jiggle coral (#147)
* add and bind coral jiggle command * testing changes
1 parent 8b4a47d commit fb28c84

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

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

+3
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,9 @@ public boolean getAsBoolean() {
404404
operator.rightBumper()
405405
.whileTrue(coralRoller.intake());
406406

407+
// Jiggle coral
408+
operator.start().whileTrue(coralRoller.jiggle().repeatedly());
409+
407410
// Force joystick operation of the elevator
408411
Trigger elevatorTriggerHigh = operator.axisGreaterThan(Axis.kLeftY.value, 0.9, loop).debounce(0.1);
409412
Trigger elevatorTriggerLow = operator.axisLessThan(Axis.kLeftY.value, -0.9, loop).debounce(0.1);

src/main/java/frc/robot/elevator/CoralRoller.java

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import edu.wpi.first.units.measure.Voltage;
1212
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
1313
import edu.wpi.first.wpilibj2.command.Command;
14+
import edu.wpi.first.wpilibj2.command.Commands;
1415
import edu.wpi.first.wpilibj2.command.SubsystemBase;
1516
import edu.wpi.first.wpilibj2.command.button.Trigger;
1617
import frc.robot.Constants.MotorConstants.NEO550Constants;
@@ -97,4 +98,9 @@ public Command outtakeToL4() {
9798
return this.run(() -> setVoltage(CoralRollerConstants.kOuttakeToL4Voltage))
9899
.withName("Outtake to L4");
99100
}
101+
102+
public Command jiggle() {
103+
return Commands.sequence(outtakeToL1().withTimeout(0.05), intake().withTimeout(0.3))
104+
.withName("Jiggle");
105+
}
100106
}

0 commit comments

Comments
 (0)