Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rumble #12

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package frc.robot;

import edu.wpi.first.wpilibj.GenericHID;
import edu.wpi.first.wpilibj.GenericHID.RumbleType;
import edu.wpi.first.wpilibj.XboxController;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj.util.Color;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.WaitCommand;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
Expand All @@ -29,8 +31,6 @@
public class RobotContainer {
/* Controllers */
private final CommandXboxController driver = new CommandXboxController(Constants.driverID);
private final CommandXboxController operator = new CommandXboxController(Constants.operatorID);

// Initialize AutoChooser Sendable
private final SendableChooser<String> autoChooser = new SendableChooser<>();

Expand Down Expand Up @@ -58,30 +58,27 @@ public RobotContainer(RobotRunType runtimeType) {
drivetrain = new Drivetrain(new DrivetrainIO() {

@Override
public void updateInputs(DrivetrainIOInputs inputs) {
}
public void updateInputs(DrivetrainIOInputs inputs) {}

@Override
public void setDrivePower(double lPower, double rPower) {
}});
public void setDrivePower(double lPower, double rPower) {}
});
hatch = new Hatch(new HatchIO() {

@Override
public void updateInputs(HatchInputs inputs) {
}
public void updateInputs(HatchInputs inputs) {}

@Override
public void setHatchPower(double power) {
}});
public void setHatchPower(double power) {}
});
intake = new ballMechanism(new ballMechanismIO() {

@Override
public void updateInputs(ballMechanismInputs inputs) {
}
public void updateInputs(ballMechanismInputs inputs) {}

@Override
public void setBallMotor(double power) {
}});
public void setBallMotor(double power) {}
});
}
// Configure the button bindings
configureButtonBindings();
Expand All @@ -95,7 +92,10 @@ public void setBallMotor(double power) {
*/
private void configureButtonBindings() {
drivetrain.setDefaultCommand(drivetrain.driveCommand(driver));
driver.a().whileTrue(hatch.setHatchUp());
driver.a()
.whileTrue(hatch.setHatchUp().andThen(
Commands.startEnd(() -> driver.getHID().setRumble(RumbleType.kBothRumble, 1),
() -> driver.getHID().setRumble(RumbleType.kBothRumble, 0), null)));
driver.b().whileTrue(hatch.setHatchNeutral());
driver.leftTrigger().whileTrue(intake.intakeCommand(Color.kPurple, Color.kWhiteSmoke));
driver.rightTrigger().whileTrue(intake.outtakeCommand());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public Command intakeCommand(Color color, Color altColor) {
}, () -> {
setBallMotor(0);
}, this).until(() -> getIntakeBeamBreakStatus()).unless(() -> getIntakeBeamBreakStatus())
.andThen(() -> lights.flash(color, altColor));
.andThen(() -> lights.flash(color, altColor)).andThen();

}

Expand Down
Loading