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

Commit

Permalink
ntx-stemgals
Browse files Browse the repository at this point in the history
  • Loading branch information
gvaldez7206 committed Oct 12, 2023
1 parent 6f5edf2 commit 3607688
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public static final class Swerve {
public static final double DRIVE_KA = (0.27 / 12);

/* Swerve Profiling Values */
public static final double MAX_SPEED = 4; // meters per second
public static final double MAX_SPEED = 2.5; // meters per second
public static final double MAX_ANGULAR_VELOCITY = 4.0;

/* Neutral Modes */
Expand Down
37 changes: 17 additions & 20 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,15 @@
import frc.lib.util.DisabledInstantCommand;
import frc.lib.util.Scoring;
import frc.lib.util.Scoring.GamePiece;
import frc.robot.autos.CrossAndDock;
import frc.robot.autos.DoubleScore;
import frc.robot.autos.DoubleScore6;
import frc.robot.autos.MiddleScoreEngage;
import frc.robot.autos.Score1;
import frc.robot.autos.Score1Dock;
import frc.robot.autos.TripleScore;
import frc.robot.autos.TripleScore6;
import frc.robot.commands.arm.ConeIntake;
import frc.robot.commands.arm.ConeUpIntake;
import frc.robot.commands.arm.CubeIntake;
import frc.robot.commands.arm.DockArm;
import frc.robot.commands.arm.ScoreArm;
import frc.robot.commands.arm.VariableArm;
import frc.robot.commands.drive.MoveToEngage;
import frc.robot.commands.drive.MoveToScore;
import frc.robot.commands.drive.TeleopSwerve;
import frc.robot.commands.leds.FlashingLEDColor;
import frc.robot.commands.leds.MovingColorLEDs;
Expand Down Expand Up @@ -141,22 +134,25 @@ public RobotContainer() {
s_wristIntake.setDefaultCommand(new VariableIntake(s_wristIntake, operator));
leds.setDefaultCommand(new MovingColorLEDs(leds, Color.kRed, 8, false));
autoChooser.setDefaultOption("Do Nothing", new WaitCommand(1));
autoChooser.addOption("Move to Score", new MoveToScore(s_Swerve, s_Arm, s_wristIntake));
// autoChooser.addOption("Move to Score", new MoveToScore(s_Swerve, s_Arm, s_wristIntake));
autoChooser.addOption("Middle Score and Engage",
new MiddleScoreEngage(s_Swerve, s_Arm, s_wristIntake));
autoChooser.addOption("Cross and Dock", new CrossAndDock(s_Swerve, s_Arm, s_wristIntake));
// autoChooser.addOption("Cross and Dock", new CrossAndDock(s_Swerve, s_Arm,
// s_wristIntake));
autoChooser.addOption("Score 1 Dock", new Score1Dock(s_Swerve, s_Arm, s_wristIntake));
autoChooser.addOption("Score 1", new Score1(s_Swerve, s_Arm, s_wristIntake));
// autoChooser.addOption("Score 1", new Score1(s_Swerve, s_Arm, s_wristIntake));
// autoChooser.addOption("Second Game Piece",
// new SecondGamePiece(s_Swerve, s_Arm, s_wristIntake));
// autoChooser.addOption("SecondGamePieceScore",
// new SecondGamePieceScore(s_Swerve, s_Arm, s_wristIntake));
autoChooser.addOption("Double Score - 8 (Bump) ;)",
new DoubleScore(s_Swerve, s_Arm, s_wristIntake));
autoChooser.addOption("Triple Score - 8 (Bump) ;)",
new TripleScore(s_Swerve, s_Arm, s_wristIntake));
autoChooser.addOption("Double Score - 6", new DoubleScore6(s_Swerve, s_Arm, s_wristIntake));
autoChooser.addOption("Triple Score - 6", new TripleScore6(s_Swerve, s_Arm, s_wristIntake));
// autoChooser.addOption("Double Score - 8 (Bump) ;)",
// new DoubleScore(s_Swerve, s_Arm, s_wristIntake));
// autoChooser.addOption("Triple Score - 8 (Bump) ;)",
// new TripleScore(s_Swerve, s_Arm, s_wristIntake));
// autoChooser.addOption("Double Score - 6", new DoubleScore6(s_Swerve, s_Arm,
// s_wristIntake));
// autoChooser.addOption("Triple Score - 6", new TripleScore6(s_Swerve, s_Arm,
// s_wristIntake));

levelsChooser.setDefaultOption("0", 0);
for (int i = 0; i < 3; i++) {
Expand Down Expand Up @@ -187,10 +183,11 @@ private void configureButtonBindings() {
driver.start().onTrue(new InstantCommand(() -> s_Swerve.resetInitialized()));

driver.y().onTrue(new DisabledInstantCommand(() -> s_Swerve.resetFieldRelativeOffset()));
driver.rightTrigger().and(driver.leftTrigger()).and(operator.start())
.whileTrue(new MoveToScore(s_Swerve, s_Arm, s_wristIntake));
driver.rightTrigger().and(driver.leftTrigger())
.onTrue(new InstantCommand(() -> s_Swerve.resetInitialized()));
// driver.rightTrigger().onTrue()
// driver.rightTrigger().and(driver.leftTrigger()).and(operator.start())
// .whileTrue(new MoveToScore(s_Swerve, s_Arm, s_wristIntake));
// driver.rightTrigger().and(driver.leftTrigger())
// .onTrue(new InstantCommand(() -> s_Swerve.resetInitialized()));
driver.rightBumper().and(driver.leftBumper())
.whileTrue(new MoveToEngage(s_Swerve, s_Arm, s_wristIntake));
driver.start()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/autos/Score1Dock.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Score1Dock(Swerve swerve, Arm arm, WristIntake wristIntake) {

CrossAndDock crossAndDock = new CrossAndDock(swerve, arm, wristIntake);

addCommands(moveToScore, wristIntakeRelease,
addCommands(moveToScore.withTimeout(5), wristIntakeRelease,
cond.alongWith(new WaitCommand(.2).andThen(dockArm)), waitToDock, crossAndDock);
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/frc/robot/commands/drive/TeleopSwerve.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public void execute() {
raxis = MathUtil.applyDeadband(raxis, Constants.STICK_DEADBAND);

double angle_speed = Constants.Swerve.MAX_ANGULAR_VELOCITY;
double speed = Constants.Swerve.MAX_SPEED;
double speed_mul = controller.rightTrigger().getAsBoolean() ? 0.33 : 1.0;
double speed = Constants.Swerve.MAX_SPEED * speed_mul;
if (arm.getArmAngle() > -70) {
angle_speed /= 3;
speed *= 0.80;
Expand Down

0 comments on commit 3607688

Please sign in to comment.