operator intake and shooting

added operator controls
This commit is contained in:
Michael Mikovsky
2026-02-14 12:33:03 -07:00
parent 8381ac4607
commit 2f6a5d56fd
2 changed files with 46 additions and 23 deletions
+40 -17
View File
@@ -152,7 +152,7 @@ public class RobotContainer {
*/ */
private void configureButtonBindings() { private void configureButtonBindings() {
//Driver controls
new JoystickButton(getDeadbandedDriverController(), XboxController.A_BUTTON) new JoystickButton(getDeadbandedDriverController(), XboxController.A_BUTTON)
.onTrue(new InstantCommand(() -> m_robotSwerveDrive.resetGyro())); .onTrue(new InstantCommand(() -> m_robotSwerveDrive.resetGyro()));
@@ -210,31 +210,30 @@ public class RobotContainer {
false false
); );
}, m_robotSwerveDrive)) }, m_robotSwerveDrive))
.onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Extended);
}))
.onFalse(new InstantCommand(() -> { .onFalse(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Retracted);
m_robotSwerveDrive.softStop(); m_robotSwerveDrive.softStop();
})); }));
// .onTrue(new InstantCommand(() -> {
// m_robotIntake.setMode(IntakeMode.Extended);
// }))
// IF the driver is holding the aim button, aim the robot towards the hub and shooter ready // IF the driver is holding the aim button, aim the robot towards the hub and shooter ready
new Trigger(() -> getDeadbandedDriverController().getRightTriggerAxis() >= 0.5) new Trigger(() -> getDeadbandedDriverController().getRightTriggerAxis() >= 0.5)
.whileTrue(new RunCommand( .whileTrue(new RunCommand(
() -> { () -> {
// m_robotSwerveDrive.driveFacingPosition( m_robotSwerveDrive.driveFacingPosition(
// getDeadbandedDriverController().getLeft(), getDeadbandedDriverController().getLeft(),
// FieldPositions.HUB_POSITION); FieldPositions.HUB_POSITION);
}, m_robotSwerveDrive) }, m_robotSwerveDrive)
) );
.onTrue(new InstantCommand(() -> { // .onTrue(new InstantCommand(() -> {
// When Right trigger is pressed, // // When Right trigger is pressed,
m_robotShooter.setShooterReady(); // m_robotShooter.setShooterReady();
})) // }))
.onFalse(new InstantCommand(() -> { // .onFalse(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Retracted); // m_robotIntake.setMode(IntakeMode.Retracted);
m_robotShooter.setShooterNotReady(); // m_robotShooter.setShooterNotReady();
})); // }));
// D-PAD fine alignment // D-PAD fine alignment
@@ -248,6 +247,30 @@ public class RobotContainer {
getDeadbandedDriverController().getRight(), 0.15 getDeadbandedDriverController().getRight(), 0.15
), m_robotSwerveDrive)) ), m_robotSwerveDrive))
.onFalse(new InstantCommand(() -> m_robotSwerveDrive.softStop(), m_robotSwerveDrive)); .onFalse(new InstantCommand(() -> m_robotSwerveDrive.softStop(), m_robotSwerveDrive));
//Operator Controls
new Trigger(() -> getDeadbandedOperatorController().getLeftTriggerAxis() >= 0.5)
.onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Extended);
}));
new JoystickButton(getDeadbandedOperatorController(), XboxController.LEFT_BUMPER_BUTTON)
.onFalse(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Retracted);
}));
new Trigger(() -> getDeadbandedOperatorController().getRightTriggerAxis() >= 0.5)
.onTrue(new InstantCommand(() -> {
m_robotShooter.setShooterReady();
}));
new JoystickButton(getDeadbandedOperatorController(), XboxController.RIGHT_BUMPER_BUTTON)
.onFalse(new InstantCommand(() -> {
m_robotShooter.setShooterNotReady();
}));
} }
//.onTrue(new InstantCommand(() -> m_robotLED.setMode(LEDPatterns.SOLID_PINK_HOT))); //.onTrue(new InstantCommand(() -> m_robotLED.setMode(LEDPatterns.SOLID_PINK_HOT)));
@@ -7,12 +7,12 @@ public final class BuildConstants {
public static final String MAVEN_GROUP = ""; public static final String MAVEN_GROUP = "";
public static final String MAVEN_NAME = "2026KPopRobotHunters"; public static final String MAVEN_NAME = "2026KPopRobotHunters";
public static final String VERSION = "unspecified"; public static final String VERSION = "unspecified";
public static final int GIT_REVISION = 49; public static final int GIT_REVISION = 50;
public static final String GIT_SHA = "0425cdd0a1e794109348c7369dc21b377fca569b"; public static final String GIT_SHA = "8381ac460776aaad24a82786c9fe12e040a99d00";
public static final String GIT_DATE = "2026-02-12 14:36:26 MST"; public static final String GIT_DATE = "2026-02-14 11:55:51 MST";
public static final String GIT_BRANCH = "shoot-button"; public static final String GIT_BRANCH = "operator-controls";
public static final String BUILD_DATE = "2026-02-14 11:48:31 MST"; public static final String BUILD_DATE = "2026-02-14 12:11:59 MST";
public static final long BUILD_UNIX_TIME = 1771094911048L; public static final long BUILD_UNIX_TIME = 1771096319898L;
public static final int DIRTY = 1; public static final int DIRTY = 1;
private BuildConstants(){} private BuildConstants(){}