mirror of
https://github.com/Team4388/2026KPopRobotHunters.git
synced 2026-06-08 16:28:05 -06:00
New controls
This commit is contained in:
@@ -109,7 +109,7 @@ public class RobotContainer {
|
||||
|
||||
|
||||
private Command IntakeExtended = new SequentialCommandGroup(
|
||||
new InstantCommand(() -> m_robotIntake.setMode(IntakeMode.Extended), m_robotIntake)
|
||||
new InstantCommand(() -> m_robotIntake.setMode(IntakeMode.ExtendedREMOVEME), m_robotIntake)
|
||||
);
|
||||
|
||||
// private Command LidarIntake = new SequentialCommandGroup(
|
||||
@@ -146,7 +146,7 @@ public class RobotContainer {
|
||||
);
|
||||
|
||||
private Command IntakeRetracted = new SequentialCommandGroup(
|
||||
new InstantCommand(() -> m_robotIntake.setMode(IntakeMode.Retracted), m_robotIntake)
|
||||
new InstantCommand(() -> m_robotIntake.setMode(IntakeMode.RetractedREMOVEME), m_robotIntake)
|
||||
);
|
||||
|
||||
private Command RobotShoot = new SequentialCommandGroup(
|
||||
@@ -357,31 +357,49 @@ public class RobotContainer {
|
||||
m_robotShooter.spinUpIdle();
|
||||
}));
|
||||
|
||||
new JoystickButton(getDeadbandedOperatorController(), XboxController.RIGHT_BUMPER_BUTTON)
|
||||
.onTrue(new InstantCommand(() -> {
|
||||
m_robotIntake.setMode(IntakeMode.Retracted);
|
||||
}));
|
||||
// new JoystickButton(getDeadbandedOperatorController(), XboxController.RIGHT_BUMPER_BUTTON)
|
||||
// .onTrue(new InstantCommand(() -> {
|
||||
// m_robotIntake.setMode(IntakeMode.RetractedREMOVEME);
|
||||
// }));
|
||||
|
||||
new JoystickButton(getDeadbandedOperatorController(), XboxController.A_BUTTON)
|
||||
.onTrue(new InstantCommand(() -> {
|
||||
m_robotIntake.setMode(IntakeMode.Extended);
|
||||
}));
|
||||
// new JoystickButton(getDeadbandedOperatorController(), XboxController.A_BUTTON)
|
||||
// .onTrue(new InstantCommand(() -> {
|
||||
// m_robotIntake.setMode(IntakeMode.ExtendedREMOVEME);
|
||||
// }));
|
||||
|
||||
new JoystickButton(getDeadbandedOperatorController(), XboxController.X_BUTTON)
|
||||
.onTrue(new InstantCommand(() -> {
|
||||
m_robotIntake.setMode(IntakeMode.Extending);
|
||||
m_robotIntake.setMode(IntakeMode.ExtendingRolling);
|
||||
}))
|
||||
.onFalse(new InstantCommand(() -> {
|
||||
m_robotIntake.setMode(IntakeMode.ExtendingIdle);
|
||||
}));
|
||||
|
||||
new JoystickButton(getDeadbandedOperatorController(), XboxController.Y_BUTTON)
|
||||
.onTrue(new InstantCommand(() -> {
|
||||
m_robotIntake.setMode(IntakeMode.Retracting);
|
||||
}));
|
||||
|
||||
|
||||
|
||||
new Trigger(() -> getDeadbandedDriverController().getPOV() == 90)
|
||||
.onTrue(new InstantCommand(() -> {
|
||||
m_robotIntake.setMode(IntakeMode.ExtendingIdle);
|
||||
}))
|
||||
.onFalse(new InstantCommand(() -> {
|
||||
m_robotIntake.setMode(IntakeMode.Idle);
|
||||
}));
|
||||
|
||||
new JoystickButton(getDeadbandedOperatorController(), XboxController.Y_BUTTON)
|
||||
new Trigger(() -> getDeadbandedDriverController().getPOV() == 270)
|
||||
.onTrue(new InstantCommand(() -> {
|
||||
m_robotIntake.setMode(IntakeMode.Retracting);
|
||||
}))
|
||||
.onFalse(new InstantCommand(() -> {
|
||||
m_robotIntake.setMode(IntakeMode.Idle);
|
||||
}));
|
||||
// .onFalse(new InstantCommand(() -> {
|
||||
// m_robotIntake.setMode(IntakeMode.Idle);
|
||||
// }));
|
||||
|
||||
// new JoystickButton(getDeadbandedOperatorController(), XboxController.B_BUTTON)
|
||||
// .onTrue(new InstantCommand(() -> {
|
||||
@@ -493,21 +511,21 @@ public class RobotContainer {
|
||||
m_robotShooter.spinUpIdle();
|
||||
}));
|
||||
|
||||
new JoystickButton(getDeadbandedDriverController(), XboxController.X_BUTTON)
|
||||
.onTrue(new InstantCommand(() -> {
|
||||
m_robotIntake.setMode(IntakeMode.Extending);
|
||||
}))
|
||||
.onFalse(new InstantCommand(() -> {
|
||||
m_robotIntake.setMode(IntakeMode.Idle);
|
||||
}));
|
||||
// new JoystickButton(getDeadbandedDriverController(), XboxController.X_BUTTON)
|
||||
// .onTrue(new InstantCommand(() -> {
|
||||
// m_robotIntake.setMode(IntakeMode.ExtendedIdle);
|
||||
// }))
|
||||
// .onFalse(new InstantCommand(() -> {
|
||||
// m_robotIntake.setMode(IntakeMode.Idle);
|
||||
// }));
|
||||
|
||||
new JoystickButton(getDeadbandedDriverController(), XboxController.Y_BUTTON)
|
||||
.onTrue(new InstantCommand(() -> {
|
||||
m_robotIntake.setMode(IntakeMode.Retracting);
|
||||
}))
|
||||
.onFalse(new InstantCommand(() -> {
|
||||
m_robotIntake.setMode(IntakeMode.Idle);
|
||||
}));
|
||||
// new JoystickButton(getDeadbandedDriverController(), XboxController.Y_BUTTON)
|
||||
// .onTrue(new InstantCommand(() -> {
|
||||
// m_robotIntake.setMode(IntakeMode.Retracting);
|
||||
// }))
|
||||
// .onFalse(new InstantCommand(() -> {
|
||||
// m_robotIntake.setMode(IntakeMode.Idle);
|
||||
// }));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,15 +5,15 @@ package frc4388.robot.constants;
|
||||
*/
|
||||
public final class BuildConstants {
|
||||
public static final String MAVEN_GROUP = "";
|
||||
public static final String MAVEN_NAME = "2026KPopRobotHunters";
|
||||
public static final String MAVEN_NAME = "2026KPopRobotHunters-new";
|
||||
public static final String VERSION = "unspecified";
|
||||
public static final int GIT_REVISION = 188;
|
||||
public static final String GIT_SHA = "d010829c21aa6f5bd1787cfcab1c02107fb353ff";
|
||||
public static final String GIT_DATE = "2026-03-28 13:30:33 MDT";
|
||||
public static final int GIT_REVISION = 189;
|
||||
public static final String GIT_SHA = "65c76aca95de81f342df7ff26a77e18856f22a83";
|
||||
public static final String GIT_DATE = "2026-03-28 15:56:54 MDT";
|
||||
public static final String GIT_BRANCH = "New-Intake";
|
||||
public static final String BUILD_DATE = "2026-03-28 15:50:49 MDT";
|
||||
public static final long BUILD_UNIX_TIME = 1774734649429L;
|
||||
public static final int DIRTY = 1;
|
||||
public static final String BUILD_DATE = "2026-03-30 15:59:11 MDT";
|
||||
public static final long BUILD_UNIX_TIME = 1774907951058L;
|
||||
public static final int DIRTY = 0;
|
||||
|
||||
private BuildConstants(){}
|
||||
}
|
||||
|
||||
@@ -28,10 +28,14 @@ public class Intake extends SubsystemBase {
|
||||
}
|
||||
|
||||
public enum IntakeMode {
|
||||
Extended,
|
||||
Retracted,
|
||||
Extending,
|
||||
ExtendedREMOVEME,
|
||||
RetractedREMOVEME,
|
||||
|
||||
ExtendingIdle,
|
||||
ExtendingRolling,
|
||||
|
||||
Retracting,
|
||||
|
||||
Idle,
|
||||
Bouncing
|
||||
}
|
||||
@@ -95,22 +99,35 @@ public class Intake extends SubsystemBase {
|
||||
// getCurrentTime
|
||||
|
||||
switch (mode) {
|
||||
case Extended:
|
||||
case ExtendedREMOVEME:
|
||||
// io.setArmAngle(state, Rotations.of(IntakeConstants.ARM_LIMIT_EXTENDED.get()));
|
||||
// io.setRollerOutput(state, IntakeConstants.ROLLER_PERCENT_OUTPUT.get());
|
||||
break;
|
||||
case Retracted:
|
||||
case RetractedREMOVEME:
|
||||
// io.setArmAngle(state, Rotations.of(IntakeConstants.ARM_LIMIT_RETRACTED.get()));
|
||||
// io.setRollerOutput(state, 0);
|
||||
break;
|
||||
case Extending:
|
||||
|
||||
case ExtendingIdle:
|
||||
io.armOutput(IntakeConstants.ARM_EXTEND_PERCENT_OUTPUT.get());
|
||||
io.setRollerOutput(state, IntakeConstants.ROLLER_PERCENT_OUTPUT.get());
|
||||
io.setRollerOutput(state, 0);
|
||||
break;
|
||||
|
||||
case ExtendingRolling:
|
||||
io.armOutput(IntakeConstants.ARM_EXTEND_PERCENT_OUTPUT.get());
|
||||
io.setRollerOutput(state, IntakeConstants.ARM_EXTEND_PERCENT_OUTPUT.get());
|
||||
break;
|
||||
|
||||
case Retracting:
|
||||
io.armOutput(IntakeConstants.ARM_RETRACT_PERCENT_OUTPUT.get());
|
||||
io.setRollerOutput(state, IntakeConstants.ROLLER_RETRACT_PERCENT_OUTPUT.get());
|
||||
|
||||
if(state.intakeEncoder.in(Rotations) > IntakeConstants.ARM_REVERSE_ROLLER_RANGE.get()) {
|
||||
io.setRollerOutput(state, IntakeConstants.ROLLER_RETRACT_PERCENT_OUTPUT.get());
|
||||
} else {
|
||||
io.setRollerOutput(state, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case Bouncing:
|
||||
io.setRollerOutput(state, 0);
|
||||
|
||||
@@ -129,11 +146,16 @@ public class Intake extends SubsystemBase {
|
||||
percentOutput = Math.max(Math.min(percentOutput, IntakeConstants.INTAKE_BOUNCE_MAX_OUTPUT.get()), -IntakeConstants.INTAKE_BOUNCE_MAX_OUTPUT.get());
|
||||
|
||||
io.armOutput(percentOutput);
|
||||
|
||||
if(state.intakeEncoder.in(Rotations) > IntakeConstants.ARM_REVERSE_ROLLER_RANGE.get()) {
|
||||
io.setRollerOutput(state, IntakeConstants.ROLLER_RETRACT_PERCENT_OUTPUT.get());
|
||||
} else {
|
||||
io.setRollerOutput(state, 0);
|
||||
}
|
||||
break;
|
||||
case Idle:
|
||||
io.armOutput(0);
|
||||
// io.setArmAngle(state, Rotations.of(IntakeConstants.ARM_LIMIT_RETRACTED.get()));
|
||||
// io.setRollerOutput(state, 0);
|
||||
io.setRollerOutput(state, 0);
|
||||
break;
|
||||
}
|
||||
// if (state.retractedLimit){
|
||||
|
||||
@@ -45,6 +45,8 @@ public class IntakeConstants {
|
||||
public static final ConfigurableDouble ARM_LIMIT_EXTENDED = new ConfigurableDouble("Arm angle extended", 1.8);
|
||||
public static final ConfigurableDouble ARM_EXTEND_PERCENT_OUTPUT = new ConfigurableDouble("Arm extend % output", 0.1);
|
||||
public static final ConfigurableDouble ARM_RETRACT_PERCENT_OUTPUT = new ConfigurableDouble("Arm retract % output", -0.1);
|
||||
|
||||
public static final ConfigurableDouble ARM_REVERSE_ROLLER_RANGE = new ConfigurableDouble("Arm reverse roller range", 2.0);
|
||||
|
||||
public static final ConfigurableDouble ROLLER_PERCENT_OUTPUT = new ConfigurableDouble("Roller Percent Output", .80);
|
||||
public static final ConfigurableDouble ROLLER_RETRACT_PERCENT_OUTPUT = new ConfigurableDouble("Roller Retract Output", .40);
|
||||
|
||||
Reference in New Issue
Block a user