mirror of
https://github.com/Team4388/2026KPopRobotHunters.git
synced 2026-06-09 00:38:03 -06:00
torque retract upper and lower curent lim thresh
This commit is contained in:
@@ -404,7 +404,7 @@ public class RobotContainer {
|
||||
|
||||
new Trigger(() -> getDeadbandedOperatorController().getPOV() == 0)
|
||||
.onTrue(new InstantCommand(() -> {
|
||||
m_robotIntake.setMode(IntakeMode.Bouncing);
|
||||
m_robotIntake.setMode(IntakeMode.RectractTorque);
|
||||
}))
|
||||
.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_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 = 197;
|
||||
public static final String GIT_SHA = "2407a900c901efca8c60d0a6143e39db7cf90201";
|
||||
public static final String GIT_DATE = "2026-03-31 19:47:27 MDT";
|
||||
public static final String GIT_BRANCH = "New-Intake";
|
||||
public static final String BUILD_DATE = "2026-03-30 19:50:05 MDT";
|
||||
public static final long BUILD_UNIX_TIME = 1774921805228L;
|
||||
public static final String BUILD_DATE = "2026-03-31 20:33:43 MDT";
|
||||
public static final long BUILD_UNIX_TIME = 1775010823079L;
|
||||
public static final int DIRTY = 1;
|
||||
|
||||
private BuildConstants(){}
|
||||
|
||||
@@ -40,6 +40,7 @@ public class Intake extends SubsystemBase {
|
||||
RectractTorque,
|
||||
Bouncing
|
||||
}
|
||||
private boolean overCompressed = false;
|
||||
|
||||
private IntakeMode mode = IntakeMode.Idle;
|
||||
|
||||
@@ -87,7 +88,6 @@ public class Intake extends SubsystemBase {
|
||||
// }
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void periodic() {
|
||||
// FaultReporter.register(this); // TODO Implement fault reporter
|
||||
@@ -100,6 +100,14 @@ public class Intake extends SubsystemBase {
|
||||
|
||||
io.updateInputs(state);
|
||||
|
||||
if (state.armMotorCurrent.in(Amps) < IntakeConstants.INTAKE_SQUEEZE_CURRENT_LOWER_THRESHOLD.get()){
|
||||
overCompressed = false;
|
||||
} else if (state.armMotorCurrent.in(Amps) > IntakeConstants.INTAKE_SQUEEZE_CURRENT_UPPER_THRESHOLD.get()) {
|
||||
overCompressed = true;
|
||||
}
|
||||
|
||||
Logger.recordOutput("overCompressed", overCompressed);
|
||||
|
||||
// getCurrentTime
|
||||
|
||||
switch (mode) {
|
||||
@@ -160,9 +168,9 @@ public class Intake extends SubsystemBase {
|
||||
break;
|
||||
case RectractTorque:
|
||||
io.setRollerOutput(state, IntakeConstants.ROLLER_RETRACT_PERCENT_OUTPUT.get());
|
||||
if (state.armMotorCurrent.in(Amps) < IntakeConstants.INTAKE_SQUEEZE_CURRENT_LIMIT.get()){
|
||||
if (!overCompressed){
|
||||
io.armOutput(IntakeConstants.ARM_SQUEEZE_PERCENT_OUTPUT.get());
|
||||
} else {
|
||||
} else if (overCompressed) {
|
||||
io.armOutput(IntakeConstants.ARM_REDUCED_SQUEEZE_PERCENT_OUTPUT.get());
|
||||
}
|
||||
if(state.intakeEncoder.in(Rotations) > IntakeConstants.ARM_REVERSE_ROLLER_RANGE.get()) {
|
||||
|
||||
@@ -26,9 +26,10 @@ public class IntakeConstants {
|
||||
|
||||
|
||||
//squeeze constants
|
||||
public static final ConfigurableDouble INTAKE_SQUEEZE_CURRENT_LIMIT = new ConfigurableDouble("Intake Squeeze Current Limit", 20);
|
||||
public static final ConfigurableDouble INTAKE_SQUEEZE_CURRENT_LOWER_THRESHOLD = new ConfigurableDouble("Intake Squeeze Current LOWER THRESHOLD", 20);
|
||||
public static final ConfigurableDouble INTAKE_SQUEEZE_CURRENT_UPPER_THRESHOLD = new ConfigurableDouble("Intake Squeeze Current UPPER THRESHOLD", 25);
|
||||
public static final ConfigurableDouble ARM_SQUEEZE_PERCENT_OUTPUT = new ConfigurableDouble("Arm squeeze % output", -0.1);
|
||||
public static final ConfigurableDouble ARM_REDUCED_SQUEEZE_PERCENT_OUTPUT = new ConfigurableDouble("Arm squeeze % output", -0.02);
|
||||
public static final ConfigurableDouble ARM_REDUCED_SQUEEZE_PERCENT_OUTPUT = new ConfigurableDouble("Arm reduce squeeze % output", -0.02);
|
||||
|
||||
|
||||
//IDs
|
||||
|
||||
@@ -67,16 +67,16 @@ public final class SwerveDriveConstants {
|
||||
|
||||
// Operation
|
||||
public static final double FORWARD_OFFSET = 90; // 0, 90, 180, 270
|
||||
public static ConfigurableDouble FAR_OFFSET = new ConfigurableDouble("Far Offset", 0.05); // degrees to add to the angle when we are far away, to account for camera misalignment. TODO: find value.
|
||||
|
||||
public static final boolean DRIFT_CORRECTION_ENABLED = true;
|
||||
public static final boolean INVERT_X = false;
|
||||
public static final boolean INVERT_Y = true;
|
||||
public static final boolean INVERT_ROTATION = false;
|
||||
|
||||
public static ConfigurableDouble FAR_OFFSET = new ConfigurableDouble("Far Offset", 0.05);
|
||||
// public static final Trim POINTLESS_TRIM = new Trim("Pointless Trim", Double.MAX_VALUE, Double.MIN_VALUE, 0.1, 0);
|
||||
|
||||
public static final class ModuleSpecificConstants { //2026
|
||||
private static final class ModuleSpecificConstants { //2025
|
||||
//Front Left
|
||||
private static final Angle FRONT_LEFT_ENCODER_OFFSET = Rotations.of(0.49707+0.350-0.03+0.0134+0.06-0.043);
|
||||
private static final boolean FRONT_LEFT_DRIVE_MOTOR_INVERTED = false;
|
||||
@@ -166,6 +166,7 @@ public final class SwerveDriveConstants {
|
||||
public static final ConfigurableDouble AIM_kP = new ConfigurableDouble("Aim kP", 12);
|
||||
public static final ConfigurableDouble AIM_kI = new ConfigurableDouble("Aim kI", 0);
|
||||
public static final ConfigurableDouble AIM_kD = new ConfigurableDouble("Aim kD", 0.1);
|
||||
public static final ConfigurableDouble HOLD_POSITION_kP = new ConfigurableDouble("Hold Position kP", 15);
|
||||
// public static final Gains AIM_GAINS = new Gains(2.5, 0, 0.1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user