Skip to content

Commit

Permalink
Merge pull request #5 from Patribots4738/3-group-2-triggers
Browse files Browse the repository at this point in the history
3 group 2 triggers to main
  • Loading branch information
PatribotsProgramming authored Dec 14, 2023
2 parents 7278bb4 + 95f98a5 commit d626319
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
37 changes: 32 additions & 5 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,16 @@ private void configureButtonBindings() {
.onTrue(
setDriveSpeed(DriveConstants.MAX_TELEOP_SPEED_METERS_PER_SECOND));

Make a trigger so then when the current GAME_MODE
(DONE) Make a trigger so then when the current GAME_MODE
is equal to AUTONOMOUS then set the drive speed to MAX_SPEED_METERS_PER_SECOND

Create a trigger like the one above so that
(DONE) Create a trigger like the one above so that
while the "a" button is been pressed,
set the drive speed to ALIGNMENT_SPEED
and when the "a" button has not been pressed,
set the drive speed to MAX_TELEOP_SPEED_METERS_PER_SECOND


driver.y().or(driver.x()).onTrue(
Commands.runOnce(() -> swerve.resetOdometry(
new Pose2d(
Expand All @@ -97,18 +98,44 @@ private void configureButtonBindings() {
swerve.getSetWheelsXCommand()
);

Create a trigger so while the leftBumper is pressed,
driver.a().onTrue(
setDriveSpeed(ALIGNMENT_SPEED)
);

driver.a().onFalse(
setDriveSpeed(MAX_TELEOP_SPEED_METERS_PER_SECOND)
);

driver.leftBumper().onTrue(
swerve.getSetWheelsXCommand()
);

driver.leftStick().toggleOnTrue(
swerve.toggleSpeed()
);

driver.leftStick().onTrue(
claw.setSpeed(driver.getLeftTriggerAxis)
);

driver.rightStick.onTrue(
claw.setSpeed(driver.getRightTriggerAxis)
);

(DONE)Create a trigger so while the leftBumper is pressed,
run the command in swerve, getSetWheelsX

Create another trigger so
(DONE) Create another trigger so
the swerve runs the toggleSpeed command in swerve
when the leftStick toggles to true
hint (use the toggleOnTrue method)


Create two triggers so while the left and right triggers are true,
(Done)Create two triggers so while the left and right triggers are true,
set the desired claw speed
to their respective left and right trigger axies


}

private CommandBase setDriveSpeed(double desiredSpeedMetersPerSecond) {
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/frc/robot/subsystems/Claw.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@ public Claw() {

}

@Override
public void periodic() {
set the current speed of the motors to the desired speed


}

private void setSpeed(double speed) {
public void setSpeed(double speed) {
claw.set(-speed);
}

Expand Down

0 comments on commit d626319

Please sign in to comment.