generated from StuyPulse/Phil
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from StuyPulse/se/arm-overrides
Se/arm overrides
- Loading branch information
Showing
18 changed files
with
247 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/com/stuypulse/robot/commands/arm/ArmDisableOverride.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.stuypulse.robot.commands.arm; | ||
|
||
import com.stuypulse.robot.subsystems.arm.Arm; | ||
|
||
import edu.wpi.first.wpilibj2.command.InstantCommand; | ||
|
||
public class ArmDisableOverride extends InstantCommand{ | ||
|
||
private final Arm arm; | ||
|
||
public ArmDisableOverride() { | ||
this.arm = Arm.getInstance(); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
arm.setOverriding(false); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/com/stuypulse/robot/commands/arm/ArmEnableOverride.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.stuypulse.robot.commands.arm; | ||
|
||
import com.stuypulse.robot.subsystems.arm.Arm; | ||
|
||
import edu.wpi.first.wpilibj2.command.InstantCommand; | ||
|
||
public class ArmEnableOverride extends InstantCommand{ | ||
|
||
private final Arm arm; | ||
|
||
public ArmEnableOverride() { | ||
this.arm = Arm.getInstance(); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
arm.setOverriding(true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/com/stuypulse/robot/commands/arm/ArmToFerry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.stuypulse.robot.commands.arm; | ||
|
||
import com.stuypulse.robot.constants.Settings; | ||
import com.stuypulse.robot.subsystems.arm.Arm; | ||
import com.stuypulse.stuylib.util.StopWatch; | ||
|
||
import edu.wpi.first.wpilibj2.command.InstantCommand; | ||
|
||
public class ArmToFerry extends InstantCommand{ | ||
|
||
private final Arm arm; | ||
private final StopWatch stopWatch; | ||
private double lastClick; | ||
|
||
public ArmToFerry() { | ||
arm = Arm.getInstance(); | ||
stopWatch = new StopWatch(); | ||
lastClick = 0; | ||
addRequirements(arm); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
if (stopWatch.getTime() - lastClick < Settings.Driver.DOUBLE_CLICK_TIME_BETWEEN_CLICKS) { | ||
arm.setRequestedState(Arm.State.LOB_FERRY); | ||
} | ||
else { | ||
arm.setRequestedState(Arm.State.LOW_FERRY); | ||
} | ||
lastClick = stopWatch.getTime(); | ||
} | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/com/stuypulse/robot/commands/arm/ArmToSpeaker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.stuypulse.robot.commands.arm; | ||
|
||
import com.stuypulse.robot.constants.Settings; | ||
import com.stuypulse.robot.subsystems.arm.Arm; | ||
import com.stuypulse.stuylib.util.StopWatch; | ||
|
||
import edu.wpi.first.wpilibj2.command.InstantCommand; | ||
|
||
public class ArmToSpeaker extends InstantCommand{ | ||
|
||
private final Arm arm; | ||
private final StopWatch stopWatch; | ||
private double lastClick; | ||
|
||
public ArmToSpeaker() { | ||
arm = Arm.getInstance(); | ||
stopWatch = new StopWatch(); | ||
lastClick = 0; | ||
addRequirements(arm); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
if (stopWatch.getTime() - lastClick < Settings.Driver.DOUBLE_CLICK_TIME_BETWEEN_CLICKS) { | ||
arm.setRequestedState(Arm.State.SPEAKER_HIGH); | ||
} | ||
else { | ||
arm.setRequestedState(Arm.State.SPEAKER_LOW); | ||
} | ||
lastClick = stopWatch.getTime(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/main/java/com/stuypulse/robot/commands/shooter/ShooterFerry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.