From 3165d7afe23d1bf3a8e8a7a876450259bd6ebb6f Mon Sep 17 00:00:00 2001 From: Jonah Snider Date: Wed, 8 Nov 2023 12:21:50 -0800 Subject: [PATCH 1/3] Use timer to delay game piece detection for scoring Signed-off-by: Jonah Snider --- src/main/java/frc/robot/intake/IntakeSubsystem.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/intake/IntakeSubsystem.java b/src/main/java/frc/robot/intake/IntakeSubsystem.java index 9fdddc9..7280177 100644 --- a/src/main/java/frc/robot/intake/IntakeSubsystem.java +++ b/src/main/java/frc/robot/intake/IntakeSubsystem.java @@ -87,10 +87,10 @@ public void enabledPeriodic() { gamePiece = HeldGamePiece.CONE; } else if (motorVelocity < threshold && goalState == IntakeState.INTAKE_CUBE) { gamePiece = HeldGamePiece.CUBE; + } else if (motorVelocity > threshold + && (goalState == IntakeState.OUTTAKE_CONE || goalState == IntakeState.OUTTAKE_CUBE)) { + gamePiece = HeldGamePiece.NOTHING; } - } else if (motorVelocity > threshold - && (goalState == IntakeState.OUTTAKE_CONE || goalState == IntakeState.OUTTAKE_CUBE)) { - gamePiece = HeldGamePiece.NOTHING; } } From dff572e1854b4771d40640afdc88da2d1d0ff376 Mon Sep 17 00:00:00 2001 From: Jonah Snider Date: Wed, 8 Nov 2023 12:21:53 -0800 Subject: [PATCH 2/3] Format with Spotless --- src/main/java/frc/robot/swerve/SwerveModule.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/frc/robot/swerve/SwerveModule.java b/src/main/java/frc/robot/swerve/SwerveModule.java index 9fe46cd..e7e42bc 100644 --- a/src/main/java/frc/robot/swerve/SwerveModule.java +++ b/src/main/java/frc/robot/swerve/SwerveModule.java @@ -7,7 +7,6 @@ import com.ctre.phoenix6.StatusCode; import com.ctre.phoenix6.StatusSignal; import com.ctre.phoenix6.configs.CANcoderConfiguration; -import com.ctre.phoenix6.configs.CurrentLimitsConfigs; import com.ctre.phoenix6.configs.TalonFXConfiguration; import com.ctre.phoenix6.controls.DutyCycleOut; import com.ctre.phoenix6.controls.VelocityVoltage; From fd5e8d8fb53d52b933cf46d16b39ad20deb52cb6 Mon Sep 17 00:00:00 2001 From: Jonah Snider Date: Wed, 8 Nov 2023 12:25:26 -0800 Subject: [PATCH 3/3] Set intake encoder position conversion factor to 1.0 --- src/main/java/frc/robot/intake/IntakeSubsystem.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/frc/robot/intake/IntakeSubsystem.java b/src/main/java/frc/robot/intake/IntakeSubsystem.java index 7280177..54fbde1 100644 --- a/src/main/java/frc/robot/intake/IntakeSubsystem.java +++ b/src/main/java/frc/robot/intake/IntakeSubsystem.java @@ -26,6 +26,7 @@ public IntakeSubsystem(CANSparkMax motor) { super(SubsystemPriority.INTAKE); this.motor = motor; encoder = motor.getEncoder(); + encoder.setPositionConversionFactor(1.0); encoder.setVelocityConversionFactor(1.0); }