Skip to content

Commit f2cbd13

Browse files
authored
prevent coral gripper from damage at upper end of lifter travel (#92)
1 parent 7f8a69c commit f2cbd13

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/main/java/frc/lib/AutoSelector.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ private boolean updateAuto() {
9595
/**
9696
* @return Object for binding a command to a change in autonomous mode selection
9797
*/
98-
public Trigger getChangedAutoSelection() {
99-
return autoSelectionChanged.castTo(Trigger::new);
100-
}
98+
public Trigger changedAutoSelection = autoSelectionChanged.castTo(Trigger::new);
10199

102100
/** Schedules the command corresponding to the selected autonomous mode */
103101
public void scheduleAuto() {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ private void configureOperatorButtonBindings() {
277277
// spotless:on
278278

279279
private void configureEventBindings() {
280-
autoSelector.getChangedAutoSelection().onTrue(leds.createChangeAutoAnimationCommand());
280+
autoSelector.changedAutoSelection.onTrue(leds.createChangeAutoAnimationCommand());
281+
lifter.impendingCoralGripperDamage.onTrue(coralWrist.createSetAngleCommand(CoralWristState.L1));
281282
}
282283

283284
private void configureAutoOptions() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static enum LifterState {
5858
Processor(12.0),
5959
AlgaeL2(30),
6060
AlgaeL3(46.5),
61-
Max(30.00);
61+
Max(52.0);
6262

6363
public Distance height;
6464

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ public Boolean inState(LifterState state) {
139139
}
140140

141141
public Trigger atIntakingHeight = new Trigger(() -> inState(LifterState.Intake));
142+
public Trigger impendingCoralGripperDamage =
143+
new Trigger(() -> getHeight().gt(LifterState.L3.height.plus(Inches.of(2.0))));
142144

143145
private void resetEncoder() {
144146
encoder.setPosition(LifterState.Reset.height.in(Inches));

0 commit comments

Comments
 (0)