-
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.
- Loading branch information
1 parent
76b5bfb
commit 3b2afdd
Showing
12 changed files
with
151 additions
and
44 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package frc.robot.commands; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.subsystems.arm.ArmSubsystem; | ||
import frc.robot.subsystems.shooter.ShooterSubsystem; | ||
|
||
|
||
public class ShooterAutoCommand extends Command { | ||
private final ArmSubsystem armSubsystem; | ||
private final ShooterSubsystem shooterSubsystem; | ||
|
||
public ShooterAutoCommand(ArmSubsystem armSubsystem, ShooterSubsystem shooterSubsystem) { | ||
this.armSubsystem = armSubsystem; | ||
this.shooterSubsystem = shooterSubsystem; | ||
// each subsystem used by the command must be passed into the | ||
// addRequirements() method (which takes a vararg of Subsystem) | ||
addRequirements(this.armSubsystem, this.shooterSubsystem); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
|
||
} | ||
|
||
@Override | ||
public void execute() { | ||
shooterSubsystem.runShooterVelocity(shooterSubsystem.atSpeed()).execute(); | ||
armSubsystem.setDesiredState(ArmSubsystem.ArmState.AUTO_AIM); | ||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
return !shooterSubsystem.hasPiece(); | ||
} | ||
|
||
@Override | ||
public void end(boolean interrupted) { | ||
shooterSubsystem.setShooterPowerFactory(0.0, 0.0, 0.0).execute(); | ||
armSubsystem.setDesiredState(ArmSubsystem.ArmState.STOW); | ||
} | ||
} |
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.