From 172d3c92ab22112a79bf7fa77f926fcf019d9139 Mon Sep 17 00:00:00 2001 From: EdwardFaucher Date: Mon, 7 Apr 2025 12:06:05 -0400 Subject: [PATCH 1/8] led --- src/main/java/frc/robot/RobotContainer.java | 4 ++-- src/main/java/frc/robot/subsystems/Bougie.java | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index b49a82e..e0bf37a 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -171,11 +171,11 @@ public class RobotContainer { .withVelocityY(0) .withRotationalRate(0)).unless(()->!L4.getBoolean(true)).withTimeout(2.35), drivetrain.applyRequest(()-> - drive.withVelocityX(-0.1*MaxSpeed) + drive.withVelocityX(0.1*MaxSpeed) .withVelocityY(0) .withRotationalRate(0)).unless(()->!sortirAngle.getBoolean(true)|| !ReculerR.getBoolean(true)).withTimeout(3), drivetrain.applyRequest(()-> - drive.withVelocityX(0.1*MaxSpeed) + drive.withVelocityX(-0.1*MaxSpeed) .withVelocityY(0) .withRotationalRate(0)).unless(()->!sortirAngle.getBoolean(true)|| !ReculerB.getBoolean(true)).withTimeout(3), drivetrain.applyRequest(()-> diff --git a/src/main/java/frc/robot/subsystems/Bougie.java b/src/main/java/frc/robot/subsystems/Bougie.java index d56a9e0..32f6a34 100644 --- a/src/main/java/frc/robot/subsystems/Bougie.java +++ b/src/main/java/frc/robot/subsystems/Bougie.java @@ -6,14 +6,22 @@ package frc.robot.subsystems; import com.ctre.phoenix.led.CANdle; import com.ctre.phoenix.led.CANdleConfiguration; +import com.ctre.phoenix.led.FireAnimation; +import com.ctre.phoenix.led.LarsonAnimation; import com.ctre.phoenix.led.RainbowAnimation; +import com.ctre.phoenix.led.TwinkleAnimation; +import com.ctre.phoenix.led.TwinkleOffAnimation; +import com.ctre.phoenix.led.TwinkleOffAnimation.TwinkleOffPercent; +import com.ctre.phoenix.led.LarsonAnimation.BounceMode; +import com.ctre.phoenix.led.TwinkleAnimation.TwinklePercent; import edu.wpi.first.wpilibj2.command.SubsystemBase; public class Bougie extends SubsystemBase { CANdle candle = new CANdle(23); CANdleConfiguration config = new CANdleConfiguration(); - RainbowAnimation rainbowAnim = new RainbowAnimation(1, 0.5, 68); + LarsonAnimation rainbowAnim = new LarsonAnimation(256,0,0,0,0.1,68,BounceMode.Front,10,8); + //TwinkleOffAnimation rainbowAnim = new TwinkleOffAnimation(256, 0, 0,0,0.5,68,TwinkleOffPercent.Percent88,8); /** Creates a new Bougie. */ public Bougie() { config.brightnessScalar = 0.5; From 0bf575ff377f3f593cfeeb05333a124ce909ec68 Mon Sep 17 00:00:00 2001 From: Samuel <2540638@etudiant.cegepvicto.com> Date: Mon, 20 Oct 2025 18:39:08 -0400 Subject: [PATCH 2/8] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c6fea4f..ff9e9af 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2025.2.1" + id "edu.wpi.first.GradleRIO" version "2025.3.2" } java { From 837435643bedbc1c6f422f42ac89e06619d24133 Mon Sep 17 00:00:00 2001 From: EdwardFaucher Date: Mon, 20 Oct 2025 18:42:24 -0400 Subject: [PATCH 3/8] pid fonctionne mais pas de pid --- .../java/frc/robot/commands/Elevateur/L3.java | 49 +++++++++++-------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/src/main/java/frc/robot/commands/Elevateur/L3.java b/src/main/java/frc/robot/commands/Elevateur/L3.java index cb940c0..8011b68 100644 --- a/src/main/java/frc/robot/commands/Elevateur/L3.java +++ b/src/main/java/frc/robot/commands/Elevateur/L3.java @@ -5,7 +5,7 @@ package frc.robot.commands.Elevateur; import edu.wpi.first.wpilibj2.command.Command; - +import edu.wpi.first.math.controller.PIDController; import frc.robot.subsystems.Elevateur; import frc.robot.subsystems.Pince; @@ -13,6 +13,8 @@ import frc.robot.subsystems.Pince; public class L3 extends Command { private Elevateur elevateur; private Pince pince; + private PIDController pidController; + private double output; /** Creates a new L2. */ public L3(Elevateur elevateur,Pince pince) { this.elevateur = elevateur; @@ -23,30 +25,35 @@ public class L3 extends Command { // Called when the command is initially scheduled. @Override - public void initialize() {} + public void initialize() { + pidController = new PIDController(0.03, 0.001, 0.001); + pidController.reset(); + } // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - if(elevateur.position()<=elevateur.encodeurelevateurL3bas() && elevateur.position()>=elevateur.encodeurelevateurL3haut()){ - elevateur.vitesse(0); - pince.pivote(-0.15); - if(pince.encodeurpivot()>=20 && pince.encodeurpivot()<=21){ - pince.pivote(0); - } - else if(pince.encodeurpivot()>=20){ - pince.pivote(-0.15); - } - else{ - pince.pivote(0.15); - } - } - else if(elevateur.position()>=elevateur.encodeurelevateurL3bas()){ - elevateur.vitesse(-0.7); - } - else{ - elevateur.vitesse(0.25); - } + output = pidController.calculate(elevateur.position(),20); + elevateur.vitesse(output); + // if(elevateur.position()<=elevateur.encodeurelevateurL3bas() && elevateur.position()>=elevateur.encodeurelevateurL3haut()){ + // elevateur.vitesse(0); + // pince.pivote(-0.15); + // if(pince.encodeurpivot()>=20 && pince.encodeurpivot()<=21){ + // pince.pivote(0); + // } + // else if(pince.encodeurpivot()>=20){ + // pince.pivote(-0.15); + // } + // else{ + // pince.pivote(0.15); + // } + // } + // else if(elevateur.position()>=elevateur.encodeurelevateurL3bas()){ + // elevateur.vitesse(-0.7); + // } + // else{ + // elevateur.vitesse(0.25); + // } } // Called once the command ends or is interrupted. From 9f64f15ae4b08a413851217b153f9b1357dac479 Mon Sep 17 00:00:00 2001 From: Samuel <2540638@etudiant.cegepvicto.com> Date: Mon, 27 Oct 2025 17:45:07 -0400 Subject: [PATCH 4/8] pid pour L3 --- src/main/java/frc/robot/commands/Elevateur/L3.java | 2 +- src/main/java/frc/robot/subsystems/Elevateur.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/commands/Elevateur/L3.java b/src/main/java/frc/robot/commands/Elevateur/L3.java index 8011b68..e3880db 100644 --- a/src/main/java/frc/robot/commands/Elevateur/L3.java +++ b/src/main/java/frc/robot/commands/Elevateur/L3.java @@ -33,7 +33,7 @@ public class L3 extends Command { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - output = pidController.calculate(elevateur.position(),20); + output = pidController.calculate(elevateur.position(),-3); elevateur.vitesse(output); // if(elevateur.position()<=elevateur.encodeurelevateurL3bas() && elevateur.position()>=elevateur.encodeurelevateurL3haut()){ // elevateur.vitesse(0); diff --git a/src/main/java/frc/robot/subsystems/Elevateur.java b/src/main/java/frc/robot/subsystems/Elevateur.java index 1ef7681..de500a4 100644 --- a/src/main/java/frc/robot/subsystems/Elevateur.java +++ b/src/main/java/frc/robot/subsystems/Elevateur.java @@ -8,6 +8,8 @@ import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj2.command.SubsystemBase; +import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine; + import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.SparkLowLevel.MotorType; public class Elevateur extends SubsystemBase { @@ -38,7 +40,6 @@ public class Elevateur extends SubsystemBase { } final SparkMax monte = new SparkMax(22, MotorType.kBrushless); final DigitalInput limit2 = new DigitalInput(0); - public double position(){ return monte.getEncoder().getPosition(); } @@ -90,7 +91,6 @@ public class Elevateur extends SubsystemBase { return distanceDeploiePince.getDouble(0.2); } - @Override public void periodic() { // This method will be called once per scheduler run From 37154519729aeb9be59bde44d809802a38ba7976 Mon Sep 17 00:00:00 2001 From: EdwardFaucher Date: Wed, 29 Oct 2025 18:34:30 -0400 Subject: [PATCH 5/8] =?UTF-8?q?pid=20d`=C3=A9douard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/frc/robot/commands/Elevateur/L2.java | 27 ++++++---- .../java/frc/robot/commands/Elevateur/L3.java | 14 +++-- .../java/frc/robot/commands/Elevateur/L4.java | 54 ++++++++++++------- .../robot/commands/Limelight/AprilTag3.java | 10 ++-- .../frc/robot/commands/Limelight/Forme3.java | 2 +- .../java/frc/robot/subsystems/Elevateur.java | 6 ++- .../java/frc/robot/subsystems/Limelight3.java | 11 +++- src/main/java/frc/robot/subsystems/Pince.java | 5 +- 8 files changed, 84 insertions(+), 45 deletions(-) diff --git a/src/main/java/frc/robot/commands/Elevateur/L2.java b/src/main/java/frc/robot/commands/Elevateur/L2.java index 9b60cea..d550b5b 100644 --- a/src/main/java/frc/robot/commands/Elevateur/L2.java +++ b/src/main/java/frc/robot/commands/Elevateur/L2.java @@ -3,6 +3,7 @@ // the WPILib BSD license file in the root directory of this project. package frc.robot.commands.Elevateur; +import edu.wpi.first.math.controller.PIDController; import edu.wpi.first.wpilibj2.command.Command; import frc.robot.subsystems.Elevateur; import frc.robot.subsystems.Pince; @@ -11,6 +12,8 @@ import frc.robot.subsystems.Pince; public class L2 extends Command { private Elevateur elevateur; private Pince pince; + private PIDController pidController; + private double output; /** Creates a new L2. */ public L2(Elevateur elevateur,Pince pince) { this.elevateur = elevateur; @@ -21,20 +24,24 @@ public class L2 extends Command { // Called when the command is initially scheduled. @Override - public void initialize() {} + public void initialize() { + pidController = new PIDController(0.025, 0.00125,0.001, 0.01); + } // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - if(pince.encodeurpivot()>=15 && pince.encodeurpivot()<=16.5){ - pince.pivote(0); - } - else if(pince.encodeurpivot()>=15){ - pince.pivote(-0.2); - } - else{ - pince.pivote(0.1); - } + output = pidController.calculate(pince.encodeurpivot(),15); + pince.pivote(output); + // if(pince.encodeurpivot()>=15 && pince.encodeurpivot()<=16.5){ + // pince.pivote(0); + // } + // else if(pince.encodeurpivot()>=15){ + // pince.pivote(-0.2); + // } + // else{ + // pince.pivote(0.1); + // } } diff --git a/src/main/java/frc/robot/commands/Elevateur/L3.java b/src/main/java/frc/robot/commands/Elevateur/L3.java index 8011b68..b0b0ae7 100644 --- a/src/main/java/frc/robot/commands/Elevateur/L3.java +++ b/src/main/java/frc/robot/commands/Elevateur/L3.java @@ -13,8 +13,10 @@ import frc.robot.subsystems.Pince; public class L3 extends Command { private Elevateur elevateur; private Pince pince; - private PIDController pidController; + private PIDController pidController1; + private PIDController pidController2; private double output; + private double output2; /** Creates a new L2. */ public L3(Elevateur elevateur,Pince pince) { this.elevateur = elevateur; @@ -26,15 +28,19 @@ public class L3 extends Command { // Called when the command is initially scheduled. @Override public void initialize() { - pidController = new PIDController(0.03, 0.001, 0.001); - pidController.reset(); + pidController1 = new PIDController(0.3, 0.04,0); + pidController2 = new PIDController(0.025, 0.00125,0.001, 0.01); + pidController1.reset(); + pidController2.reset(); } // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - output = pidController.calculate(elevateur.position(),20); + output = pidController1.calculate(elevateur.position(),-3); + output2 = pidController2.calculate(pince.encodeurpivot(),20); elevateur.vitesse(output); + pince.pivote(output2); // if(elevateur.position()<=elevateur.encodeurelevateurL3bas() && elevateur.position()>=elevateur.encodeurelevateurL3haut()){ // elevateur.vitesse(0); // pince.pivote(-0.15); diff --git a/src/main/java/frc/robot/commands/Elevateur/L4.java b/src/main/java/frc/robot/commands/Elevateur/L4.java index 4b8dcbc..0ae6fe1 100644 --- a/src/main/java/frc/robot/commands/Elevateur/L4.java +++ b/src/main/java/frc/robot/commands/Elevateur/L4.java @@ -4,6 +4,7 @@ package frc.robot.commands.Elevateur; +import edu.wpi.first.math.controller.PIDController; import edu.wpi.first.wpilibj2.command.Command; import frc.robot.subsystems.Elevateur; import frc.robot.subsystems.Pince; @@ -12,6 +13,10 @@ import frc.robot.subsystems.Pince; public class L4 extends Command { private Elevateur elevateur; private Pince pince; + private PIDController pidController; + private PIDController pidController1; + private double output; + private double output1; /** Creates a new L2. */ public L4(Elevateur elevateur,Pince pince) { this.elevateur = elevateur; @@ -22,30 +27,39 @@ public class L4 extends Command { // Called when the command is initially scheduled. @Override - public void initialize() {} + public void initialize() { + pidController = new PIDController(0.3, 0.04,0); + pidController1 = new PIDController(0.025, 0.00125,0.001, 0.01); + pidController.reset(); + pidController1.reset(); + } // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - if(elevateur.position()<=elevateur.encodeurelevateurL4bas() && elevateur.position()>=elevateur.encodeurelevateurL4haut()){ - elevateur.vitesse(0); - pince.pivote(-0.15); - if(pince.encodeurpivot()>=20 && pince.encodeurpivot()<=21){ - pince.pivote(0); - } - else if(pince.encodeurpivot()>=20){ - pince.pivote(-0.15); - } - else{ - pince.pivote(0.15); - } - } - else if(elevateur.position()>=elevateur.encodeurelevateurL4bas()){ - elevateur.vitesse(-0.7); - } - else{ - elevateur.vitesse(.25); - } + output = pidController.calculate(elevateur.position(),-6.3); + elevateur.vitesse(output); + output1 = pidController1.calculate(pince.encodeurpivot(),20); + pince.pivote(output1); + // if(elevateur.position()<=elevateur.encodeurelevateurL4bas() && elevateur.position()>=elevateur.encodeurelevateurL4haut()){ + // elevateur.vitesse(0); + // pince.pivote(-0.15); + // if(pince.encodeurpivot()>=20 && pince.encodeurpivot()<=21){ + // pince.pivote(0); + // } + // else if(pince.encodeurpivot()>=20){ + // pince.pivote(-0.15); + // } + // else{ + // pince.pivote(0.15); + // } + // } + // else if(elevateur.position()>=elevateur.encodeurelevateurL4bas()){ + // elevateur.vitesse(-0.7); + // } + // else{ + // elevateur.vitesse(.25); + // } } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc/robot/commands/Limelight/AprilTag3.java b/src/main/java/frc/robot/commands/Limelight/AprilTag3.java index 4253b96..7dd2172 100644 --- a/src/main/java/frc/robot/commands/Limelight/AprilTag3.java +++ b/src/main/java/frc/robot/commands/Limelight/AprilTag3.java @@ -47,14 +47,14 @@ public class AprilTag3 extends Command { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - double a = limelight3.getX(); - + double a = limelight3.getTx(); + double b = limelight3.getRx(); if(limelight3.getV() == true){ drivetrain.setControl(drive. withRotationalRate(a/10). - withVelocityX(x.getAsDouble()). - withVelocityY(y.getAsDouble())); - System.out.println(a/10); + withVelocityX(0). + withVelocityY(b/10)); + System.out.println(b/10); } else{ drivetrain.setControl(drive. diff --git a/src/main/java/frc/robot/commands/Limelight/Forme3.java b/src/main/java/frc/robot/commands/Limelight/Forme3.java index 2504d38..8afaec4 100644 --- a/src/main/java/frc/robot/commands/Limelight/Forme3.java +++ b/src/main/java/frc/robot/commands/Limelight/Forme3.java @@ -46,7 +46,7 @@ public class Forme3 extends Command { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - double a = limelight3.getX(); + double a = limelight3.getTx(); if(limelight3.getV() == true){ drivetrain.setControl(drive. withRotationalRate(a/10). diff --git a/src/main/java/frc/robot/subsystems/Elevateur.java b/src/main/java/frc/robot/subsystems/Elevateur.java index 1ef7681..06c9250 100644 --- a/src/main/java/frc/robot/subsystems/Elevateur.java +++ b/src/main/java/frc/robot/subsystems/Elevateur.java @@ -31,10 +31,10 @@ public class Elevateur extends SubsystemBase { teb.add("encodeurelevateursationhaut", -0.4).getEntry(); private GenericEntry distanceDeploiePince = teb.add("encodeurDeploiePince", 0.2).getEntry(); - public Elevateur() { teb.addDouble("encodeur elevateur",this::position); teb.addBoolean("limit elevateur", this::limit2); + teb.addDouble("amperage elevateur", this::amp); } final SparkMax monte = new SparkMax(22, MotorType.kBrushless); final DigitalInput limit2 = new DigitalInput(0); @@ -89,7 +89,9 @@ public class Elevateur extends SubsystemBase { public double distanceDeploiePince(){ return distanceDeploiePince.getDouble(0.2); } - + public double amp(){ + return monte.getOutputCurrent(); + } @Override public void periodic() { diff --git a/src/main/java/frc/robot/subsystems/Limelight3.java b/src/main/java/frc/robot/subsystems/Limelight3.java index fe039c4..787fc37 100644 --- a/src/main/java/frc/robot/subsystems/Limelight3.java +++ b/src/main/java/frc/robot/subsystems/Limelight3.java @@ -20,8 +20,15 @@ public class Limelight3 extends SubsystemBase { PortForwarder.add(port, "limelight.local", port); } } - public double getX(){ - return LimelightHelpers.getTX("limelight-balon"); + public double getTx(){ + NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balon"); + NetworkTableEntry tx = table.getEntry("tx"); + return tx.getDouble(0.0); + } + public double getRx(){ + NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balon"); + NetworkTableEntry rx = table.getEntry("rx"); + return rx.getDouble(0.0); } public boolean getV(){ return LimelightHelpers.getTV("limelight-balon"); diff --git a/src/main/java/frc/robot/subsystems/Pince.java b/src/main/java/frc/robot/subsystems/Pince.java index 4ddc0a7..a75cb5f 100644 --- a/src/main/java/frc/robot/subsystems/Pince.java +++ b/src/main/java/frc/robot/subsystems/Pince.java @@ -19,6 +19,7 @@ public class Pince extends SubsystemBase { teb.addDouble("encodeur pince", this::encodeurpivot); teb.addDouble("amperage corail", this::emperagecoral); teb.addDouble("amperage algue", this::emperagealgue); + teb.addDouble("amperage pivotis", this::ampPivote); } final SparkMax coral = new SparkMax(20, MotorType.kBrushless); final SparkMax pivoti = new SparkMax(14, MotorType.kBrushless); @@ -63,7 +64,9 @@ public double emperagealgue(){ return algue1.getOutputCurrent(); } public boolean x = false; - +public double ampPivote(){ + return pivoti.getOutputCurrent(); +} @Override public void periodic() { // This method will be called once per scheduler run From 299e1f8914797bd814748582001b68cb50408223 Mon Sep 17 00:00:00 2001 From: Samuel <2540638@etudiant.cegepvicto.com> Date: Wed, 29 Oct 2025 18:44:15 -0400 Subject: [PATCH 6/8] Limelight 3d (j'ai peur) --- src/main/java/frc/robot/commands/Limelight/AprilTag3.java | 4 ++-- src/main/java/frc/robot/subsystems/Limelight3.java | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/commands/Limelight/AprilTag3.java b/src/main/java/frc/robot/commands/Limelight/AprilTag3.java index 7dd2172..b275a8f 100644 --- a/src/main/java/frc/robot/commands/Limelight/AprilTag3.java +++ b/src/main/java/frc/robot/commands/Limelight/AprilTag3.java @@ -48,12 +48,12 @@ public class AprilTag3 extends Command { @Override public void execute() { double a = limelight3.getTx(); - double b = limelight3.getRx(); + double b = limelight3.getTA()*100/Math.cos(90-limelight3.getTx()); if(limelight3.getV() == true){ drivetrain.setControl(drive. withRotationalRate(a/10). withVelocityX(0). - withVelocityY(b/10)); + withVelocityY( b/30)); System.out.println(b/10); } else{ diff --git a/src/main/java/frc/robot/subsystems/Limelight3.java b/src/main/java/frc/robot/subsystems/Limelight3.java index 787fc37..75dd7ce 100644 --- a/src/main/java/frc/robot/subsystems/Limelight3.java +++ b/src/main/java/frc/robot/subsystems/Limelight3.java @@ -25,6 +25,11 @@ public class Limelight3 extends SubsystemBase { NetworkTableEntry tx = table.getEntry("tx"); return tx.getDouble(0.0); } + public double getTA(){ + NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balon"); + NetworkTableEntry ta = table.getEntry("ta"); + return ta.getDouble(0.0); + } public double getRx(){ NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balon"); NetworkTableEntry rx = table.getEntry("rx"); From 9a4a3bf0b1d47e54a26fc528a0dcd3e3520fafa4 Mon Sep 17 00:00:00 2001 From: EdwardFaucher Date: Wed, 29 Oct 2025 19:03:12 -0400 Subject: [PATCH 7/8] test d'april tag pas concluant --- src/main/java/frc/robot/commands/Limelight/AprilTag3.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/commands/Limelight/AprilTag3.java b/src/main/java/frc/robot/commands/Limelight/AprilTag3.java index b275a8f..fb65005 100644 --- a/src/main/java/frc/robot/commands/Limelight/AprilTag3.java +++ b/src/main/java/frc/robot/commands/Limelight/AprilTag3.java @@ -48,12 +48,12 @@ public class AprilTag3 extends Command { @Override public void execute() { double a = limelight3.getTx(); - double b = limelight3.getTA()*100/Math.cos(90-limelight3.getTx()); + double b = (limelight3.getTA()*100) / (Math.cos(90-limelight3.getTx())); if(limelight3.getV() == true){ drivetrain.setControl(drive. withRotationalRate(a/10). withVelocityX(0). - withVelocityY( b/30)); + withVelocityY( b/30)); System.out.println(b/10); } else{ From 34ea5ba46fe2066dc588521a7019e2c103f05859 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 29 Oct 2025 19:44:55 -0400 Subject: [PATCH 8/8] test de formule pour b pas concluant(j'ai moins peur) --- src/main/java/frc/robot/commands/Limelight/AprilTag3.java | 6 +++--- src/main/java/frc/robot/subsystems/Elevateur.java | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/commands/Limelight/AprilTag3.java b/src/main/java/frc/robot/commands/Limelight/AprilTag3.java index fb65005..e0de605 100644 --- a/src/main/java/frc/robot/commands/Limelight/AprilTag3.java +++ b/src/main/java/frc/robot/commands/Limelight/AprilTag3.java @@ -51,10 +51,10 @@ public class AprilTag3 extends Command { double b = (limelight3.getTA()*100) / (Math.cos(90-limelight3.getTx())); if(limelight3.getV() == true){ drivetrain.setControl(drive. - withRotationalRate(a/10). + withRotationalRate(a/20). withVelocityX(0). - withVelocityY( b/30)); - System.out.println(b/10); + withVelocityY( b/50)); + System.out.println(b/50); } else{ drivetrain.setControl(drive. diff --git a/src/main/java/frc/robot/subsystems/Elevateur.java b/src/main/java/frc/robot/subsystems/Elevateur.java index 615bf6d..314d3f7 100644 --- a/src/main/java/frc/robot/subsystems/Elevateur.java +++ b/src/main/java/frc/robot/subsystems/Elevateur.java @@ -8,7 +8,6 @@ import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj2.command.SubsystemBase; -import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine; import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.SparkLowLevel.MotorType;