generated from StuyPulse/Phil
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:StuyPulse/BigWang into se/climber
- Loading branch information
Showing
48 changed files
with
3,146 additions
and
11 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
25 changes: 25 additions & 0 deletions
25
src/main/java/com/stuypulse/robot/commands/amper/AmperIntake.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,25 @@ | ||
package com.stuypulse.robot.commands.amper; | ||
|
||
import com.stuypulse.robot.subsystems.amper.Amper; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
|
||
public class AmperIntake extends Command { | ||
|
||
private final Amper amper; | ||
|
||
public AmperIntake() { | ||
amper = Amper.getInstance(); | ||
addRequirements(amper); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
amper.intake(); | ||
} | ||
|
||
@Override | ||
public void end(boolean interrupted) { | ||
amper.stopRoller(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/com/stuypulse/robot/commands/amper/AmperOuttake.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,30 @@ | ||
package com.stuypulse.robot.commands.amper; | ||
|
||
import com.stuypulse.robot.subsystems.amper.Amper; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
|
||
public class AmperOuttake extends Command { | ||
|
||
private final Amper amper; | ||
|
||
public AmperOuttake() { | ||
amper = Amper.getInstance(); | ||
addRequirements(amper); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
amper.score(); | ||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
return !amper.hasNote(); | ||
} | ||
|
||
@Override | ||
public void end(boolean interrupted) { | ||
amper.stopRoller(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/stuypulse/robot/commands/amper/AmperScoreAmp.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,17 @@ | ||
package com.stuypulse.robot.commands.amper; | ||
|
||
import com.stuypulse.robot.constants.Settings.Amper.Score; | ||
|
||
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; | ||
|
||
public class AmperScoreAmp extends SequentialCommandGroup { | ||
|
||
public AmperScoreAmp() { | ||
addCommands( | ||
new AmperToHeight(Score.AMP_SCORE_HEIGHT.get()), | ||
new AmperWaitToHeight(Score.AMP_SCORE_HEIGHT.get()), | ||
new AmperOuttake() | ||
); | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/stuypulse/robot/commands/amper/AmperScoreForever.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,20 @@ | ||
package com.stuypulse.robot.commands.amper; | ||
|
||
import com.stuypulse.robot.subsystems.amper.Amper; | ||
|
||
import edu.wpi.first.wpilibj2.command.InstantCommand; | ||
|
||
public class AmperScoreForever extends InstantCommand { | ||
|
||
private final Amper amper; | ||
|
||
public AmperScoreForever() { | ||
amper = Amper.getInstance(); | ||
addRequirements(amper); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
amper.score(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/stuypulse/robot/commands/amper/AmperScoreTrap.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,17 @@ | ||
package com.stuypulse.robot.commands.amper; | ||
|
||
import com.stuypulse.robot.constants.Settings.Amper.Score; | ||
|
||
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; | ||
|
||
public class AmperScoreTrap extends SequentialCommandGroup { | ||
|
||
public AmperScoreTrap() { | ||
addCommands( | ||
new AmperToHeight(Score.TRAP_SCORE_HEIGHT.get()), | ||
new AmperWaitToHeight(Score.TRAP_SCORE_HEIGHT.get()), | ||
new AmperOuttake() | ||
); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/stuypulse/robot/commands/amper/AmperToHeight.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,22 @@ | ||
package com.stuypulse.robot.commands.amper; | ||
|
||
import com.stuypulse.robot.subsystems.amper.Amper; | ||
|
||
import edu.wpi.first.wpilibj2.command.InstantCommand; | ||
|
||
public class AmperToHeight extends InstantCommand { | ||
private final Amper amper; | ||
private final double height; | ||
|
||
public AmperToHeight(double height) { | ||
amper = Amper.getInstance(); | ||
this.height = height; | ||
|
||
addRequirements(amper); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
amper.setTargetHeight(height); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/stuypulse/robot/commands/amper/AmperWaitToHeight.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,24 @@ | ||
package com.stuypulse.robot.commands.amper; | ||
|
||
import com.stuypulse.robot.constants.Settings.Amper.Lift; | ||
import com.stuypulse.robot.subsystems.amper.Amper; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
|
||
public class AmperWaitToHeight extends Command { | ||
|
||
private final Amper amper; | ||
private final double height; | ||
|
||
public AmperWaitToHeight(double height) { | ||
amper = Amper.getInstance(); | ||
this.height = height; | ||
|
||
addRequirements(amper); | ||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
return Math.abs(amper.getLiftHeight() - height) < Lift.MAX_HEIGHT_ERROR; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/com/stuypulse/robot/commands/intake/IntakeAcquire.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,30 @@ | ||
package com.stuypulse.robot.commands.intake; | ||
|
||
import com.stuypulse.robot.subsystems.intake.Intake; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
|
||
public class IntakeAcquire extends Command{ | ||
|
||
private Intake intake; | ||
|
||
public IntakeAcquire() { | ||
intake = Intake.getInstance(); | ||
addRequirements(intake); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
intake.acquire(); | ||
} | ||
|
||
@Override | ||
public void end(boolean interrupted) { | ||
intake.stop(); | ||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
return intake.hasNote(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/stuypulse/robot/commands/intake/IntakeAcquireForever.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,20 @@ | ||
package com.stuypulse.robot.commands.intake; | ||
|
||
import com.stuypulse.robot.subsystems.intake.Intake; | ||
|
||
import edu.wpi.first.wpilibj2.command.InstantCommand; | ||
|
||
public class IntakeAcquireForever extends InstantCommand { | ||
|
||
private Intake intake; | ||
|
||
public IntakeAcquireForever() { | ||
intake = Intake.getInstance(); | ||
addRequirements(intake); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
intake.acquire(); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/com/stuypulse/robot/commands/intake/IntakeDeacquire.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.intake; | ||
|
||
import com.stuypulse.robot.subsystems.intake.Intake; | ||
|
||
import edu.wpi.first.wpilibj2.command.InstantCommand; | ||
|
||
public class IntakeDeacquire extends InstantCommand { | ||
private Intake intake; | ||
|
||
public IntakeDeacquire() { | ||
intake = Intake.getInstance(); | ||
addRequirements(intake); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
intake.deacquire(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/stuypulse/robot/commands/intake/IntakeStop.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,20 @@ | ||
package com.stuypulse.robot.commands.intake; | ||
|
||
import edu.wpi.first.wpilibj2.command.InstantCommand; | ||
|
||
import com.stuypulse.robot.subsystems.intake.Intake; | ||
|
||
public class IntakeStop extends InstantCommand { | ||
|
||
private Intake intake; | ||
|
||
public IntakeStop() { | ||
intake = Intake.getInstance(); | ||
addRequirements(intake); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
intake.stop(); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/stuypulse/robot/commands/shooter/ShooterPodiumShot.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,10 @@ | ||
package com.stuypulse.robot.commands.shooter; | ||
|
||
import com.stuypulse.robot.constants.Settings; | ||
|
||
public class ShooterPodiumShot extends ShooterSetRPM{ | ||
|
||
public ShooterPodiumShot() { | ||
super(Settings.Shooter.PODIUM_SHOT_LEFT_RPM, Settings.Shooter.PODIUM_SHOT_RIGHT_RPM); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/stuypulse/robot/commands/shooter/ShooterSetRPM.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,27 @@ | ||
package com.stuypulse.robot.commands.shooter; | ||
|
||
import com.stuypulse.robot.subsystems.shooter.Shooter; | ||
|
||
import edu.wpi.first.wpilibj2.command.InstantCommand; | ||
|
||
public class ShooterSetRPM extends InstantCommand { | ||
private final Shooter shooter; | ||
private final Number leftTargetRPM; | ||
private final Number rightTargetRPM; | ||
|
||
public ShooterSetRPM(Number leftTargetRPM, Number rightTargetRPM) { | ||
shooter = Shooter.getInstance(); | ||
this.leftTargetRPM = leftTargetRPM; | ||
this.rightTargetRPM = rightTargetRPM; | ||
|
||
addRequirements(shooter); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
shooter.setLeftTargetRPM(leftTargetRPM); | ||
shooter.setRightTargetRPM(rightTargetRPM); | ||
} | ||
|
||
} | ||
|
8 changes: 8 additions & 0 deletions
8
src/main/java/com/stuypulse/robot/commands/shooter/ShooterStop.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,8 @@ | ||
package com.stuypulse.robot.commands.shooter; | ||
|
||
public class ShooterStop extends ShooterSetRPM { | ||
|
||
public ShooterStop(){ | ||
super(0, 0); | ||
} | ||
} |
Oops, something went wrong.