Skip to content

Commit

Permalink
Add SwerveDriveStop
Browse files Browse the repository at this point in the history
  • Loading branch information
BenG49 committed Apr 11, 2024
1 parent 01301a3 commit c2279f5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.stuypulse.robot.commands.conveyor.ConveyorShootRoutine;
import com.stuypulse.robot.commands.shooter.ShooterPodiumShot;
import com.stuypulse.robot.commands.shooter.ShooterSetRPM;
import com.stuypulse.robot.commands.swerve.SwerveDriveStop;
import com.stuypulse.robot.commands.swerve.SwerveDriveToPose;
import com.stuypulse.robot.commands.swerve.SwerveDriveToShoot;
import com.stuypulse.robot.constants.Settings;
Expand Down Expand Up @@ -37,13 +38,13 @@ public TopFerry(PathPlannerPath... paths) {

// shoot D, intake E
SwerveDrive.getInstance().followPathCommand(paths[1]),
new InstantCommand(() -> SwerveDrive.getInstance().stop()),
new SwerveDriveStop(),
new ConveyorShootRoutine(),
new FollowPathAndIntake(paths[2]),

// shoot E, intake F
SwerveDrive.getInstance().followPathCommand(paths[3]),
new InstantCommand(() -> SwerveDrive.getInstance().stop()),
new SwerveDriveStop(),
new ConveyorShootRoutine(),
new ShooterPodiumShot(),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.pathplanner.lib.path.PathPlannerPath;
import com.stuypulse.robot.commands.intake.IntakeAcquire;
import com.stuypulse.robot.commands.swerve.SwerveDriveStop;
import com.stuypulse.robot.constants.Settings.Auton;
import com.stuypulse.robot.subsystems.swerve.SwerveDrive;

Expand All @@ -25,7 +26,7 @@ public FollowPathAndIntake(PathPlannerPath path, double intakeTimeout) {
.andThen(new WaitCommand(intakeTimeout))
),

new InstantCommand(() -> SwerveDrive.getInstance().stop(), SwerveDrive.getInstance())
new SwerveDriveStop()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.pathplanner.lib.path.PathPlannerPath;
import com.stuypulse.robot.commands.intake.IntakeAcquire;
import com.stuypulse.robot.commands.swerve.SwerveDriveStop;
import com.stuypulse.robot.constants.Settings.Auton;
import com.stuypulse.robot.subsystems.swerve.SwerveDrive;

Expand All @@ -25,7 +26,7 @@ public FollowPathTrackingAndIntake(PathPlannerPath path, double intakeTimeout) {
.andThen(new WaitCommand(intakeTimeout))
),

new InstantCommand(() -> SwerveDrive.getInstance().stop())
new SwerveDriveStop()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.stuypulse.robot.commands.conveyor.ConveyorShootRoutine;
import com.stuypulse.robot.commands.intake.IntakeAcquire;
import com.stuypulse.robot.commands.shooter.ShooterWaitForTarget;
import com.stuypulse.robot.commands.swerve.SwerveDriveStop;
import com.stuypulse.robot.constants.Settings.Auton;
import com.stuypulse.robot.subsystems.intake.Intake;
import com.stuypulse.robot.subsystems.swerve.SwerveDrive;
Expand Down Expand Up @@ -33,7 +34,7 @@ public FollowPathWithShootAndIntake(PathPlannerPath path, double shootTime, doub
)
),

new InstantCommand(() -> SwerveDrive.getInstance().stop(), SwerveDrive.getInstance())
new SwerveDriveStop()
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.stuypulse.robot.commands.swerve;

import com.stuypulse.robot.subsystems.swerve.SwerveDrive;

import edu.wpi.first.wpilibj2.command.InstantCommand;

public class SwerveDriveStop extends InstantCommand {

public SwerveDriveStop() {
super(() -> SwerveDrive.getInstance().stop());

addRequirements(SwerveDrive.getInstance());
}

}

0 comments on commit c2279f5

Please sign in to comment.