changement fait
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user