squidward

This commit is contained in:
Shikhar
2026-02-16 16:19:51 -07:00
parent 8551843831
commit 84596775b7
4 changed files with 23 additions and 21 deletions
+10 -11
View File
@@ -250,18 +250,12 @@ public class RobotContainer {
//Operator Controls //Operator Controls
new Trigger(() -> getDeadbandedOperatorController().getLeftTriggerAxis() >= 0.5) new Trigger(() -> getDeadbandedOperatorController().getLeftTriggerAxis() >= 0.5)
.onTrue(new InstantCommand(() -> { .onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Extending); m_robotIntake.setMode(IntakeMode.Extended);
}))
.onFalse(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Idle);
})); }));
new JoystickButton(getDeadbandedOperatorController(), XboxController.LEFT_BUMPER_BUTTON) new JoystickButton(getDeadbandedOperatorController(), XboxController.LEFT_BUMPER_BUTTON)
.onTrue(new InstantCommand(() -> { .onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Retracting); m_robotIntake.setMode(IntakeMode.Retracted);
}))
.onFalse(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Idle);
})); }));
new Trigger(() -> getDeadbandedOperatorController().getRightTriggerAxis() >= 0.5) new Trigger(() -> getDeadbandedOperatorController().getRightTriggerAxis() >= 0.5)
@@ -275,14 +269,19 @@ public class RobotContainer {
})); }));
new JoystickButton(getDeadbandedOperatorController(), XboxController.Y_BUTTON) new JoystickButton(getDeadbandedOperatorController(), XboxController.Y_BUTTON)
.onFalse(new InstantCommand(() -> { .onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Retracting); m_robotIntake.setMode(IntakeMode.Retracting);
}))
.onFalse(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Idle);
})); }));
new JoystickButton(getDeadbandedOperatorController(), XboxController.X_BUTTON) new JoystickButton(getDeadbandedOperatorController(), XboxController.X_BUTTON)
.onFalse(new InstantCommand(() -> { .onTrue(new InstantCommand(() -> {
m_robotShooter.setShooterNotReady();
m_robotIntake.setMode(IntakeMode.Extending); m_robotIntake.setMode(IntakeMode.Extending);
}))
.onFalse(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Idle);
})); }));
@@ -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 = 60; public static final int GIT_REVISION = 61;
public static final String GIT_SHA = "f88619a1da6b3adf64df3c4277deeca5bed6ee21"; public static final String GIT_SHA = "8551843831dbdc8790c0f9c02fb406248b69ec7a";
public static final String GIT_DATE = "2026-02-14 15:57:33 MST"; public static final String GIT_DATE = "2026-02-16 15:57:24 MST";
public static final String GIT_BRANCH = "operator-controls"; public static final String GIT_BRANCH = "operator-controls";
public static final String BUILD_DATE = "2026-02-16 15:54:00 MST"; public static final String BUILD_DATE = "2026-02-16 15:58:06 MST";
public static final long BUILD_UNIX_TIME = 1771282440915L; public static final long BUILD_UNIX_TIME = 1771282686680L;
public static final int DIRTY = 1; public static final int DIRTY = 1;
private BuildConstants(){} private BuildConstants(){}
@@ -76,17 +76,20 @@ public class Intake extends SubsystemBase {
io.setRollerVelocity(state, RotationsPerSecond.of(0)); io.setRollerVelocity(state, RotationsPerSecond.of(0));
break; break;
case Extending: case Extending:
io.armOutput(0.1); io.armOutput(IntakeConstants.ARM_EXTEND_PERCENT_OUTPUT.get());
io.setRollerVelocity(state, RotationsPerSecond.of(IntakeConstants.ROLLER_ACTIVE.get())); io.setRollerVelocity(state, RotationsPerSecond.of(IntakeConstants.ROLLER_ACTIVE.get()));
break; break;
case Retracting: case Retracting:
io.armOutput(-0.1); io.armOutput(IntakeConstants.ARM_RETRACT_PERCENT_OUTPUT.get());
io.setRollerVelocity(state, RotationsPerSecond.of(0)); io.setRollerVelocity(state, RotationsPerSecond.of(0));
break; break;
case Idle: case Idle:
io.stopArm(); io.stopArm();
break; break;
} }
if (state.retractedLimit){
this.mode = IntakeMode.Retracted;
}
} }
} }
@@ -95,7 +95,7 @@ public class IntakeReal implements IntakeIO {
public void stopArm(){ public void stopArm(){
m_armMotor.set(0); m_armMotor.set(0);
} }
@Override @Override
public void armOutput(double percentOutput){ public void armOutput(double percentOutput){
var d = new DutyCycleOut(0); var d = new DutyCycleOut(0);
@@ -109,7 +109,7 @@ public class IntakeReal implements IntakeIO {
public void updateInputs(IntakeState state) { public void updateInputs(IntakeState state) {
state.armAngle = m_armMotor.getPosition().getValue().div(IntakeConstants.ARM_MOTOR_GEAR_RATIO); state.armAngle = m_armMotor.getPosition().getValue().div(IntakeConstants.ARM_MOTOR_GEAR_RATIO);
state.armMotorCurrent = m_armMotor.getStatorCurrent().getValue(); state.armMotorCurrent = m_armMotor.getStatorCurrent().getValue();
state.retractedLimit = m_armLimitSwitch.get(); state.retractedLimit = !m_armLimitSwitch.get();
state.rollerVelocity = m_rollerMotor.getVelocity().getValue().div(IntakeConstants.ROLLER_MOTOR_GEAR_RATIO); state.rollerVelocity = m_rollerMotor.getVelocity().getValue().div(IntakeConstants.ROLLER_MOTOR_GEAR_RATIO);
state.rollerMotorCurrent = m_rollerMotor.getStatorCurrent().getValue(); state.rollerMotorCurrent = m_rollerMotor.getStatorCurrent().getValue();
} }