Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
feat: event changes
Browse files Browse the repository at this point in the history
  • Loading branch information
WeilSimon committed Dec 31, 2023
1 parent 0555c37 commit 8caf7af
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ private void configureAutoChooser() {
new InstantCommand(() -> drive.resetPose()),
new InstantCommand(() -> intake.zeroPivotAngle()),
new IntakeCommands.IntakeUp(intake)));
autoChooser.addOption(
"Shoot and Drive",
new DriveCommands.ShootAndDrive(drive, intake, shooter, limelight, indexer)
);
}

/**
Expand Down
27 changes: 24 additions & 3 deletions src/main/java/frc/robot/commands/DriveCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@
import edu.wpi.first.math.geometry.Translation2d;
import edu.wpi.first.math.kinematics.ChassisSpeeds;
import edu.wpi.first.wpilibj2.command.*;
import frc.robot.commands.ShooterCommands.Shoot;
import frc.robot.subsystems.drive.Drive;
import frc.robot.subsystems.indexer.Indexer;
import frc.robot.subsystems.intake.Intake;
import frc.robot.subsystems.limelight.Limelight;
import frc.robot.subsystems.shooter.Shooter;

import java.util.function.DoubleSupplier;

Expand Down Expand Up @@ -111,14 +114,32 @@ public static class JustinCase extends SequentialCommandGroup {
public JustinCase(Drive drive, Intake intake){
addCommands(
new InstantCommand(() -> drive.resetPose()),
new InstantCommand(() -> intake.zeroPivotAngle()),
new IntakeCommands.IntakeUp(intake),
// new InstantCommand(() -> intake.zeroPivotAngle()),
new ParallelRaceGroup(
new WaitCommand(1),
// new IntakeCommands.IntakeUp(intake),
new WaitCommand(1)
),
new ParallelRaceGroup(
new WaitCommand(3),
joystickDrive(drive, () -> 0.0, () -> -0.5, () -> 0.0)
),
joystickDrive(drive, () -> 0.0, () -> 0.0, () -> 0.0)
);
}
}

public static class ShootAndDrive extends SequentialCommandGroup{
public ShootAndDrive(Drive drive, Intake intake, Shooter shooter, Limelight limelight, Indexer indexer){
addCommands(
new JustinCase(drive, intake),
// new InstantCommand(() -> indexer.setVoltage(9)),
new Shoot(shooter, limelight),
new WaitCommand(1),
new Shoot(shooter, limelight),
new WaitCommand(1),
new Shoot(shooter, limelight),
new WaitCommand(1)
);
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/commands/IntakeCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public IntakeUp(Intake intake){
@Override
public void initialize() {
intake.setPivotAngle(Rotation2d.fromRotations(5));
intake.rollerVoltage(0);
intake.rollerVoltage(8);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/commands/ShooterCommands/Shoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public void execute() {
}
case SPINUP -> {
//TODO calculation based on distance;
mainRPM = mainRPMLog.get();
secondaryRPM = secondRPMLog.get();
mainRPM = 6500;
secondaryRPM = 0;

shooter.setMainVelocity(mainRPM);
shooter.setSecondaryVelocity(secondaryRPM);
Expand Down

0 comments on commit 8caf7af

Please sign in to comment.