no intake branch

This commit is contained in:
Mira
2026-04-17 18:54:29 -06:00
parent 1bb098eb04
commit 64d9c92e74
17 changed files with 528 additions and 98 deletions
@@ -0,0 +1,31 @@
{
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "LeftBump"
}
},
{
"type": "named",
"data": {
"name": "BumpOffsetForward"
}
},
{
"type": "path",
"data": {
"pathName": "Crazy ahh"
}
}
]
}
},
"resetOdom": true,
"folder": null,
"choreoAuto": false
}
@@ -0,0 +1,43 @@
{
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "NOINTAKE-PlayerStation"
}
},
{
"type": "named",
"data": {
"name": "Robot Rev Up"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "path",
"data": {
"pathName": "NOINTAKE-Shoot"
}
},
{
"type": "named",
"data": {
"name": "Robot Shoot"
}
}
]
}
},
"resetOdom": true,
"folder": null,
"choreoAuto": false
}
@@ -0,0 +1,86 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 5.968,
"y": 5.709
},
"prevControl": null,
"nextControl": {
"x": 6.456621794912318,
"y": 5.792802459713735
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 7.7625119047619044,
"y": 5.709
},
"prevControl": {
"x": 7.288242020608637,
"y": 6.45543909551135
},
"nextControl": {
"x": 7.913678571428569,
"y": 5.4710833333333335
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 8.075642857142858,
"y": 4.304940476190477
},
"prevControl": {
"x": 8.243811055641936,
"y": 4.489925494539463
},
"nextControl": {
"x": 7.7517142857142876,
"y": 3.948619047619048
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.974285714285714,
"y": 4.888011904761904
},
"prevControl": {
"x": 6.8647798501853154,
"y": 4.344969868631092
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 600.0,
"maxAngularAcceleration": 750.0,
"nominalVoltage": 12.0,
"unlimited": true
},
"goalEndState": {
"velocity": 0.0,
"rotation": -91.24536426676825
},
"reversed": false,
"folder": null,
"idealStartingState": {
"velocity": 0,
"rotation": -90.0
},
"useDefaultConstraints": false
}
@@ -0,0 +1,100 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 6.491,
"y": 5.511782051282052
},
"prevControl": null,
"nextControl": {
"x": 6.15378205128205,
"y": 5.348987179487179
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 3.3977820512820527,
"y": 5.511782051282052
},
"prevControl": {
"x": 3.6429272202047827,
"y": 5.560811085066598
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 0.4736842105263164,
"rotationDegrees": 22.5
}
],
"constraintZones": [],
"pointTowardsZones": [
{
"fieldPosition": {
"x": 6.0,
"y": 0.0
},
"rotationOffset": 0.0,
"minWaypointRelativePos": 0.0,
"maxWaypointRelativePos": 0.0,
"name": "Point Towards Zone"
},
{
"fieldPosition": {
"x": 8.0,
"y": 5.5
},
"rotationOffset": 0.0,
"minWaypointRelativePos": 0.0,
"maxWaypointRelativePos": 0.0,
"name": "Point Towards Zone"
},
{
"fieldPosition": {
"x": 5.0,
"y": 8.0
},
"rotationOffset": 0.0,
"minWaypointRelativePos": 0.0,
"maxWaypointRelativePos": 0.0,
"name": "Point Towards Zone"
},
{
"fieldPosition": {
"x": 12.0,
"y": 8.0
},
"rotationOffset": 0.0,
"minWaypointRelativePos": 0.0,
"maxWaypointRelativePos": 0.012181616832757314,
"name": "Point Towards Zone"
}
],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 600.0,
"maxAngularAcceleration": 750.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0.0,
"rotation": 23.069999999999993
},
"reversed": false,
"folder": null,
"idealStartingState": {
"velocity": 0.0,
"rotation": 90.0
},
"useDefaultConstraints": true
}
@@ -43,7 +43,7 @@
"maxAngularVelocity": 600.0, "maxAngularVelocity": 600.0,
"maxAngularAcceleration": 750.0, "maxAngularAcceleration": 750.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,
"unlimited": false "unlimited": true
}, },
"goalEndState": { "goalEndState": {
"velocity": 0.0, "velocity": 0.0,
@@ -55,5 +55,5 @@
"velocity": 0, "velocity": 0,
"rotation": -147.0305960965379 "rotation": -147.0305960965379
}, },
"useDefaultConstraints": true "useDefaultConstraints": false
} }
@@ -0,0 +1,81 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 3.5838333333333345,
"y": 1.5515476190476192
},
"prevControl": null,
"nextControl": {
"x": 3.3365992451162603,
"y": 1.5886327322801814
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 1.5754761904761914,
"y": 1.0
},
"prevControl": {
"x": 2.2272563574654534,
"y": 0.9727386663284083
},
"nextControl": {
"x": 0.9236960234869294,
"y": 1.0272613336715914
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 0.325,
"y": 0.75
},
"prevControl": {
"x": 0.5747421350529089,
"y": 0.7386480847776856
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [
{
"fieldPosition": {
"x": 0.0,
"y": 0.7
},
"rotationOffset": 180.0,
"minWaypointRelativePos": 0.6,
"maxWaypointRelativePos": 1.0956834532374118,
"name": "Point Towards Zone"
}
],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 600.0,
"maxAngularAcceleration": 750.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": -95.0
},
"reversed": false,
"folder": null,
"idealStartingState": {
"velocity": 0,
"rotation": 0.0
},
"useDefaultConstraints": true
}
@@ -0,0 +1,75 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 0.45,
"y": 0.8500000000000001
},
"prevControl": null,
"nextControl": {
"x": 0.8305284220032643,
"y": 0.7700002390150003
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 1.435,
"y": 1.6487261904761907
},
"prevControl": {
"x": 1.168662018325582,
"y": 1.4638305391236057
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [
{
"fieldPosition": {
"x": 4.612,
"y": 4.0213534
},
"rotationOffset": 180.0,
"minWaypointRelativePos": 0.4,
"maxWaypointRelativePos": 1.0,
"name": "Point Towards Zone"
},
{
"fieldPosition": {
"x": 0.4,
"y": 5.5
},
"rotationOffset": 180.0,
"minWaypointRelativePos": 0.0,
"maxWaypointRelativePos": 0.2749379652605452,
"name": "Point Towards Zone"
}
],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 600.0,
"maxAngularAcceleration": 750.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0.0,
"rotation": -142.9
},
"reversed": false,
"folder": null,
"idealStartingState": {
"velocity": 0.0,
"rotation": -90.0
},
"useDefaultConstraints": true
}
+60 -58
View File
@@ -137,9 +137,9 @@ public class RobotContainer {
// ); // );
private Command RobotRev = new SequentialCommandGroup( private Command RobotRev = new SequentialCommandGroup(
new InstantCommand(() -> m_robotShooter.spinUpShooting(), m_robotShooter), new InstantCommand(() -> m_robotShooter.spinUpShooting(), m_robotShooter)
IntakeExtended, // IntakeExtended,
new InstantCommand(() -> m_robotIntake.setMode(IntakeMode.ExpelBalls), m_robotIntake) // new InstantCommand(() -> m_robotIntake.setMode(IntakeMode.ExpelBalls), m_robotIntake)
); );
private Command WaitIntakeReference = private Command WaitIntakeReference =
@@ -164,11 +164,9 @@ public class RobotContainer {
// TEST NEW AUTO ALIGN // TEST NEW AUTO ALIGN
//new AutoAlign(m_robotSwerveDrive, m_vision, new Pose2d(FieldPositions.HUB_POSITION, new Rotation2d(0)), false), //new AutoAlign(m_robotSwerveDrive, m_vision, new Pose2d(FieldPositions.HUB_POSITION, new Rotation2d(0)), false),
new WaitUntilCommand(m_robotShooter::isShooterUpToSpeed), new WaitUntilCommand(m_robotShooter::isShooterUpToSpeed),
new InstantCommand(() -> m_robotIntake.setMode(IntakeMode.Idle), m_robotIntake), // new InstantCommand(() -> m_robotIntake.setMode(IntakeMode.Idle), m_robotIntake),
new InstantCommand(()-> m_robotShooter.allowShooting(), m_robotShooter), new InstantCommand(()-> m_robotShooter.allowShooting(), m_robotShooter),
new WaitCommand(3.5), new WaitCommand(10),
IntakeRetracted,
new WaitCommand(5),
new InstantCommand(() -> m_robotShooter.denyShooting(), m_robotShooter), new InstantCommand(() -> m_robotShooter.denyShooting(), m_robotShooter),
new InstantCommand(()-> m_robotShooter.spinUpIdle(), m_robotShooter) new InstantCommand(()-> m_robotShooter.spinUpIdle(), m_robotShooter)
); );
@@ -376,70 +374,74 @@ public class RobotContainer {
// m_robotIntake.setMode(IntakeMode.RetractedREMOVEME); // m_robotIntake.setMode(IntakeMode.RetractedREMOVEME);
// })); // }));
// new JoystickButton(getDeadbandedOperatorController(), XboxController.A_BUTTON) new JoystickButton(getDeadbandedOperatorController(), XboxController.A_BUTTON)
// .onTrue(new InstantCommand(() -> { .onTrue(new InstantCommand(() -> {
// m_robotIntake.setMode(IntakeMode.ExtendedREMOVEME); m_robotLED.goonCycle();
// })); }));
new JoystickButton(getDeadbandedOperatorController(), XboxController.X_BUTTON) new JoystickButton(getDeadbandedOperatorController(), XboxController.X_BUTTON)
.onTrue(new InstantCommand(() -> { .onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.ExtendingRolling); m_robotLED.setMode(Constants.LEDConstants.GURT);
}));
new JoystickButton(getDeadbandedOperatorController(), XboxController.BACK_BUTTON)
.onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.EncoderFix);
}));
new JoystickButton(getDeadbandedOperatorController(), XboxController.B_BUTTON)
.onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.LabubuGrowl);
})) }))
.onFalse(new InstantCommand(() -> { .onFalse(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.ExtendingRolling); m_robotLED.setMode(Constants.LEDConstants.DEFAULT_PATTERN);
}));
new JoystickButton(getDeadbandedOperatorController(), XboxController.Y_BUTTON)
.onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Retracting);
}))
.onFalse(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.ArmIdleRollingNot);
})); }));
// new JoystickButton(getDeadbandedOperatorController(), XboxController.BACK_BUTTON)
// .onTrue(new InstantCommand(() -> {
// m_robotIntake.setMode(IntakeMode.EncoderFix);
// }));
// new JoystickButton(getDeadbandedOperatorController(), XboxController.B_BUTTON)
// .onTrue(new InstantCommand(() -> {
// m_robotIntake.setMode(IntakeMode.LabubuGrowl);
// }))
// .onFalse(new InstantCommand(() -> {
// m_robotIntake.setMode(IntakeMode.ExtendingRolling);
// }));
// new JoystickButton(getDeadbandedOperatorController(), XboxController.Y_BUTTON)
// .onTrue(new InstantCommand(() -> {
// m_robotIntake.setMode(IntakeMode.Retracting);
// }))
// .onFalse(new InstantCommand(() -> {
// m_robotIntake.setMode(IntakeMode.ArmIdleRollingNot);
// }));
new Trigger(() -> getDeadbandedOperatorController().getPOV() == 90)
.onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.ExtendingIdle);
}))
.onFalse(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Idle);
}));
new Trigger(() -> getDeadbandedOperatorController().getPOV() == 270) // new Trigger(() -> getDeadbandedOperatorController().getPOV() == 90)
.onTrue(new InstantCommand(() -> { // .onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Retracting); // m_robotIntake.setMode(IntakeMode.ExtendingIdle);
})) // }))
.onFalse(new InstantCommand(() -> { // .onFalse(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Idle); // m_robotIntake.setMode(IntakeMode.Idle);
})); // }));
// 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) // new Trigger(() -> getDeadbandedOperatorController().getPOV() == 0)
.onTrue(new InstantCommand(() -> { // .onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.RectractTorque); // m_robotIntake.setMode(IntakeMode.RectractTorque);
})) // }))
.onFalse(new InstantCommand(() -> { // .onFalse(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Idle); // m_robotIntake.setMode(IntakeMode.Idle);
})); // }));
new Trigger(() -> getDeadbandedOperatorController().getPOV() == 180) // new Trigger(() -> getDeadbandedOperatorController().getPOV() == 180)
.onTrue(new InstantCommand(() -> { // .onTrue(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.ExpelBalls); // m_robotIntake.setMode(IntakeMode.ExpelBalls);
})) // }))
.onFalse(new InstantCommand(() -> { // .onFalse(new InstantCommand(() -> {
m_robotIntake.setMode(IntakeMode.Idle); // m_robotIntake.setMode(IntakeMode.Idle);
})); // }));
// .onFalse(new InstantCommand(() -> { // .onFalse(new InstantCommand(() -> {
+2 -2
View File
@@ -84,7 +84,7 @@ public class RobotMap {
// // Configure LiDAR // // Configure LiDAR
// reefLidar = new LidarReal(LiDARConstants.REEF_LIDAR_DIO_CHANNEL); // reefLidar = new LidarReal(LiDARConstants.REEF_LIDAR_DIO_CHANNEL);
// reverseLidar = new LidarReal(LiDARConstants.REVERSE_LIDAR_DIO_CHANNEL); // reverseLidar = new LidarReal(LiDARConstants.REVERSE_LIDAR_DIO_CHANNEL);
DigitalInput armLimitSwitch = new DigitalInput(IntakeConstants.ARM_LIMIT_SWITCH_CHANNEL); // DigitalInput armLimitSwitch = new DigitalInput(IntakeConstants.ARM_LIMIT_SWITCH_CHANNEL);
// Configure swerve drive train // Configure swerve drive train
SwerveDrivetrain<TalonFX, TalonFX, CANcoder> swerveDrivetrainReal = new SwerveDrivetrain<TalonFX, TalonFX, CANcoder> (TalonFX::new, TalonFX::new, CANcoder::new, SwerveDrivetrain<TalonFX, TalonFX, CANcoder> swerveDrivetrainReal = new SwerveDrivetrain<TalonFX, TalonFX, CANcoder> (TalonFX::new, TalonFX::new, CANcoder::new,
@@ -111,7 +111,7 @@ public class RobotMap {
shooterIO = new ShooterReal(shooter1, shooter2, indexer); shooterIO = new ShooterReal(shooter1, shooter2, indexer);
JankCoder armEncoder = new JankCoder(0, IntakeConstants.ARM_ENCODER_OFFSET); JankCoder armEncoder = new JankCoder(0, IntakeConstants.ARM_ENCODER_OFFSET);
intakeIO = new IntakeReal(armLimitSwitch, arm, roller, armEncoder); intakeIO = new IntakeReal(arm, roller, armEncoder);
// Fault // Fault
FaultPidgeon2.addDevice(swerveDrivetrainReal.getPigeon2(), "Gyro"); FaultPidgeon2.addDevice(swerveDrivetrainReal.getPigeon2(), "Gyro");
@@ -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 = 239; public static final int GIT_REVISION = 240;
public static final String GIT_SHA = "4d732970da558d90c4be1787635dc5786674bd27"; public static final String GIT_SHA = "1bb098eb04dc97a69698c169243bfdf38f69f305";
public static final String GIT_DATE = "2026-04-10 13:59:21 MDT"; public static final String GIT_DATE = "2026-04-10 15:29:55 MDT";
public static final String GIT_BRANCH = "Encoder-Fix"; public static final String GIT_BRANCH = "Encoder-Fix";
public static final String BUILD_DATE = "2026-04-10 14:33:17 MDT"; public static final String BUILD_DATE = "2026-04-11 11:59:44 MDT";
public static final long BUILD_UNIX_TIME = 1775853197175L; public static final long BUILD_UNIX_TIME = 1775930384277L;
public static final int DIRTY = 1; public static final int DIRTY = 1;
private BuildConstants(){} private BuildConstants(){}
@@ -99,7 +99,11 @@ public final class Constants {
public static final class LEDConstants { public static final class LEDConstants {
public static final int LED_SPARK_ID = 8; public static final int LED_SPARK_ID = 8;
public static final LEDPatterns DEFAULT_PATTERN = LEDPatterns.FOREST_RAINBOW; public static final LEDPatterns RAGE = LEDPatterns.SOLID_RED;
public static final LEDPatterns DEFAULT_PATTERN = LEDPatterns.PARTY_RAINBOW;
public static final LEDPatterns GURT = LEDPatterns.FOREST_BPM;
// // // LED color for when the intake is out // // // LED color for when the intake is out
// public static final LEDPatterns INTAKE_OUT = LEDPatterns.SOLID_RED; // public static final LEDPatterns INTAKE_OUT = LEDPatterns.SOLID_RED;
@@ -57,17 +57,17 @@ public class IntakeConstants {
public static final ConfigurableDouble ARM_LIMIT_RETRACTED = new ConfigurableDouble("Arm angle retracted", 0.); 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.625); //new soft limt public static final ConfigurableDouble ARM_LIMIT_EXTENDED = new ConfigurableDouble("Arm angle extended", 1.625); //new soft limt
public static final ConfigurableDouble ARM_EXTEND_PERCENT_OUTPUT = new ConfigurableDouble("Arm extend % output", 0.3); public static final ConfigurableDouble ARM_EXTEND_PERCENT_OUTPUT = new ConfigurableDouble("Arm extend % output", 0.);
public static final ConfigurableDouble ARM_RETRACT_PERCENT_OUTPUT = new ConfigurableDouble("Arm retract % output", -0.15); public static final ConfigurableDouble ARM_RETRACT_PERCENT_OUTPUT = new ConfigurableDouble("Arm retract % output", -0.);
public static final ConfigurableDouble ARM_AUTO_OUTPUT = new ConfigurableDouble("Arm auto output", -0.07); public static final ConfigurableDouble ARM_AUTO_OUTPUT = new ConfigurableDouble("Arm auto output", -0.07);
public static final ConfigurableDouble ARM_REVERSE_ROLLER_RANGE = new ConfigurableDouble("Arm reverse roller range", 1.17); 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", .50); public static final ConfigurableDouble ROLLER_PERCENT_OUTPUT = new ConfigurableDouble("Roller Percent Output", .0);
public static final ConfigurableDouble ROLLER_LABUBU_GROWL_PERCENT_OUTPUT = new ConfigurableDouble("Roller Labubu Growl Percent Output", .7); public static final ConfigurableDouble ROLLER_LABUBU_GROWL_PERCENT_OUTPUT = new ConfigurableDouble("Roller Labubu Growl Percent Output", .0);
public static final ConfigurableDouble ROLLER_EJECT_PERCENT_OUTPUT = new ConfigurableDouble("Roller eject Percent Output", -.20); public static final ConfigurableDouble ROLLER_EJECT_PERCENT_OUTPUT = new ConfigurableDouble("Roller eject Percent Output", .0);
public static final ConfigurableDouble ROLLER_IDLE_PERCENT_OUTPUT = new ConfigurableDouble("Roller IDLE Percent Output", .20); public static final ConfigurableDouble ROLLER_IDLE_PERCENT_OUTPUT = new ConfigurableDouble("Roller IDLE Percent Output", .0);
public static final ConfigurableDouble ROLLER_RETRACT_PERCENT_OUTPUT = new ConfigurableDouble("Roller Retract Output", .40); public static final ConfigurableDouble ROLLER_RETRACT_PERCENT_OUTPUT = new ConfigurableDouble("Roller Retract Output", .0);
public static final ConfigurableDouble ROLLER_MULTIPLIER_CONST = new ConfigurableDouble("Roller Multiplier Constant", 0.4); public static final ConfigurableDouble ROLLER_MULTIPLIER_CONST = new ConfigurableDouble("Roller Multiplier Constant", 0.4);
// public static final ConfigurableDouble ROLL = new ConfigurableDouble("Arm angle extended", 0.25); // public static final ConfigurableDouble ROLL = new ConfigurableDouble("Arm angle extended", 0.25);
@@ -26,13 +26,13 @@ public class IntakeReal implements IntakeIO {
// SparkLimitSwitch reverse_limit; // SparkLimitSwitch reverse_limit;
TalonFX m_rollerMotor; TalonFX m_rollerMotor;
JankCoder m_encoder; JankCoder m_encoder;
DigitalInput m_armLimitSwitch; // DigitalInput m_armLimitSwitch;
boolean m_limitTRIGGER = false; boolean m_limitTRIGGER = false;
private final Timer m_limitTimer = new Timer(); private final Timer m_limitTimer = new Timer();
public IntakeReal( public IntakeReal(
DigitalInput armLimitSwitch, // DigitalInput armLimitSwitch,
SparkMax armMotor, SparkMax armMotor,
TalonFX rollerMotor, TalonFX rollerMotor,
JankCoder jankCoder JankCoder jankCoder
@@ -41,7 +41,7 @@ public class IntakeReal implements IntakeIO {
// m_pitchMotor = pitchMotor; // m_pitchMotor = pitchMotor;
m_armMotor = armMotor; m_armMotor = armMotor;
arm_encoder = m_armMotor.getEncoder(); arm_encoder = m_armMotor.getEncoder();
m_armLimitSwitch = armLimitSwitch; // m_armLimitSwitch = armLimitSwitch;
m_rollerMotor = rollerMotor; m_rollerMotor = rollerMotor;
m_encoder = jankCoder; m_encoder = jankCoder;
@@ -85,9 +85,9 @@ public class IntakeReal implements IntakeIO {
// m_rollerMotor.set(0); // m_rollerMotor.set(0);
} }
private boolean retractedLimit() { // private boolean retractedLimit() {
return m_armLimitSwitch.get(); // // return m_armLimitSwitch.get();
} // }
private boolean retractedSoftLimit() { private boolean retractedSoftLimit() {
return m_encoder.get() <= IntakeConstants.ARM_LIMIT_RETRACTED.get(); return m_encoder.get() <= IntakeConstants.ARM_LIMIT_RETRACTED.get();
} }
@@ -135,7 +135,7 @@ public class IntakeReal implements IntakeIO {
state.intakeEncoder = m_encoder.getRotations(); state.intakeEncoder = m_encoder.getRotations();
state.encoderConnected = m_encoder.isConnected(); state.encoderConnected = m_encoder.isConnected();
state.retractedLimitSwitch = retractedLimit(); // state.retractedLimitSwitch = retractedLimit();
// if(state.retractedLimitSwitch && (state.armMotorVelocity.in(RotationsPerSecond) <0)) { // if(state.retractedLimitSwitch && (state.armMotorVelocity.in(RotationsPerSecond) <0)) {
// if (!m_limitTRIGGER) { // if (!m_limitTRIGGER) {
@@ -156,9 +156,9 @@ public class IntakeReal implements IntakeIO {
// m_encoder.loadRotations(); // m_encoder.loadRotations();
if(retractedLimit()) { // if(retractedLimit()) {
m_encoder.resetRotations(); // m_encoder.resetRotations();
} // }
// IntakeConstants.ARM_PID.kP = IntakeConstants.arm_kP.get(); // IntakeConstants.ARM_PID.kP = IntakeConstants.arm_kP.get();
// IntakeConstants.ARM_PID.kI = IntakeConstants.arm_kI.get(); // IntakeConstants.ARM_PID.kI = IntakeConstants.arm_kI.get();
@@ -49,6 +49,13 @@ public class LED extends SubsystemBase implements Queryable {
} }
} }
public void goonCycle(){
LEDPatterns[] patterns = LEDPatterns.values();
int currentPatternIndex = mode.ordinal();
int nextPatternIndex = (currentPatternIndex + 1)% patterns.length;
setMode(patterns[nextPatternIndex]);
}
@AutoLogOutput @AutoLogOutput
public String getMode(){ public String getMode(){
return mode.name(); return mode.name();
@@ -182,30 +182,30 @@ public class Shooter extends SubsystemBase {
switch (bitmask) { switch (bitmask) {
case 0b000: // No errors but button is not pressed case 0b000: // No errors but button is not pressed
io.setIndexerOutput(state, ShooterConstants.INDEXER_REVERSE_OUTPUT.get()); io.setIndexerOutput(state, ShooterConstants.INDEXER_REVERSE_OUTPUT.get());
m_robotLED.setMode(Constants.LEDConstants.OPREADY); // m_robotLED.setMode(Constants.LEDConstants.OPREADY);
break; break;
case 0b001: // No errors and shoot button is pressed case 0b001: // No errors and shoot button is pressed
io.setIndexerOutput(state, ShooterConstants.INDEXER_FORWARD_OUTPUT.get()); io.setIndexerOutput(state, ShooterConstants.INDEXER_FORWARD_OUTPUT.get());
m_robotLED.setMode(Constants.LEDConstants.OPREADY); // m_robotLED.setMode(Constants.LEDConstants.OPREADY);
break; break;
case 0b010: // Bad shooter velocity, button is not pressed case 0b010: // Bad shooter velocity, button is not pressed
case 0b011: // Bad shooter velocty, button is pressed case 0b011: // Bad shooter velocty, button is pressed
io.setIndexerOutput(state, ShooterConstants.INDEXER_REVERSE_OUTPUT.get()); io.setIndexerOutput(state, ShooterConstants.INDEXER_REVERSE_OUTPUT.get());
m_robotLED.setMode(Constants.LEDConstants.BAD_FLYWEEL); // m_robotLED.setMode(Constants.LEDConstants.BAD_FLYWEEL);
break; break;
case 0b100: // Driver error, button is not pressed case 0b100: // Driver error, button is not pressed
case 0b101: // Driver error, button is pressed case 0b101: // Driver error, button is pressed
io.setIndexerOutput(state, 0); io.setIndexerOutput(state, 0);
m_robotLED.setMode(Constants.LEDConstants.OPREADY_BADPHYS); // m_robotLED.setMode(Constants.LEDConstants.OPREADY_BADPHYS);
break; break;
case 0b110: // Driver error, bad shooter vel, button is not pressed case 0b110: // Driver error, bad shooter vel, button is not pressed
case 0b111: // Driver error, bad shooter vel, button is pressed case 0b111: // Driver error, bad shooter vel, button is pressed
io.setIndexerOutput(state, 0); io.setIndexerOutput(state, 0);
m_robotLED.setMode(Constants.LEDConstants.BAD_FLYWEEL_BADPHYS); // m_robotLED.setMode(Constants.LEDConstants.BAD_FLYWEEL_BADPHYS);
break; break;
} }
break; break;
@@ -220,18 +220,18 @@ public class Shooter extends SubsystemBase {
switch (bitmask2) { switch (bitmask2) {
case 0b000: // No errors but button is not pressed case 0b000: // No errors but button is not pressed
io.setIndexerOutput(state, 0); io.setIndexerOutput(state, 0);
m_robotLED.setMode(Constants.LEDConstants.OPREADY_FEED); // m_robotLED.setMode(Constants.LEDConstants.OPREADY_FEED);
break; break;
case 0b001: // No errors and shoot button is pressed case 0b001: // No errors and shoot button is pressed
io.setIndexerOutput(state, ShooterConstants.INDEXER_FORWARD_OUTPUT.get()); io.setIndexerOutput(state, ShooterConstants.INDEXER_FORWARD_OUTPUT.get());
m_robotLED.setMode(Constants.LEDConstants.OPREADY_FEED); // m_robotLED.setMode(Constants.LEDConstants.OPREADY_FEED);
break; break;
case 0b010: // Bad shooter velocity, button is not pressed case 0b010: // Bad shooter velocity, button is not pressed
case 0b011: // Bad shooter velocty, button is pressed case 0b011: // Bad shooter velocty, button is pressed
io.setIndexerOutput(state, 0); io.setIndexerOutput(state, 0);
m_robotLED.setMode(Constants.LEDConstants.BAD_FLYWEEL); // m_robotLED.setMode(Constants.LEDConstants.BAD_FLYWEEL);
break; break;
// case 0b100: // Driver error, button is not pressed // case 0b100: // Driver error, button is not pressed
@@ -257,7 +257,7 @@ public class Shooter extends SubsystemBase {
// RotationsPerSecond.of(ShooterConstants.INDEXER_REVERSE_OUTPUT.get()) // RotationsPerSecond.of(ShooterConstants.INDEXER_REVERSE_OUTPUT.get())
); );
io.setIndexerOutput(state, 0); io.setIndexerOutput(state, 0);
m_robotLED.setMode(Constants.LEDConstants.DEFAULT_PATTERN); // m_robotLED.setMode(Constants.LEDConstants.DEFAULT_PATTERN);
break; break;
} }
@@ -26,7 +26,7 @@ public class ShooterConstants {
// public static final ConfigurableDouble SHOOTER_RESTING_VELOCITY = new ConfigurableDouble("Shooter Resting Velocity", 0.0); // public static final ConfigurableDouble SHOOTER_RESTING_VELOCITY = new ConfigurableDouble("Shooter Resting Velocity", 0.0);
public static final ConfigurableDouble SHOOTER_IDLE_PERCENT_OUTPUT = new ConfigurableDouble("Shooter idle % output", -0.15); public static final ConfigurableDouble SHOOTER_IDLE_PERCENT_OUTPUT = new ConfigurableDouble("Shooter idle % output", 0.0);
// public static final ConfigurableDouble SHOOTER_IDLE_TARGET_VEL = new ConfigurableDouble("Shooter idle target velocity", 20.); // public static final ConfigurableDouble SHOOTER_IDLE_TARGET_VEL = new ConfigurableDouble("Shooter idle target velocity", 20.);
// public static final ConfigurableDouble SHOOTER_IDLE_MAX_CURRENT = new ConfigurableDouble("Shooter Idle max current", 10); // public static final ConfigurableDouble SHOOTER_IDLE_MAX_CURRENT = new ConfigurableDouble("Shooter Idle max current", 10);
@@ -9,7 +9,7 @@ public enum LEDPatterns {
RAINBOW_GLITTER(-0.89f), CONFETTI(-0.87f), RED_SHOT(-0.85f), BLUE_SHOT(-0.83f), WHITE_SHOT(-0.81f), RAINBOW_SINELON(-0.79f), RAINBOW_GLITTER(-0.89f), CONFETTI(-0.87f), RED_SHOT(-0.85f), BLUE_SHOT(-0.83f), WHITE_SHOT(-0.81f), RAINBOW_SINELON(-0.79f),
PARTY_SINELON(-0.77f), OCEAN_SINELON(-0.75f), LAVA_SINELON(-0.73f), FOREST_SINELON(-0.71f), RAINBOW_BPM(-0.69f), PARTY_SINELON(-0.77f), OCEAN_SINELON(-0.75f), LAVA_SINELON(-0.73f), FOREST_SINELON(-0.71f), RAINBOW_BPM(-0.69f),
PARTY_BPM(-0.67f), OCEAN_BPM(-0.65f), LAVA_BPM(-0.63f), FOREST_BPM(-0.61f), FIRE_MEDIUM(-0.59f), FIRE_LARGE(-0.57f), PARTY_BPM(-0.67f), OCEAN_BPM(-0.65f), LAVA_BPM(-0.63f), FOREST_BPM(-0.61f), FIRE_MEDIUM(-0.59f), FIRE_LARGE(-0.57f),
RAINBOW_TWINKLES(-0.55f), PARTY_TWINKLES(-0.53f), OCEAN_TWINKLES(-0.51f), LAVA_TWINKLES(-0.49f), FOREST_TWINKLES(-0.47f), // RAINBOW_TWINKLES(-0.55f), PARTY_TWINKLES(-0.53f), OCEAN_TWINKLES(-0.51f), LAVA_TWINKLES(-0.49f), FOREST_TWINKLES(-0.47f),
RAINBOW_WAVES(-0.45f), PARTY_WAVES(-0.43f), OCEAN_WAVES(-0.41f), LAVA_WAVES(-0.39f), FOREST_WAVES(-0.37f), RAINBOW_WAVES(-0.45f), PARTY_WAVES(-0.43f), OCEAN_WAVES(-0.41f), LAVA_WAVES(-0.39f), FOREST_WAVES(-0.37f),
RED_SCANNER(-0.35f), GRAY_SCANNER(-0.33f), RED_CHASE(-0.31f), BLUE_CHASE(-0.29f), GRAY_CHASE(-0.27f), RED_HEARTBEAT(-0.25f), RED_SCANNER(-0.35f), GRAY_SCANNER(-0.33f), RED_CHASE(-0.31f), BLUE_CHASE(-0.29f), GRAY_CHASE(-0.27f), RED_HEARTBEAT(-0.25f),
BLUE_HEARTBEAT(-0.23f), WHITE_HEARTBEAT(-0.21f), GRAY_HEARBEAT(-0.19f), RED_BREATH(-0.17f), BLUE_BREATH(-0.15f), BLUE_HEARTBEAT(-0.23f), WHITE_HEARTBEAT(-0.21f), GRAY_HEARBEAT(-0.19f), RED_BREATH(-0.17f), BLUE_BREATH(-0.15f),
@@ -24,8 +24,9 @@ public enum LEDPatterns {
C2_HEARTBEAT_FAST(0.27f), C2_BREATH_SLOW(0.29f), C2_BREATH_FAST(0.31f), C2_SHOT(0.33f), C2_STROBE(0.35f), C2_HEARTBEAT_FAST(0.27f), C2_BREATH_SLOW(0.29f), C2_BREATH_FAST(0.31f), C2_SHOT(0.33f), C2_STROBE(0.35f),
/* COLOR 1 AND 2 PATTERNS */ /* COLOR 1 AND 2 PATTERNS */
C1C2_SPARKLE(0.37f), C2C1_SPARKLE(0.39f), C1C2_GRADIENT(0.41f), C1C2_BPM(0.43f), C1C2_BLEND(0.45f), C1C2_TWINKLES(0.51f), C1C2_SPARKLE(0.37f), C2C1_SPARKLE(0.39f), C1C2_GRADIENT(0.41f), C1C2_BPM(0.43f), C1C2_BLEND(0.45f),
C1C2_WAVES(0.53f), C1C2_SINELON(0.55f), // C1C2_TWINKLES(0.51f),
C1C2_WAVES(0.53f), C1C2_SINELON(0.55f),
/* SOLID COLORS */ /* SOLID COLORS */
SOLID_PINK_HOT(0.57f), SOLID_RED_DARK(0.59f), SOLID_RED(0.61f), SOLID_RED_ORANGE(0.63f), SOLID_ORANGE(0.65f), SOLID_PINK_HOT(0.57f), SOLID_RED_DARK(0.59f), SOLID_RED(0.61f), SOLID_RED_ORANGE(0.63f), SOLID_ORANGE(0.65f),