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

3 group 2 triggers to main #5

Merged
merged 2 commits into from
Dec 14, 2023
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
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
Loading