This commit is contained in:
Shatcar
2026-03-30 18:57:14 -06:00
parent 3fe5d0e5a1
commit 9021f480be
10 changed files with 159 additions and 28 deletions
@@ -378,11 +378,14 @@ public class RobotContainer {
new JoystickButton(getDeadbandedOperatorController(), XboxController.Y_BUTTON)
.onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Retracting);
}))
.onFalse(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Idle);
}));
new Trigger(() -> getDeadbandedDriverController().getPOV() == 90)
new Trigger(() -> getDeadbandedOperatorController().getPOV() == 90)
.onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.ExtendingIdle);
}))
@@ -390,13 +393,24 @@ public class RobotContainer {
m_robotIntake.setMode(IntakeMode.Idle);
}));
new Trigger(() -> getDeadbandedDriverController().getPOV() == 270)
new Trigger(() -> getDeadbandedOperatorController().getPOV() == 270)
.onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Retracting);
}))
.onFalse(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Idle);
}));
new Trigger(() -> getDeadbandedOperatorController().getPOV() == 0)
.onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Bouncing);
}))
.onFalse(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Idle);
}));
// .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-new";
public static final String MAVEN_NAME = "2026KPopRobotHunters";
public static final String VERSION = "unspecified";
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 int GIT_REVISION = 190;
public static final String GIT_SHA = "3fe5d0e5a1cfe24710b755b489fa61255e307095";
public static final String GIT_DATE = "2026-03-30 16:15:43 MDT";
public static final String GIT_BRANCH = "New-Intake";
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;
public static final String BUILD_DATE = "2026-03-30 18:15:12 MDT";
public static final long BUILD_UNIX_TIME = 1774916112363L;
public static final int DIRTY = 1;
private BuildConstants(){}
}
@@ -115,7 +115,7 @@ public class Intake extends SubsystemBase {
case ExtendingRolling:
io.armOutput(IntakeConstants.ARM_EXTEND_PERCENT_OUTPUT.get());
io.setRollerOutput(state, IntakeConstants.ARM_EXTEND_PERCENT_OUTPUT.get());
io.setRollerOutput(state, IntakeConstants.ROLLER_PERCENT_OUTPUT.get());
break;
case Retracting:
@@ -4,6 +4,7 @@ import com.revrobotics.spark.FeedbackSensor;
import com.revrobotics.spark.config.SparkMaxConfig;
import com.revrobotics.spark.config.LimitSwitchConfig.Behavior;
import com.revrobotics.spark.config.LimitSwitchConfig.Type;
import com.revrobotics.spark.config.SparkBaseConfig.IdleMode;
import frc4388.utility.configurable.ConfigurableDouble;
import frc4388.utility.status.CanDevice;
@@ -13,7 +14,7 @@ public class IntakeConstants {
public static final double ARM_MOTOR_GEAR_RATIO = 125;
public static final double ROLLER_MOTOR_GEAR_RATIO = 3;
public static final double ARM_ENCODER_OFFSET = -0.466;
public static final ConfigurableDouble ARM_ENCODER_OFFSET = new ConfigurableDouble("Arm Encoder Offset", 0);
@@ -42,11 +43,11 @@ public class IntakeConstants {
// public static final Angle ARM_LIMIT_UPPER = Degrees.of(-90);
public static final ConfigurableDouble ARM_LIMIT_RETRACTED = new ConfigurableDouble("Arm angle retracted", 0.);
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_LIMIT_EXTENDED = new ConfigurableDouble("Arm angle extended", 1.5);
public static final ConfigurableDouble ARM_EXTEND_PERCENT_OUTPUT = new ConfigurableDouble("Arm extend % output", 0.5);
public static final ConfigurableDouble ARM_RETRACT_PERCENT_OUTPUT = new ConfigurableDouble("Arm retract % output", -0.5);
public static final ConfigurableDouble ARM_REVERSE_ROLLER_RANGE = new ConfigurableDouble("Arm reverse roller range", 2.0);
public static final ConfigurableDouble ARM_REVERSE_ROLLER_RANGE = new ConfigurableDouble("Arm reverse roller range", 1.17);
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);
@@ -90,6 +91,11 @@ public class IntakeConstants {
.reverseLimitSwitchType(Type.kNormallyClosed)
.reverseLimitSwitchPosition(0)
.reverseLimitSwitchTriggerBehavior(Behavior.kStopMovingMotorAndSetPosition);
ARM_MOTOR_CONFIG.idleMode(IdleMode.kBrake);
ROLELR_MOTOR_CONFIG.idleMode(IdleMode.kCoast);
}
// public static final TalonFXConfiguration ARM_MOTOR_CONFIG = new TalonFXConfiguration()
@@ -20,6 +20,8 @@ public interface IntakeIO {
boolean retractedLimitSwitch = false;
boolean extendedSoftLimit = false;
boolean retractedSoftLimit = false;
boolean encoderConnected = false;
Angle intakeEncoder = Rotations.of(0);
Angle armAngle = Rotations.of(0);
@@ -119,6 +119,8 @@ public class IntakeReal implements IntakeIO {
state.extendedSoftLimit = extendedLimit();
state.intakeEncoder = m_encoder.getRotations();
state.encoderConnected = m_encoder.isConnected();
state.retractedLimitSwitch = m_armMotor.getReverseLimitSwitch().isPressed();
if(state.retractedLimitSwitch) {
@@ -128,6 +130,7 @@ public class IntakeReal implements IntakeIO {
@Override
public void updateGains() {
m_encoder.loadRotations();
// IntakeConstants.ARM_PID.kP = IntakeConstants.arm_kP.get();
// IntakeConstants.ARM_PID.kI = IntakeConstants.arm_kI.get();