generated from StuyPulse/Phil
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working preload auto and clearer TankDriveDrive
Co-authored-by: Ian Shi <IanShiii@users.noreply.github.com>
- Loading branch information
Showing
6 changed files
with
78 additions
and
34 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
9 changes: 6 additions & 3 deletions
9
src/main/java/com/stuypulse/robot/commands/auton/Mobility.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 |
---|---|---|
@@ -1,15 +1,18 @@ | ||
package com.stuypulse.robot.commands.auton; | ||
|
||
import com.stuypulse.robot.commands.swerve.SwerveDriveBack; | ||
import com.stuypulse.robot.commands.tank.TankDriveBack; | ||
|
||
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; | ||
import edu.wpi.first.wpilibj2.command.WaitCommand; | ||
|
||
public class Mobility extends SequentialCommandGroup { | ||
public Mobility() { | ||
addCommands( | ||
new WaitCommand(8), | ||
new SwerveDriveBack(2).withTimeout(2) | ||
new WaitCommand(2), | ||
|
||
// new SwerveDriveBack(2).withTimeout(2) | ||
new TankDriveBack().withTimeout(2) | ||
); | ||
} | ||
} | ||
} |
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
29 changes: 29 additions & 0 deletions
29
src/main/java/com/stuypulse/robot/commands/tank/TankDriveBack.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,29 @@ | ||
package com.stuypulse.robot.commands.tank; | ||
|
||
import com.stuypulse.robot.subsystems.TankDrive; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
|
||
public class TankDriveBack extends Command { | ||
private TankDrive tank; | ||
|
||
public TankDriveBack() { | ||
this.tank = TankDrive.getInstance(); | ||
addRequirements(tank); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
tank.tankDriveVolts(-12,-12); | ||
} | ||
|
||
@Override | ||
public void execute() { | ||
tank.tankDriveVolts(-12,-12); | ||
} | ||
|
||
@Override | ||
public void end(boolean isInterrupted) { | ||
tank.stop(); | ||
} | ||
} |
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