From 99f3a8fe2ce3c34a5e1b280cd211a302ab317f12 Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Thu, 8 Feb 2024 19:47:36 -0500 Subject: [PATCH] --- src/main/java/frc/robot/command/Lancer.java | 2 +- src/main/java/frc/robot/command/Lancerampli.java | 2 +- src/main/java/frc/robot/command/Limelight_tracker.java | 1 + src/main/java/frc/robot/subsystem/Drive.java | 10 +++++----- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/frc/robot/command/Lancer.java b/src/main/java/frc/robot/command/Lancer.java index 01eb49c..e7fa56d 100644 --- a/src/main/java/frc/robot/command/Lancer.java +++ b/src/main/java/frc/robot/command/Lancer.java @@ -19,7 +19,7 @@ public class Lancer extends Command { this.limelight = limelight; this.lanceur = lanceur; // Use addRequirements() here to declare subsystem dependencies. - addRequirements(lanceur,limelight); + addRequirements(lanceur); } // Called when the command is initially scheduled. diff --git a/src/main/java/frc/robot/command/Lancerampli.java b/src/main/java/frc/robot/command/Lancerampli.java index 4a9b3c8..3e1fe59 100644 --- a/src/main/java/frc/robot/command/Lancerampli.java +++ b/src/main/java/frc/robot/command/Lancerampli.java @@ -17,7 +17,7 @@ public class Lancerampli extends Command { private Limelight limelight; public Lancerampli(Lanceur lanceur,Limelight limelight) { // Use addRequirements() here to declare subsystem dependencies. - addRequirements(lanceur, limelight); + addRequirements(lanceur); this.limelight = limelight; this.lanceur = lanceur; } diff --git a/src/main/java/frc/robot/command/Limelight_tracker.java b/src/main/java/frc/robot/command/Limelight_tracker.java index 78d0f91..9b42d82 100644 --- a/src/main/java/frc/robot/command/Limelight_tracker.java +++ b/src/main/java/frc/robot/command/Limelight_tracker.java @@ -29,6 +29,7 @@ public class Limelight_tracker extends Command { if (tracker.getv()){ drive.drive(0,0, tracker.getx()); + } else{ drive.drive(0, 0, 0); diff --git a/src/main/java/frc/robot/subsystem/Drive.java b/src/main/java/frc/robot/subsystem/Drive.java index 7770387..76da4b1 100644 --- a/src/main/java/frc/robot/subsystem/Drive.java +++ b/src/main/java/frc/robot/subsystem/Drive.java @@ -32,6 +32,11 @@ public class Drive extends SubsystemBase { } public Drive() { + try { + this.swerveDrive = new SwerveParser(swerveJsonDirectory).createSwerveDrive(2); + } catch (IOException e) { + e.printStackTrace(); + } AutoBuilder.configureHolonomic(swerveDrive::getPose, swerveDrive::resetOdometry, swerveDrive::getRobotVelocity, swerveDrive::setChassisSpeeds, new HolonomicPathFollowerConfig( new PIDConstants(5,0,0), new PIDConstants(5,0,0), 4.5, 0.275, @@ -43,11 +48,6 @@ public class Drive extends SubsystemBase { } return false; }, this); - try { - this.swerveDrive = new SwerveParser(swerveJsonDirectory).createSwerveDrive(2); - } catch (IOException e) { - e.printStackTrace(); - } } public SwerveModulePosition[] distance(){