instant commands for testing

This commit is contained in:
Shikhar
2026-02-07 14:51:05 -07:00
parent f39bd20b9f
commit 2d9ed527be
6 changed files with 61 additions and 41 deletions
@@ -18,11 +18,11 @@ public class Intake extends SubsystemBase {
Supplier<Pose2d> m_swervePoseSupplier;
public Intake(
IntakeIO io,
Supplier<Pose2d> swervePoseSupplier
IntakeIO io
// Supplier<Pose2d> swervePoseSupplier
) {
this.io = io;
this.m_swervePoseSupplier = swervePoseSupplier;
// this.m_swervePoseSupplier = swervePoseSupplier;
}
public enum IntakeMode {
@@ -33,11 +33,11 @@ public class Intake extends SubsystemBase {
public void setMode(IntakeMode mode) {
switch (mode) {
case Up:
io.setArmAngle(state, IntakeConstants.ARM_LIMIT_UPPER);
// io.setArmAngle(state, IntakeConstants.ARM_LIMIT_UPPER);
io.setRollerVelocity(state, IntakeConstants.ROLLER_STOP);
break;
case Down:
io.setArmAngle(state, IntakeConstants.ARM_LIMIT_LOWER);
// io.setArmAngle(state, IntakeConstants.ARM_LIMIT_LOWER);
io.setRollerVelocity(state, IntakeConstants.ROLLER_MAX_VELOCITY);
break;
}
@@ -23,7 +23,6 @@ public class IntakeConstants {
//IDs
public static final CanDevice ARM_ID = new CanDevice("SHOOTER 1", 20);
public static final CanDevice ROLLER_ID = new CanDevice("SHOOTER 2", 21);
@@ -31,8 +30,11 @@ public class IntakeConstants {
// 0 is the forward angle on the robot.
// negative is left, positive is right
public static final Angle ARM_LIMIT_LOWER = Degrees.of(-180);
public static final Angle ARM_LIMIT_UPPER = Degrees.of(180);
//when testing the negative output of 10% made the robot put the intake up
public static final Angle ARM_LIMIT_LOWER = Degrees.of(90);
public static final Angle ARM_LIMIT_UPPER = Degrees.of(-90);
public static final AngularVelocity ROLLER_MAX_VELOCITY = RotationsPerSecond.of(4.0);
public static final AngularVelocity ROLLER_STOP = RotationsPerSecond.of(0.0);
@@ -14,15 +14,15 @@ public class Shooter extends SubsystemBase {
ShooterIO io;
ShooterStateAutoLogged state = new ShooterStateAutoLogged();
Supplier<Pose2d> m_swervePoseSupplier;
// Supplier<Pose2d> m_swervePoseSupplier;
public Shooter(
ShooterIO io,
Supplier<Pose2d> swervePoseSupplier
ShooterIO io
// Supplier<Pose2d> swervePoseSupplier
) {
this.io = io;
this.m_swervePoseSupplier = swervePoseSupplier;
// this.m_swervePoseSupplier = swervePoseSupplier;
}
public enum FieldZone {
@@ -80,8 +80,8 @@ public class Shooter extends SubsystemBase {
Logger.processInputs("Shooter", state);
Pose2d pose = m_swervePoseSupplier.get();
Angle robotRot = pose.getRotation().getMeasure();
// Pose2d pose = m_swervePoseSupplier.get();
// Angle robotRot = pose.getRotation().getMeasure();
io.updateInputs(state);
@@ -22,9 +22,10 @@ public class ShooterConstants {
public static final double INDEXER_GEAR_RATIO = 1.;
public static final AngularVelocity SHOOTER_RESTING_VELOCITY = RotationsPerSecond.of(0.0);
public static final AngularVelocity SHOOTER_ACTIVE_VELOCITY = RotationsPerSecond.of(0.0);
public static final AngularVelocity SHOOTER_ACTIVE_VELOCITY = RotationsPerSecond.of(4.0);
public static final AngularVelocity SHOOTER_INACTIVE_VELOCITY = RotationsPerSecond.of(0.0);
public static final AngularVelocity INDEXER_ACTIVE_VELOCITY = RotationsPerSecond.of(0.0);
public static final AngularVelocity INDEXER_ACTIVE_VELOCITY = RotationsPerSecond.of(4.0);
public static final AngularVelocity INDEXER_INACTIVE_VELOCITY = RotationsPerSecond.of(0.0);
@@ -59,6 +60,7 @@ public class ShooterConstants {
// .withDutyCycleNeutralDeadband(0.04) // TODO: Figure out what this means
// );
public static final CanDevice SHOOTER1_ID = new CanDevice("SHOOTER 1", 22);
public static final CanDevice SHOOTER2_ID = new CanDevice("SHOOTER 2", 23);
public static final CanDevice INDEXER_ID = new CanDevice("INDEXER",24);