changement fait

This commit is contained in:
Samuel
2026-02-04 18:14:55 -05:00
parent 952545efae
commit 5fe8ffbb41
4 changed files with 77 additions and 6 deletions

View File

@@ -8,17 +8,18 @@ import edu.wpi.first.math.controller.PIDController;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Lanceur;
import frc.robot.subsystems.LimeLight3;
import frc.robot.subsystems.Limelight3G;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class Lancer extends Command {
private Lanceur lanceur;
private PIDController pidController;
private LimeLight3 limeLight3;
private Limelight3G limeLight3G;
private double output;
/** Creates a new Lancer. */
public Lancer(Lanceur lanceur, LimeLight3 limeLight3) {
this.lanceur = lanceur;
this.limeLight3 = new LimeLight3();
this.limeLight3G = new Limelight3G();
addRequirements(lanceur);
// Use addRequirements() here to declare subsystem dependencies.
}
@@ -32,7 +33,7 @@ public class Lancer extends Command {
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
double vitesse = (100-limeLight3.getTA())/100;
double vitesse = (100-limeLight3G.getTA())/100;
double output = pidController.calculate(lanceur.Vitesse(),vitesse);
lanceur.Lancer(output);
if(lanceur.Vitesse() >= vitesse){