From 8c7d310a8592dae0d624d7e39c0877549f428809 Mon Sep 17 00:00:00 2001 From: Programming Laptop 1 <2491nomythic@gmail.com> Date: Thu, 25 Jan 2024 17:55:31 -0600 Subject: [PATCH] Removed the broken REV Sensor --- .../java/frc/robot/settings/Constants.java | 2 - .../robot/subsystems/IndexerSubsystem.java | 11 +--- vendordeps/REV2mDistanceSensor.json | 56 ------------------- 3 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 vendordeps/REV2mDistanceSensor.json diff --git a/src/main/java/frc/robot/settings/Constants.java b/src/main/java/frc/robot/settings/Constants.java index 7b427042..818babcc 100644 --- a/src/main/java/frc/robot/settings/Constants.java +++ b/src/main/java/frc/robot/settings/Constants.java @@ -14,7 +14,6 @@ import com.ctre.phoenix6.signals.InvertedValue; import com.ctre.phoenix6.signals.NeutralModeValue; import com.pathplanner.lib.path.PathConstraints; -import com.revrobotics.Rev2mDistanceSensor.Port; import edu.wpi.first.math.MathUtil; import edu.wpi.first.math.geometry.Pose2d; @@ -312,7 +311,6 @@ public static final class IndexerConstants{ public static final int HOLDER_1_MOTOR = 2491; public static final int HOLDER_2_MOTOR = 2491; public static final double INDEXER_SPEED = 0.75; - public static final Port DIST_SENSOR_PORT = Port.kOnboard; } public static final class IntakeConstants{ public static final int INTAKE_1_MOTOR = 2491; diff --git a/src/main/java/frc/robot/subsystems/IndexerSubsystem.java b/src/main/java/frc/robot/subsystems/IndexerSubsystem.java index e42bcfaf..716324f9 100644 --- a/src/main/java/frc/robot/subsystems/IndexerSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IndexerSubsystem.java @@ -2,7 +2,6 @@ import com.revrobotics.CANSparkMax; import com.revrobotics.RelativeEncoder; -import com.revrobotics.Rev2mDistanceSensor; import com.revrobotics.SparkPIDController; import com.revrobotics.SparkRelativeEncoder; import com.revrobotics.CANSparkBase.ControlType; @@ -11,14 +10,12 @@ import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.settings.Constants; import frc.robot.settings.Constants.IndexerConstants; -import com.revrobotics.Rev2mDistanceSensor.*; public class IndexerSubsystem extends SubsystemBase{ CANSparkMax holder1; CANSparkMax holder2; CANSparkMax feeder1; CANSparkMax feeder2; - Rev2mDistanceSensor distanceSensor; //sensor Sensorthingy; boolean isHolding; public IndexerSubsystem(){ CANSparkMax holder1 = new CANSparkMax(IndexerConstants.HOLDER_1_MOTOR, MotorType.kBrushless); @@ -35,16 +32,10 @@ public IndexerSubsystem(){ holder2.setIdleMode(IdleMode.kBrake); feeder1.setIdleMode(IdleMode.kBrake); feeder2.setIdleMode(IdleMode.kBrake); - - distanceSensor = new Rev2mDistanceSensor( - Constants.IndexerConstants.DIST_SENSOR_PORT, - Unit.kInches, - RangeProfile.kHighAccuracy); - distanceSensor.setAutomaticMode(true); } public double getInchesFromSensor() { - return distanceSensor.getRange(); + return 0; } public void feederFeed(double generalSpeed){ feeder1.set(generalSpeed); diff --git a/vendordeps/REV2mDistanceSensor.json b/vendordeps/REV2mDistanceSensor.json deleted file mode 100644 index adcfa42a..00000000 --- a/vendordeps/REV2mDistanceSensor.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "fileName": "REV2mDistanceSensor.json", - "name": "REV2mDistanceSensor", - "version": "0.4.0", - "frcYear": "2024", - "uuid": "9e352acd-4eec-40f7-8490-3357b5ed65ae", - "mavenUrls": [ - "https://www.revrobotics.com/content/sw/max/sdk/maven/" - ], - "jsonUrl": "https://www.revrobotics.com/content/sw/max/sdk/Rev2mDistanceSensor.json", - "javaDependencies": [ - { - "groupId": "com.revrobotics.frc", - "artifactId": "DistanceSensor-java", - "version": "0.4.0" - } - ], - "jniDependencies": [ - { - "groupId": "com.revrobotics.frc", - "artifactId": "DistanceSensor-driver", - "version": "0.4.0", - "skipInvalidPlatforms": true, - "isJar": false, - "validPlatforms": [ - "linuxathena" - ] - } - ], - "cppDependencies": [ - { - "groupId": "com.revrobotics.frc", - "artifactId": "DistanceSensor-cpp", - "version": "0.4.0", - "libName": "libDistanceSensor", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena" - ] - }, - { - "groupId": "com.revrobotics.frc", - "artifactId": "DistanceSensor-driver", - "version": "0.4.0", - "libName": "libDistanceSensorDriver", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena" - ] - } - ] -} \ No newline at end of file