-
Notifications
You must be signed in to change notification settings - Fork 13
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 #33 from iamawesomecat/main
Launcher updates
- Loading branch information
Showing
5 changed files
with
134 additions
and
18 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
27 changes: 27 additions & 0 deletions
27
src/main/java/frc/team2412/robot/commands/diagnostic/LauncherDiagnosticCommand.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 frc.team2412.robot.commands.diagnostic; | ||
|
||
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; | ||
import edu.wpi.first.wpilibj2.command.WaitCommand; | ||
import frc.team2412.robot.commands.launcher.SetAngleCommand; | ||
import frc.team2412.robot.commands.launcher.SetLaunchSpeedCommand; | ||
import frc.team2412.robot.commands.launcher.StopLauncherCommand; | ||
import frc.team2412.robot.subsystems.LauncherSubsystem; | ||
|
||
public class LauncherDiagnosticCommand extends SequentialCommandGroup { | ||
private final LauncherSubsystem launcherSubsystem; | ||
private final double Angle; | ||
|
||
public LauncherDiagnosticCommand(LauncherSubsystem launcherSubsystem) { | ||
this.launcherSubsystem = launcherSubsystem; | ||
this.Angle = launcherSubsystem.getAngle(); | ||
addCommands( | ||
new SetAngleCommand(launcherSubsystem, 45), | ||
new WaitCommand(2), | ||
new SetAngleCommand(launcherSubsystem, 90), | ||
new WaitCommand(1), | ||
new SetAngleCommand(launcherSubsystem, Angle), | ||
new SetLaunchSpeedCommand(launcherSubsystem, 100), | ||
new WaitCommand(5), | ||
new StopLauncherCommand(launcherSubsystem)); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/frc/team2412/robot/commands/launcher/StopLauncherCommand.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,23 @@ | ||
package frc.team2412.robot.commands.launcher; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.team2412.robot.subsystems.LauncherSubsystem; | ||
|
||
public class StopLauncherCommand extends Command { | ||
private final LauncherSubsystem launcherSubsystem; | ||
|
||
public StopLauncherCommand(LauncherSubsystem launcherSubsystem) { | ||
this.launcherSubsystem = launcherSubsystem; | ||
addRequirements(launcherSubsystem); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
launcherSubsystem.stopLauncher(); | ||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
return 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
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