Skip to content

Commit

Permalink
added driveforwardcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
eerinn committed Feb 10, 2024
1 parent c5685f4 commit 0ea69fe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/main/java/frc/robot/commands/auton/BaseAutonSequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,10 @@ public Command followPath(ChoreoTrajectory traj){
return swerveCommand;
}

public ParallelDeadlineGroup driveForward(double xpower, double ypower, double angularpower){

return new ParallelDeadlineGroup( new IntakeRollerIntakeCommand(intakeRollersSubsystem));
}
public SequentialCommandGroup goIntake(ChoreoTrajectory intaketraj, double xpower, double ypower, double angularpower ){
public SequentialCommandGroup goIntake(ChoreoTrajectory intaketraj){
return followPath(intaketraj)
.andThen(new IntakePivotExtendedCommand(intakePivotSubsystem))
.andThen(driveForward(xpower, ypower, angularpower))
.andThen(new IntakeRollerIntakeCommand(intakeRollersSubsystem).deadlineWith(new DriveForwardCommand(swerveSubsystem).withTimeout(driveforwardtime)))
.andThen(new IntakeRollerIntakeCommand(intakeRollersSubsystem))//just in case the note isn't fully intaken during intakeandMove
.andThen(new IntakePivotVerticalCommand(intakePivotSubsystem));
}
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/frc/robot/commands/auton/DriveForwardCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,22 @@

public class DriveForwardCommand extends Command{
private final SwerveSubsystem swerve;
private int xpower;
private int ypower;

public DriveForwardCommand(SwerveSubsystem swerve){
this.swerve = swerve;
addRequirements(swerve);
}

@Override
public void initialize() {
swerve.setDrivePowers(xpower, ypower, 0);
}

@Override
public void end(boolean interrupted) {
swerve.setDrivePowers(0,0,0);
}

}

0 comments on commit 0ea69fe

Please sign in to comment.