balayeuse fait

This commit is contained in:
samuel desharnais
2026-03-10 20:39:18 -04:00
parent d04817a197
commit a142290bd5
8 changed files with 52 additions and 44 deletions

View File

@@ -37,7 +37,7 @@ public class LancerBaseVitesse extends Command {
// Called when the command is initially scheduled.
@Override
public void initialize() {
pidController = new PIDController(0, 0,0, 0);
pidController = new PIDController(1, 0,0, 0);
timer.reset();
timer.start();
temp = lanceur.Amp();
@@ -46,32 +46,32 @@ public class LancerBaseVitesse extends Command {
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
int nbFois = 0;
// int nbFois = 0;
double moyenneAmp = 0;
if(timer.get() < 3){
nbFois++;
moyenneAmp += balayeuse.Amp() / nbFois;
}
else{
nbFois++;
moyenneAmp -= temp;
moyenneAmp += balayeuse.Amp() / nbFois;
temp = balayeuse.Amp();
}
if(moyenneAmp > 30 && nbFois > 10){
timer.reset();
balayeuse.Balayer(0.5);
led.Jaune2();
}
else{
// double moyenneAmp = 0;
// if(timer.get() < 3){
// nbFois++;
// moyenneAmp += balayeuse.Amp() / nbFois;
// }
// else{
// nbFois++;
// moyenneAmp -= temp;
// moyenneAmp += balayeuse.Amp() / nbFois;
// temp = balayeuse.Amp();
// }
// if(moyenneAmp > 30 && nbFois > 10){
// timer.reset();
// balayeuse.Balayer(0.5);
// led.Jaune2();
// }
// else{
double vitesse = 0.4;
double output = pidController.calculate(lanceur.Vitesse(),vitesse);
lanceur.Lancer(output);
if(lanceur.Vitesse() >= vitesse){
lanceur.Demeler(0.5);
}
}
// }
}